Update faq authored by Rémy Mozul's avatar Rémy Mozul
# Frequently Asked Question #
## <a name=general_questions> General questions </a> ##
###### What is the license of this software ? ######
This software is distributed under the [Free Software CECILL License]()
###### On which OS does it work ? ######
Currently it works on UNIX OS (Linux, Solaris, MacOSX, etc).
Concerning Windows, a pre-compiled version is available for a specific version of Anaconda Python Distribution.
Check the [prerequisites](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/wikis/prerequisites) section
of the wiki.
###### What is needed to install ? ######
Check the [prerequisites](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/wikis/prerequisites) section
of the wiki.
###### I get the message "ImportError: No module named pylmgc90" when running an example, what is wrong ? ######
Python did not find the module with lmgc90. If the path to your build directory is *my_build_path*,
then make sure your ```PYTHONPATH``` environment variable is correctly set with:
```shell
export PYTHONPATH=my_build_path
```
or that you add the path inside your command script with the two lines:
```python
import sys
sys.path.append("my_build_path")
```
###### How to use multi-threaded version ? ####
First the code must be re-compiled (unavailable on Windows).
Go to your build directory (if you followed the instruction of the wiki it should be *lmgc90_user/build*), then type the
following command in your terminal:
```shell
cmake . -DWITH_OPENMP=True
```
Finally before running a computation, you must set two environment variables which are:
```shell
export OMP_SCHEDULE=STATIC
export OMP_NUM_THREADS=n
export OPENBLAS_NUM_THREADS=1
```
where **n** is the number of threads you want to use (usually no more than the number of core available).
Additional informations in: examples/Ateliers/Performance/directions/index.html
## <a name=compile_error> Known compilation errors </a> ##
##### An error arise at the very beginning when running `cmake` command ####
* if the error message is something like:
```Text
CMake generation for this library is not allowed within the source
directory!
Remove the CMakeCache.txt file and try again from another folder, e.g.:
rm -r CMakeCache.txt CMakeFiles
cd <somewhere (preferably a local place on your computer and not a network folder)>
cmake <source directory of LMGC90>
If you really need an in source build, then run : cmake
-DIN_SOURCE_BUILD=ON
Call Stack (most recent call first):
CMakeLists.txt:21 (include)
-- Configuring incomplete, errors occurred!
```
Then it means you issued the `cmake` command within the base of your source
directory. In this case, following the recommendation of the error message
you have to remove, in the source directory the `CMakeCache.txt` file and
the `CMakeFiles` directory. Then you can go back to step where you change of
directory (`cd build`) before continuing the installation process.
##### An error arise when building the `matlib` on Mac OS Yosemite ####
* if the error is something like:
```shell
/usr/include/dispatch/object.h:143:15: error: expected ')' before '^' token
/usr/include/dispatch/object.h:362:3: error: 'dispatch_block_t' has not been declared
dispatch_block_t notification_block);
^
make[5]: *** [CMakeFiles/matlib.dir/src/math/eigmat.cpp.o] Error 1
make[4]: *** [CMakeFiles/matlib.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [src/contribs/matlib-prefix/src/matlib-stamp/matlib-build] Error 2
make[1]: *** [src/contribs/CMakeFiles/matlib.dir/all] Error 2
make: *** [all] Error 2
```
Then you can:
* shut down the MatLib if you do not need it:
```shell
cmake . -DMATLIB_VERSION=none
make
```
* or modifiy the file *src/contribs/MatLib4-LMGC-2015-1/src/math/lapack.h* so that it looks like this:
```
#ifndef ZORGLIB_MATH_LAPACK_H
#define ZORGLIB_MATH_LAPACK_H
#ifndef __has_extension
#define __has_extension(x) 0
#endif
#define vImage_Utilities_h
#define vImage_CVUtilities_h
// config
#include <matlib_macros.h>
```
Then run `make` again.
****
| [back](./Documentation) | [home](./Home) |
# Frequently Asked Question #
## <a name=general_questions> General questions </a> ##
###### What is the license of this software ? ######
This software is distributed under the [Free Software CECILL License]()
###### On which OS does it work ? ######
Currently it works on UNIX OS (Linux, Solaris, MacOSX, etc).
Concerning Windows, a pre-compiled version is available for a specific version of Anaconda Python Distribution.
Check the [prerequisites](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/wikis/prerequisites) section
of the wiki.
###### What is needed to install ? ######
Check the [prerequisites](https://git-xen.lmgc.univ-montp2.fr/lmgc90/lmgc90_user/wikis/prerequisites) section
of the wiki.
###### I get the message "ImportError: No module named pylmgc90" when running an example, what is wrong ? ######
Python did not find the module with lmgc90. If the path to your build directory is *my_build_path*,
then make sure your ```PYTHONPATH``` environment variable is correctly set with:
```shell
export PYTHONPATH=my_build_path
```
or that you add the path inside your command script with the two lines:
```python
import sys
sys.path.append("my_build_path")
```
###### How to use multi-threaded version ? ####
First the code must be re-compiled (unavailable on Windows).
Go to your build directory (if you followed the instruction of the wiki it should be *lmgc90_user/build*), then type the
following command in your terminal:
```shell
cmake . -DWITH_OPENMP=True
```
Finally before running a computation, you must set two environment variables which are:
```shell
export OMP_SCHEDULE=STATIC
export OMP_NUM_THREADS=n
export OPENBLAS_NUM_THREADS=1
```
where **n** is the number of threads you want to use (usually no more than the number of core available).
Additional informations in: examples/Ateliers/Performance/directions/index.html
## <a name=compile_error> Known compilation errors </a> ##
##### An error arise at the very beginning when running `cmake` command ####
* if the error message is something like:
```Text
CMake generation for this library is not allowed within the source
directory!
Remove the CMakeCache.txt file and try again from another folder, e.g.:
rm -r CMakeCache.txt CMakeFiles
cd <somewhere (preferably a local place on your computer and not a network folder)>
cmake <source directory of LMGC90>
If you really need an in source build, then run : cmake
-DIN_SOURCE_BUILD=ON
Call Stack (most recent call first):
CMakeLists.txt:21 (include)
-- Configuring incomplete, errors occurred!
```
Then it means you issued the `cmake` command within the base of your source
directory. In this case, following the recommendation of the error message
you have to remove, in the source directory the `CMakeCache.txt` file and
the `CMakeFiles` directory. Then you can go back to step where you change of
directory (`cd build`) before continuing the installation process.
##### An error arise when building on Mac OS ####
On MacOS, at the time of writing (May 27th 2025) there may be an error during the `make` step:
```
from /Users/mozul/WORK/LMGC90/sources/lmgc90_dev/src/contribs/clipper2-1.4.0/CPP/Clipper2Lib/src/clipper.engine.cpp:10:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:627:35: error: expected primary-expression before 'unsigned'
627 | } __attribute__((aligned(_Alignof(unsigned int))));
| ^~~~~~~~
```
In this case, following these instructions https://fluka-forum.web.cern.ch/t/geoviewer-compilation-error-on-macbook-pro-m4-macos-15-4/7246, you must:
* Check that you are using the Command Line Tools (CLT) 16.3
* `pkgutil --pkg-info=com.apple.pkg.CLTools_Executables`
* Uninstall Xcode if installed
* Remove the command line tools:
* `sudo rm -rf /Library/Developer/CommandLineTools`
* Download and install CLT 16.2 from [Apple Developer website](https://developer.apple.com/download/all/)
* Clean your build directory and start over...
| [back](./Documentation) | [home](./Home) |
|:---------------------|---------------:|
\ No newline at end of file