Re: [cx-oracle-users] libclntsh.so and setup.py
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2012-02-12 05:37:20
|
2012/2/9 Aurélien Vallée <val...@gm...>: > Not a matter of taste, it's a matter of "standard expected way", or "weird > uncommon way". Using LD_LIBRARY_PATH would not change a lot to people using > the current behavior (just add $ORACLE_HOME/lib to your LD_LIBRARY_PATH) and > would help a lot those trying to manage uniform python packages. Ok. Let me see if I can clear things up for you. :-) First of all, Oracle is used on a lot of platforms and so LD_LIBRARY_PATH is not something used on all of them. They came up with a different environment variable ORACLE_HOME that is used or (on Windows) they simply use the PATH environment variable. So for Oracle, what you are suggesting is not "the standard expected way!" Regardless, the paths searched for libraries generally includes LD_LIBRARY_PATH and the setup.py for cx_Oracle does nothing to prevent such linking from happening. The logic that is used in the setup.py should be okay. 1) attempt to find what ORACLE_HOME directory should be used by looking at the environment variable (if specified) or searching the PATH environment variable 2) For each directory, attempt to find the DLL or shared library in $ORACLE_HOME or certain subdirectories which are dependent on platform. The file name searched for will be something like libclntsh.so.11.1 and it is assumed that a symbolic link will be found in that directory called libclntsh.so as otherwise the linking will fail. 3) Once found, set the library directories to search to include the directory in which the libclntsh.so file was found and set the include directories to search based on what a normal Oracle installation looks like Note there are a few scenarios that are covered 1) Full installation with subdirectories bin and lib as standard 2) Instant client all in one directory 3) Instant client similar to full installation with subdirectories bin and lib as standard If you can let me know what your situation is like and why it is not covered by this logic I'd be happy to make adjustments -- but so far you have not given us many details. Can you perhaps show us the directory structure you have, what you have for LD_LIBRARY_PATH, PATH and ORACLE_HOME and what you expect to happen? Thanks. Anthony |