v0.16.3
Loading...
Searching...
No Matches
Installation with Spack (Scripts)

We prefer to use the scripts provided below to install user version or developer version of MoFEM with Spack as a package manager.

‍We do recommend you to use the scripts below for installation; however, if you would like to read about different ways to install MoFEM, you can have a look at install_spack

User version

User version of MoFEM installation provides only binary files (not the source codes) that allow users to run analyses in MoFEM straightaway. You may wish follow these steps for installation that will include binary (executable) files of Basic User Module and Fracture Module

  • Locate the directory where you would like to install MoFEM
  • Download installation script to that directory install_mofem_user.sh
  • Change mode of the script (if neccesary)
    chmod +x install_mofem_user.sh
  • Run the script (sudo privileges may be required)
    ./install_mofem_user.sh
  • Test run elasticity program
    cd YOUR_INSTALLATION_DIRECTORY
    cd mofem_install/um_view/elasticity
    ./elasticity -my_file LShape.h5m -my_order 2
  • Test run fracture_mechanics program
    cd YOUR_INSTALLATION_DIRECTORY
    cd mofem_install/um_view/fracture_mechanics
    ./crack_propagation -my_file examples/analytical_bc/out_10.h5m -my_order 2 -my_ref 0

Developer version

Developer version of MoFEM installation provides you with highest flexibility with all the source codes. You can experiment the codes, create your own module, and always stay up-to-date to the latest developement of MoFEM. You may wish to follow these steps for installation that will include source code and executables of Core Library, Basic User Module, and Fracture Module with both release and debug build types

  • Locate the directory where you would like to install MoFEM
  • Download installation script to that directory install_mofem_developer.sh
  • Change mode of the script (if neccesary)
    chmod +x install_mofem_developer.sh
  • Run the script (sudo privileges may be required)
    ./install_mofem_developer.sh
  • Test run elasticity program
    cd YOUR_INSTALLATION_DIRECTORY
    cd mofem_install/mofem-cephas/mofem/users_modules/um-build-RelWithDebInfo-abcd1234/tutorials/vec-0_elasticity/
    ./elastic_2d -file_name plate.cub -my_order 2
    where abcd1234 in um-build-RelWithDebInfo-abcd1234 is the package hash and can different every time you install MoFEM.
  • Test run fracture_mechanics program
    cd YOUR_INSTALLATION_DIRECTORY
    cd mofem_install/mofem-cephas/mofem/users_modules/um-build-RelWithDebInfo-abcd1234/mofem_um_fracture_mechanics
    ./crack_propagation -my_file examples/analytical_bc/out_10.h5m -my_order 2 -my_ref 0

Compile codes and add new module in MoFEM

For developer, you may wish to have a look at these two tutorials to compile codes and add new module in MoFEM

Embedded Python

cmake/FindPython.cmake discovers the Python interpreter and embedding library with CMake's FindPython3 module on Linux and macOS. By default it uses PETSc's interpreter; -DPython3_EXECUTABLE=/path/to/python3 selects another installation. When needed, -DPython3_ROOT_DIR=/path/to/python also hints its development files. Boost.Python and Boost.NumPy are selected for that interpreter's major and minor version. Their use requires matching Python development headers and libraries.

The generated MoFEMConfig.cmake exposes MoFEM_PYTHON_EXECUTABLE, MoFEM_PYTHON_VERSION, MoFEM_PYTHON_INCLUDE_DIRS and MoFEM_PYTHON_LIBRARIES. The last variable contains the Python3::Python target when embedding support is available, so installed user modules can reuse the same dependency without parsing python3-config output.

Note
If you have issues installing MoFEM, please let us know on MoFEM Q&A. Enjoy MoFEM!