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

npm install/test failing on ubuntu 15.10 #61

Closed ghatwala closed 8 years ago

ghatwala commented 8 years ago

Hi,

After cloning this repo on my ubuntu vm and post installing the oracle instant client 12.1 for my system i am getting below errors. This is the debug log...

/***/

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ] 2 info using npm@2.14.4 3 info using node@v4.1.1 4 verbose readDependencies loading dependencies from /home/user1/strong-oracle/package.json 5 verbose install where, deps [ '/home/user1/strong-oracle', 5 verbose install [ 'nan', 'segfault-handler', 'async', 'mocha' ] ] 6 verbose install where, peers [ '/home/user1/strong-oracle', [] ] 7 verbose installManyTop reading for lifecycle /home/user1/strong-oracle/package.json 8 info preinstall strong-oracle@1.8.0 9 verbose installManyTop reading scoped package data from /home/user1/strong-oracle/node_modules/async/package.json 10 verbose installManyTop reading scoped package data from /home/user1/strong-oracle/node_modules/mocha/package.json 11 verbose installManyTop reading scoped package data from /home/user1/strong-oracle/node_modules/nan/package.json 12 verbose installManyTop reading scoped package data from /home/user1/strong-oracle/node_modules/segfault-handler/package.json 13 verbose readDependencies loading dependencies from /home/user1/strong-oracle/package.json 14 verbose targetResolver reading package data from /home/user1/strong-oracle/node_modules/async/package.json 15 verbose targetResolver reading package data from /home/user1/strong-oracle/node_modules/mocha/package.json 16 verbose targetResolver reading package data from /home/user1/strong-oracle/node_modules/nan/package.json 17 verbose targetResolver reading package data from /home/user1/strong-oracle/node_modules/segfault-handler/package.json 18 verbose targetResolver reading package data from /home/user1/strong-oracle/node_modules/.bin/mocha/package.json 19 verbose already installed skipping segfault-handler@^0.2.4 /home/user1/strong-oracle 20 verbose already installed skipping async@^1.4.0 /home/user1/strong-oracle 21 verbose already installed skipping mocha@~2.2.5 /home/user1/strong-oracle 22 verbose already installed skipping nan@^2.0.9 /home/user1/strong-oracle 23 silly install resolved [] 24 info build /home/user1/strong-oracle 25 info linkStuff strong-oracle@1.8.0 26 silly linkStuff strong-oracle@1.8.0 has /home/user1 as its parent node_modules 27 verbose linkBins strong-oracle@1.8.0 28 verbose linkMans strong-oracle@1.8.0 29 verbose rebuildBundles strong-oracle@1.8.0 30 verbose rebuildBundles [ '.bin', 'async', 'mocha', 'nan', 'segfault-handler' ] 31 info install strong-oracle@1.8.0 32 verbose unsafe-perm in lifecycle true 33 info strong-oracle@1.8.0 Failed to exec install script 34 verbose stack Error: strong-oracle@1.8.0 install: node-gyp rebuild 34 verbose stack Exit status 1 34 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:214:16) 34 verbose stack at emitTwo (events.js:87:13) 34 verbose stack at EventEmitter.emit (events.js:172:7) 34 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 34 verbose stack at emitTwo (events.js:87:13) 34 verbose stack at ChildProcess.emit (events.js:172:7) 34 verbose stack at maybeClose (internal/child_process.js:817:16) 34 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 35 verbose pkgid strong-oracle@1.8.0 36 verbose cwd /home/user1/strong-oracle 37 error Linux 4.2.0-16-generic 38 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" 39 error node v4.1.1 40 error npm v2.14.4 41 error code ELIFECYCLE 42 error strong-oracle@1.8.0 install: node-gyp rebuild 42 error Exit status 1 43 error Failed at the strong-oracle@1.8.0 install script 'node-gyp rebuild'. 43 error This is most likely a problem with the strong-oracle package, 43 error not with npm itself. 43 error Tell the author that this fails on your system: 43 error node-gyp rebuild 43 error You can get their info via: 43 error npm owner ls strong-oracle 43 error There is likely additional logging output above. 44 verbose exit [ 1, true ] /**/

My bashrc file for reference: export OCI_LIB_DIR=/opt/instantclient_12_1 export OCI_INCLUDE_DIR=$OCI_LIB_DIR/sdk/include export OCI_HOME=/opt/instantclient_12_1 export OCI_VERSION=12 export OCI_INCLUDE_DIR=/opt/instantclient_12_1/sdk/include export OCI_LIB_DIR=/opt/instantclient_12_1 export LD_LIBRARY_PATH=/opt/instantclient_12_1/

Also my contents of oracle_instant client path ..

user1@pts00433-vm24:/opt/instantclient_12_1$ ll total 184732 drwxr-xr-x 3 root root 4096 Jan 19 21:20 ./ drwxr-xr-x 3 root root 4096 Jan 19 21:09 ../ -rwxr-xr-x 1 root root 72875 Dec 11 05:37 adrci -rw-r--r-- 1 root root 441 Dec 11 05:37 BASIC_README -rwxr-xr-x 1 root root 75297 Dec 11 05:37 genezi -r-xr-xr-x 1 root root 342 Dec 11 05:37 glogin.sql -rwxr-xr-x 1 root root 3892329 Dec 11 05:37 libclntshcore.so.12.1 lrwxrwxrwx 1 root root 17 Jan 19 21:20 libclntsh.so -> libclntsh.so.12.1 -rwxr-xr-x 1 root root 57326986 Dec 11 05:37 libclntsh.so.12.1 -r-xr-xr-x 1 root root 6168711 Dec 11 05:37 libnnz12.so lrwxrwxrwx 1 root root 15 Jan 19 21:20 libocci.so -> libocci.so.12.1 -rwxr-xr-x 1 root root 1957552 Dec 11 05:37 libocci.so.12.1 -rwxr-xr-x 1 root root 108537800 Dec 11 05:37 libociei.so -r-xr-xr-x 1 root root 153958 Dec 11 05:37 libocijdbc12.so -r-xr-xr-x 1 root root 308242 Dec 11 05:37 libons.so -rwxr-xr-x 1 root root 151042 Dec 11 05:37 liboramysql12.so -r-xr-xr-x 1 root root 1577859 Dec 11 05:37 libsqlplusic.so -r-xr-xr-x 1 root root 1113751 Dec 11 05:37 libsqlplus.so -r--r--r-- 1 root root 3692096 Dec 11 05:37 ojdbc6.jar -r--r--r-- 1 root root 3698857 Dec 11 05:37 ojdbc7.jar drwxr-xr-x 5 root root 4096 Dec 11 05:37 sdk/ -r-xr-xr-x 1 root root 70197 Dec 11 05:37 sqlplus -rw-r--r-- 1 root root 445 Dec 11 05:37 SQLPLUS_README -rwxr-xr-x 1 root root 234652 Dec 11 05:37 uidrvci* -rw-r--r-- 1 root root 71200 Dec 11 05:37 xstreams.jar

Additional info , while running this same using root user. I get the below: root@pts00433-vm24:~/strong-oracle# npm install npm WARN prefer global node-gyp@3.2.1 should be installed with -g npm WARN cannot run in wd oracle@0.3.8 node-gyp rebuild (wd=/root/strong-oracle/node_modules/oracle) npm WARN cannot run in wd strong-oracle@1.8.0 node-gyp rebuild (wd=/root/strong-oracle)

root@pts00433-vm24:~/strong-oracle# npm test

strong-oracle@1.8.0 pretest /root/strong-oracle node pretest.js

module.js:338 throw err; ^

Error: Cannot find module '../build/Debug/oracle_bindings' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/root/strong-oracle/lib/oracle.js:15:16) at Module._compile (module.js:434:26) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) npm ERR! Test failed. See above for more details.

Any pointers to the resolve the same.

bnoordhuis commented 8 years ago

Did node-gyp print anything to the console? npm is singularly useless when it comes to build errors with native add-ons because it doesn't log the actual error.

ghatwala commented 8 years ago

@bnoordhuis - yes it did , please see below for ur reference

/****_*/ node-gyp@3.2.1 /usr/local/lib/node_modules/node-gyp node@4.2.2 root@pts00433-vm24:~/strong-oracle# node-gyp build gyp info it worked if it ends with ok gyp info using node-gyp@3.2.1 gyp info using node@4.2.2 | linux | ppc64 gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/root/strong-oracle/build' SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node /usr/bin/ld: cannot find -lnnz11 collect2: error: ld returned 1 exit status oracle_bindings.target.mk:129: recipe for target 'Release/obj.target/oracle_bindings.node' failed make: _* [Release/obj.target/oracle_bindings.node] Error 1 make: Leaving directory '/root/strong-oracle/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 4.2.0-16-generic gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "build" gyp ERR! cwd /root/strong-oracle gyp ERR! node -v v4.2.2 gyp ERR! node-gyp -v v3.2.1 gyp ERR! not ok /***/

ghatwala commented 8 years ago

@bnoordhuis , appears that some dependency is missing... node-gyp gives the above error , mainly ( gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node /usr/bin/ld: cannot find -lnnz11 collect2: error: ld returned 1 exit status )

how to install -lnnz11 on my ubuntu vm , also verbose log is as below ,

root@pts00433-vm24:~/strong-oracle# ld -lnnz11 --verbose ...... attempt to open /usr/powerpc64le-linux-gnu/lib64/libnnz11.so failed attempt to open /usr/powerpc64le-linux-gnu/lib64/libnnz11.a failed attempt to open /usr/local/lib64/libnnz11.so failed attempt to open /usr/local/lib64/libnnz11.a failed attempt to open /lib64/libnnz11.so failed attempt to open /lib64/libnnz11.a failed attempt to open /usr/lib64/libnnz11.so failed attempt to open /usr/lib64/libnnz11.a failed attempt to open /usr/powerpc64le-linux-gnu/lib/libnnz11.so failed attempt to open /usr/powerpc64le-linux-gnu/lib/libnnz11.a failed attempt to open /usr/local/lib/powerpc64le-linux-gnu/libnnz11.so failed attempt to open /usr/local/lib/powerpc64le-linux-gnu/libnnz11.a failed attempt to open /usr/local/lib/libnnz11.so failed attempt to open /usr/local/lib/libnnz11.a failed attempt to open /lib/powerpc64le-linux-gnu/libnnz11.so failed attempt to open /lib/powerpc64le-linux-gnu/libnnz11.a failed attempt to open /lib/libnnz11.so failed attempt to open /lib/libnnz11.a failed attempt to open /usr/lib/powerpc64le-linux-gnu/libnnz11.so failed attempt to open /usr/lib/powerpc64le-linux-gnu/libnnz11.a failed attempt to open /usr/lib/libnnz11.so failed attempt to open /usr/lib/libnnz11.a failed ld: cannot find -lnnz11

Any pointers to resolve this issue will be helpful.

bnoordhuis commented 8 years ago

Where did you install instantclient to? Is there a libnnz12.so in that directory? If yes, creating a libnnz11.so symlink will probably help.

cjbj commented 8 years ago

Does LD_LIBRARY_PATH include the directory that Instant Client installed into?

ghatwala commented 8 years ago

@bnoordhuis - instantclient is installed at /opt and created the soft link for libnnz11.so , see below.. /**_/ root@pts00433-vm24:/opt/instantclient_121# ll total 184732 drwxr-xr-x 3 root root 4096 Jan 20 22:32 ./ drwxr-xr-x 4 root root 4096 Jan 20 03:59 ../ -rwxr-xr-x 1 root root 72875 Dec 11 05:37 adrci -rw-r--r-- 1 root root 441 Dec 11 05:37 BASIC_README -rwxr-xr-x 1 root root 75297 Dec 11 05:37 genezi -r-xr-xr-x 1 root root 342 Dec 11 05:37 glogin.sql -rwxr-xr-x 1 root root 3892329 Dec 11 05:37 libclntshcore.so.12.1 lrwxrwxrwx 1 root root 17 Jan 20 00:40 libclntsh.so -> libclntsh.so.12.1 -rwxr-xr-x 1 root root 57326986 Dec 11 05:37 libclntsh.so.12.1 lrwxrwxrwx 1 root root 11 Jan 20 22:32 libnnz11.so -> libnnz12.so -r-xr-xr-x 1 root root 6168711 Dec 11 05:37 libnnz12.so lrwxrwxrwx 1 root root 15 Jan 20 00:40 libocci.so -> libocci.so.12.1 -rwxr-xr-x 1 root root 1957552 Dec 11 05:37 libocci.so.12.1 -rwxr-xr-x 1 root root 108537800 Dec 11 05:37 libociei.so -r-xr-xr-x 1 root root 153958 Dec 11 05:37 libocijdbc12.so -r-xr-xr-x 1 root root 308242 Dec 11 05:37 libons.so -rwxr-xr-x 1 root root 151042 Dec 11 05:37 liboramysql12.so -r-xr-xr-x 1 root root 1577859 Dec 11 05:37 libsqlplusic.so -r-xr-xr-x 1 root root 1113751 Dec 11 05:37 libsqlplus.so -r--r--r-- 1 root root 3692096 Dec 11 05:37 ojdbc6.jar -r--r--r-- 1 root root 3698857 Dec 11 05:37 ojdbc7.jar drwxr-xr-x 5 root root 4096 Dec 11 05:37 sdk/ -r-xr-xr-x 1 root root 70197 Dec 11 05:37 sqlplus -rw-r--r-- 1 root root 445 Dec 11 05:37 SQLPLUSREADME -rwxr-xr-x 1 root root 234652 Dec 11 05:37 uidrvci* -rw-r--r-- 1 root root 71200 Dec 11 05:37 xstreams.jar /**/ After i do node-gyp rebuild , i get below .. /_**_/ root@pts00433-vm24:~/strong-oracle# node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@3.2.1 gyp info using node@4.2.2 | linux | ppc64 gyp info spawn /usr/bin/python2 gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/root/strong-oracle/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/root/.node-gyp/4.2.2/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/root/.node-gyp/4.2.2', gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=node.lib', gyp info spawn args '-Dmodule_root_dir=/root/strong-oracle', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/root/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 COPY Release/oraclebindings.node make: Leaving directory '/root/strong-oracle/build' gyp info ok /***/ Next to try the npm test gives me below.. /*******/ root@pts00433-vm24:~/strong-oracle# npm test

strong-oracle@1.8.0 pretest /root/strong-oracle node pretest.js

/root/strong-oracle/lib/oracle.js:17 throw err; ^

Error: /opt/instantclient_12_1/libocci.so.12.1: undefined symbol: __IBMCPlusPlusExceptionV3 at Error (native) at Object.Module._extensions..node (module.js:460:18) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Module.require (module.js:366:17) at require (module.js:385:17) at Object. (/root/strong-oracle/lib/oracle.js:11:14) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) npm ERR! Test failed. See above for more details. /***/

Any pointers to move ahead .. ? :-)

ghatwala commented 8 years ago

@cjbj - Please see my bashrc file contents .. /***/ export LD_LIBRARY_PATH=/opt/instantclient_12_1 export OCI_LIB_DIR=/opt/instantclient_12_1 export OCI_INCLUDE_DIR=$OCI_LIB_DIR/sdk/include export OCI_HOME=/opt/instantclient_12_1 export OCI_VERSION=12 export OCI_INCLUDE_DIR=/opt/instantclient_12_1/sdk/include

if [ -f ~/strong-oracle.rc ]; then

source ~/strong-oracle.rc

fi

/**/ Hope so the above env variables settings augers well with my installed oracle instant client at /opt/instantclient_12_1. Also for reference , please refer the contents of instantclient folder for my above comment. Any pointers further please ..

ghatwala commented 8 years ago

Hi @cjbj , @bnoordhuis ... I just happen to read " readme.md" file for strong-oracle repo , noticed below ... Download Oracle Express 10g Download Instant Client Instant Client Package - Basic Lite Instant Client Package - SQL*Plus Instant Client Package - SDK Install Oracle Express (Ubuntu)

From the above , i just have installed the oracle instant client 12.1 from " http://www.oracle.com/technetwork/topics/linux-power-le-2835260.html " . My machine is "ppc64le ( with ubuntu/rhel 7.1)" .

Will i need oracle express , if yes , i don't find the one which is applicable to my set up. "http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html". Please comment on the above ?

bnoordhuis commented 8 years ago

Error: /opt/instantclient_12_1/libocci.so.12.1: undefined symbol: __IBMCPlusPlusExceptionV3

What file or files did you download from oracle.com exactly?

On the face of it, it looks like a bug in the oracle libraries caused by using IBM's XL compiler instead of g++, see http://www-01.ibm.com/support/docview.wss?uid=swg1IZ42393.

cjbj commented 8 years ago

__IBMCPlusPlusExceptionV3 doesn't appear in the Linux 64bit Instant Client that I can see. (And running 'strings' on libocci.so.12.1 shows that icc was used in the build). Looks like the Instant Client bundle for a different platform was pulled.

ghatwala commented 8 years ago

@bnoordhuis , @cjbj - i downloaded the below files.My platform that i am using is " ppc64le " with ubuntu 15.04 running on it.

instant client basic : http://download.oracle.com/otn/linux/instantclient/121020/instantclient-basic-linux.leppc64-12.1.0.2.0.zip instant client sdk - http://download.oracle.com/otn/linux/instantclient/121020/instantclient-sdk-linux.leppc64-12.1.0.2.0.zip instant client sql plus - http://download.oracle.com/otn/linux/instantclient/121020/instantclient-sqlplus-linux.leppc64-12.1.0.2.0.zip

The url for my platform is - http://www.oracle.com/technetwork/topics/linux-power-le-2835260.html . Please confirm if i have selected/downloaded the correct url.

ghatwala commented 8 years ago

@cjbj - " And running 'strings' on libocci.so.12.1 shows that icc was used in the build " ...in ur above statement . could u please let me know the exact command for running 'strings' on libocci.so.12.1 ?

bnoordhuis commented 8 years ago

Those look like the right files to me. Not sure why you're getting that undefined symbol error. Maybe file a support request with your oracle rep?

ghatwala commented 8 years ago

@bnoordhuis - how do i find if i have downloaded the correct ones . Is there a command to find it the correct instant client for correct platform is downloaded ?

bnoordhuis commented 8 years ago

If they were for the wrong platform/architecture, you'd get an error about an ELF class mismatch. You can try running ldd and readelf -a on the .so files.

ghatwala commented 8 years ago

@bnoordhuis - please see below ... root@pts00433-vm24:/opt/instantclient_12_1# ldd libocci.so linux-vdso64.so.1 => (0x00003fff87310000) libstdc++.so.6 => /usr/lib/powerpc64le-linux-gnu/libstdc++.so.6 (0x00003fff86f50000) libm.so.6 => /lib/powerpc64le-linux-gnu/libm.so.6 (0x00003fff86e60000) libgcc_s.so.1 => /lib/powerpc64le-linux-gnu/libgcc_s.so.1 (0x00003fff86e20000) libc.so.6 => /lib/powerpc64le-linux-gnu/libc.so.6 (0x00003fff86c40000) /lib64/ld64.so.2 (0x00000000577a0000)

so guess it seems in order ?

bnoordhuis commented 8 years ago

Looks alright to me.

ghatwala commented 8 years ago

@bnoordhuis - so is the " Error: /opt/instantclient_12_1/libocci.so.12.1: undefined symbol: __IBMCPlusPlusExceptionV3 " a bug on oracle instant client ( for ppc64le - linux ) and nothing wrong on the strong-oracle front ?

ghatwala commented 8 years ago

@bnoordhuis - one more point , do i need to install oracle database express from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html or will just oracle instant client suffice for strong-oracle ?

bnoordhuis commented 8 years ago

Just instantclient should be enough. That __IBMCPlusPlusExceptionV3 error from libocci.so suggests an issue with oracle's libraries, it doesn't look like a strong-oracle issue to me.

cjbj commented 8 years ago

I can see 'nm' shows __IBMCPlusPlusExceptionV3 as undefined with PPC LE Instant Client.

What compiler are you using? See the pre-requisites https://docs.oracle.com/database/121/LPLIG/pre_install.htm#LPLIG122 which say to use the IBM XL compiler.

I'll check with the team who built Instant Client PPC LE to see what they say.

ghatwala commented 8 years ago

@cjbj - i was trying it on a ubuntu/ppc64le vm , also i have tried it on a RHEL/ppc64le vm and it failed with same undefined symbol error....any comments on the ubuntu port ?

cjbj commented 8 years ago

@ghatwala what compiler & version are you using?

ghatwala commented 8 years ago

@cjbj -
[jenkins@p006vm14 strong-oracle]$ yum list installed | grep -i --color gcc gcc.ppc64le 4.8.3-9.ael7b @anaconda/7.1 gcc-c++.ppc64le 4.8.3-9.ael7b @anaconda/gcc-gfortran.ppc64le 4.8.3-9.ael7b @anaconda/7.1 libgcc.ppc64le 4.8.3-9.ael7b @anaconda/7.1

Please note that i dont have IBM XL compiler. installed ...also can oracle instant client work on ubuntu-ppc64le ?

cjbj commented 8 years ago

Thanks for the info.

Regarding Ubuntu; we don't certify it for any client. But many people use x86 Ubuntu for development without problems.

I'd be interested to know if you also see problems with the alternative driver https://www.npmjs.com/package/oracledb This doesn't use the libocci.so.12.1 library. Note installation setup is slightly different than strong-oracle.

cjbj commented 8 years ago

@ghatwala Our team with access to PPC LE tested linking with gcc on RHEL 7.1 and didn't see a problem. They don't have your environment and are not testing Node.

Can you check you can build the Instant Client demo program on RHEL to check the basics work?

  1. Edit instantclient_12_1/sdk/demo.mk and set CC & cc to your gcc location.
  2. Edit occidml.cpp, and (optionally for our purposes) edit occidemo.sql and occidemod.sql and set your DB credentials
  3. Run 'sqlplus /nolog occidemo.sql' if you want to run the demo completely. Ignore AQ errors, since the basic demo doesn't use AQ
  4. In your shell set LD_LIBRARY_PATH to the Instant Client lib directory
  5. Run make -f demo.mk occidml
  6. Run './occidml' It will either display data, or give an error about a missing table (if you didn't run occidemo.sql)

Do this on RHEL. If you have compilation issues, check the list of required packages in https://docs.oracle.com/database/121/LPLIG/pre_install.htm#LPLIG122 If it works, check whether strong-oracle is passing the correct build & link parameters. Maybe there is a bug in its install script.

elkorep commented 8 years ago

@ghatwala

It may be looking for the wrong libraries resolved by this pull request strongloop/strong-oracle/pull/60 once it has been merged try again: If you want to try it then try to clone my branch update_ic_ppc64, move it to your global node module directory and run npm install from within the strong-oracle directory.

It works for me on RHEL 7.1 and UBUNTU 14 on PPC64LE with both Node 12 and Node 42

Here are my steps for the pre reqs PREREQUISITES

Download instanclient basic and sdk for ppc64 le (64-bit): http://www.oracle.com/technetwork/topics/linux-power-le-2835260.html

First try to unzip them into the same directory.

unzip -o instantclient-basic-linux.leppc64-12.1.0.2.0.zip
unzip -o instantclient-sdk-linux.leppc64-12.1.0.2.0.zip

Then try to move it to /opt/ and create links to to library directory you have in your PATH

sudo mv instantclient_12_1 /opt/

sudo ln -s /opt/instantclient_12_1/libocci.so.12.1 /usr/local/lib/libocci.so
sudo ln -s /opt/instantclient_12_1/libclntsh.so.12.1 /usr/local/lib/libclntsh.so

Then export the following:

export OCI_HOME=/opt/instantclient_12_1
export OCI_LIB_DIR=$OCI_HOME
export OCI_INCLUDE_DIR=$OCI_HOME/sdk/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OCI_LIB_DIR
ghatwala commented 8 years ago

@elkorep - i have tried the above , however the error is still the same , will await your code commit to cross verify if strong-oracle working using npm install and npm install

elkorep commented 8 years ago

@ghatwala try strong-oracle again, changes are merged to npm now.

ghatwala commented 8 years ago

@elkorep : i tried the latest one again , however the error is still the same.

Please see my steps :

[test@pts00433-vm27 peter_oracle]$ npm install npm WARN package.json strong-oracle@1.8.1 license should be a valid SPDX license expression

strong-oracle@1.8.1 install /home/test/amit/peter_oracle node-gyp rebuild make: Entering directory /home/test/amit/peter_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 COPY Release/oracle_bindings.node make: Leaving directory/home/test/amit/peter_oracle/build'

[test@pts00433-vm27 peter_oracle]$ npm test

strong-oracle@1.8.1 pretest /home/test/amit/peter_oracle node pretest.js /home/test/amit/peter_oracle/lib/oracle.js:17 throw err; ^ Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/test/amit/peter_oracle/build/Release/oracle_bindings.node) at Error (native) at Object.Module._extensions..node (module.js:435:18) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object. (/home/test/amit/peter_oracle/lib/oracle.js:11:14) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) npm ERR! Test failed. See above for more details.

My set up details , [test@pts00433-vm27 peter_oracle]$ node --version v4.2.6 [test@pts00433-vm27 peter_oracle]$ npm --version 2.14.12 [test@pts00433-vm27 strong-oracle]$ strings /lib64/libstdc++.so.6 | grep GLIBC GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10 GLIBCXX_3.4.11 GLIBCXX_3.4.12 GLIBCXX_3.4.13 GLIBCXX_3.4.14 GLIBCXX_3.4.15 GLIBCXX_3.4.16 GLIBCXX_3.4.17 GLIBCXX_3.4.18 GLIBCXX_3.4.19 GLIBCXX_LDBL_3.4 GLIBCXX_LDBL_3.4.7 GLIBCXX_LDBL_3.4.10 GLIBC_2.17 GLIBCXX_FORCE_NEW GLIBCXX_DEBUG_MESSAGE_LENGTH

[test@pts00433-vm27 peter_oracle]$ gcc --version gcc (GCC) 5.2.1 20150824 (Advance-Toolchain-at9.0) [ibm/gcc-5-branch, revision: 227148 merged from gcc-5-branch, revision 227146] Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cjbj commented 8 years ago

@ghatwala did you try it on RHEL 7 with the required RPMs mentioned in https://docs.oracle.com/database/121/LPLIG/pre_install.htm#LPLIG122 ?

ghatwala commented 8 years ago

@cjbj - i installed "unixODBC-2.3.1-4.95.ppc64le" as well .. [test@pts00433-vm27 strong-oracle]$ rpm -q unixODBC unixODBC-2.3.1-11.el7.ppc64le.

I even installed gcc 4.8.5 version on it. [test@pts00433-vm27 strong-oracle]$ gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

However the error is still the same , Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/test/amit/strong-oracle/build/Release/oracle_bindings.node)

ghatwala commented 8 years ago

@cjbj - My set up details .. [test@pts00433-vm27 strong-oracle]$ cat /etc/os-release NAME="Red Hat Enterprise Linux Server" VERSION="7.1 (Maipo)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.1" PRETTY_NAME="Red Hat Enterprise Linux" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.1:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.1 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION=7.1

ghatwala commented 8 years ago

pretestlog.txt ) @cjbj - error log for reference.

cjbj commented 8 years ago

@ghatwala there seemed to be a few RPMs listed as requirements. Better check you have those.

ghatwala commented 8 years ago

@cjbj - yes , i have installed everything under - " Red Hat Enterprise Linux Server 7.1 Packages " on the above url ..still the error persists.

cjbj commented 8 years ago

@ghatwala Did you try the demo program like I described?

ghatwala commented 8 years ago

@cjbj - i have input to give , somehow i installed the iBM C/C++ runtime from http://www-01.ibm.com/support/docview.wss?uid=swg24040214 , however i got only lib files and no binary for xlc/c++ ...

[test@pts00433-vm27 opt]$ rpm -q --filesbypkg xlc package xlc is not installed [test@pts00433-vm27 opt]$ rpm -q --filesbypkg libxlc libxlc /opt/ibm libxlc /opt/ibm/lib libxlc /opt/ibm/lib/libibmc++.so.1

I dont have the steps to install XLC/C++ binary ? Any thoughts on this ?

elkorep commented 8 years ago

@cjbj I am able to reproduce the error: Error: /opt/instantclient_12_1/libocci.so.12.1: undefined symbol: __IBMCPlusPlusExceptionV3 at Error (native)

It is only occuring on ppc64le and ppc64 machines

cjbj commented 8 years ago

@elkorep what was your testcase? And did you have the various packages (other than XLC compiler) mentioned as the Instant Client prerequisites?

ghatwala commented 8 years ago

@cjbj - i have feeling this has gotto to do more with the oracle library - instant client 12.1 rather then nodejs /npm . Even installing all the packages mentioned as dependencies for instant client 12.1 doesn't help to port strong -oracle to ppc64le machines.

Any thoughts on this ?

cjbj commented 8 years ago

As mentioned, the demo program works for us with gcc. Start from that and see what you are missing.

elkorep commented 8 years ago

@cjbj Thanks for the help I will try installing IBM XL C/C++ for Linux 13.1.1, I did not have that pre requisite.

cjbj commented 8 years ago

@elkorep to compile the demo script, our platform team successfully used gcc. (They might have also had XL installed from previous requirements, I don't know)

elkorep commented 8 years ago

@cjbj XL is shown as a pre req here instantoraclepreinstall

gireeshpunathil commented 8 years ago

@cjbj,

I have some observations on the issue. Please review and let me know what do you think.

  1. Write a sample program which loads the oci library (emulating how this is loaded in the consuming program such as node):
bash-4.2$ cat foo.cpp
#include <dlfcn.h>
#include <stdio.h>

int main()
{
        void *handle = dlopen("./libclntsh.so", RTLD_NOW | RTLD_GLOBAL);
        if(handle == NULL)
                fprintf(stderr, "%s\n", dlerror());
        else
                fprintf(stderr, "success loading library: 0x%p\n", handle);
        void *handle1 = dlopen("./libocci.so", RTLD_NOW);
        if(handle1 == NULL)
                fprintf(stderr, "%s\n", dlerror());
        else
                fprintf(stderr, "success loading library: 0x%p\n", handle1);

}
  1. Examine the symbol status in the oci library:
bash-4.2$ nm libocci.so | grep __IBMCPlusPlusExceptionV3
                 U __IBMCPlusPlusExceptionV3

Clearly, this symbol is undefined in the library, which is present in the C++ runtime library libibmc++.so:

bash-4.2$` nm /opt/ibm/lib/libibmc++.so.1 | grep __IBMCPlusPlusExceptionV3
0000000000000f24 T __IBMCPlusPlusExceptionV3
bash-4.2$
  1. Examine the linkage dependancies of libocci.so:
bash-4.2$ ldd libocci.so
        linux-vdso64.so.1 =>  (0x00003fff96560000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00003fff96230000)
        libm.so.6 => /lib64/power8/libm.so.6 (0x00003fff96150000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00003fff96120000)
        libc.so.6 => /lib64/power8/libc.so.6 (0x00003fff95f50000)
        /lib64/ld64.so.2 (0x0000000037200000)

We don't see that libibmc++.so.1 as a dependancy for oci library. This is fine as long as a consuming program is linked with the C++ runtime library from where this symbol will be resolved, as below:

  1. Build foo.cpp with xlC, which causes the resultant executable to link with libibmc++.so, and everything works.
bash-4.2$ xlC foo.cpp
bash-4.2$ ldd a.out
        linux-vdso64.so.1 =>  (0x00003fff86df0000)
        libibmc++.so.1 => /opt/ibm/lib/libibmc++.so.1 (0x00003fff86dd0000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00003fff86c40000)
        libm.so.6 => /lib64/power8/libm.so.6 (0x00003fff86b60000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00003fff86b40000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00003fff86b10000)
        libc.so.6 => /lib64/power8/libc.so.6 (0x00003fff86940000)
        /lib64/ld64.so.2 (0x0000000059c20000)
bash-4.2$ ./a.out
success loading library: 0x0x1001d5e0030
success loading library: 0x0x1001d5e3250
  1. If the consuming program is not build with xlC, rather with g++, then there is no module in the whole program space which has a dependency on the IBM C++ runtime library, leading to the issue.

bash-4.2$ g++ foo.cpp -ldl
bash-4.2$ ldd a.out
        linux-vdso64.so.1 =>  (0x00003fff9b0b0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00003fff9b080000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00003fff9af00000)
        libm.so.6 => /lib64/power8/libm.so.6 (0x00003fff9ae20000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00003fff9adf0000)
        libc.so.6 => /lib64/power8/libc.so.6 (0x00003fff9ac20000)
        /lib64/ld64.so.2 (0x0000000021e30000)

As we can see, and is evident, a.out has no dependancy with libibmc++.so.

bash-4.2$ ./a.out
success loading library: 0x0x10021ec0030
./libocci.so: undefined symbol: __IBMCPlusPlusExceptionV3
bash-4.2$

In summary, an executable which is not built with xlC will not be able to load this oci libary, as it contains an unresolved symbol. My view is that as we cannot guarentee this pre-requisite, and the oci library should define the dependancy by itself, as this module requires the symbol in question.

Coming to why oci library has no defined dependancy with libibmc++.so.1, I tried elumating the same behavior using small tests, and could not figure out how is it possible - any program which has a try-catch sequence in it, causes the symbol __IBMCPlusPlusExceptionV3 to be referenced, and a linkage to depend on the runtime library, and show up in the ldd output. The only exception is when I compile it with xlC [ C++ ] and link the object code using xlc [ C ] to make the final shared module where I see the behavior similar to oci. I am not sure this is how the oci library is built, do you know?

As for the support scenario of g++: I see the pre-req page https://docs.oracle.com/database/121/LPLIG/pre_install.htm#LPLIG122 which talks about needing IBM XL C/C++ runime environment, but it does not pre-req that xlC be used for compilation. The package listing says that gcc/g++ is also supported.

In summary, I believe the right approach is to have libocci.so defining dependancy with the IBM XL C/C++ runtime library, due to that fact that it referenes a symbol from the runtime library - without delegating the linkage to consumer programs, which may or may not be built with xlC.

Please let me know your views. Thanks in advance.

ghatwala commented 8 years ago

@cjbj , Any comments on the above reply ?

cjbj commented 8 years ago

I will have to defer to the group building the library; I'll ping them.

I would still like to see the result of my request to try the Instant Client demo program.

WTMServers commented 8 years ago

The Oracle Instant Clients for IBM's Linux on Power Systems Platform are built with the xlc and c++ libraries. When linking with a gcc based application the xlc RTE must be available. For the 12c Little Endian versions xlc 13.1.2 RTE is used and the required RTE can be found here

gireeshpunathil commented 8 years ago

@WTMServers, thanks - when you say "the xlc RTE must be available", what does that mean? The host system should have those libraries installed, or the hosting application (the one which links the Oracle Instant Clients libraries) should make explicit bindings with the RTE libraries? even if they don't have any direct dependency on them?

If the answer is former yes, we do have them installed in the system, but due to the fact that no object in the process is linked with RTE libs, the symbols are not resolved. Please see my previous comment for the details.

If the answer is the later then that would be a new application linkage protocol which is not prevalent in any of established linking scenarios, and needs to be well documented.