MSYS2 environmentThis document describes how to install TFEL/MFront on Windows plateform using the MSYS2 environment.
MSYS2MSYS2MSYS2 is a
collection of GNU utilities, in particular make which is
used by MFront. It also provides a convenient shell which
is far more easier to use than the DOS terminal provided by
the cmd command.
MSYS2Open an MSYS2 MSYS
terminal and run:
$ pacman -SyuClose the terminal after completion.
Open a MSYS2
MINGW64 terminal and run:
$ pacman -S mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-eigen3 \
mingw-w64-x86_64-pybind11 \
mingw-w64-x86_64-python \
mingw-w64-x86_64-python-numpy \
mingw-w64-x86_64-python-matplotlib \
mingw-w64-x86_64-python-setuptools \
gitThese packages supply the compiler, cmake, numerical
libraries, and Python bindings that TFEL
depends on.
TFEL
repositoryGo to a directory where you want to download the TFEL sources and run:
$ git clone https://github.com/thelfer/tfel.git
$ cd tfel
$ mkdir -p build
$ cd buildThen run:
$ cmake .. -G "MinGW Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/mingw64 \
-DPYTHON_EXECUTABLE=/mingw64/bin/python \
-Denable-python=ON \
-Denable-python-bindings=ON
TFELCompile the project using:
$ mingw32-make -jYYNote: YY corresponds to the number of parallel jobs (for
example, a CPU with 12 threads → -j12).
Then install it with:
$ mingw32-make installTo check whether MFront has been successfully installed, run:
$ which mfrontIf the installation succeeded, this command should return the path to
the mfront executable. Alternatively, TFEL can also be
installed using the official package by running:
$ pacman -S mingw-w64-x86_64-tfelHowever, this installation method does not provide the
Cast3M and Python interfaces.
Create a file named env.sh and add the following
lines:
$ export TFELHOME=/mingw64
$ export PATH=/mingw64/bin:$PATH
$ export LD_LIBRARY_PATH=/mingw64/lib:$LD_LIBRARY_PATH
$ export PYTHONPATH=/mingw64/bin/python3.XX/site-packages
$ export MAKE=mingw32-make.exeNote: XX corresponds to the Python version
installed in MSYS2.
Before using TFEL/MFront, load the environment with:
$ source env.shOnce done, MFront can be used as “usual” (like in Posix environments)
in MSYS2.