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
  • 104,088
  • 27
  • 192
  • 230
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465

1 Answers1

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.

Community
  • 1
  • 1
rocky
  • 7,226
  • 3
  • 33
  • 74