strongloop / strong-oracle

Deprecated: Node.js Driver for Oracle databases (Use https://github.com/oracle/node-oracledb instead)
Other
45 stars 18 forks source link

Build Fails: Missed OCI libs? #28

Open juancarloscancela opened 9 years ago

juancarloscancela commented 9 years ago

Hi,

I've tried installing library, but got this error:

child_process: customFds option is deprecated, use stdio instead. make: Entering directory `/home/juan/WebstormProjects/waterline-oracle-adapter/node_modules/strong-oracle/build' CXX(target) Release/obj.target/oracle_bindings/src/connection.o CXX(target) Release/obj.target/oracle_bindings/src/oracle_bindings.o CXX(target) Release/obj.target/oracle_bindings/src/executeBaton.o CXX(target) Release/obj.target/oracle_bindings/src/outParam.o CXX(target) Release/obj.target/oracle_bindings/src/reader.o CXX(target) Release/obj.target/oracle_bindings/src/statement.o SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node /usr/bin/ld: cannot find -locci /usr/bin/ld: cannot find -lclntsh /usr/bin/ld: cannot find -lnnz11

Ive completed all steps described in Instaclient guide. Im using Ubuntu 14.04.

Any idea what can is missed?

raymondfeng commented 9 years ago

Can you make sure you have the following files?

$OCI_LIB_DIR/libclntsh.so $OCI_LIB_DIR/libocci.so $OCI_LIB_DIR/libnnz11.so

Some of the files are linked as follows:

cd $OCI_LIB_DIR ln -s libclntsh.so.11.1 libclntsh.so ln -s libocci.so.11.1 libocci.so

juancarloscancela commented 9 years ago

Hi,

this is the content of $OCI_LIB_DIR:

-rwxrwxr-x 1 juan juan 29404 jul 7 2014 adrci -rw-rw-r-- 1 juan juan 440 jul 7 2014 BASIC_README -rwxrwxr-x 1 juan juan 43944 jul 7 2014 genezi -rwxrwxr-x 1 juan juan 6990875 jul 7 2014 libclntshcore.so.12.1 lrwxrwxrwx 1 juan juan 17 abr 17 10:56 libclntsh.so -> libclntsh.so.11.1 -rwxrwxr-x 1 juan juan 58793741 jul 7 2014 libclntsh.so.12.1 -r-xr-xr-x 1 juan juan 1768370 jul 7 2014 libipc1.so -r-xr-xr-x 1 juan juan 544150 jul 7 2014 libmql1.so -r-xr-xr-x 1 juan juan 6213011 jul 7 2014 libnnz12.so lrwxrwxrwx 1 root root 18 abr 17 11:28 libocci.dylib -> libocci.dylib.11.1 lrwxrwxrwx 1 juan juan 15 abr 17 10:57 libocci.so -> libocci.so.11.1 -rwxrwxr-x 1 juan juan 2576030 jul 7 2014 libocci.so.12.1 -rwxrwxr-x 1 juan juan 109549133 jul 7 2014 libociei.so -r-xr-xr-x 1 juan juan 156353 jul 7 2014 libocijdbc12.so -r-xr-xr-x 1 juan juan 337137 jul 7 2014 libons.so -rwxrwxr-x 1 juan juan 118491 jul 7 2014 liboramysql12.so -r--r--r-- 1 juan juan 3692096 jul 7 2014 ojdbc6.jar -r--r--r-- 1 juan juan 3698857 jul 7 2014 ojdbc7.jar drwxrwxr-x 5 juan juan 4096 abr 17 10:53 sdk -rwxrwxr-x 1 juan juan 227410 jul 7 2014 uidrvci -rw-rw-r-- 1 juan juan 71202 jul 7 2014 xstreams.jar

Missed libraries seem to be there.

raymondfeng commented 9 years ago

Did you perform the following to make sure libaio is installed?

sudo apt-get install libaio1

Do you have the correct instant-client (32 bit vs 64 bit)?

juancarloscancela commented 9 years ago

Hi, Yes, tried installing it and says : libaio1 is already the newest version.

Ive downloaded and installed the 64 bit version.

juancarloscancela commented 9 years ago

$OCI_LIB_DIR needs to be in PATH?

raymondfeng commented 9 years ago

$OCI_LIB_DIR needs to be an env var.

juancarloscancela commented 9 years ago

Yes, i've created it and added it in .bash.rc file.

raymondfeng commented 9 years ago

Your instant client version is 12.1. Please adjust the symbolic links as follows:

ln -s libclntsh.so.12.1 libclntsh.so
ln -s libocci.so.12.1 libocci.so

I'll update the README too.

juancarloscancela commented 9 years ago

Thanks! I think the solution is "almost" there ;) still fails due to one remaining missed dependency: SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node /usr/bin/ld: cannot find -lnnz11 collect2: error: ld returned 1 exit status

Is it possible that lnnz11 is referenced somewhere and it fails with client version 12? i see that there is a libnnz12.so in OCI_LIB_DIR

raymondfeng commented 9 years ago

It's referenced in https://github.com/strongloop/strong-oracle/blob/master/binding.gyp but it should be set to 12 for Linux

juancarloscancela commented 9 years ago

Thanks for the info. If you want i can try to add that and send you a pull request.

smartmouse commented 8 years ago

Hey, I got the same issue -- by adding in the soft-link as suggested by raymond, I can install strong-oracle on my SLES 11 box without any error. gcc version 4.3.4 [gcc-4_3-branch revision 152973](SUSE Linux)

nodebot@zsl11n1:~/teststrongoracle/node_modules> ls strong-oracle

Even with the softlink sets: But I got the same error when npm install strong-oracle on my SLES 12 box.

SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node /usr/lib64/gcc/s390x-suse-linux/4.8/../../../../s390x-suse-linux/bin/ld: cannot find -locci /usr/lib64/gcc/s390x-suse-linux/4.8/../../../../s390x-suse-linux/bin/ld: cannot find -lclntsh collect2: error: ld returned 1 exit status oracle_bindings.target.mk:123: recipe for target 'Release/obj.target/oracle_bindings.node' failed make: *\ [Release/obj.target/oracle_bindings.node] Error 1 make: Leaving directory '/home/nodebot/teststrongOracle/node_modules/strong-oracle/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/nodebot/IBMSVT64_128/

nodebot@zsl12n1:~> ls -l libocci.so lrwxrwxrwx 1 nodebot users 48 Nov 26 16:00 libocci.so -> /home/nodebot/instantclient_12_1/libocci.so.12.1 nodebot@zsl12n1:~> ls -l libclntsh.so lrwxrwxrwx 1 nodebot users 50 Nov 26 16:17 libclntsh.so -> /home/nodebot/instantclient_12_1/libclntsh.so.12.1

any idea?

could this be the gcc version mismatch? SLES has gcc 4.8.x gcc version 4.8.3 20140627 [gcc-4_8-branch revision 212064](SUSE Linux)

Also have issues on RH6/RH7

https://gist.github.com/smartmouse/97cd483aa277211eb77a

smartmouse commented 8 years ago

We have resolved the issues on the other platforms RH6/RH7/SLES12. The reason being our instantClient_12_1 is not installed in a typical location, it was installed in /home/nodebot , so the they cannot be found. After we export LIBRARY_PATH to /home/nodebot , the problem is resolved.

In summary : we did 2 things to resolve the issue.

  1. create softlinks ln -s libclntsh.so.11.1 libclntsh.so ln -s libocci.so.11.1 libocci.so
  2. export LIBRARY_PATH=/home/nodebot:$LIBRARY_PATH (where the libclntsh.so and linocci.so is located )