Hi Andreas, On Tue, Mar 29, 2016 at 09:18:50PM +0200, Andreas Tille wrote: > I'm trying to package seer[1] for the Debian Med team. Upstream provides a > simple Makefile which is probably the cause why the libraries for linking > are not found properly so it ends up in > > ... > g++ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall > -O3 -std=c++11 -I/nonexistent/software/include -I../gzstream -I../dlib -D > DLIB_NO_GUI_SUPPORT=1 -D DLIB_USE_BLAS=1 -D DLIB_USE_LAPACK=1 -Wl,-z,relro > sample.o significant_kmer.o kmer.o covar.o seerCommon.o seerErr.o > seerFilter.o seerIO.o seerChiFilter.o seerMain.o seerCmdLine.o > seerContinuousAssoc.o seerBinaryAssoc.o logitFunction.o linearFunction.o > -lhdf5 -lgzstream -lz -larmadillo -lboost_program_options -llapack -lblas > -Wl,-z,relro -o seer > /usr/bin/ld: cannot find -lhdf5 > /usr/bin/ld: cannot find -lgzstream > /usr/bin/ld: cannot find -lboost_program_options > collect2: error: ld returned 1 exit status > > Any hint how to elegantly deal with this situation?
Besides the command-line options -I and -L, GCC and Clang read the colon-separated (:) environment variables CPATH and LIBRARY_PATH to search for header files and link libraries, respectively. You can set these in debian/rules: # Support manual invocation of debian/rules include /usr/share/dpkg/architecture.mk export CPATH := /usr/include/hdf5/serial export LIBRARY_PATH := /usr/lib/$(DEB_TARGET_MULTIARCH)/hdf5/serial Regards, Peter

