Skip to content
Snippets Groups Projects
Commit 8d03b1e4 authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

howto for cmake and getamdis-script which uses cmake

parent b97f84ba
Branches
Tags
No related merge requests found
......@@ -276,6 +276,7 @@ if(ENABLE_MARMOT)
Message("please set marmotcc manually")
endif(ENABLE_MARMOT)
#dont change this destination. the GUI depends on it to guess the buildsystem
list(APPEND deb_add_dirs "lib/amdis")
install(TARGETS amdis compositeFEM
LIBRARY DESTINATION lib/amdis/ )
......
<html>
<head>
<title> Using AMDiS with cmake </title>
</head>
<body>
<h1> Using AMDiS with cmake </h1>
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>
<h2> Compiling and installing AMDiS with CMake </h2>
<h3> configure </h3>
There are 3 different configure tools for CMake:
<ul> <li> cmake (non interactive) </li>
<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>
Assume, you have AMDiS downloaded in the directory
<p align="center">
/home/joe/work/
</p>
, the AMDiS source directory is
<p align="center">
/home/joe/work/amdis/AMDiS
</p>
. To configure and compile AMDiS I recommend to create a directory
<p align="center">
/home/joe/work/amdis_build
</p>
and run
<p align="center">
cd /home/joe/work/amdis_build<br>
cmake -DCMAKE_INSTALL_PREFIX=/home/joe/programs/ ../amdis/AMDiS
</p>
Compilation and installation is the same as with automake/autoconf:
<p align="center">
make ; make install
</p>
The last command will install AMDiS to /home/joe/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> Using the cmake-installed AMDiS in your project </h2>
</body>
</html>
if test -e ./AMDiS ; then
echo "there is already an AMDiS directory. I will abort. "
exit 1
fi
ERROR=""
DOWNLOAD="OK"
svn --username studentiwr co https://gforge.zih.tu-dresden.de/svn/amdis/trunk amdis
if test $? -ne 0 ; then
DOWNLOAD="NOT OK"
ERROR="DOWNLOAD"
fi
if test "$1" ; then
prefix="$1"
else
prefix=$(pwd)/amdis_installed
fi
echo "prefix: ${prefix}"
if test ! -d ${prefix} ; then
mkdir --parents ${prefix}
fi
if test ! -d amdis_build ; then
mkdir amdis_build
fi
cd amdis_build
CONFIGURING="OK"
cmake -DCMAKE_INSTALL_PREFIX=${prefix} ../AMDiS
if test $? -ne 0; then
CONFIGURING="NOT OK"
ERROR="${ERROR} CONFIGURE"
fi
COMPILE="OK"
make
if test $? -ne 0; then
COMPILE="NOT OK"
ERROR="${ERROR} COMPILE"
fi
INSTALLING="OK"
make install
if test $? -ne 0; then
INSTALLING="NOT OK"
ERROR="${ERROR} INSTALL"
fi
if test -z "${ERROR}"; then
echo "amdis was successfully downloaded, configured and installed to ${prefix}"
echo "you can use this installation in cmake with the AMDiS_DIR ${prefix}/share/amdis"
else
echo "something went wrong: "
echo "download: ${DOWNLOAD}"
echo "configure: ${CONFIGURING}"
echo "compile: ${COMPILE}"
echo "install: ${INSTALLING}"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment