Commit 5ccc3a0a authored by Naumann, Andreas's avatar Naumann, Andreas

always the same problem with the howto

parent 68b18f9a
......@@ -21,76 +21,70 @@ There are 3 different configure tools for CMake:
<li> ccmake (interactive on command line) </li>
<li> cmake-gui (qt-based gui) </li></ul>
<p>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 <a href="https://gforge.zih.tu-dresden.de/frs/download.php/34/getamdis_cmake.sh" >getamdis_cmake.sh</a>, which can be found on <ah ref="https://gforge.zih.tu-dresden.de" >gforge.zih.tu-dresden.de</a>, creates such a directory structure.</p>
<p>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 <a href="https://fusionforge.zih.tu-dresden.de/frs/download.php/34/getamdis_cmake.sh" >getamdis_cmake.sh</a>, which can be found on <a href="https://fusionforge.zih.tu-dresden.de" >https://fusionforge.zih.tu-dresden.de</a>, creates such a directory structure.</p>
Assume, you have AMDiS downloaded in the directory
<p class="desc" >
/home/joe/work/
</p>
<pre class="desc" >
${HOME}/work/ </pre>
, the AMDiS source directory is
<p class="desc">
/home/joe/work/amdis/AMDiS
</p>
. To configure and compile AMDiS I recommend to create a directory
<p class="desc">
/home/joe/work/amdis_build
</p>
and run
<p class="desc">
cd /home/joe/work/amdis_build<br>
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/programs/ ../amdis/AMDiS
</p>
<pre class="desc">
${HOME}/work/amdis/AMDiS </pre>
. To configure and compile AMDiS I recommend using out of source builds. This means, you should create a directory amdis_build
<pre class="desc">
mkdir ${HOME}/work/amdis_build </pre>
and do the remaining work from there.
<pre class="desc">
cd ${HOME}/work/amdis_build </pre>
The 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
<pre class="desc" >
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/programs/ ../amdis/AMDiS</pre>
Compilation and installation is the same as with automake/autoconf:
<p class="desc">
make ; make install
</p>
The last command will install AMDiS to /home/joe/programs
<pre class="desc">
make && make install </pre >
The last command will install AMDiS to ${HOME}/programs
<a href="#config_fast_and_simple" >fast and simple configuration </a>
<a href="#config_with_options" >configuration with options </a>
If you only want to build with standard options, you can simply run
<verbatim> cmake . </verbatim>
<h2> <a name="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:
<p class="desc" >
<pre class="desc" >
project(projectName) <br>
cmake_minimum_required(VERSION 2.8)<br><br>
find_package(AMDiS REQUIRED)<br>
if(AMDiS_FOUND)<br>
include(${AMDiS_USE_FILE})<br>
find_package(AMDIS REQUIRED)<br>
if(AMDIS_FOUND)<br>
include(${AMDIS_USE_FILE})<br>
add_executable(fooProg src/foo.cc)<br>
target_link_libraries(fooProg ${AMDIS_LIBRARIES})<br>
endif(AMDiS_FOUND)<br>
</p >
endif(AMDIS_FOUND)<br>
</pre >
The first two lines
<p class="desc" >
<pre class="desc" >
project(projectName) <br>
cmake_minimum_required(VERSION 2.8)
</p >
</pre >
tell cmake the name of your project and that you whish to use only cmake versions newer than 2.8.<br>
The line
<p class="desc" >
find_package(AMDiS REQUIRED)
</p >
<pre class="desc" >
find_package(AMDIS REQUIRED)
</pre >
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
<p class="desc" >
include(${AMDiS_USE_FILE})
</p >
<pre class="desc" >
include(${AMDIS_USE_FILE})
</pre >
we read an AMDiS specific configuration file, which sets some compilerflags and adds the include directorys. The program is added with
<p class="desc" >
<pre class="desc" >
add_executable(fooProg src/foo.cc)
</p >
</pre >
and we have to tell cmake, that we need the library amdis and each library amdis depends on. This is done with the command
<p class="desc" >
<pre class="desc" >
target_link_libraries(fooProg ${AMDIS_LIBRARIES})
</p >
</pre >
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
<p class="desc" >
$CMAKE_INSTALL_PREFIX/share/amdis/
</p >
<pre class="desc" >
${CMAKE_INSTALL_PREFIX}/share/amdis/
</pre >
where CMAKE_INSTALL_PREFIX is the directory you choose during installation of amdis.
<h2 > <a name="faq" > Frequently asked questions </a ></h2 >
<h3 > Boost </h3>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment