4

I usually build my library ./configure && make && sudo make install. However the Travis docs discourage using sudo http://docs.travis-ci.com/user/workers/container-based-infrastructure/

So I changed the build command to ./configure --prefix=$HOME && make && make install. This worked, however at the next step (building a Python extension) I got an error

/usr/bin/ld: cannot find -lprimesieve

Any ideas? Do I need to add $HOME/lib to some environment variables, because I changed prefix?

  1. My travis config https://github.com/hickford/primesieve-python/blob/travis-ci/.travis.yml
  2. Build log with error https://travis-ci.org/hickford/primesieve-python/jobs/69536543#L382
Makoto
107k29 gold badges200 silver badges236 bronze badges
asked Jul 4, 2015 at 12:43

1 Answer 1

2

Try setting set LD_LIBRARY_PATH which is like PATH for libraries. For example:

LD_LIBRARY_PATH= $HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH 

More detailed information about library path variables is here.

Environment variables that specifically influence how the configure script passes arguments to compilation are LIBS and LD_FLAGS. bash ./configure --help mentions these.

And as you mention in the comments LIBRARY_PATH also needs to be set. See LD_LIBRARY_PATH vs LIBRARY_PATH for an explanation of the difference.

answered Jul 4, 2015 at 12:49
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. I also had to update LIBRARY_PATH as well as LD_LIBRARY_PATH. Is that expected?
Yes, it is expected. Sorry for the omission.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.