[Dune] Problem compiling with SuperLUDist

Aleksejs Fomins aleksejs.fomins at lspr.ch
Mon May 11 09:09:10 CEST 2015


Dear Dune,

For the last few days I have been fighting with compiling our code Hades3d on a different machine.

I do not seem to be able to find the correct parameters of the (opts file / CMakeLists.txt) that would make it work. The major challenge is SuperLUDist.

Here are a few details
* I am running Linux debian-fomins 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
* SuperLUDist is located at /opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/lib/, it is exported in .bashrc
* I am building with the latest dune-trunk and all other modules compile no problem

The important 3 lines of the attached CMakeLists file are:

----------------------------------------------------------------
target_link_libraries("hades3ddgfd" ${DUNE_LIBS} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${MY_WEIRD_LIBS})


set_property(TARGET hades3ddgfd APPEND PROPERTY COMPILE_FLAGS ${MY_WEIRD_FLAGS})
set_property(TARGET hades3ddgfd APPEND PROPERTY LINK_FLAGS ${MY_WEIRD_LIB_PATH} )
----------------------------------------------------------------

When compiling like that, I get the error:
   /bin/sh: 1: -DHAVE_SUPERLU_DIST: not found

When compiling with last 2 lines (from above) commented out, I get the error
  /usr/bin/ld: cannot find -lsuperludist
  /usr/bin/ld: cannot find -lparmetis
  /usr/bin/ld: cannot find -lmetis

When compiling without the COMPILE_FLAGS line, I get
  /usr/bin/ld: unrecognized option '--enable-new-dtags;-L/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/lib'

The only time it compiles no problem is with a single line 
----------------------------------------------------------------
target_link_libraries("hades3ddgfd" ${DUNE_LIBS} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
----------------------------------------------------------------

But in this case there is no mention of SuperLUDist in the executable whatsoever, so the code assumes it is not defined


Furthermore, SuperLUDist is not specified among Requested/Optional packages.


Please tell me if you would like any additional information.


Kind regards,
Aleksejs Fomins



P.S. I have included the .opts file used, and the CMakeLists used within the Hades3d directory





-------------- next part --------------
#################################################################################################################
## objective - opts file for building curvilineargrid, based on Dune, with cmake
##
## history - 2014 apr 16, created
##
## usage - time ./dune-common/bin/dunecontrol --use-cmake --opts=af.debian7.lsprag.cmakebuild.minimalistic.opts all
##
##################################################################################################################


USE_CMAKE=yes

CONFIGURE_FLAGS="--enable-parallel --enable-experimental-grid-extensions CC=mpicc CXX=mpicxx" 

CMAKE_PREFIX_PATH="\
/opt/extlib/boost/1.58.0/gcc/4.9.0;\
/opt/extlib/parmetis/4.0.3/openmpi/1.8.1/gcc/4.9.0;\
/opt/extlib/metis/5.1.0/gcc/4.9.0;\
/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0;\
/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/SRC;\
/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/lib;\
"

GXX_WARNING_OPTS="-Wall -pedantic" 
GXX_OPTS="-O0 -g3" 

## define superludist paths & library
SUPERLU_DIST_OPTS="-DHAVE_SUPERLU_DIST"
SUPERLU_DIST_INCLUDE_PATH="-I/opt/extlib/parmetis/4.0.3/openmpi/1.8.1/gcc/4.9.0 -I/opt/extlib/metis/5.1.0/gcc/4.9.0/include -I/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/SRC"
SUPERLU_DIST_LIBRARY="-L/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/lib -L/opt/extlib/parmetis/4.0.3/openmpi/1.8.1/gcc/4.9.0/lib -L/opt/extlib/metis/5.1.0/gcc/4.9.0/lib -framework Accelerate"


CMAKE_FLAGS="\
-DMY_WEIRD_FLAGS='-DHAVE_SUPERLU_DIST -DBOOST_LOG_DYN_LINK -DHAVE_DEBUG' \
-DMY_WEIRD_LIBS='superludist;parmetis;metis' \
-DMY_WEIRD_LIB_PATH='-L/opt/extlib/superludist/3.3/openmpi/1.8.1/gcc/4.9.0/lib -L/opt/extlib/parmetis/4.0.3/openmpi/1.8.1/gcc/4.9.0/lib -L/opt/extlib/metis/5.1.0/gcc/4.9.0/lib' \
-DCMAKE_CXXFLAGS=\"$GXX_WARNING_OPTS $GXX_OPTS $SUPERLU_DIST_INCLUDE_PATH \" \
-DPARMETIS_ROOT='/opt/extlib/parmetis/4.0.3/openmpi/1.8.1/gcc/4.9.0' \
-DCMAKE_LIBRARY_PATH:RELEASE=\"/opt/extlib/boost/1.58.0/gcc/4.9.0/lib\" \
-DCMAKE_LIBRARY_PATH:DEBUG=\"/opt/extlib/boost/1.58.0/gcc/4.9.0/lib\" \
-DCMAKE_STANDARD_LIBRARIES:RELEASE=\"-lboost_system -lprogram_options\" \
-DCMAKE_STANDARD_LIBRARIES:DEBUG=\"-lboost_system -lprogram_options\" \
-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH\" \
-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS:BOOL=TRUE \
-DCMAKE_SHARED_LINKER_FLAGS=\"-lzlib\" \
" 


-------------- next part --------------
# objective - implement CMakeLists.txt
# author - benedikt oswald, all rights reserved, 2014.



# hades3ddgfd

##add_definitions(-DHAVE_PARALOG)

# specify the executable
add_executable(hades3ddgfd "hades3ddgfd.cc")
add_dune_mpi_flags(hades3ddgfd)
add_dune_boost_flags(hades3ddgfd)
target_link_libraries("hades3ddgfd" ${DUNE_LIBS} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${MY_WEIRD_LIBS})


set_property(TARGET hades3ddgfd APPEND PROPERTY COMPILE_FLAGS ${MY_WEIRD_FLAGS})
#set_property(TARGET hades3ddgfd APPEND PROPERTY LINK_FLAGS ${MY_WEIRD_LIB_PATH} )






# specify libraries
#link_libraries(${DUNE_Boost_LIBRARIES})
#include_directories(${Boost_INCLUDE_DIR})
#add_definitions(-DENABLE_BOOST)
#"-L/opt/extlib/superludist/3.3/openmpi/1.8.4/gcc/4.9.2/lib -L/opt/extlib/parmetis/4.0.3/openmpi/1.8.4/gcc/4.9.2/lib -L/opt/extlib/metis/5.1.0/gcc/4.9.2/lib"











More information about the Dune mailing list