I will use the cmake and ccmake. The autoconf/automake implementation was used directly inside the AMDiS source directory (i.e. the directory you get through svn). To use the CMake buildsystem, I recommend a different directory structure for building and compiling AMDiS. The script getamdis_cmake.sh, which can be found on https://fusionforge.zih.tu-dresden.de, creates such a directory structure.
Assume, you have AMDiS downloaded in the directory${HOME}/work/, the AMDiS source directory is
${HOME}/work/amdis/AMDiS. To configure and compile AMDiS I recommend using out of source builds. This means, you should create a directory amdis_build
mkdir ${HOME}/work/amdis_buildand do the remaining work from there.
cd ${HOME}/work/amdis_buildThe simplest configuration of AMDiS, i.e. without umfpack and parallelization, only sets the install destination to the directory "${HOME}/programs/". To do this, you have to call cmake with your install destination and the AMDiS source directory as commandline arguments
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/programs/ ../amdis/AMDiSCompilation and installation is the same as with automake/autoconf:
make && make installThe last command will install AMDiS to ${HOME}/programs
project(projectName)The first two lines
cmake_minimum_required(VERSION 2.8)
find_package(AMDIS REQUIRED)
if(AMDIS_FOUND)
include(${AMDIS_USE_FILE})
add_executable(fooProg src/foo.cc)
target_link_libraries(fooProg ${AMDIS_LIBRARIES})
endif(AMDIS_FOUND)
project(projectName)tell cmake the name of your project and that you whish to use only cmake versions newer than 2.8.
cmake_minimum_required(VERSION 2.8)
find_package(AMDIS REQUIRED)tells cmake, that you want to use AMDiS and it should complain if AMDiS was not found. CMake will print an error message, bu will not stop the execution! With the command
include(${AMDIS_USE_FILE})we read an AMDiS specific configuration file, which sets some compilerflags and adds the include directorys. The program is added with
add_executable(fooProg src/foo.cc)and we have to tell cmake, that we need the library amdis and each library amdis depends on. This is done with the command
target_link_libraries(fooProg ${AMDIS_LIBRARIES})If cmake does not find AMDiS, you have to set the variable AMDIS_DIR to the directory containing the file AMDiSConfig.cmake. This file resides in
${CMAKE_INSTALL_PREFIX}/share/amdis/where CMAKE_INSTALL_PREFIX is the directory you choose during installation of amdis.