Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when building ibm_db #1

Closed
ethanwillis opened this issue Mar 6, 2014 · 13 comments
Closed

Errors when building ibm_db #1

ethanwillis opened this issue Mar 6, 2014 · 13 comments

Comments

@ethanwillis
Copy link

Hello, I'm receiving errors when trying to build ibm_db.

System: I'm using the latest release of 64 bit linux mint.

Steps:
1.) I installed node and npm.
2.) I created my project directory + the node modules folder
3.) I downloaded and installed installed Data Server Client v9.7. I've verified that all the files installed in the correct default folder under /opt/ibm/db2.
4.) I've cloned ibm_db into my project's node_modules folder and issues "node-gyp configure"
5.) On "node-gyp build" I get the following output...

sudo node-gyp build > debug.txt
gyp info it worked if it ends with ok
gyp info using node-gyp@0.13.0
gyp info using node@0.10.15 | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
/usr/bin/ld: cannot find -ldb2o
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/odbc_bindings.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/bin/node-gyp" "build"
gyp ERR! cwd /home/mint/Programming/CCP/node_modules/node-ibm_db
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok

What steps do I need to take to ensure that this builds correctly, or is this an actual issue?

@praveend
Copy link
Contributor

Hi,

Could you let us know what your IBM_DB_HOME variable is set to. Before installing you will need to set the IBM_DB_HOME variable to the installation directory of IBM DataServer Driver package.

Coming to the DB2 client, it is recommended that you use the Data Server Driver package instead of Data Server Client with node-ibm_db.
http://www-01.ibm.com/support/docview.wss?uid=swg27016878
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.swg.im.dbclient.install.doc/doc/t0054799.html

Thanks

Praveen

@ethanwillis
Copy link
Author

I set my IBM_DB_HOME to be the install directory for the Data Server Client and I still get the same errors.

echo $IBM_DB_HOME
/opt/ibm/db2/V9.7

I then installed the Data Server Driver Package in /home/mint/db2user, and updated my IBM_DB_HOME to be that install folder. I still get the same errors when trying to run "node-gyp configure build"

ls /home/mint/db2user
bin db2cshrc installDSDriver license db2_cli_odbc_driver db2profile installDSDriver.log tools
echo $IBM_DB_HOME
/home/mint/db2user

@praveend
Copy link
Contributor

Hi,

I don't see the lib and include folders under the install folder.....after installation the folder should look like below, to which IBM_DB_HOME is to be set......check under db2_cli_odbc_driver, might be the necessary libraries have got installed there.

Once all these are ensured and still error is seen....I would next look at if you node is 32-bit or 64-bit if node is 32-bit and the DB2 client u downloaded is 64-bit or vice versa then you would still your installation could fail....hence ensure that you have both the packages for same architecture....

Folder structure

$ ls
adm bin bnd cfgcache db2cshrc db2dump db2profile32 installDSDriver java lib license php rdf tools
adm32 bin32 cfg conv db2cshrc32 db2profile include installDSDriver.log json lib32 msg python ruby

Thanks

Praveen

@ethanwillis
Copy link
Author

I reinstalled the Dataserver Driver packages and now I have the correct folder structure

$ ls ~/db2user
adm bin bnd cfg cfgcache conv db2cshrc db2dump db2profile include installDSDriver installDSDriver.log java lib license msg odbc_cli_driver php security64 tools

I also checked to see which architecture my nodejs and Data Server driver packages have. NodeJS is x64, version is 0.10.15, And my Data Server Driver package is x64 as well.

Thanks

@ethanwillis
Copy link
Author

Here is a screenshot of the the install log file, installDSDriver.log
screenshot from 2014-03-10 15 17 32

@ethanwillis
Copy link
Author

I believe I have found the issue. I think that my config.gyp is being generated incorrectly. This might be due to the binding.gyp in the project being out of date for the latest version of node-gyp.

Here is a screenshot of my config.gyp under node-ibm_db/build/ and my binding.gyp under node-bim_db/ Notice in my config.gyp (on the left side) that the variables "include_dirs" and "libraries" are empty.

screenshot from 2014-03-10 16 06 07

If this is the case, I will create and send a pull request.

@praveend
Copy link
Contributor

Hi,

What version of node.js are you on?

One thing to note is if config.gyp was not generated properly how were the include files under instal_dir/include detected. The reason I say this is the failure is seen at the link step while the compile is gone through fine.

Thanks

Praveen

@ethanwillis
Copy link
Author

NodeJS version is 0.10.15

@praveend
Copy link
Contributor

could you update your node to latest stable v0.10.26 and give a try

@ethanwillis
Copy link
Author

I updated to v0.10.26 and I still get the error "/usr/bin/ld: cannot find -ldb2o" after running node-gyp configure and node-gyp build.

@praveend
Copy link
Contributor

Not sure what is that piece we are missing....I tried to repro by following the steps you mentioned....it goes through fine on my system and config.gypi is as in your case....

Only thing I see is you are on mint....does mint have any particular binary format? If yes, then might be DB2 client libraries and node libraries are of different format.

Would it be possible for you to give a try on ubuntu box and see if you hit the same error?

@ethanwillis
Copy link
Author

Yes, I will try this on a regular ubuntu box and update this comment with my findings. It will be a few hours before I can try this, because I have some meetings I have to prepare for.

@ethanwillis
Copy link
Author

Hello Praveen, I have been able to successfully build and install this module.

I...

1.) switched to ubuntu 12.04LTS
2.) Downloaded the correct DataServerDriver package for my architecture and installed it.
3.) Set environment variables IBM_DB_HOME and CPATH to the root directory of my dsdriver install and the include folder within my dsdriver folder respectively.
4.) successfully issued node-gyp configure build command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants