BIC-MNI / minc-toolkit

Metaproject uniting all the available minc tools
GNU General Public License v3.0
37 stars 15 forks source link

compilation issue in centos 6.x #26

Open hazedine opened 9 years ago

hazedine commented 9 years ago

Hi, I got an error when compiling the current minc-toolkit (hash c25f0632f177), here is the CMAKE configuration:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/minc-toolkit/1.9.08 -DCMAKE_INSTALL_LIBDIR:PATH=/opt/minc-toolkit/1.9.08/lib -DINCLUDE_INSTALL_DIR:PATH=/opt/minc-toolkit/1.9.08/include -DLIB_INSTALL_DIR:PATH=/opt/minc-toolkit/1.9.08/lib -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/opt/minc-toolkit/1.9.08/share -DLIB_SUFFIX= -DCMAKE_SKIP_RPATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON .. -DCMAKE_SKIP_RPATH:BOOL=OFF -DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF -DCMAKE_INSTALL_RPATH:PATH=/opt/minc-toolkit/1.9.08/lib -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DMT_BUILD_SHARED_LIBS:BOOL=ON -DMT_BUILD_ITK_TOOLS:BOOL=ON -DMT_BUILD_VISUAL_TOOLS:BOOL=OFF -DMT_BUILD_ANTS:BOOL=ON -DMT_BUILD_ELASTIX:BOOL=ON -DMT_BUILD_C3D:BOOL=OFF -DMT_USE_OPENMP:BOOL=ON -DUSE_SYSTEM_ZLIB:BOOL=OFF -DUSE_SYSTEM_NETCDF:BOOL=OFF -DUSE_SYSTEM_HDF5:BOOL=OFF -DUSE_SYSTEM_PCRE:BOOL=ON -DUSE_SYSTEM_GSL:BOOL=ON -DUSE_SYSTEM_FFTW3F:BOOL=ON -DUSE_SYSTEM_ITK:BOOL=OFF -DUSE_SYSTEM_GLUT:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON && make

And here is the error:

Linking CXX executable volume_hist

/usr/lib64/ccache/c++    -fPIC -fkeep-inline-functions -O3 -DNDEBUG    CMakeFiles/volume_hist.dir/src/VolumeHist/minchist.cc.o CMakeFiles/volume_hist.dir/src/VolumeHist/DHistogram.cc.o CMakeFiles/volume_hist.dir/src/VolumeHist/WHistogram.cc.o CMakeFiles/volume_hist.dir/src/VolumeHist/args.cc.o  -o volume_hist  -L/home/hassemlal/github/minc-toolkit/build-shared/libminc  -L/home/hassemlal/github/minc-toolkit/build-shared/libminc/ezminc  -L/home/hassemlal/github/minc-toolkit/build-shared/EBTKS  -L/home/hassemlal/github/minc-toolkit/build-shared/bicpl  -L/home/hassemlal/github/minc-toolkit/build-shared/arguments  -L/home/hassemlal/github/minc-toolkit/build-shared/oobicpl  -L/home/hassemlal/github/minc-toolkit/build-shared/external/opt/minc-toolkit/1.9.08/lib -rdynamic libmincprog.a ../EBTKS/libEBTKS.a ../libminc/libminc2.so.2.3.00 ../libminc/libminc2.so.2.3.00 -lhdf5 ../external//opt/minc-toolkit/1.9.08/lib/libz.a -lm -ldl ../external//opt/minc-toolkit/1.9.08/lib/libnetcdf.a -Wl,-rpath,/home/hassemlal/github/minc-toolkit/build-shared/libminc:/home/hassemlal/github/minc-toolkit/build-shared/libminc/ezminc:/home/hassemlal/github/minc-toolkit/build-shared/EBTKS:/home/hassemlal/github/minc-toolkit/build-shared/bicpl:/home/hassemlal/github/minc-toolkit/build-shared/arguments:/home/hassemlal/github/minc-toolkit/build-shared/oobicpl:/home/hassemlal/github/minc-toolkit/build-shared/external/opt/minc-toolkit/1.9.08/lib:
CMakeFiles/volume_hist.dir/src/VolumeHist/minchist.cc.o: In function `equalize(WHistogram const&, WHistogram const&)':
minchist.cc:(.text._Z8equalizeRK10WHistogramS1_[equalize(WHistogram const&, WHistogram const&)]+0x5): undefined reference to `WHistogram::equalize(WHistogram const&) const'
collect2: ld returned 1 exit status
make[2]: *** [N3/volume_hist] Error 1
make[2]: Leaving directory `/home/hassemlal/github/minc-toolkit/build-shared'
make[1]: *** [N3/CMakeFiles/volume_hist.dir/all] Error 2
make[1]: Leaving directory `/home/hassemlal/github/minc-toolkit/build-shared'
make: *** [all] Error 2

It looks like a linking issue, maybe the libraries should be reordered? I am using gcc 4.4.7.

vfonov commented 9 years ago

try re-running configuration with -DCMAKE_C_FLAGS:STRING=-fkeep-inline-functions -DCMAKE_CXX_FLAGS:STRING=-fkeep-inline-functions