1install(3) MEPACK install(3)
2
3
4
6 install - Installation
7
9 The following tools and libraries are required for installing MEPACK:
10
11 • A Fortran compiler supporting Fortran 95/2003, e.g. GNU Fortran,
12 Intel ifort, IBM XLF, ...
13
14 • A C99 compiler, e.g. GNU GCC, Intel icc, IBM XLC, ...
15
16 • (optional) A C++14 compiler for MATLAB/GNU Octave interfaces
17
18 • CMake 3.15 or newer. If Intel's oneAPI icx and ifx are used,
19 CMake>=3.20 is required.
20
21 • BLAS and LAPACK, at least version 3.4.2
22
23 • (optional) HDF5, at least version 1.8.5 (only for tests and examples)
24
25 • (optional) doxygen, at least version 1.8.16 with dot, if the HTML
26 documentation is required
27
28 • (optional) MATLAB for building the MATLAB interface
29
30 • (optional) GNU Octave, at least version 4.4, for building the GNU
31 Octave interface
32
33 • (optional) lcov and gcov for building the tests with code coverage
34
35 The following compilers are known to be unusable due to compiler bugs:
36
37 • AMD AOCC 3.x and 4.0 (Compiler Crash)
38
39 • Intel ICC/IFort Classic 2021 (OpenMP failures)
40
41 • Intel ICX/IFX 2021.x, 2022.x (OpenMP failures)
42
43 If the BLAS / LAPACK library does not provide the full interface, i.e.
44 some routines are not implemented or available for the user, MEPACK
45 builds the required but missing routines from reference LAPACK and
46 includes them in MEPACK. This is the if IBM ESSL is used as BLAS
47 library.
48
50 The source code is configured using CMake. An out-of-source build is
51 preferred. Typically, this is done by
52
53 cmake -S . -B build-dir <OtherCMakeOptions>
54 make -C build-dir
55 make -C build-dir install
56
57
58 The following options can be added to CMake to configure MEPACK
59 properly, for MATLAB/GNU Octave specific options, see below:
60
61 Option Description Default -DDEBUG=ON/OFF Enable building the
62 library in debug mode OFF -DBUILD_STATIC=ON/OFF Enable building
63 the static libraries. OFF -DCOVERAGE=ON/OFF Enable the creation
64 of code coverage files OFF -DCMAKE_INSTALL_PREFIX=PREFIX
65 Installation prefix /usr/local -DBLA_VENDOR=VENDOR_NAME Set the
66 BLAS library to use. Generic See FindBLAS.cmake for details
67 -DHOSTOPT=ON/OFF Enable host-specific optimizations OFF
68 -DLTO=ON/OFF Enable Link Time Optimization OFF
69 -DVALGRIND_SUPPRESSIONS=PATH Set a suppressions file for valgrind
70 empty -DINTEGER8=ON/OFF Build with 64-bit integers and 64 bit BLAS
71 OFF -DFORTRAN_BOUND_CHECK=ON/OFF Check the array bounds at runtime
72 (slow) OFF -DFORTRAN_SANITIZE=ON/OFF Check the memory accesses
73 at runtime (slow) OFF -DDOC=ON/OFF Build the documentation OFF
74 -DMATLAB=ON/OFF Enable MATLAB / Octave interface building OFF
75 -DEXAMPLES=ON/OFF Build the tests and examples ON
76 -DMEPACK_LUA_CONFIG=PATH Path for an alternative configuration file
77 empty -DRECSY=PATH Path to a precompiled library containing
78 empty the RECSY library. empty -DGL705=PATH Path to a
79 precompiled library containing empty the code from Algorithm 705
80 as library. empty -DCMAKE_INSTALL_MODULEDIR=PATH Custom
81 destination directory for Fortran /usr/include/mepack/ modules.
82
83 The test suite is executed by calling
84
85 make -C build-dir test
86
87
88 If valgrind was found during the configuration procedure, all tets can
89 be executed with the help of valgrind by executing:
90
91 cd build-dir
92 ctest -D NightlyMemoryCheck
93
94
95 The documentation is built in build-dir/doc by calling:
96
97 make -C build-dir doc
98
99
101 The MATLAB/Octave interface is built if -DMATLAB=ON is set during
102 configuration. The build process can be adjusted using the following
103 CMake options:
104
105 Option Description Default -DMEXOCT_MATLAB_DOC=ON/OFF Extract
106 the help texts for MATLAB ON -DMEXOCT_MATLAB=ON/OFF Search for
107 MATLAB ON -DMEXOCT_OCTAVE=ON/OFF Search for Octave ON
108 -DMEXOCT_MATLAB_ROOT=PATH Path of the MATLAB installation empty
109 -DMEXOCT_OCTAVE_CONFIG=PATH Full path of the octave-config tool
110 empty -DMEXOCT_LINK_STATIC=ON/OFF Static linking of MEPACK to the
111 MEX/OCT files OFF -DMEXOCT_SKIP_RPATH=1/0 Skip the RPATH setting
112 in MEX/OCT files 0
113
114 After compiling, the build directory contains a matlab/matlab folder
115 including the mex files to be used with MATLAB and a matlab/octave
116 folder, which contains the octfiles for GNU Octave. Furthermore, a
117 distribution archive
118
119 mepack-<MEPACK_VERSION>-matlab-<MATLAB_RELEASE>-<ARCH>-dist.tar.gz
120
121
122 for MATLAB and
123
124 mepack-<MEPACK_VERSION>-octave-<OCTAVE_VERSION>-<ARCH>-dist.tar.gz
125
126
127 for GNU Octave is created in the root of the build directory. These
128 files can be used to ship the compiled MEX/OCT files to othersystems.
129
130 The test suite is also added to the test target of the main makefile.
131 In this way
132
133 make -C build-dir test
134
135
136 will also test the MATLAB/Octave interface. In order to test the
137 MATLAB/Octave interface separately run
138
139 cd build-dir/matlab
140 make test
141
142
143 By default (MEXOCT_SKIP_RPATH=0) the MEX and OCT files have set its
144 RPATH to the $ORIGIN and thus will search for the libmepack.so file in
145 the current directory. In this case, the libmepack.so is copied to the
146 matlab or octave directory. In this case, the libmepack.so file will
147 also be added to the distribution archives. If MEXOCT_LINK_STATIC is
148 enabled, no RPATH is required since MEPACK is statically linked to the
149 MEX/OCT files, resulting in larger files. The libmepack.so file is not
150 part of the distribution file in this case.
151
152 Attention: The MATLAB part of the interface requires -DINTEGER8=ON in
153 most cases, since MATLAB uses 64-bit integers everywhere. In the case
154 of GNU Octave the setting -DINTEGER8=OFF is required in most cases,
155 since Octave uses 64-bit integers internally, but uses
156 BLAS/LAPACK/other Fortran codes with 32-bit integers.
157
158 Attention: Enable the static linkage with MEXOCT_LINK_STATIC also
159 requires to build the static library with BUILD_STATIC=ON.
160
161 Warning: The MATLAB interface is implemented using C++ template meta
162 programming and thus the compiling the code leads to a huge memory
163 consumption. If MEPACK is build in parallel, e.g. make -j 4, this can
164 crash your computer. For reason the MATLAB interface should be compiled
165 with one job per 8 GB of free memory. If your are not sure if this is
166 fulfilled, consider compiling the code with only one job, i.e. make -j
167 1.
168
170 The RECSY library and the reference implementation of Algorithm 705
171 cannot be shipped due to unclear licenses. If you want to compile the
172 examples with support for these codes, you have to provide a shared or
173 static library containing the codes yourself. Perferably, RECSY and
174 Algorithm 705 should be compiled as static library with the -fPIC flag
175 set during compilation. Then they can be enabled in the during the
176 build via
177
178 cmake ....... -DRECSY=/path/to/librecsy.a -DGL705=/path/to/libgl705.a
179
180
181Version 1.1.0 Wed Oct 18 2023 install(3)