install(3)
β¨ NAME β¨
Okay bestie, welcome to install(3) from the MEPACK manual β yes, section 3, we're in library-manual territory, we're fancy. And the whole entire point of this page? install β Installation. That's it. That's the name. Short, sweet, iconic. Now let's get you set up π
πΈ Requirements πΈ
π§ Linux and Unix-like Operating Systems π§
So to get MEPACK living on Linux or any Unix-like OS, you're gonna need these besties on deck:
- A Fortran compiler supporting Fortran 95/2003, e.g. GNU Fortran, Intel ifort, IBM XLF, ...
- A C99 compiler, e.g. GNU GCC, Intel icc, IBM XLC, ...
- (optional) A C++17 compiler for MATLAB/GNU Octave interfaces
- CMake 3.15 or newer. If Intel's oneAPI icx and ifx are used, CMake>=3.20 is required.
- BLAS and LAPACK, at least version 3.4.2
- (optional) HDF5, at least version 1.8.5 (only for tests and examples)
- (optional) doxygen, at least version 1.8.16 with dot, if the HTML documentation is required
- (optional) MATLAB, at least 2018a, for building the MATLAB interface
- (optional) GNU Octave, at least version 4.4, for building the GNU Octave interface
- (optional) lcov and gcov for building the tests with code coverage
β οΈ And now the do-not-touch list β these compilers are known to be unusable because of compiler bugs, no cap: - AMD AOCC 3.x and 4.0 (Compiler Crash) - Intel ICC/IFort Classic 2021 (OpenMP failures) - Intel ICX/IFX 2021.x, 2022.x (OpenMP failures)
Now here's a lil detail that's lowkey kind of slay: if your BLAS / LAPACK library does not provide the full interface, like some routines just aren't implemented or aren't available to you, then MEPACK builds the required but missing routines from reference LAPACK and includes them in MEPACK. This is the if IBM ESSL is used as BLAS library. π She's resourceful, she fills in the gaps herself.
πͺ Microsoft Windows πͺ
MEPACK can be built on MS Windows using the MSYS2 (https://www.msys2.org/) environemnt in combination with the MingW64(gcc) compiler. We support both, the MSVCRT and the UCRT runtime environment. If you are plan to use MSVCRT set
export MINGWPREFIX=mingw-w64-x86_64
In case of the UCRT runtime set
export MINGWPREFIX=mingw-w64-ucrt-x86_64
Afterwards, the required packages can be installed using
pacman -S ${MINGWPREFIX}-gcc ${MINGWPREFIX}-gcc-fortran \
${MINGWPREFIX}-cmake ${MINGWPREFIX}-ninja \
${MINGWPREFIX}-openblas ${MINGWPREFIX}-openblas64 \
${MINGWPREFIX}-hdf5
π οΈ Installation π οΈ
The source code is configured using CMake. An out-of-source build is preferred β that's the vibe, keep your source tree clean bestie. Typically, this is done by
cmake -S . -B build-dir <OtherCMakeOptions>
make -C build-dir
make -C build-dir install
The following options can be added to CMake to configure MEPACK properly, and for MATLAB/GNU Octave specific options, see below π
-DDEBUG=ON/OFFβ Enable building the library in debug mode β defaultOFF-DBUILD_STATIC=ON/OFFβ Enable building the static libraries. β defaultOFF-DBUILD_DYNAMIC=ON/OFFβ Enable building the dynamic/shared libraries. β defaultON-DCOVERAGE=ON/OFFβ Enable the creation of code coverage files β defaultOFF-DCMAKE_INSTALL_PREFIX=PREFIXβ Installation prefix β default/usr/local-DBLA_VENDOR=VENDOR_NAMEβ Set the BLAS library to use. β defaultGenericβ SeeFindBLAS.cmakefor details-DHOSTOPT=ON/OFFβ Enable host-specific optimizations β defaultOFF-DLTO=ON/OFFβ Enable Link Time Optimization β defaultOFF-DVALGRIND_SUPPRESSIONS=PATHβ Set a suppressions file for valgrind β default empty-DINTEGER8=ON/OFFβ Build with 64-bit integers and 64 bit BLAS β defaultOFF-DFORTRAN_BOUND_CHECK=ON/OFFβ Check the array bounds at runtime (slow) β defaultOFF-DFORTRAN_SANITIZE=ON/OFFβ Check the memory accesses at runtime (slow) β defaultOFF-DDOC=ON/OFFβ Build the documentation β defaultOFF-DMATLAB=ON/OFFβ Enable MATLAB / Octave interface building β defaultOFF-DEXAMPLES=ON/OFFβ Build the tests and examples β defaultON-DMEPACK_LUA_CONFIG=PATHβ Path for an alternative configuration file β default empty-DRECSY=PATHβ Path to a precompiled library containing the RECSY library. β default empty-DGL705=PATHβ Path to a precompiled library containing the code from Algorithm 705 as library. β default empty-DCMAKE_INSTALL_MODULEDIR=PATHβ Custom destination directory for Fortran modules. β default/usr/include/mepack/
Heads up π«Ά the examples/tests are only built if BUILD_DYNAMIC=ON, otherwise they can not be used.
The test suite is executed by calling
make -C build-dir test
If valgrind was found during the configuration procedure, all tets can be executed with the help of valgrind by executing:
cd build-dir
ctest -D NightlyMemoryCheck
The documentation is built in build-dir/doc by calling:
make -C build-dir doc
π MATLAB/Octave Interface π
The MATLAB/Octave interface is built if -DMATLAB=ON is set during configuration. The build process can be adjusted using the following CMake options:
-DMEXOCT_MATLAB_DOC=ON/OFFβ Extract the help texts for MATLAB from Mex-Files, β defaultOFF-DMEXOCT_MATLAB=ON/OFFβ Search for MATLAB β defaultON-DMEXOCT_OCTAVE=ON/OFFβ Search for Octave β defaultON-DMEXOCT_MATLAB_ROOT=PATHβ Path of the MATLAB installation β default empty-DMEXOCT_OCTAVE_CONFIG=PATHβ Full path of theoctave-configtool β default empty-DMEXOCT_LINK_STATIC=ON/OFFβ Static linking of MEPACK to the MEX/OCT files β defaultOFF-DMEXOCT_SKIP_RPATH=1/0β Skip the RPATH setting in MEX/OCT files β default0
After compiling, the build directory contains a matlab/matlab folder including the mex files to be used with MATLAB and a matlab/octave folder, which contains the octfiles for GNU Octave. Furthermore, a distribution archive
mepack-<MEPACK_VERSION>-matlab-<MATLAB_VERSION>-<ARCH>-dist.{tar.gz,zip}
for MATLAB and
mepack-<MEPACK_VERSION>-octave-<OCTAVE_VERSION>-<ARCH>-dist.tar.gz
for GNU Octave is created in the root of the build directory. These files can be used to ship the compiled MEX/OCT files to othersystems. πβ¨
The test suite is also added to the test target of the main makefile. In this way
make -C build-dir test
will also test the MATLAB/Octave interface. In order to test the MATLAB/Octave interface separately run
cd build-dir/matlab
make test
By default (MEXOCT_SKIP_RPATH=0) the MEX and OCT files have set its RPATH to the $ORIGIN and thus will search for the libmepack.so file in the current directory. In this case, the libmepack.so is copied to the matlab or octave directory. In this case, the libmepack.so file will also be added to the distribution archives. If MEXOCT_LINK_STATIC is enabled, no RPATH is required since MEPACK is statically linked to the MEX/OCT files, resulting in larger files. The libmepack.so file is not part of the distribution file in this case.
Attention: The MATLAB part of the interface requires-DINTEGER8=ONin most cases, since MATLAB uses 64-bit integers everywhere. In the case of GNU Octave the setting-DINTEGER8=OFFis required in most cases, since Octave uses 64-bit integers internally, but uses BLAS/LAPACK/other Fortran codes with 32-bit integers. Yes bestie, they're built different, we don't make the rules. π
Attention: Enable the static linkage withMEXOCT_LINK_STATICalso requires to build the static library withBUILD_STATIC=ON.
Warning: The MATLAB interface is implemented using C++ template meta programming and thus the compiling the code leads to a huge memory consumption. If MEPACK is build in parallel, e.g.make -j 4, this can crash your computer. For reason the MATLAB interface should be compiled with one job per 8 GB of free memory. If your are not sure if this is fulfilled, consider compiling the code with only one job, i.e.make -j 1.
Like. Do not rawdog that build with -j 4 unless you have the RAM. She will take your whole machine down. π
π» MATLAB Interface on Microsoft Windows π»
Since MATLAB and its shipped libraries behave slightly different compared to the Linux/Unix world, building the MEPACK MATLAB interface under Microsoft Windows requires a special build configuration. Using MEPACK the MSYS2 MingW64 environment using either the MSVCRT or the UCRT runtime is required. Therefor, the requirements from above are required to installed beforehand.
The MATLAB interface is built from the MINGW64 command line using:
cmake -DLTO=OFF -DINTEGER8=ON -DBUILD_STATIC=ON -DBUILD_DYNAMIC=OFF \
-DMATLAB=ON -DMEXOCT_OCTAVE=OFF -DMEXOCT_LINK_STATIC=ON \
-DCMAKE_Fortran_FLAGS="-fno-underscoring" -DMEXOCT_MATLAB_DOC=OFF \
-S . -B build-matlab
cmake --build build-matlab
Afterwards, the distribution can be found as zip-file in the build-dir directory.
Building for GNU Octave on Windows is not possible at the moment. π Sorry octave girlies, not yet.
π₯ RECSY and Algorithm 705 π₯
The RECSY library and the reference implementation of Algorithm 705 cannot be shipped due to unclear licenses. If you want to compile the examples with support for these codes, you have to provide a shared or static library containing the codes yourself. Perferably, RECSY and Algorithm 705 should be compiled as static library with the -fPIC flag set during compilation. Then they can be enabled in the during the build via
cmake ....... -DRECSY=/path/to/librecsy.a -DGL705=/path/to/libgl705.a
Legal girlies said no, so you gotta bring your own. Slay responsibly. βοΈβ¨
And that's the whole page, bestie!! π This was Version 1.1.2, dated Thu Oct 9 2025 00:00:00, straight from the MEPACK manual β go forth and install, you absolute main character. ππ
π¦ where this page comes from
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms