How are the setup tools gathering my library search paths, it does not seem to be from LD_LIBRARY_PATH, as I have set this and unset it with the same result. My attempts at passing options to the setup.py script seem to have failed, so I'm hoping for some help. I'd like to specify my library search paths and build options. When I run 'python setup.py build' I get two gcc statements, one is mostly correct the other is not.
When I manually run the both gcc lines with the correct options the .so file builds correctly. So passing the options to the setup.py seems to be the issue.
% file build/lib.solaris-2.10-sun4u-2.5/_mysql.so
build/lib.solaris-2.10-sun4u-2.5/_mysql.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, UltraSPARC1 Extensions Required, dynamically linked, not stripped, no debugging information available
Hi,
How are the setup tools gathering my library search paths, it does not seem to be from LD_LIBRARY_PATH, as I have set this and unset it with the same result. My attempts at passing options to the setup.py script seem to have failed, so I'm hoping for some help. I'd like to specify my library search paths and build options. When I run 'python setup.py build' I get two gcc statements, one is mostly correct the other is not.
gcc -fno-strict-aliasing -O3 -m64 -mcpu=ultrasparc -I/opt/include -L/opt/lib/sparcv9 -L/opt/lib/sparcv9/mysql -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql -DNDEBUG -fPIC -fPIC -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/opt/include/mysql -I/opt/include/python2.5 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.5/_mysql.o -m64 -mcpu=ultrasparc -R/opt/lib/sparcv9
gcc -shared build/temp.solaris-2.10-sun4u-2.5/_mysql.o -L/opt/lib/sparcv9/mysql -L/opt/lib -lmysqlclient_r -lz -lpthread -lthread -lposix4 -lgen -lsocket -lnsl -lm -lpthread -lthread -lssl -lcrypto -lpython2.5 -o build/lib.solaris-2.10-sun4u-2.5/_mysql.so
ld: fatal: file build/temp.solaris-2.10-sun4u-2.5/_mysql.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to build/lib.solaris-2.10-sun4u-2.5/_mysql.so
When I manually run the both gcc lines with the correct options the .so file builds correctly. So passing the options to the setup.py seems to be the issue.
% gcc -fno-strict-aliasing -O3 -m64 -mcpu=ultrasparc -I/opt/include -L/opt/lib/sparcv9 -L/opt/lib/sparcv9/mysql -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql -DNDEBUG -fPIC -Dversion_info="( 1,2,2,'final',0 )" -Dversion=1.2.2 -I/opt/include/mysql -I/opt/include/python2.5 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.5/_mysql.o
% gcc -O3 -m64 -mcpu=ultrasparc -shared build/temp.solaris-2.10-sun4u-2.5/_mysql.o -L/opt/lib/sparcv9/mysql -L/opt/lib/sparcv9-lz -lpthread -lthread -lposix4 -lgen -lsocket -lnsl -lm -lpthread -lthread -lssl -lcrypto -lpython2.5 -R/opt/lib/sparcv9 -R/opt/lib/sparcv9/mysql -o build/lib.solaris-2.10-sun4u-2.5/_mysql.so
% file build/lib.solaris-2.10-sun4u-2.5/_mysql.so
build/lib.solaris-2.10-sun4u-2.5/_mysql.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, UltraSPARC1 Extensions Required, dynamically linked, not stripped, no debugging information available
% ldd build/lib.solaris-2.10-sun4u-2.5/_mysql.so
libpthread.so.1 => /lib/64/libpthread.so.1
libthread.so.1 => /lib/64/libthread.so.1
librt.so.1 => /lib/64/librt.so.1
libgen.so.1 => /lib/64/libgen.so.1
libsocket.so.1 => /lib/64/libsocket.so.1
libnsl.so.1 => /lib/64/libnsl.so.1
libm.so.2 => /lib/64/libm.so.2
libssl.so.0.9.8 => /opt/lib/sparcv9/libssl.so.0.9.8
libcrypto.so.0.9.8 => /opt/lib/sparcv9/libcrypto.so.0.9.8
libpython2.5.so.1.0 => /opt/lib/sparcv9/libpython2.5.so.1.0
libgcc_s.so.1 => /opt/lib/sparcv9/libgcc_s.so.1
libaio.so.1 => /lib/64/libaio.so.1
libmd5.so.1 => /lib/64/libmd5.so.1
libc.so.1 => /lib/64/libc.so.1
libmp.so.2 => /lib/64/libmp.so.2
libscf.so.1 => /lib/64/libscf.so.1
libdl.so.1 => /lib/64/libdl.so.1
libresolv.so.2 => /lib/64/libresolv.so.2
libdoor.so.1 => /lib/64/libdoor.so.1
libuutil.so.1 => /lib/64/libuutil.so.1
/platform/SUNW,Sun-Fire-280R/lib/sparcv9/libmd5_psr.so.1
/platform/SUNW,Sun-Fire-280R/lib/sparcv9/libc_psr.so.1
Thanks,
Ryan
So, is passing options to the setup.py script even possible, or is it just not done.
Try editing setup.cfg:
http://docs.python.org/dist/setup-config.html