... | ... | @@ -12,7 +12,7 @@ AMDiS is tested with the following compilers: |
|
|
|
|
|
To install and use AMDiS some external packages/libraries must be installed:
|
|
|
- boost (>= 1.44)
|
|
|
- cmake (>=2.8.10)
|
|
|
- cmake (>= 3.0)
|
|
|
|
|
|
Some additional packages are necessary for special situations:
|
|
|
- UMFPACK (e.g. from SuiteSparse), when using `ENABLE_UMFPACK`
|
... | ... | @@ -28,22 +28,25 @@ There are at least 3 different configure tools for CMake: |
|
|
|
|
|
I will use the cmake and ccmake. To use the CMake buildsystem, I recommend an out-of-source build and compiliation of AMDiS.
|
|
|
|
|
|
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
|
|
|
Assume, you have downloaded AMDiS in the directory `${SOURCE_DIR}`, i.e.
|
|
|
```
|
|
|
git clone https://gitlab.math.tu-dresden.de/iwr/amdis.git ${SOURCE_DIR}
|
|
|
```
|
|
|
|
|
|
Then, create a build directory
|
|
|
```
|
|
|
mkdir ${HOME}/work/amdis_build
|
|
|
mkdir -p /tmp/amdis/build
|
|
|
```
|
|
|
|
|
|
and do the remaining work from there.
|
|
|
|
|
|
```
|
|
|
cd ${HOME}/work/amdis_build
|
|
|
cd /tmp/amdis/build
|
|
|
```
|
|
|
|
|
|
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
|
|
|
The simplest configuration of AMDiS, i.e. without umfpack and parallelization, only sets the install destination to the directory `${INSTALL_DIR}`. To do this, you have to call cmake with your install destination and the AMDiS source directory as command-line arguments
|
|
|
|
|
|
```
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/programs/ ../amdis/AMDiS
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ${SOURCE_DIR}/AMDiS
|
|
|
```
|
|
|
|
|
|
Compilation and installation is the same as with automake/autoconf:
|
... | ... | @@ -52,33 +55,32 @@ Compilation and installation is the same as with automake/autoconf: |
|
|
make && make install
|
|
|
```
|
|
|
|
|
|
The last command will install AMDiS to `${HOME}/programs`
|
|
|
The last command will install AMDiS to `${INSTALL_DIR}`
|
|
|
|
|
|
## Using the cmake installed AMDiS in your project
|
|
|
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:
|
|
|
## Using the installed AMDiS library in your project
|
|
|
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 *foo*, which have to compile only one source file `src/foo.cc`, your `CMakeLists.txt` consist of the following lines:
|
|
|
|
|
|
```
|
|
|
project(projectName)
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
```cmake
|
|
|
project(foo)
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
|
|
find_package(AMDIS REQUIRED)
|
|
|
add_executable(fooProg src/foo.cc)
|
|
|
include_directories(${AMDIS_INCLUDE_DIRS})
|
|
|
compile_definitions(${AMDIS_COMPILE_OPTIONS})
|
|
|
target_link_libraries(fooProg ${AMDIS_LIBRARIES})
|
|
|
add_executable(foo src/foo.cc)
|
|
|
target_include_directories(foo PRIVATE ${AMDIS_INCLUDE_DIRS})
|
|
|
target_compile_options(foo PRIVATE ${AMDIS_COMPILE_OPTIONS})
|
|
|
target_link_libraries(foo ${AMDIS_LIBRARIES})
|
|
|
```
|
|
|
|
|
|
The first two lines
|
|
|
|
|
|
```
|
|
|
project(projectName)
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
```cmake
|
|
|
project(foo)
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
```
|
|
|
|
|
|
tell cmake the name of your project and that you whish to use only cmake versions newer than 2.8.<br>
|
|
|
The line `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! 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})`.
|
|
|
tell cmake the name of your project and that you whish to use only cmake versions newer than 3.0. The line `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, and will stop the execution! The list of source files of your program is added with `add_executable(foo 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(foo ${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.
|
|
|
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 `${INSTALL_DIR}/share/amdis/`, where `INSTALL_DIR` is the directory you choose during installation of amdis.
|
|
|
|
|
|
## Frequently asked questions
|
|
|
### Boost
|
... | ... | @@ -86,3 +88,9 @@ If you have different boost versions on your system and you do not want to use t |
|
|
|
|
|
### I don't want to set the AMDIS_DIR in every project.
|
|
|
If you always use the same AMDiS directory, you can add the directory to your `PATH` variable.
|
|
|
|
|
|
### Compiling both, sequential and parallel version of AMDiS
|
|
|
AMDiS is configured so that you can install both version in the same directory. This creates two libraries `amdis_s` and `amdis_p`. In you project, you can select the sequential or parallel version, by
|
|
|
```cmake
|
|
|
find_package(AMDIS REQUIRED [SEQUENTIAL|PARALLEL])
|
|
|
``` |