* In the terminal of VS Code, install gmsh-sdk using the script `get_gmsh.cmd` (only once per working copy of the repository)
* In the terminal of VS Code, go to the `lib` folder and install gmsh-sdk and Eigen using the scripts`get_gmsh.cmd`and `get_eigen.cmd`(only once per working copy of the repository)
```
```
cd lib
get_gmsh.cmd
get_gmsh.cmd
get_eigen.cmd
cd ..
```
```
* Add MinGW and gmsh-sdk to your environment by running this script (it should be done each time you re-open VS Code or a new terminal):
* Add MinGW, gmsh-sdk and eigen to your environment by running this script (it should be done each time you re-open VS Code or a new terminal):
```
```
envs\win-mingw64.cmd
envs\windows.cmd
```
```
* Then, in the same terminal, create a build folder:
* Then, in the same terminal, create a build folder:
```
```
...
@@ -32,23 +36,27 @@ make -j 4
...
@@ -32,23 +36,27 @@ make -j 4
```
```
* run a program
* run a program
```
```
gmsh -2 ..\sandbox\mymesh.geo
gmsh -3 ..\srcs\mymesh.geo
bin\myedges.exe ..\sandbox\mymesh.msh
bin\myview.exe ..\srcs\mymesh.msh
```
```
If a window does not show up, it means that you forgot to run `envs\windows.cmd`.
* install gmsh-sdk and Eigen using the script `get_gmsh.sh` and `get_eigen.sh` in the `lib` folder
```
```
cd lib
./get_gmsh.sh
./get_gmsh.sh
./get_eigen.sh
cd ..
```
```
* set the environment variables for cmake
* set the environment variables for cmake
```
```
...
@@ -69,13 +77,13 @@ make -j 4
...
@@ -69,13 +77,13 @@ make -j 4
```
```
* run a program
* run a program
```
```
gmsh -2 ../sandbox/mymesh.geo
gmsh -3 ../srcs/mymesh.geo
./bin/myedges.exe ../sandbox/mymesh.msh
bin/myview.exe ../srcs/mymesh.msh
```
```
# Note about the environment scripts
# Note about the environment scripts
The scripts in the `gmsh-api/envs/` folder add several folders to 3 environment variables so that the system and cmake find the compiler and the libraries correctly:
The scripts in the `math0471/envs/` folder add several folders to 3 environment variables so that the system and cmake find the compiler and the libraries correctly:
*`PATH`: this variable should contain the location of the folder of your `g++` compiler, of `gmsh.exe` and its shared library (`gmsh.dll/so/dylib`),
*`PATH`: this variable should contain the location of the folder of your `g++` compiler, of `gmsh.exe` and its shared library (`gmsh.dll/so/dylib`),
*`LIB`: points to the path of the folder containing `gmsh.lib` (windows) or `gmsh.so` (linux) or `gmsh.dylib` (macOS),
*`LIB`: points to the path of the folder containing `gmsh.lib` (windows) or `gmsh.so` (linux) or `gmsh.dylib` (macOS),
*`INCLUDE`: points to the path of the folder containing the header `gmsh.h`.
*`INCLUDE`: points to the path of the folder containing the header `gmsh.h`.
...
@@ -84,6 +92,6 @@ Instead of using these scripts which should be loaded each time you start a new
...
@@ -84,6 +92,6 @@ Instead of using these scripts which should be loaded each time you start a new
This is done by going to "Settings" on Windows, and typing "env" in the search bar. Then choose the appropriate menu ("modify environment variables").
This is done by going to "Settings" on Windows, and typing "env" in the search bar. Then choose the appropriate menu ("modify environment variables").
On Linux/macOS, you can add/modify environment variables by editing `~/.bashrc` (just copy & paste the contents of `envs/linux-macOS.sh`).
On Linux/macOS, you can add/modify environment variables by editing `~/.bashrc` (just copy & paste the contents of `envs/linux-macos.sh`).