Installer GNU Scientific Library (GSL)

Simphusband

Membre actif
10 Octobre 2008
128
2
Bonjour à tous

Je débute en programmation et sous OsX (j'ai mon mac depuis quelques mois....un vrai bonheur...).

Pour mon stage de M2 de biologie (donc je suis loin d'avoir un niveau d'informaticien) je doit écrire un programme en C++ (automake / autoconf) qui DOIT tourner sur LINUX.

Mon maître de stage m'a donné un bout de code qui utilise la bibliothèque GNU Scientific Library (GSL).

J'ai écrit sous linux un micro programme qui utilise unz de ses fonctions ( ce programme tourne parfaitement sous linux) mais bon je préfère quand même utiliser mon mac...

Lors de la compilation sous mac.... le configure fonctionne parfaitement :

Bloc de code:
macbook-de-remy:merde ferrerremy$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking whether NLS is requested... yes
checking for intltool >= 0.35.0... 0.35.5 found
checking for intltool-update... /sw/bin/intltool-update
checking for intltool-merge... /sw/bin/intltool-merge
checking for intltool-extract... /sw/bin/intltool-extract
checking for xgettext... /sw/bin/xgettext
checking for msgmerge... /sw/bin/msgmerge
checking for msgfmt... /sw/bin/msgfmt
checking for gmsgfmt... /sw/bin/msgfmt
checking for perl... (cached) /usr/bin/perl
checking for XML::Parser... ok
checking build system type... i386-apple-darwin9.6.0
checking host system type... i386-apple-darwin9.6.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -p
checking the name lister (/usr/bin/nm -p) interface... rm: conftest.dSYM: is a directory
BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -p output from gcc object... rm: conftest.dSYM: is a directory
ok
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for objdir... .libs
rm: conftest.dSYM: is a directory
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by g++... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking whether the g++ linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.6.0 dyld
checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: executing libtool commands
config.status: executing po/stamp-it commands
# INTLTOOL_MAKEFILE

mais le make plante ...

Bloc de code:
macbook-de-remy:merde ferrerremy$ make
make  all-recursive
Making all in src
g++ -DHAVE_CONFIG_H -I. -I..  -DPACKAGE_LOCALE_DIR=\""/usr/local/lib/locale"\" -DPACKAGE_SRC_DIR=\""."\" -DPACKAGE_DATA_DIR=\""/usr/local/share"\"    -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc
In file included from main.cc:10:
alea.h:25:29: error: gsl/gsl_randist.h: No such file or directory
alea.h:48: error: ISO C++ forbids declaration of ‘gsl_rng’ with no type
alea.h:48: error: expected ‘;’ before ‘*’ token
main.cc:43: error: expected unqualified-id before ‘{’ token
make[2]: *** [main.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

D'après le message d'erreur j'ai pas gsl d'installé...
J'ai fait des recherches et j'ai donc essayer de l'installer a la main... sans résultats
puis via fink .....sans résultats aussi.... (peut être un problème de répertoire par défaut mais je comprend pas tout... je débute....)

Si vous pouviez m'indiquer la marche à suivre pour installer correctement cette bibliothèque (et puis d'autre par la même occasion...)....

En vous remerciant.....
 
En fait,

c'est une librairie qu'il faut compiler.

Il faut télécharger le bintz ici :
http://www.gnu.org/software/software.html

puis faire un make, c'est uns standard GNU.

Le make se chargera de compiler tout ce qu'il faut.

il faut ensuite faire :
sudo make install

en général c'est comme cela que ça marche.


Il t'installera la librairie modulo :
- il y a parfois des suprises et il faut installer d'autre librairies pour cela, il suffit de défaire la pelote de laine ;)

Au fait tu as pu tester mon Appli.

J'ai beaucoup avancé et éliminé beaucoup de bug depuis.

Merci,


Philippe.
 
je regarde ça....


Pour ton appli j'ai pas trop eu le temps...; dans la salle de tp ou elle aurait pu me servir... il y avait pas le net..... donc j'ai pas eu la possibilité de m'en servir....

Par contre dans la seconde phase de mon stage ou je vais devoir faire des maths je regarde ce que ça donne... mais ça sera pas dans quelques semaines.....