This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Linking to static libraries, e.g. gsl and hdf5
- From: Susi Lehtola <susi dot lehtola at iki dot fi>
- To: cygwin at cygwin dot com
- Date: Fri, 18 Oct 2013 00:02:38 +0300
- Subject: Linking to static libraries, e.g. gsl and hdf5
- Authentication-results: sourceware.org; auth=none
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