I just tried to install Open DBX on my machine.
I'm using Mac OS 10.8 and Pharo 1.4.
I went through the installation–from sources–of the C openDBX driver for the Postgres database platform.
Then I loaded the OpenDBX driver for Pharo using Metacello as explained and reached the point in which I have to check if everything has installed correctly.
I changed the DBXPostgresFacility>>createConnection as requested and ran the test cases.
All test cases, but DBXConnectionSettingsTest, failed.
Do you have any hints on how to proceed?
On Wed, Oct 24, 2012 at 3:53 PM, Roberto Minelli <[hidden email]> wrote:
Hi. Did you compile everything forcing the 32 bits compilation?
did you also install the 32 bits client library of Postgres?
Can you provide us the stacktrace of any of the failing test?
On Wednesday, October 24, 2012 4:12:10 PM UTC+2, Mariano Martinez Peck wrote:
I don't think so. How can I do it?
Hum.. Not sure.. I have to check.. However the installation guide says: If in the previous step you have installed OpenDBX by using its binaries (no compilation), then you must install the databse client library (C library) of your database.
I installed from source, thus I believe this is not an issue. Is it?
It's an external error... https://dl.dropbox.com/u/6281855/external_error.png
I was having some troubles getting postgres/openDBX working on Mac's and hired a consultant last spring -- nice lady, not a smalltalker, but she found some solutions for me. And of the surprises that she found for me were the following: on Lion, if you have installed Xcode, then you already have a 64-bit Postgres already installed. So that obviously creates potential conflicts in library paths, as well as which binary is running and listening, etc. So my basic Postgres DB tests kept working, but my library-based access (opendbx) kept failing.
Anyway, that was the key discovery that allowed us to solve to several of our woes. One tool that greatly simplified installation of openDBX, and postgres-32bit, is called brew. It really is slick. [I have not used it in 6 months, but it worked great when I used it.]
Below I have simply cut -n- pasted the steps that this consultant (and I ) typed up to get through the install. The notes are not perfect in the presentation... as it was a scratch-pad of commands that were utilized, and once it worked, we did not scrub the document. Oh, also, please consider using Glorp if you are not already planning on it.
I hope this helps more than it confuses you!
Homebrew v0.9“the easiest and most flexible way to install the UNIX tools Apple didn't include with OS X”
Install/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
Useful Commandsbrew doctor
brew install git
brew search postgresql
brew uninstall postgresql
Notes on Cam’s mac 19apr12: already had installed git, Xcode, and Xcode command line tools
Postgres v9.1.3 as 32 bitReally, we only want the Postgres C library libpq built as 32 bits, but we seems to have to build the whole DB that way. Building requires Xcode and Xcode command line tools.
Download, build and installbrew install -v postgresql --32-bit > ~/brew-install-postgres-32.txt
brew uninstall postgresql
brew uninstall ossp-uuid # non-32 bit had been previously installed
brew install -v postgresql --32-bit > ~/brew-install-postgres-32.txt
Set up data and logging areasmkdir ~/postgres/data
Initialize the databaseinitdb -D ~/postgres/data > ~/initdb-log.txt
Start the database
Method 1: start the database automatically[ mkdir -p ~/Library/LaunchAgents/ ]
edit: ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist (sample in Appendix A)
Run this once:
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Here is how to unload it if a change needs to be made:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Note: we think launchctl should be run after initdb, but on 19apr12 we ran launchctl before initdb
Method 2: manually start the database (note that the log name here isn’t ideal)
Check that the database is runningpg_ctl status -D /usr/local/var/postgres/data
ps auxwww | grep postgres
Set up test user and database[sudo su - postgres createuser --createdb --login --superuser --createrole --pwprompt sanders]
createuser sodbxtest --no-superuser --createdb --createrole
Optional: Load a Sample DatabaseFor example, download: http://pgfoundry.org/projects/dbsamples/ : the USDA food database
psql -f usda.sql usda ## while sitting in ~/Downloads/usda-r18-1.0/
OpenDBX v1.4.5 as 32 bitSimilar to ODBC, OpenDBX is an API for many databases like Oracle, Postgres, MySQL, etc, written in C. Its old name was SqeakDBX. This needs to be built as a 32 bit application for DBXTalk.
sample build: how a lib developer would build it
Build and Installmkdir ~/prog
mv ~/Downloads/opendbx-1.4.5 prog/.
[ sudo make clean ]
#For the next CFLAGS variable, consider “-m32 -g” and/or “-m32 -O2”
CFLAGS="-m32" CXXFLAGS="-m32" CPPFLAGS="-m32" LDFLAGS="-L/usr/local/lib -m32" ./configure --with-backends="pgsql sqlite3" --disable-utils > configure-opendbx.txt
make > make-opendbx.txt
sudo make install > install-opendbx.txt
How to Check for a 32 bit Buildlipo -info lib/*.o
Non-fat file: libopendbx_la-odbx.o is architecture: i386
Non-fat file: libopendbx_la-odbxlib.o is architecture: i386
Non-fat file: libopendbxplus_la-odbx.o is architecture: i386
Non-fat file: libopendbxplus_la-odbx_impl.o is architecture: i386lipo -info /usr/local/lib/libpg*
ODBXTestThe test harness included in the OpenDBX library. It requires the user create the database before running the test. Format:
Usage: ./odbxtest <options>
-b <backend> Database backend (mysql, pgsql, sqlite, sqlite3, firebird, freetds, sybase)
-h <server> Server name, IP address or directory
-p <port> Server port
-d <database> Database or file name
-u <user> User name for authentication
-w <password> Password for authentication
-e Force encrypted connection
-r Number of runs
-v Verbose mode
./odbxtest -b pgsql -h localhost -d myDatabase > testrun.txt 2>&1
diff ref/pgsql.ref testrun.txt
[ dropdb myDatabase ]
On Wed, Oct 24, 2012 at 5:28 PM, Cameron Sanders <[hidden email]> wrote:
Thanks Cameron for sharing all this valuable information. I have read them all and looks correct to me.
Indeed, that's a common problem. Another way to solve the problem of multiple versions of the library, is to include the library in the same directory where the image/vm is. I think all OS/vms search there before going to the "known" places, so if you place them right to the image/vm you are kind of forcing with library to use.
Using Brew is easier, but just for the note, another way is to also compile the postgres client library using the 32 bits parameter (the same used for OpenDBX). Never tried, but it should work.
Also, it was always difficult for us to shared binaries for Max/Unix. For Windows, we have precompiled openDBX so you can directly download the dlls (you still need the database client library).
I hope some day we will have a real 64 bits VM with a working FFI. Right now, we need to deal with it :(
We should really improve the documentation, but the whole team (included myself) seems to be busy :(
In reply to this post by Roberto Minelli
Thanks for the answer, but unfortunately it does not work.
Error: Failure while executing: ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.2.1 --datadir=/usr/local/Cellar/postgresql/9.2.1/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.2.1/share/doc/postgresql --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-ossp-uuid --with-python --with-perl
On Wednesday, October 24, 2012 3:53:22 PM UTC+2, Roberto Minelli wrote:
And it is not a permissions problem? (I assume you are sudo'ing or something.)
On Wed, Oct 24, 2012 at 11:52 AM, Roberto Minelli <[hidden email]> wrote:
Thanks for the answer, but unfortunately it does not work.
Unfortunately I'm doing nothing more than 'brew install postgresql --32-bit'
Il giorno 24-ott-2012, alle ore 18:58, Cameron Sanders <[hidden email]> ha scritto:
It is not clear to me whether that is acknowledgement that you forgot to sudo, that you don't have permission, or that you didn't know you should.
Before doing those commands, insert the word 'sudo'.
On Wed, Oct 24, 2012 at 1:10 PM, Roberto Minelli [via Smalltalk] <[hidden email]> wrote:
|Free forum by Nabble||Edit this page|