|
|
# Windows
|
|
|
|
|
|
Here are detailed instructions on how to build GmshDDM on Windows, using Cygwin and the MinGW compilers. The resulting programs do *not* depend on the cygwin DLL, i.e. are pure Windows executables.
|
|
|
|
|
|
## Cygwin and Windows PATH
|
|
|
|
|
|
Install cygwin from https://www.cygwin.com. Accept all defaults and select View "Full". Install the following packages:
|
|
|
* mingw64_x86_64-gcc-g++
|
|
|
* mingw64_x86_64-gcc-fortran
|
|
|
* cmake
|
|
|
* make
|
|
|
* openssh
|
|
|
* python3
|
|
|
* autoconf
|
|
|
* automake
|
|
|
* openssh
|
|
|
* git
|
|
|
* curl
|
|
|
* unzip
|
|
|
|
|
|
Type "path" in the Windows search box and choose "Edit the system environment variables". Go to "Advanced" and select "Environment variables". If the `PATH` variable does not exist (note the ALL CAPS!), create it and set it to
|
|
|
```
|
|
|
C:\cygwin64\usr\local\bin\;C:\cygwin64\usr\local\lib;C:\cygwin64\usr\local\petsc\complex_mumps_seq\lib;C:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin
|
|
|
```
|
|
|
If `PATH` already exists, append the value (don't forget the semicolon!).
|
|
|
|
|
|
## Cygwin terminal and Bash environment variables
|
|
|
|
|
|
Open the Cygwin terminal.
|
|
|
|
|
|
Edit the `~/.bash_profile` and add the following at the end:
|
|
|
```
|
|
|
export PATH="${PATH}:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:/usr/local/bin"
|
|
|
export CXX=x86_64-w64-mingw32-g++
|
|
|
export CC=x86_64-w64-mingw32-gcc
|
|
|
export FC=x86_64-w64-mingw32-gfortran
|
|
|
export PETSC_DIR=/usr/local/petsc
|
|
|
export PETSC_ARCH=complex_mumps_seq
|
|
|
```
|
|
|
Then
|
|
|
```shell
|
|
|
cd
|
|
|
source .bash_profile
|
|
|
```
|
|
|
|
|
|
## PETSc
|
|
|
|
|
|
### Method 1: download a pre-built binary package
|
|
|
|
|
|
```shell
|
|
|
cd /usr/local
|
|
|
curl -O https://gmsh.info/beta/petsc-Windows64.zip
|
|
|
unzip petsc-Windows64.zip
|
|
|
```
|
|
|
|
|
|
### Method 2: build from source
|
|
|
|
|
|
Download and configure PETSc:
|
|
|
```shell
|
|
|
cd /usr/local
|
|
|
git clone -b maint https://gitlab.com/petsc/petsc.git petsc
|
|
|
cd petsc
|
|
|
./configure --CXX=x86_64-w64-mingw32-g++ --CC=x86_64-w64-mingw32-gcc --FC=x86_64-w64-mingw32-gfortran --with-clanguage=cxx --with-debugging=0 --with-mpi=0 --with-fortran-bindings=0 --download-mumps=yes --with-mumps-serial --with-shared-libraries=1 --with-x=0 --with-ssl=0 --with-scalar-type=complex --download-f2cblaslapack=1
|
|
|
```
|
|
|
|
|
|
Edit `complex_mumps_seq/include/petscconf.h` and set
|
|
|
```
|
|
|
#undef PETSC_HAVE_UNISTD_H
|
|
|
#undef PETSC_HAVE_GETPAGESIZE
|
|
|
#undef PETSC_HAVE_SLEEP
|
|
|
```
|
|
|
|
|
|
Build PETSc:
|
|
|
```shell
|
|
|
make
|
|
|
```
|
|
|
|
|
|
## Gmsh
|
|
|
|
|
|
### Method 1: download our pre-built binary package
|
|
|
|
|
|
```shell
|
|
|
cd
|
|
|
curl -O https://gmsh.info/bin/Windows/gmsh-git-Windows64-sdk.zip
|
|
|
unzip gmsh-git-Windows64-sdk.zip
|
|
|
mkdir /usr/local/include/
|
|
|
cp gmsh-git-Windows64-sdk/include/* /usr/local/include/
|
|
|
cp gmsh-git-Windows64-sdk/lib/* /usr/local/lib/
|
|
|
cp gmsh-git-Windows64-sdk/bin/* /usr/local/bin/
|
|
|
```
|
|
|
|
|
|
### Method 2: build from source
|
|
|
|
|
|
Download, build and install Gmsh (here we build a barebones version - see the Gmsh wiki to compile a full-featured version with OpenCASCADE, the graphical user interface, ...):
|
|
|
```shell
|
|
|
cd
|
|
|
git clone https://gitlab.onelab.info/gmsh/gmsh.git
|
|
|
cd gmsh
|
|
|
mkdir build
|
|
|
cd build
|
|
|
cmake -DENABLE_BUILD_DYNAMIC=1 -DENABLE_PETSC=1 -DENABLE_OPENMP=1 ..
|
|
|
make install
|
|
|
```
|
|
|
|
|
|
## GmshFEM
|
|
|
|
|
|
Build and install GmshFEM:
|
|
|
```shell
|
|
|
cd
|
|
|
git clone https://gitlab.onelab.info/gmsh/fem.git
|
|
|
cd fem
|
|
|
mkdir build
|
|
|
cd build
|
|
|
cmake ..
|
|
|
make install
|
|
|
``` |