Bonjour,

Il me semblait qu'une compilation en mode debug -g ralentissait le code
à l'exécution et que pour optimiser un code à l'exécution il faillait compiler
avec des options comme -O2, -O3, ... en prenant soin de ne pas utiliser en
même temps -g.

En essayant de trouver les options de compilation d'une bibliothèque c++
installer par synaptic sur ma plateforme ubuntu 12.04, je tombe sur un fichier
buildlog qui contient des choses comme:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
 
make[3]: Entering directory `/build/buildd/getfem++-4.1.1/src'
/bin/bash ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I..  -DGMM_USES_BLAS -I/usr/include  -g -O2 -O3 -Wall -W -fmessage-length=0 -ftemplate-depth-40 -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wconversion -Wredundant-decls -Wno-long-long -MT dal_backtrace.lo -MD -MP -MF .deps/dal_backtrace.Tpo -c -o dal_backtrace.lo dal_backtrace.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I.. -DGMM_USES_BLAS -I/usr/include -g -O2 -O3 -Wall -W -fmessage-length=0 -ftemplate-depth-40 -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wconversion -Wredundant-decls -Wno-long-long -MT dal_backtrace.lo -MD -MP -MF .deps/dal_backtrace.Tpo -c dal_backtrace.cc  -fPIC -DPIC -o .libs/dal_backtrace.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I.. -DGMM_USES_BLAS -I/usr/include -g -O2 -O3 -Wall -W -fmessage-length=0 -ftemplate-depth-40 -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wconversion -Wredundant-decls -Wno-long-long -MT dal_backtrace.lo -MD -MP -MF .deps/dal_backtrace.Tpo -c dal_backtrace.cc  -fPIC -DPIC -o dal_backtrace.o >/dev/null 2>&1
mv -f .deps/dal_backtrace.Tpo .deps/dal_backtrace.Plo
où je remarque que les "-g" et "-O2" sont juxtaposés.

Est ce que quelqu'un peut m'expliquer cette ligne, ce qu'elle fait exactement?
Merci