jdorner / node-sapnwrfc

SAP Netweaver RFC SDK bindings for Node.js
MIT License
56 stars 23 forks source link

Can't build on Ubuntu 12.04 and node.js v0.10.41 #27

Open mjsalinger opened 8 years ago

mjsalinger commented 8 years ago

Unable to build binding on Ubuntu 12.04 and node.js v0.10.41.

Steps Taken For First Attempt

./SAPCAR_3-20002089.EXE -xf NWRFC_8-20004549.SAR
cd nwrfcsdk
cp ./lib/* /usr/lib
cp ./include/* /usr/inlude

Second Attempt Added sdk files to the sapnwrfc directory under our project.
ran npm rebuild sapnwrfc

Received the following error for both attempts:

> sapnwrfc@0.2.0 install /app_dir/node_modules/sapnwrfc
> node preinstall.js

>{ [Error: Could not locate the bindings file. Tried:
→ /app_dir/node_modules/sapnwrfc/build/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/build/Debug/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/build/Release/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/out/Debug/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/Debug/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/out/Release/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/Release/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/build/default/sapnwrfc.node
 → /app_dir/node_modules/sapnwrfc/compiled/0.10/linux/x64/sapnwrfc.node]
  tries:
   [ '/app_dir/node_modules/sapnwrfc/build/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/build/Debug/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/build/Release/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/out/Debug/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/Debug/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/out/Release/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/Release/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/build/default/sapnwrfc.node',
     '/app_dir/node_modules/sapnwrfc/compiled/0.10/linux/x64/sapnwrfc.node' ] }
error a precompiled module could not be found or loaded
info trying to compile it...
make: Entering directory `/app_dir/node_modules/sapnwrfc/build'
  CXX(target) Release/obj.target/sapnwrfc/src/binding.o
In file included from ../src/Connection.h:28:0,
                 from ../src/binding.cc:28:
../src/Common.h:30:22: fatal error: sapnwrfc.h: No such file or directory
compilation terminated.
make: *** [Release/obj.target/sapnwrfc/src/binding.o] Error 1
make: Leaving directory `/app_dir/node_modules/sapnwrfc/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ubuntu/nodejs/node0.10.41/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.8.0-44-generic
gyp ERR! command "node" "/home/ubuntu/nodejs/node0.10.41/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app_dir/node_modules/sapnwrfc
gyp ERR! node -v v0.10.41
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
sapnwrfc@0.2.0 /app_dir/node_modules/sapnwrfc

The following is the tree for our sapnwrfc directory:

$ tree -L 2 /app_dir/node_modules/sapnwrfc
├── bin
│   ├── desktop.ini
│   ├── rfcexec
│   └── startrfc
├── binding.gyp
├── build
│   ├── binding.Makefile
│   ├── config.gypi
│   ├── Makefile
│   ├── Release
│   └── sapnwrfc.target.mk
├── circle.yml
├── compiled
│   ├── 4.0
│   ├── 4.1
│   ├── 4.2
│   └── 5.0
├── demo
│   ├── companyClient.c
│   ├── desktop.ini
│   ├── readme.txt
│   ├── rfcexec.cpp
│   ├── rfcexec.h
│   ├── sapnwrfc.ini
│   ├── sflightClient.c
│   ├── sso2sample.c
│   ├── startrfc.cpp
│   ├── startrfc.h
│   └── stfcDeepTableServer.c
├── desktop.ini
├── doc
│   └── desktop.ini
├── examples
│   └── example1.js
├── gulpfile.js
├── include
│   ├── desktop.ini
│   ├── sapdecf.h
│   ├── sapnwrfc.h
│   ├── sapuc.h
│   └── sapucx.h
├── lib
│   ├── desktop.ini
│   ├── libicudata.so.34
│   ├── libicudecnumber.so
│   ├── libicui18n.so.34
│   ├── libicuuc.so.34
│   ├── libsapnwrfc.so
│   └── libsapucum.so
├── LICENSE
├── node_modules
│   ├── bindings
│   └── nan
├── package.json
├── preinstall.js
├── README.md
├── sapnwrfc.js
├── src
│   ├── binding.cc
│   ├── Common.h
│   ├── Connection.cc
│   ├── Connection.h
│   ├── Function.cc
│   └── Function.h
└── tests
    ├── offline.js
    └── testSetIniPath.js
mjsalinger commented 8 years ago

Anyone have any advice on this?

StefanScherer commented 8 years ago

@mjsalinger As there is the error fatal error: sapnwrfc.h: No such file or directory the SDK header file could not be found. Have a look how this is built at CircleCI setting the environment https://github.com/jdorner/node-sapnwrfc/blob/master/circle.yml#L5 adding the shared libs https://github.com/jdorner/node-sapnwrfc/blob/master/circle.yml#L30-L31.

Any plans to use a more recent version of Node? The repo has precompiled bindings for 4.0, 4.1, 4.2 and 5.0.

mjsalinger commented 8 years ago

We do have plans to use a more recent version of node, but the project that this is being added to has a lot of dependencies and is quite large, so the upgrade is going to take some time. I'll try your advice.

StefanScherer commented 8 years ago

There's a typo in cp ./include/* /usr/inlude missing a c.