OpenInformix / IfxNode

Informix native node.js driver for scalable enterprise and IoT solutions.
MIT License
9 stars 11 forks source link

Getting error while Linux build from source code. #7

Closed PawarPawan closed 5 years ago

PawarPawan commented 6 years ago

Hi team, I follow the instructions as mentioned at https://github.com/OpenInformix/IfxNode/blob/master/LocalBuildLinux.md

I have installed informix in my machine, and its working fine. 1) I have install all Prerequisite. 2) Also set CSDK_HOME ~/IfxNode$ echo $CSDK_HOME /opt/client_sdk 3) Output of node-gyp configure -v

~/IfxNode$ node-gyp configure -v gyp info it worked if it ends with ok gyp verb cli [ '/usr/local/bin/node', gyp verb cli '/usr/local/bin/node-gyp', gyp verb cli 'configure', gyp verb cli '-v' ] gyp info using node-gyp@3.6.2 gyp info using node@8.4.0 | linux | arm64 gyp verb command configure [] gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR gyp verb download using dist-url http://nodejs.org/dist gyp verb check python checking for Python executable "python2" in the PATH gyp verb which succeeded python2 /usr/bin/python2 gyp verb check python version /usr/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.12\n" gyp verb get node dir no --target version specified, falling back to host node version: 8.4.0 gyp verb command install [ '8.4.0' ] gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR gyp verb download using dist-url http://nodejs.org/dist gyp verb install input version string "8.4.0" gyp verb install installing version: 8.4.0 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version is already installed, need to check "installVersion" gyp verb got "installVersion" 9 gyp verb needs "installVersion" 9 gyp verb install version is good gyp verb get node dir target node version installed: 8.4.0 gyp verb build dir attempting to create "build" dir: /home/informix/IfxNode/build gyp verb build dir "build" dir needed to be created? null gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: /home/informix/IfxNode/build/config.gypi gyp verb config.gypi checking for gypi file: /home/informix/IfxNode/config.gypi gyp verb common.gypi checking for gypi file: /home/informix/IfxNode/common.gypi gyp verb gyp gyp format was not specified; forcing "make" 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 '/home/informix/IfxNode/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 '/home/informix/.node-gyp/8.4.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/informix/.node-gyp/8.4.0', gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/home/informix/.node-gyp/8.4.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/home/informix/IfxNode', gyp info spawn args '-Dnode_engine=v8', 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 ok

4) But when I run node-gyp build -v cmd I got this error

~/IfxNode$ node-gyp build -v gyp info it worked if it ends with ok gyp verb cli [ '/usr/local/bin/node', gyp verb cli '/usr/local/bin/node-gyp', gyp verb cli 'build', gyp verb cli '-v' ] gyp info using node-gyp@3.6.2 gyp info using node@8.4.0 | linux | arm64 gyp verb command build [] gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR gyp verb download using dist-url http://nodejs.org/dist gyp verb build type Release gyp verb architecture arm64 gyp verb node dev dir /home/informix/.node-gyp/8.4.0 gyp verb which succeeded for make /usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/home/informix/IfxNode/build' g++ '-DNODE_GYP_MODULE_NAME=ifx_njs_bind' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DODBC64' '-DBUILDING_NODE_EXTENSION' -I/home/informix/.node-gyp/8.4.0/include/node -I/home/informix/.node-gyp/8.4.0/src -I/home/informix/.node-gyp/8.4.0/deps/uv/include -I/home/informix/.node-gyp/8.4.0/deps/v8/include -I../node_modules/nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/ifx_njs_bind/src/odbc.o.d.raw -c -o Release/obj.target/ifx_njs_bind/src/odbc.o ../src/odbc.cpp In file included from ../src/odbc.cpp:27:0: ../src/odbc.h:27:21: fatal error: infxcli.h: No such file or directory compilation terminated. ifx_njs_bind.target.mk:99: recipe for target 'Release/obj.target/ifx_njs_bind/src/odbc.o' failed make: *** [Release/obj.target/ifx_njs_bind/src/odbc.o] Error 1 make: Leaving directory '/home/informix/IfxNode/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:258:23) gyp ERR! stack at emitTwo (events.js:125:13) gyp ERR! stack at ChildProcess.emit (events.js:213:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 3.14.79-86 gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "build" "-v" gyp ERR! cwd /home/informix/IfxNode gyp ERR! node -v v8.4.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok

msatyan commented 6 years ago

Look like on your system the CSDK_HOME environment variable is not getting picked up Just as temporary workaround can you please update the information directly on binding.gyp

PawarPawan commented 6 years ago

Thanks @msatyan, as you suggest I did the same, but still have same error. I am not good in C, but can you please suggest how I can set path for this ../src/odbc.h:27:21: fatal error: infxcli.h: No such file or directory

msatyan commented 6 years ago

Hi Pawar,

Sorry for the delay in getting you back, middle of something that I could not give enough attention to ....

The infxcli.h is being picked up from your CSDK installation; please check you have the file at $(CSDK_HOME)/incl/cli. Since you have installed CSDK at /opt/client_sdk, then it will be ls -l /opt/client_sdk/incl/cli/infxcli.h If it doesn’t exist then there is something wrong with the CSDK installation, hope that is not the case. Then try specifying the location by using C_INCLUDE_PATH (or CPLUS_INCLUDE_PATH) Additional include directories can be added to the include path using the environment variable While doing the preprocessing, C compilers also look for the header file from the location you have mention though environment. C_INCLUDE_PATH (for C header files) or CPLUS_INCLUDE_PATH (for C++ header files); Then set the following on your shell environment. C_INCLUDE_PATH=/opt/client_sdk/incl/cli or CPLUS_INCLUDE_PATH=/opt/client_sdk/incl/cli You may find more information about this from Environment Variables Affecting GCC

If you need more help, please don’t hesitate to reach out to us, we want to make sure you got enough information for you to get your application up and running.

Regards, Satyan.

trendzetter commented 5 years ago

Seems like a common issue. Having the same here.