gcc include /usr/include/algorithm
I am starting to dig deeper into gcc compiles using ibmichroot. My current en devour is compiling node-inspector. I eventually hope to combine the steps I take into a xxxx.lst file (probably the gcc one).
To compile Node.js modules the following are needed:
- Python 2.7 (perzl)
- gcc (perzl)
The compile goes fine until I get to other includes, like algorithm
.
$ npm install node-inspector
> v8-profiler@5.3.2 preinstall /home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/v8-profiler
>
> v8-debug@0.5.4 preinstall /home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/v8-debug
>
npm WARN optional dep failed, continuing default-browser-id@1.0.2
> utf-8-validate@1.2.1 install /home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild
gmake: Entering directory '/home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:48:21: fatal error: algorithm: No such file or directory
#include <algorithm>
So I went searching and found /QSYS.LIB/QSYSINC.LIB/STD.FILE/ALGORITHM.MBR
and copied it to the IFS similar to what we do for ruby-ibm_db:
$ system -v "CPY OBJ('/QSYS.LIB/QSYSINC.LIB/STD.FILE/ALGORITHM.MBR') TODIR('/usr/include') TOCCSID(*STDASCII) DTAFMT(*TEXT) REPLACE(*YES)"
$ mv /usr/include/ALGORITHM.MBR /usr/include/algorithm
Copy and rename (mv
) is successful. I run the install again and get errors from the algorithm
include.
% npm install node-inspector
> v8-profiler@5.3.2 preinstall /home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/v8-profiler
>
> v8-debug@0.5.4 preinstall /home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/v8-debug
>
npm WARN optional dep failed, continuing default-browser-id@1.0.2
> utf-8-validate@1.2.1 install /home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild
gmake: Entering directory '/home/USRAB3L5/nodejs_sqlite3/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../node_modules/nan/nan.h:48:0,
from ../src/validation.cc:15:
/usr/include/algorithm:5:26: error: #endif without #if
#endif /* defined(__COMPILER_VER__) */
^
/usr/include/algorithm:8:24: error: #endif without #if
#endif /* defined(__MVS__) */
^
/usr/include/algorithm:26:6: error: #error This file to be used only with IBM VisualAge C++ v4 and later compilers
# error\
^
I am not sure if I can copy the algorithm
file to here without it being illegal, but there is a lot of interesting stuff in the top of it (i.e. significantly indented 'if' statements with question marks in front of them).
##Should I be pulling includes from somewhere else?
Comments (8)
-
Account Deleted -
reporter Can you find an Open Source equivalent???
Here is the gcc repo. Pressing 't' on that page opens up a nifty file search tool that allowed me to find a couple different
algorithm
files.Do you know which one I should be using?...
- https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/include/std/algorithm
- https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/include/ext/algorithm
- https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/include/experimental/algorithm
- https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/include/parallel/algorithm
-
Account Deleted Wait just a minute, you are a c geek now, second you started compiling things, 'which header' is your work here. Have a nice afternoon :)
-
reporter Too true. Time for me to put on my big boy pants. :-)
-
I'm hitting this issue too. @aaronbartell were you able to find a solution? I'm trying to install the
ibm_db
module for Node. -
reporter Sorry, I haven't had time to pursue this further.
-
reporter I've resolved this issue with direction from Kevin Adler. See this link for how to resolve the
algorithm
include. -
reporter - changed status to resolved
- Log in to comment
Welcome to IBM i ... cough ... shipped with xlC (pay for compiler).
Can you find an Open Source equivalent???