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

Support for C/C++ modules #12

Closed
ckir opened this issue Dec 25, 2015 · 8 comments
Closed

Support for C/C++ modules #12

ckir opened this issue Dec 25, 2015 · 8 comments
Labels

Comments

@ckir
Copy link

ckir commented Dec 25, 2015

All modules I have tried so far (e.g. pm2, pg-native) are failing to build.
This is not a node.js version or module problem. All modules mentioned as example build fine on 5.1.1 when i use a cartrige like this one

https://github.com/ramr/nodejs-custom-version-openshift

However the latest one also installs supervisor and therefore i prefer to use yours if possible.

@icflorescu
Copy link
Owner

Will take a look at this over the next few days. I'm not sure exactly why this is happening, any idea?

@icflorescu
Copy link
Owner

Looks like some modules relying on native C/C++ code fail to build due to OpenShift's gcc 4.4.7. Ram's cartridge is facing the same issue (see here).

AFAIK, in thier latest versions mongoose and mongodb-core are not relying on kerberos as a mandatory dependency anymore.
I've recently seen many other module authors switching to pure js alternatives instead of relying on native C/C++ code to avoid issues like this one.

Meanwhile, there's nothing we can do about it, except maybe ask OpenShift to update the compiler chain to a contemporary version.

@ckir
Copy link
Author

ckir commented Dec 28, 2015

The information about Ram's cartridge is a bit outdated. I tried myself two days ago and it works. I'm new to Openshift and I don't know how come one cartridge can have access to a specific version of C/C++ compiler.

@Schezuk
Copy link

Schezuk commented Dec 31, 2015

I think it's probably because of missing of v8.h when building.

@icflorescu
Copy link
Owner

@Schezuk - no, v8.h appears to be fine in the build logs (i.e. /tmp/.node-gyp/5.3.0/include/node/v8.h).

The error is This version of node/NAN/v8 requires a C++11 compiler, which leads me to believe it has something to do with the outdated gcc on OpenShift.

I'm thinking about trying to compile Node.js from source just to see what happens, but, event if it works, this wouldn't be feasible to do in update_nodejs. For one thing, I'm sure it would simply timeout in the best case.

@icflorescu
Copy link
Owner

Still running more tests; I'm now trying to compile Node.js from source on the OpenShift machine.

./configure issues WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++) and running make fails.

So the problem is definitely OpenShift's outdated gcc.

@icflorescu
Copy link
Owner

I just checked installing pg-native on Ram's cartridge with Node.js 5.3.0 and I got the same error: This version of node/NAN/v8 requires a C++11 compiler.

@icflorescu
Copy link
Owner

I think I finally got to the bottom of this - the error is definitely coming from OpenShift's outdated gcc.

I've tried various scenarios on both Ram's cartridge and mine, and it seems native modules are working fine on Node.js 0.10.x, 0.12.x but fail to compile on Node.js > 4.x.

The only thing we can do is to keep asking OpenShift to update the compiler chain to a contemporary version.

So, if you really need native modules and can live with Node.js 0.12, you can use this cartridge on OpenShift Online. Otherwise, you'll have to switch hosting to Heroku or other PaaS provider.

Personally, I'm ok with Node.js 5.3.x and no native modules.

Meanwhile, since there's nothing else we can do, I'll close the issue and make a note in the README.md.

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

No branches or pull requests

3 participants