Update build_win_msys authored by Adrien Crovato's avatar Adrien Crovato
## Windows - MSYS2 ## Windows - MSYS2
:warning: _**Pre-built binaries available here: [Build](build).**_ :warning: _**Pre-built binaries available here: [Build](build).**_
:warning: _**This page is not maintained anymore, prefer using [WSL](build_win_wsl).**_ :warning: _**This page is not maintained anymore, prefer using [WSL](build_win_wsl).**_
**Install MSYS2** **Install MSYS2**
Get [MSYS2](https://www.msys2.org) and install it where you have read/write privileges (e.g. C:\msys64). Get [MSYS2](https://www.msys2.org) and install it where you have read/write privileges (e.g. C:\msys64).
Open a MSYS terminal and perform basic configuration Open a MSYS terminal and perform basic configuration
```sh ```sh
pacman -Syu pacman -Syu
``` ```
We asked to do so, close the terminal (ignore the warning saying that a process is running), and open a new one When asked to do so, close the terminal (ignore the warning saying that a process is running), and open a new one
```sh ```sh
pacman -Su pacman -Su
``` ```
**Get pre-compiled packages** **Get pre-compiled packages**
Open a MSYS terminal Open a MSYS terminal
```sh ```sh
pacman -S make pacman -S make
pacman -S mingw-w64-x86_64-tools-git pacman -S mingw-w64-x86_64-tools-git
pacman -S mingw-w64-x86_64-gcc-fortran pacman -S mingw-w64-x86_64-gcc-fortran
pacman -S mingw-w64-x86_64-cmake pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-swig pacman -S mingw-w64-x86_64-swig
pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-eigen3 pacman -S mingw-w64-x86_64-eigen3
pacman -S mingw-w64-x86_64-intel-tbb pacman -S mingw-w64-x86_64-intel-tbb
pacman -S mingw-w64-x86_64-openblas pacman -S mingw-w64-x86_64-openblas
# python 3 # python 3
pacman -S mingw-w64-x86_64-vtk pacman -S mingw-w64-x86_64-vtk
pacman -S mingw-w64-x86_64-python3 pacman -S mingw-w64-x86_64-python3
pacman -S mingw-w64-x86_64-python3-numpy pacman -S mingw-w64-x86_64-python3-numpy
pacman -S mingw-w64-x86_64-python3-scipy pacman -S mingw-w64-x86_64-python3-scipy
pacman -S mingw-w64-x86_64-python3-matplotlib pacman -S mingw-w64-x86_64-python3-matplotlib
# optional (needed to build the documentation) # optional (needed to build the documentation)
[pacman -S mingw-w64-x86_64-doxygen] [pacman -S mingw-w64-x86_64-doxygen]
[pacman -S mingw-w64-x86_64-graphviz] [pacman -S mingw-w64-x86_64-graphviz]
``` ```
*Notes*: *Notes*:
- A python binding for vtk is currently broken (vtkIOMySQL). To disable it, comment the related line in path/to/msys/mingw64/lib/python3.8/site-packages/vtkmodules/all.py (around line 86: ```from .vtkIOMySQL import *```) - A python binding for vtk is currently broken (vtkIOMySQL). To disable it, comment the related line in path/to/msys/mingw64/lib/python3.8/site-packages/vtkmodules/all.py (around line 86: ```from .vtkIOMySQL import *```)
- nb lpx : 11/2020 : the upper problem seems to have been solved - nb lpx : 11/2020 : the upper problem seems to have been solved
**Compile packages** **Compile packages**
1) MUMPS (optional) 1) MUMPS (optional)
Get [MUMPS with CMake](https://gitlab.uliege.be/am-dept/MN2L/mumps-4.10.0). Get [MUMPS with CMake](https://gitlab.uliege.be/am-dept/MN2L/mumps-4.10.0).
Open a MSYS-MINGW64 terminal Open a MSYS-MINGW64 terminal
```sh ```sh
mkdir build && cd build mkdir build && cd build
export MINGW_LOC=/path/to/msys/mingw export MINGW_LOC=/path/to/msys/mingw
cmake -C ../Cmake/msys.cmake .. cmake -C ../Cmake/msys.cmake ..
make [-j4] install make [-j4] install
``` ```
2) MS-MPI (optional) 2) MS-MPI (optional)
Install [MSMPI](https://www.microsoft.com/en-us/download/details.aspx?id=100305) and the related SDK and copy the header Install [MSMPI](https://www.microsoft.com/en-us/download/details.aspx?id=100305) and the related SDK and copy the header
```sh ```sh
cp "$MSMPI_INC/mpi.h" /path/to/msys/mingw64/include cp "$MSMPI_INC/mpi.h" /path/to/msys/mingw64/include
``` ```
Modify mpi.h by adding `#include <stdint.h>` just above `typedef int_64t MPI_Aint;` Modify mpi.h by adding `#include <stdint.h>` just above `typedef int_64t MPI_Aint;`
3) mpi4py (optional) 3) mpi4py (optional)
Get [mpi4py](https://bitbucket.org/mpi4py/mpi4py/downloads/). Open a MSYS-MINGW terminal and install mpi4py Get [mpi4py](https://bitbucket.org/mpi4py/mpi4py/downloads/). Open a MSYS-MINGW terminal and install mpi4py
```sh ```sh
python setup.py build python setup.py build
python setup.py install python setup.py install
``` ```
**Install packages** **Install packages**
Install [gmsh](http://geuz.org/gmsh) and add it to MSYS path. Open a WINDOWS console (admin mode) Install [gmsh](http://geuz.org/gmsh) and add it to MSYS path. Open a WINDOWS console (admin mode)
```msdos ```msdos
mkdir \path\to\msys\usr\local\bin mkdir \path\to\msys\usr\local\bin
mklink \path\to\msys\usr\local\bin\gmsh.exe "\path\to\gmsh" mklink \path\to\msys\usr\local\bin\gmsh.exe "\path\to\gmsh"
``` ```
**Build** **Build**
Get [git for windows](https://git-scm.com/download/win), or alternatively, install git using pacman (`pacman -S mingw-w64-x86_64-git`), then clone DART Get [git for windows](https://git-scm.com/download/win), or alternatively, install git using pacman (`pacman -S mingw-w64-x86_64-git`), then clone DART
```sh ```sh
git lfs install # enable large file support git lfs install # enable large file support
git clone git@gitlab.uliege.be:am-dept/dartflo.git git clone git@gitlab.uliege.be:am-dept/dartflo.git
cd dartflo cd dartflo
git submodule init git submodule init
git submodule update git submodule update
``` ```
Compile and test DART in a MSYS-MINGW terminal Compile and test DART in a MSYS-MINGW terminal
```sh ```sh
mkdir build && cd build mkdir build && cd build
export INCLUDE="${INCLUDE}:/mingw64/include/eigen3" export INCLUDE="${INCLUDE}:/mingw64/include/eigen3"
cmake -C ../ext/amfe/CMake/msys2.cmake .. cmake -C ../ext/amfe/CMake/msys2.cmake ..
make [-j4] make [-j4]
ctest [-j4] ctest [-j4]
[make install] [make install]
``` ```
For a complete list of options, refer to the [build](Build) page. For a complete list of options, refer to the [build](Build) page.
*Note*: test tbox/mpi/helloworld.py requires MS-MPI and mpi4py to work *Note*: test tbox/mpi/helloworld.py requires MS-MPI and mpi4py to work
**Run an example** **Run an example**
From the DART root directory, From the DART root directory,
```sh ```sh
python run.py dart/tests/lift.py [-k4] [--nogui] python run.py dart/tests/lift.py [-k4] [--nogui]
``` ```
\ No newline at end of file