... | ... | @@ -15,21 +15,38 @@ You must run a set of commands from the terminal to build LMGC90 software for yo |
|
|
|
|
|
## Unix like system (linux, MacOS, WSL) ##
|
|
|
|
|
|
Open a terminal and go to your `lmgc90_user_xxx` directory.
|
|
|
|
|
|
Run the following commands:
|
|
|
```shell
|
|
|
cd build
|
|
|
cmake ..
|
|
|
make
|
|
|
```
|
|
|
On Ubuntu 18 you may need to run :
|
|
|
|
|
|
#### Python selection ####
|
|
|
|
|
|
It is really important that the compilation process get access to the python version that the user want to use with lmgc90. As such, it possible to specify the absolute path to the python executable. For an example, to use python3 on ubuntu 18, one must run:
|
|
|
```shell
|
|
|
cd build
|
|
|
cmake .. -DPYTHON_EXECUTABLE=/usr/bin/python3
|
|
|
make
|
|
|
```
|
|
|
|
|
|
Or if the user prefers to use *virtual environment* (with or without a manager like [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/#) or [miniconda](https://virtualenvwrapper.readthedocs.io/en/latest/#), then there is two changes:
|
|
|
1. the path to the environment must be provided to cmake
|
|
|
2. lmgc90 must be installed in the environment.
|
|
|
|
|
|
For example when using *virtualenvwrapper* and with an environment called *lmgc90* the compilation steps becomes:
|
|
|
```shell
|
|
|
workon lmgc90
|
|
|
cd build
|
|
|
cmake .. -DVENV_PATH=$VIRTUAL_ENV
|
|
|
make
|
|
|
make install
|
|
|
```
|
|
|
|
|
|
#### Optional compilation ####
|
|
|
|
|
|
|
|
|
Instead of simply running `cmake`, you can run `ccmake` or `cmake-gui` to help you changing some
|
|
|
configuration parameters. For examples people interested only in rigid computation can change
|
|
|
the configuration to:
|
... | ... | @@ -52,11 +69,12 @@ make docs |
|
|
It will build the sphinx documentation in `build/docs` directory,
|
|
|
but the one provided should be up-to-date
|
|
|
|
|
|
Our policy is to not mess with default system paths. So instead we advise to
|
|
|
use an environment variable to add to python the path to our build directory.
|
|
|
In general adding the following lines to your *.bashrc* (Linux) or *.profile* (MacOS)
|
|
|
file does the trick. Of course you have to replace *mysourcepath* by the path to
|
|
|
your own `lmgc90_user_xxx` directory (something like `/users/name/LMGC90/lmgc90_user_xxx/` and replacing `xxx` by the version you downloaded).
|
|
|
#### Installation ####
|
|
|
|
|
|
Our policy is to not mess with default system paths. So instead we advise to either using *virtual environment* to install or to use an environment variable to add to python the path
|
|
|
to our build directory. In general adding the following lines to your *.bashrc* (Linux)
|
|
|
or *.profile* (MacOS) file does the trick. Of course you have to replace *mysourcepath*
|
|
|
by the path to your own `lmgc90_user_xxx` directory (something like `/users/name/LMGC90/lmgc90_user_xxx/` and replacing `xxx` by the version you downloaded).
|
|
|
```shell
|
|
|
if [ -z ${PYTHONPATH} ]; then
|
|
|
export PYTHONPATH=mysourcepath/build
|
... | ... | |