EDITAR : problema resolvido, veja minha resposta abaixo.
Existe algum problema com a biblioteca GSL no Oneiric? Estou tendo problemas para vincular e não entendo o porquê - isso funciona bem em 10.4, 10.10 e 11.4.
EDITAR : casos de teste pequenos primeiro, o problema completo está abaixo:
Funciona bem em Natty:
$ cat /etc/issue
Ubuntu 11.04 \n \l
$ cat gsl-test.cpp
#include <gsl/gsl_errno.h>
void handler(const char *, const char *, int, int) { }
int main() { gsl_set_error_handler(handler); }
$ g++ gsl-test.cpp ## Expect problems since libraries not linked in
/tmp/ccnjUNdv.o: In function 'main':
gsl-test.cpp:(.text+0x16): undefined reference to 'gsl_set_error_handler'
collect2: ld returned 1 exit status
$ g++ -lgsl -lgslcblas gsl-test.cpp
$ ./a.out
$
Falha no Oneiric:
$ cat /etc/issue
Ubuntu 11.10 \n \l
$ cat gsl-test.cpp
#include <gsl/gsl_errno.h>
void handler(const char *, const char *, int, int) { }
int main() { gsl_set_error_handler(handler); }
$ g++ gsl-test.cpp
/tmp/ccWKJMov.o: In function 'main':
gsl-test.cpp:(.text+0x16): undefined reference to 'gsl_set_error_handler'
collect2: ld returned 1 exit status
$ g++ -lgsl -lgslcblas -lm gsl-test.cpp
/tmp/ccV0UIx5.o: In function 'main':
gsl-test.cpp:(.text+0x16): undefined reference to 'gsl_set_error_handler'
collect2: ld returned 1 exit status
Mas isso funciona no Oneiric:
$ g++ gsl-test.cpp -lgsl -lgslcblas
$ ./a.out
Eu suspeito que há alguma diferença em como o g ++ está funcionando (4.6.1 vs. 4.5.2).
EDITAR :
$ nm /usr/lib/libgslcblas.so
nm: /usr/lib/libgslcblas.so: no symbols
$ nm /usr/lib/libgslcblas.a|grep 'cblas_zher2k\|cblas_dtrsm\|cblas_zhemm'
00000000 T cblas_dtrsm
00000000 T cblas_zhemm
00000000 T cblas_zher2k
E aqui está o problema completo, que parece ter um sabor um pouco diferente do meu caso de teste acima, pois ainda não foi corrigido colocando -lgsl -lgslcblas
no final da linha:
/usr/bin/c++ -g -O2 -O2 -g -Wl,-Bsymbolic-functions CMakeFiles/css.dir/main.cpp.o -o ../../../bin/css -rdynamic ../../../lib/libtemt.so.5.2.3 -lCoin -lQuarter -lQtOpenGL -lQtWebKit -lQtGui -lQtXml -lQtXmlPatterns -lQtNetwork -lQtCore -lode -lgslcblas -lgsl -lGLU -lGL -lSM -lICE -lX11 -lXext -lz -lreadline -lreadline -ltermcap -Wl,-rpath,/tmp/emergent-5.2.3/build/lib:
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zher2k'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dtrsm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zhemm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sgemv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dgemm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_drotg'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sscal'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cdotc_sub'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ssymm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zherk'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_caxpy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_scasum'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dgemv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cgemm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_isamax'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dtrsv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sswap'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cher2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dasum'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cgeru'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_csscal'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_chemm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ctrsv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_icamax'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_scnrm2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ctrsm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_drotmg'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsyrk'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dznrm2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ssyr2k'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_chemv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsyr2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_srotm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dscal'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cdotu_sub'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zswap'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dswap'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zcopy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ztrmv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_scopy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_drot'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ssyrk'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zsyr2k'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zaxpy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zher'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_daxpy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cscal'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_srotmg'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ssyr'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_strsm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsymv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zgeru'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dcopy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_snrm2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dtrmm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_strsv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zdotc_sub'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_strmm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_csymm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sger'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zscal'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_srotg'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_strmv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cgerc'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_saxpy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cherk'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsdot'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ssymv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zher2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ddot'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dnrm2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cgemv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zgemv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ctrmv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cswap'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zgemm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ctrmm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_csyrk'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsyr2k'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsyr'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sgemm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_srot'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dzasum'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_idamax'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_csyr2k'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zhemv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_drotm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dsymm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zsyrk'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sdsdot'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zgerc'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ssyr2'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cher'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zsymm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ztrsm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_cher2k'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sasum'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ztrsv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ccopy'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_ztrmm'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dger'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_dtrmv'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_izamax'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zdscal'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_sdot'
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libgsl.so: undefined reference to 'cblas_zdotu_sub'
collect2: ld returned 1 exit status
Eu recebo a mesma quantidade de referências indefinidas se eu fizer isso, seja em Natty ou Oneiric:
$ g++ gsl-test.cpp -lgsl
Não sei o que fazer com isso ainda.