[Dune] cmake flags position problem

Benedikt Oswald benedikt.oswald at lspr.ch
Thu Jan 22 16:12:08 CET 2015


Dear Dune

I am currently experiencing problems with linking libsuperludist.a on
the Cray XE6.
In fact, compiling in SuperLU Dist works but it seems that the position
of the library
specification is wrong,

i.e. the
-L/users/boswald/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/lib
and

-lsuperludist

is located_before_ the object file and then the linker does not find it,
cf. the output excerpt below
and the opts file .

The same applies to the -lparmetis required by SuperLU Dist,

Would there be a way to make sure that these SuperLU Dist flags are placed
_after_ the executable when using cmake as the build system ?


Thanks for your suggestions & greetings,

Benedikt


==========================
Linking CXX executable hades3ddgfd
cd /scratch/rosa/boswald/gitwork/hades/hades/build-cmake/hades/3ddgfd &&
/apps/rosa/cmake/2.8.10.2/bin/cmake -E cmake_link_script
CMakeFiles/hades3ddgfd.dir/link.txt --verbose=1
/opt/cray/xt-asyncpe/5.16/bin/CC   -Wall -O2 -DHAVE_SUPERLU_DIST
-I/users/boswald/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/SRC
-L/users/boswald/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/lib
-lsuperludist
-L/users/boswald/extlib/parmetis/4.0.3/cray-mpich/6.1.0/gcc/4.8.1/lib
-lparmetis -L/users/boswald/extlib/metis/5.1.0/gcc/4.8.1/lib -lmetis -
std=c++11     CMakeFiles/hades3ddgfd.dir/hades3ddgfd.cc.o  -o
hades3ddgfd 
-L/scratch/rosa/boswald/gitwork/hades/hades/build-cmake/hadesgeo/parser 
-L/scratch/rosa/boswald/gitwork/hades/hades/build-cmake/hadesgeo/exporter -rdynamic
/scratch/rosa/boswald/gitwork/hades/dune-alugrid/build-cmake/lib/libdunealugrid.a
/scratch/rosa/boswald/gitwork/hades/dune-grid/b
uild-cmake/lib/libdunegrid.a
/scratch/rosa/boswald/gitwork/hades/dune-geometry/build-cmake/lib/libdunegeometry.a
/scratch/rosa/boswald/gitwork/hades/dune-common/build-cmake/lib/libdunecommon.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_regex.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_filesystem.a
/users/boswald/extlib/boost/1.5
5.0/gcc/4.8.1/lib/libboost_system.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_thread.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_date_time.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_program_options.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_log_setup.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8
.1/lib/libboost_log.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_regex.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_filesystem.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_system.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_thread.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_date_time.
a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_program_options.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_log_setup.a
/users/boswald/extlib/boost/1.55.0/gcc/4.8.1/lib/libboost_log.a -lz
-Wl,-rpath,/scratch/rosa/boswald/gitwork/hades/hades/build-cmake/hadesgeo/parser:/scratch/rosa/boswald/gitwork/hades/hades/build-cmake/hadesgeo/e
xporter



==========================


USE_CMAKE=yes

CONFIGURE_FLAGS="--enable-parallel --enable-experimental-grid-extensions
MPICC='cc' MPICXX='CC' CXX='CC' CC='cc' FC='ftn' LD='CC' "

CMAKE_PREFIX_PATH="\
$HOME/extlib/boost/1.55.0/gcc/4.8.1;\
$HOME/extlib/parmetis/4.0.3/cray-mpich/6.1.0/gcc/4.8.1;\
$HOME/extlib/metis/5.1.0/gcc/4.8.1;\
$HOME/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1;\
$HOME/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/SRC;\
$HOME/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/lib;\
"


## define gcc options - nota bene: -O2 and -g2 cause gcc 4.9.2 to crash !
GXX_WARNING_OPTS="-Wall"
GXX_OPTS="-O2"


## define superludist paths & library
SUPERLU_DIST_OPTS="-DHAVE_SUPERLU_DIST"
SUPERLU_DIST_INCLUDE_PATH="-I$HOME/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/SRC"
SUPERLU_DIST_LIBRARY="-L$HOME/extlib/superludist/3.3/cray-mpich/6.1.0/gcc/4.8.1/lib
-lsuperludist
-L$HOME/extlib/parmetis/4.0.3/cray-mpich/6.1.0/gcc/4.8.1/lib -lparmetis
-L$HOME/extlib/metis/5.1.0/gcc/4.8.1/lib -lmetis "




CMAKE_FLAGS="\
-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH\" \
-DCMAKE_CXX_FLAGS=\"$GXX_WARNING_OPTS $GXX_OPTS $SUPERLU_DIST_OPTS
$SUPERLU_DIST_INCLUDE_PATH $SUPERLU_DIST_LIBRARY\" \
-DCMAKE_LIBRARY_PATH:RELEASE=\"$HOME/extlib/boost/1.55.0/gcc/4.8.1/lib\" \
-DCMAKE_LIBRARY_PATH:DEBUG=\"$HOME/extlib/boost/1.55.0/gcc/4.8.1/lib\" \
-DCMAKE_STANDARD_LIBRARIES:RELEASE=\"-lboost_system -lprogram_options\" \
-DCMAKE_STANDARD_LIBRARIES:DEBUG=\"-lboost_system -lprogram_options\" \
-DCMAKE_SHARED_LINKER_FLAGS=\"-lzlib\" \
-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS:BOOL=TRUE \
-lboost_system -lprogram_options
"

-- 
------------------------------------------------------------------------------------------------
Dr. sc. techn. Benedikt Oswald - first engineer - LSPR AG - phone - +41 43 366 90 74
Technoparkstrasse 1, CH-8005 Zürich, benedikt.oswald at lspr.ch - labor vincit omnia improbus
------------------------------------------------------------------------------------------------






More information about the Dune mailing list