Now we have 64bit builds of Firebird 2.1 for MacOSX 10.5, we have issues trying to test them properly using the Firebird QMTest QA suite. This QA suite relies on Python and kinterbasdb. Currently Philippe Makowski has been able to run the tests from a 64bit Linux client. But is unable to run the tests locally. Well currently the python framework that comes with MacOSX 10.5 is only 32bit and this forces a 32bit build of kinterbasdb, since the build environment of kinterbasdb uses distutils to use the same compile switches as python. So I thought I would have a look at the issue and see if I could build a 64bit version of kinterbasdb for MacOSX 10.5.
This is how I did it...
1. Download the source distribution of Python
2. Edit configure.in and change line 817, so it looks like this
BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd -arch x86_64"
3. Make sure that (just in case)
a, CFLAGS, CXXFLAGS and LDFLAGS are exported with -arch x86_64
e.g. export CFLAGS='-arch x86_64'
b, export MACOSX_DEPLOYMENT_TARGET=10.5
5. ./configure --disable-toolbox-glue
This disables Carbon as its only 32bit and you will get compile errors if you don't
We are not building a framework, or a universal binary just a simple standalone version of 64bit python. So do not enable those options.
You may get a warning/errors possibly in some of the extensions e.g.
ld warning in /System/Library/Frameworks/TK.framework/Tk missing required architecture x86_64 in file.
I guess you would have to download the relevant code and rebuild these as 64bit if you need them. But since we are only interested in kinterbasdb I guess I can afford to ignore it.
A check on the built python.exe shows that it is Mach-O 64 bit executable.
Now we need to build kinterbas db using this python.exe
1. Download kinterbasdb from sourceforge
-> 2. Replace in the kinterbasdb source the __init__.py with this one :
Note I forgot to add this step when I wrote the original instructions.
3. Make sure you have the 64bit Firebird 2.1 for MacOSX installed
4. Make sure you are running as root
su and log in
export CFLAGS, CXXFLAGS and LDFLAGS ='-arch x86_64'
The install option will want to put the kinterbasdb in /usr/local/lib/python2.5
Although I suspect you can change this by using a different --prefix when you build python
5. pathtojustbuilt64bitpython/python.exe setup.py install
pathtojustbuilt64bitpython/python.exe setup.py build
if you just want to build it.
6. You can check what you have installed by
Mach-O 64bit bundle x86_64
Now we can test it...
create a database using isql
>>> import kinterbasdb;kinterbasdb.init(type_conv=200)
Don't use mx.DateTime use the default python DateTime
>>> con = kinterbasdb.connect(dsn='localhost:/pathtodd/test.fdb', user='sysdba', password='masterkey')
It works ....