Linking to static libraries, e.g. gsl and hdf5

Susi Lehtola susi.lehtola@iki.fi
Thu Oct 17 21:02:00 GMT 2013


Hi,


it seems that linking to some static libraries has broken down since  
the last time I tried to recompile my project (in April). Now the  
linking commands fail, e.g.

/usr/bin/g++.exe  -Wall -O2 -funroll-loops -mtune=generic -msse2  
-static -fopenmp program.cpp -lgsl -lgslcblas -llapack -lblas -lgfortran

results in

/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld:  
cannot find -lgsl
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld:  
cannot find -lgslcblas

I also get the same error when linking to -lhdf5.

Having had a look at /usr/lib, I noticed that a lot of the libraries  
follow the *nix convention
of the static libraries being named libfoo.a, while others have names  
of the type libfoo.dll.a.
Indeed, the latter was true for the GSL and the HDF5 libraries, and symlinking

/usr/lib/libgsl.a -> /usr/lib/libgsl.dll.a
/usr/lib/libgslcblas.a -> /usr/lib/libgslcblas.dll.a
/usr/lib/libhdf5.a -> /usr/lib/libhdf5.dll.a

solved the problem.

Why is this not done in the gsl and hdf5 packages? Other packages  
might also be affected.
-- 
Susi Lehtola
susi.lehtola@iki.fi


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list