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 additional INCLUDE/LIB paths during compile #546

Closed
68040 opened this issue May 30, 2017 · 19 comments
Closed

Support additional INCLUDE/LIB paths during compile #546

68040 opened this issue May 30, 2017 · 19 comments

Comments

@68040
Copy link

68040 commented May 30, 2017

Problem

Try to build CouchDB 2.0.0 from the source on CentOS 6.9 stopped with this problem:

Compiling /home/USER/tmp/apache-couchdb-2.0.0/src/couch/priv/couch_js/http.c
/home/USER/tmp/apache-couchdb-2.0.0/src/couch/priv/couch_js/http.c:18:19: Warning: jsapi.h: No such file or directory

Setup

I've build ERLANG OTP 17.5 and SpiderMonkey 1.8.5 in the local user directory.
They are available in $HOME/include and $HOME/lib.

What i tried

Give configure the paths like in earlier CouchDB versions (./configure --with-js-lib=$HOME/lib --with-js-include=$HOME/include/js) doesn't work and was ignored.

I tried to set the paths as compiler vars.

CFLAGS=-I$HOME/include
LDFLAGS=-L$HOME/lib

But it also doesn't work. The compile run breaks.

Another try:

export CPATH=$HOME/include:$LD_LIBRARY_PATH
export LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH

Make always fails at the same point.

@68040 68040 changed the title jsapi.h: No such file or directory / Set the lib and include path manually Set the lib and include path manually / jsapi.h: No such file or directory May 30, 2017
@wohali wohali changed the title Set the lib and include path manually / jsapi.h: No such file or directory Support additional INCLUDE/LIB paths during compile May 30, 2017
@wohali
Copy link
Member

wohali commented May 30, 2017

HI @NoodleBB, at present we don't support searching for include headers or shared libraries anywhere other than the system default. Our configure script is not based on autotools - none of the environment variables you specified will work.

It is possible to update https://github.com/apache/couchdb/blob/master/src/couch/rebar.config.script to make this work specifically for couchjs in a platform-neutral fashion, by changing how we handle the JS_CFLAGS and JS_LDFLAGS variables. We'd be happy to accept a pull request here that doesn't break our current build process.

@68040
Copy link
Author

68040 commented May 30, 2017

Hi @wohali.

at present we don't support searching for include headers or shared libraries anywhere other than the system default.

Not very handy.

It is possible to update https://github.com/apache/couchdb/blob/master/src/couch/rebar.config.script to make this work (...)

I tried it to change it that way...

{unix, freebsd} ->
    {"-DHAVE_CURL -I$HOME/include", "-DHAVE_CURL -L$HOME/lib -lmozjs185 -lcurl"};

...but it fails at the same point again.

@wohali
Copy link
Member

wohali commented May 30, 2017

Yeah, that won't work, because there is no $ENVVAR expansion with that syntax inside of a rebar.config file.

If you just want it compiling for now, hard-code the path to your home directory instead of using $HOME.

@68040
Copy link
Author

68040 commented May 30, 2017

If you just want it compiling for now, (...)

Yes: now.
I wanted to demonstrate my bosses and the IT-Department the advantages of CouchDB over Access in an actual use case. - ...and i don't get the the latest version of CouchDB installed.

(...) hard-code the path to your home directory instead of using $HOME.

By the way...

{unix, freebsd} ->
   {"-DHAVE_CURL -I/home/syncer/include", "-DHAVE_CURL -L/home/syncer/lib -lmozjs185 -lcurl"};

...also fails. Same point, same error.

@wohali
Copy link
Member

wohali commented May 30, 2017

That line only applies if you specify -c or --with-curl to configure. Did you?

@68040
Copy link
Author

68040 commented May 30, 2017

That line only applies if you specify -c or --with-curl to configure. Did you?

Nope. I didn't know. But now...

$ ./configure --with-curl
==> configuring couchdb in rel/couchdb.config
You have configured Apache CouchDB, time to relax. Relax.

Nothing changed. Make still fails. Same error.

@wohali
Copy link
Member

wohali commented May 30, 2017

Try -I/home/syncer/include/js.

@68040
Copy link
Author

68040 commented May 30, 2017

Try -I/home/syncer/include/js

I did. Build fails. Same error.

@wohali wohali marked this as a duplicate of #712 Jul 24, 2017
@jvabob
Copy link

jvabob commented Jul 24, 2017

I am having he same problem.... have tried the same things and end up in the same place....

I thought my spidermonkey was installed in the default location

/usr/local/lib/libmozjs185.so and
/usr/local/include/js/

If that is not the default location where do I need to move it to?

@wohali
Copy link
Member

wohali commented Jul 24, 2017

Default location should be under /usr/lib/libmozjs185.so and /usr/include/js.

So sorry for the inconvenience here. Pull requests welcome.

@jvabob
Copy link

jvabob commented Jul 25, 2017

That did the trick... THANKS!

@wohali wohali marked this as a duplicate of #727 Jul 31, 2017
@janl
Copy link
Member

janl commented Oct 1, 2017

Added needhelp label, closing for inactivity until somebody sends a PR

@janl janl closed this as completed Oct 1, 2017
@arunp123
Copy link

installing libmozjs185-dev fixed my problem

@tarasvaskiv
Copy link

Yeah, I had to download https://launchpad.net/ubuntu/bionic/amd64/libmozjs185-dev/1.8.5-1.0.0+dfsg-7
deb version from here and install on ubuntu 18.

@lag-linaro
Copy link
Contributor

FYI libmozjs185{-dev} is no longer available in the Ubuntu repos.

It has been deleted and replaced by libmozjs-52.

@wohali
Copy link
Member

wohali commented Jul 9, 2018

@lag-linaro Yes, we will be supplying our own packages for libmozjs185.

@lag-linaro
Copy link
Contributor

@wohali do you have a time-line for this?

@wohali
Copy link
Member

wohali commented Aug 1, 2018

@lag-linaro already done for 2.1.2

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

No branches or pull requests

7 participants