Skip to content

Commit c2ef5fc

Browse files
ronald-jaepelr.jaepel
and
r.jaepel
authored
Simplify and update build instructions
* Update compilation and build workflow on windows - update build workflow to use vcpkg - update build instructions - remove redundant build instructions by linking to the build guides in root from the documentation - update FindXXX.cmake to better handle windows paths - update FindUMFPACK.cmake to include GKlib --------- Co-authored-by: r.jaepel <[email protected]>
1 parent 6dfe1f0 commit c2ef5fc

16 files changed

+224
-731
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ doc/tex/docs/*.aux
7979
*.kdev4
8080
.kdev4/
8181
compile_commands.json
82+
83+
# Ignore build and install directories
84+
build
85+
install
86+
vcpkg_installed

BUILD-LINUX.md

+35-68
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,60 @@
1-
# Prerequisites
1+
## Prerequisites
22

33
* CMake (>= 3.12.0)
44
* GCC >= 7.0, Clang >= 3.9, or Intel C++ 18.0
5-
* Optional: MATLAB R2009a or greater
65
* Optional: Git
76

87
Assumed directory structure:
98

109
<pre>
11-
&lt;ROOT&gt;
12-
|-libs
13-
| |- sundials
14-
| |- hdf5
15-
| |- superlu
16-
| |- suitesparse
17-
|-code
18-
|-cadet
19-
|-build
10+
|- CADET
11+
| - src
12+
| - include
13+
| - [...]
14+
| - build
15+
| - install
2016
</pre>
2117

22-
Note that the version numbers of the files and packages below are subject to change and will not always reflect the most recent version.
18+
Note that the version numbers of the files and packages below are subject to change and will not always reflect the most
19+
recent version.
2320

24-
# Build dependencies
21+
## Install dependencies
2522

26-
## HDF5
23+
```
24+
sudo apt-get update
25+
sudo apt -y install build-essential cmake libhdf5-dev libtbb-dev libsuperlu-dev libeigen3-dev
26+
```
2727

28-
You can either build HDF5 yourself or rely on the packages provided by your Linux distribution.
28+
sudo apt -y install build-essential libhdf5-dev libsuperlu-dev libeigen3-dev intel-mkl
2929

30-
Obtain HDF5 from your distribution:
31-
* Install the development package of your distribution (e.g., `libhdf5-dev` for Ubuntu and Debian, `hdf5-devel` OpenSUSE)
32-
* Additional postfixes or prefixes in the library names (e.g., Debian uses `libhdf5_serial.*` instead of `libhdf5.*`) can cause troubles when CMake is trying to find HDF5. If this is the case, you can circumvent this by using symlinks `ln -s libhdf5_serial.* libhdf5.*`. However, this can later cause troubles because other packages might contain this file.
30+
### LAPACK
3331

34-
Build HDF5 yourself:
35-
* Download CMake-enabled source from https://www.hdfgroup.org/downloads/hdf5/source-code/
36-
* Unzip and make sure that the directory path does not contain blank spaces
37-
* Open a terminal and change to the unzipped directory
38-
* Execute `ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix,INSTALLDIR="<ROOT>/Libs/hdf5" -C Release -V`
39-
* Extract the created `HDF5-1.10.0-patch1-Linux.tar.gz` file to `<ROOT>/Libs/hdf5` such that you have `<ROOT>/Libs/hdf5/lib`
32+
You can either use a LAPACK implementation provided by your distribution or install the freely available Intel MKL
4033

41-
## SUNDIALS (Optional)
34+
for Intel run
4235

43-
* Download SUNDIALS source from http://computation.llnl.gov/projects/sundials/sundials-software (version <= 3.2.1)
44-
* Unzip
45-
* Open a terminal and change to the parent directory of the unzipped directory
46-
* Create a new folder `sundialsbuild` and change to it
47-
* Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/Libs/sundials" -DEXAMPLES_ENABLE=OFF -DOPENMP_ENABLE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC ../sundials-3.2.1/`
48-
* Execute `make install`
49-
* Delete the folder `sundialsbuild` (e.g., execute `rm -rf sundialsbuild` in the parent directory of `sundialsbuild`)
36+
```
37+
sudo apt -y install intel-mkl
38+
```
5039

51-
## LAPACK
40+
for distro defaults run
5241

53-
You can either use a LAPACK implementation provided by your distribution or install the freely available [Intel MKL](https://software.intel.com/sites/campaigns/nest/) which is very fast and probably faster than your distribution's implementation.
42+
```
43+
sudo apt -y install liblapack3 liblapack-dev libblas3 libblas-dev`
44+
```
5445

55-
Obtain LAPACK from your distribution:
56-
* Install the packages (LAPACK and BLAS) of your distribution (e.g., `liblapack3`, `liblapack-dev`, `libblas3`, `libblas-dev` for Ubuntu and Debian). Note that some packages only provide reference (i.e., slow) implementations and others (e.g., ATLAS, GOTO) perform much faster.
46+
## Build CADET
5747

58-
## SuperLU (Optional)
48+
- Clone the CADET source code `git clone https://github.com/modsim/CADET.git CADET`
49+
- Create the directories `CADET/build` and `CADET/install`
5950

60-
* Download SuperLU source from https://github.com/xiaoyeli/superlu
61-
* Unzip
62-
* Open a terminal and change to the parent directory of the unzipped directory
63-
* Create a new folder `superlubuild` and change to it
64-
* Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/Libs/superlu" -Denable_complex=OFF -Denable_complex16=OFF -Denable_blaslib=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=Release ../SuperLU_5.2.1/`
65-
* Execute `make install`
66-
* Delete the folder `superlubuild` (e.g., execute `rm -rf superlubuild` in the parent directory of `superlubuild`)
51+
- Open a terminal and change to `CADET/build`
52+
- If using MKL, execute `export MKLROOT=/opt/intel/mkl`
53+
- Using standard LAPACK: Execute `cmake -DCMAKE_INSTALL_PREFIX="../install" ../`
6754

68-
## UMFPACK (Optional)
55+
- Using MKL (sequential): Execute `cmake -DCMAKE_INSTALL_PREFIX="../install" -DBLA_VENDOR=Intel10_64lp_seq ../`
6956

70-
* Download SuiteSparse source from http://faculty.cse.tamu.edu/davis/suitesparse.html
71-
* Unzip
72-
* Open a terminal and change to the unzipped directory
73-
* Execute `make install INSTALL="<ROOT>/Libs/suitesparse" CHOLMOD_CONFIG=-DNPARTITION` or `make install INSTALL="<ROOT>/Libs/suitesparse" CHOLMOD_CONFIG=-DNPARTITION AUTOCC=no CC=<COMPILER> CXX=<C++COMPILER>` if you want to manually select the compiler
74-
75-
# Build CADET
76-
77-
* Download release of CADET or checkout from git
78-
* Place the source in `<ROOT>/code` and create the directory `<ROOT>/build`
79-
* Open a terminal and change to `<ROOT>/build`
80-
* If you have built HDF5 yourself, execute `export HDF5_ROOT=<ROOT>/Libs/hdf5`
81-
* If you have built SUNDIALS, execute `export SUNDIALS_ROOT=<ROOT>/Libs/sundials` and add `-DENABLE_PACKAGED_SUNDIALS=OFF` to the CMake command (see below)
82-
* If you have built SuperLU, execute `export SUPERLU_ROOT=<ROOT>/Libs/superlu`
83-
* If you have built UMFPACK, execute `export UMFPACK_ROOT=<ROOT>/Libs/suitesparse`
84-
* If using MKL, execute `export MKLROOT=/opt/intel/mkl`
85-
* Using standard LAPACK: Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/cadet" ../code/`
86-
87-
Using MKL (sequential): Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/cadet" -DBLA_VENDOR=Intel10_64lp_seq ../code/`
88-
89-
Using MKL (parallel): Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/cadet" -DBLA_VENDOR=Intel10_64lp ../code/`
90-
* If CMake was not able to locate Matlab, execute `export MATLAB_ROOT=/path/to/my/MATLAB/R2016a` and try to run CMake again
91-
* Execute `make`
92-
* Execute `make install`
57+
- Using MKL (parallel): Execute `cmake -DCMAKE_INSTALL_PREFIX="../install" -DBLA_VENDOR=Intel10_64lp ../`
9358

59+
- Execute `make`
60+
- Execute `make install`

BUILD-OSX.md

+25-73
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Prerequisites
1+
## Prerequisites
22

33
* CMake (>= 3.12.0)
44
* GCC >= 7.0, Clang >= 3.9, or Intel C++ 18.0
@@ -8,92 +8,44 @@
88
Assumed directory structure:
99

1010
<pre>
11-
&lt;ROOT&gt;
12-
|-libs
13-
| |- sundials
14-
| |- hdf5
15-
| |- superlu
16-
| |- suitesparse
17-
|-code
18-
|-cadet
19-
|-build
11+
|- CADET
12+
| - src
13+
| - include
14+
| - [...]
15+
| - build
16+
| - install
2017
</pre>
2118

2219
Note that the version numbers of the files and packages below are subject to change and will not always reflect the most recent version.
2320

2421
Also note that you have to use the same compiler for all packages. This is especially important if some of the packages are installed via a package manager such as [Homebrew](http://brew.sh/) which uses the system compiler (Clang).
2522

26-
# Build dependencies
23+
## Build dependencies
2724

28-
## HDF5
25+
```
26+
brew update > /dev/null || true
27+
brew install cmake --without-docs
28+
brew install hdf5
29+
brew install tbb
30+
brew install eigen
31+
```
2932

30-
You can either build HDF5 yourself or rely on the `hdf5` package of [Homebrew](http://brew.sh/).
33+
### LAPACK
3134

32-
Obtain HDF5 from Homebrew:
33-
* Open a terminal and execute `brew install hdf5`
34-
* Homebrew has installed HDF5 to `/usr/local`
35+
You can either use the native LAPACK implementation provided by Mac OS X (vecLib, Accelerate)
36+
or install the freely available [Intel MKL](https://software.intel.com/sites/campaigns/nest/) which is very fast and probably faster than Accelerate.
3537

36-
Build HDF5 yourself:
37-
* Download CMake-enabled source from https://www.hdfgroup.org/downloads/hdf5/source-code/
38-
* Unzip and make sure that the directory path does not contain blank spaces
39-
* Open a terminal and change to the unzipped directory
40-
* Execute `ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix,INSTALLDIR="<ROOT>/Libs/hdf5" -C Release -V`
41-
* Extract the created `HDF5-1.10.0-patch1-Darwin.tar.gz` file to `<ROOT>/Libs/hdf5` such that you have `<ROOT>/Libs/hdf5/lib`
38+
## Build CADET
4239

43-
## SUNDIALS (Optional)
40+
- Clone the CADET source code `git clone https://github.com/modsim/CADET.git CADET`
41+
- Create the directories `CADET/build` and `CADET/install`
4442

45-
You can either build SUNDIALS yourself or rely on the `sundials` package of [Homebrew](http://brew.sh/).
46-
Note that a version <= 3.2.1 is required whereas the current version provided by Homebrew is >= 5.1.0.
47-
48-
Obtain SUNDIALS from Homebrew:
49-
* Open a terminal and execute `brew install sundials`
50-
* Homebrew has installed SUNDIALS to `/usr/local`
51-
52-
Build SUNDIALS yourself:
53-
* Download SUNDIALS source from http://computation.llnl.gov/projects/sundials/sundials-software
54-
* Unzip
55-
* Open a terminal and change to the parent directory of the unzipped directory
56-
* Create a new folder `sundialsbuild` and change to it
57-
* Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/Libs/sundials" -DEXAMPLES_ENABLE=OFF -DOPENMP_ENABLE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=Release ../sundials-3.2.1/`
58-
* Execute `make install`
59-
* Delete the folder `sundialsbuild` (e.g., execute `rm -rf sundialsbuild` in the parent directory of `sundialsbuild`)
60-
61-
## LAPACK
62-
63-
You can either use the native LAPACK implementation provided by Mac OS X (vecLib, Accelerate) or install the freely available [Intel MKL](https://software.intel.com/sites/campaigns/nest/) which is very fast and probably faster than Accelerate.
64-
65-
## SuperLU (Optional)
66-
67-
* Download SuperLU source from https://github.com/xiaoyeli/superlu
68-
* Unzip
69-
* Open a terminal and change to the parent directory of the unzipped directory
70-
* Create a new folder `superlubuild` and change to it
71-
* Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/Libs/superlu" -Denable_complex=OFF -Denable_complex16=OFF -Denable_blaslib=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=Release ../SuperLU_5.2.1/`
72-
* Execute `make install`
73-
* Delete the folder `superlubuild` (e.g., execute `rm -rf superlubuild` in the parent directory of `superlubuild`)
74-
75-
## UMFPACK (Optional)
76-
77-
* Download SuiteSparse source from http://faculty.cse.tamu.edu/davis/suitesparse.html
78-
* Unzip
79-
* Open a terminal and change to the unzipped directory
80-
* Execute `make install INSTALL="<ROOT>/Libs/suitesparse" CHOLMOD_CONFIG=-DNPARTITION` or `make install INSTALL="<ROOT>/Libs/suitesparse" CHOLMOD_CONFIG=-DNPARTITION AUTOCC=no CC=<COMPILER> CXX=<C++COMPILER>` if you want to manually select the compiler
81-
82-
# Build CADET
83-
84-
* Download release of CADET or checkout from git
85-
* Place the source in `<ROOT>/code` and create the directory `<ROOT>/build`
86-
* Open a terminal and change to `<ROOT>/build`
87-
* If you have built HDF5 yourself, execute `export HDF5_ROOT=<ROOT>/Libs/hdf5`
88-
* If you have built SUNDIALS yourself, execute `export SUNDIALS_ROOT=<ROOT>/Libs/sundials` and add `-DENABLE_PACKAGED_SUNDIALS=OFF` to the CMake command (see below)
89-
* If you have built SuperLU, execute `export SUPERLU_ROOT=<ROOT>/Libs/superlu`
90-
* If you have built UMFPACK, execute `export UMFPACK_ROOT=<ROOT>/Libs/suitesparse`
91-
* If using MKL, execute `export MKLROOT=/opt/intel/mkl`
92-
* Using standard LAPACK: Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/cadet" ../code/`
43+
* If using Intel MKL, execute `export MKLROOT=/opt/intel/mkl`
44+
* Using standard LAPACK: Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/install" ../`
9345

94-
Using MKL (sequential): Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/cadet" -DBLA_VENDOR=Intel10_64lp_seq ../code/`
46+
Using MKL (sequential): Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/install" -DBLA_VENDOR=Intel10_64lp_seq ../`
9547

96-
Using MKL (parallel): Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/cadet" -DBLA_VENDOR=Intel10_64lp ../code/`
48+
Using MKL (parallel): Execute `cmake -DCMAKE_INSTALL_PREFIX="<ROOT>/install" -DBLA_VENDOR=Intel10_64lp ../`
9749
* Execute `make`
9850
* Execute `make install`
9951

0 commit comments

Comments
 (0)