OGS6 compilation with Intel MKL and MFRONT

Hi all,

I am trying to set up a slope model that considers the rainfall and water level fluctuation (Richards Mechanics). I would like to compile OGS6 enabling Intel MKL and MFront, such that PARDISO solver can be used. The operating system I am using is Ubuntu-24.04.
However, I always failed in configuring OGS6 with MKL. I am following the instruction here: INTEL MKL: undefined symbol .
I have already installed the Intel MKL toolkit. The MKL version is 2024.2.1. The configuration command I am using is:
sudo cmake -S ../../ogs-master/ -B ./ -DMKL_DIR=“/opt/intel/oneapi/mkl/2024.2” -DOGS_USE
_MKL=“ON” -DCMAKE_BUILD_TYPE=“Release” -DOGS_USE_MFRONT=“ON”
The error informaton is attached below.


It shows that I did not source the MKL environment. However, I have already sourced the MKL environment in the .bashrc file.
Could anybody help me find out the solution?

Best regards,
Miao

Hi Miao,

you shouldn’t use sudo to make directories and run cmake. It will run these commands as root user leading to unnecessary security risks/risk of messing up your system if something goes wrong.

In addition, sudo might unset environment variables that you’ve set before (e.g. by sourcing one api in .bashrc), and it will not use your user’s .bashrc, but probably root’s.

Please try again without sudo. sudo is only necessary for apt-get install to install Ubuntu packages.

Best regards,
Christoph

Hi Christoph,

Thank you so much for your solution. It is really helpful. I found that the files in the original directory, somehow, becomes “Read-only”. This is why I use “sudo” and have the aboved error information.
I moved the ogs source code to another location, then I remove the sudo following your advice. This time, the configuration and build works well. I finally have the OGS6 compiled with MKL and MFRONT.