With this short page, I will show you, how to use the cmake buildsystem with AMDiS. The introduction consists of two main parts:
<ol><li>compiling and installing AMDiS with CMake </li>
<li> using the cmake installed AMDiS in your project </li></ol>
<ol>
<li><ahref="#compiling"> compiling and installing AMDiS with CMake </a></li>
<li><ahref="#using"> using the cmake installed AMDiS in your project </a></li>
<li><ahref="#faq"> some frequently asked questions </a></li>
</ol>
<h2> Compiling and installing AMDiS with CMake </h2>
<h2><aname="compiling">Compiling and installing AMDiS with CMake </a></h2>
<h3> configure </h3>
There are 3 different configure tools for CMake:
<ul><li> cmake (non interactive) </li>
...
...
@@ -47,7 +50,7 @@ The last command will install AMDiS to /home/joe/programs
<ahref="#config_with_options">configuration with options </a>
If you only want to build with standard options, you can simply run
<verbatim> cmake . </verbatim>
<h2> Using the cmake installed AMDiS in your project </h2>
<h2><aname="using">Using the cmake installed AMDiS in your project </a></h2>
A cmake-project consists of the source files and a file CMakeLists.txt, which contains a description of needed libraries, headers and programs. If you have a simple project with one program "fooProg", which have to compile only one source file "src/foo.cc", your CMakeLists.txt consist of the following lines:
<pclass="desc">
project(projectName) <br>
...
...
@@ -84,9 +87,16 @@ and we have to tell cmake, that we need the library amdis and each library amdis
target_link_libraries(fooProg ${AMDiS_LIBRARIES})
</p>
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
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
If you have different boost versions on your system and you do not want to use the standard version in /usr/lib and /usr/include, you should set the environment variable BOOST_ROOT to your boost-installation.
<h3> I will not set the AMDIS_DIR in every project. </h3>
If you always use the same AMDiS directory, you can add the directory to your PATH variable.