automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling statically


From: Paulo J. Matos
Subject: Compiling statically
Date: Thu, 26 Jun 2008 13:34:50 +0100

Hello all,

To compile a program fully-statically I do:
./configure CPPFLAGS="-DNDEBUG -I../../libfileIO-0.2.3/src"
CXXFLAGS="-O3" LDFLAGS="-static-libgcc -static -Wl,-Bstatic
-L../../libfileIO-0.2.3/src"

In the linking phase things go wrong:
/bin/sh ../libtool --tag=CXX   --mode=link g++ -Wall -std=c++98 -ggdb
-O3 ../ubcsat/libubcsat.la -lfileio -static-libgcc -static
-Wl,-Bstatic -L../../libfileIO-0.2.3/src -o maxsatzilla.bin
maxsatzilla_bin-main.o maxsatzilla_bin-MaxSatInstance.o
maxsatzilla_bin-argumentsparser.o  -lz -lm -lgslcblas -lgsl -lgmp
-lcblas -lblas

libtool: link: g++ -Wall -std=c++98 -ggdb -O3 -static-libgcc
-Wl,-Bstatic -o maxsatzilla.bin maxsatzilla_bin-main.o
maxsatzilla_bin-MaxSatInstance.o maxsatzilla_bin-argumentsparser.o
../ubcsat/.libs/libubcsat.a
-L/home/pmatos/software/maxsatzilla/tags/libfileIO-0.2.3/src
/home/pmatos/software/maxsatzilla/tags/libfileIO-0.2.3/src/.libs/libfileio.a
-lz /usr/lib64/libgsl.so /usr/lib64/libgslcblas.so -lm
/usr/lib64/libgmp.so -lcblas -lblas
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/../../../../x86_64-pc-linux-gnu/bin/ld:
attempted static link of dynamic object `/usr/lib64/libgsl.so'

Why is -lgsl converted to /usr/lib64/libgsl.so instead of the static
archive? and the same with gmp and gslcblas? And by the way, why is
-lcblas and -lblas not expanded?

Cheers,

-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]