Building NGSolve from scratch trouble

I am trying to build NGSolve from source. When I get to the part where I call cmake:

cmake -DUSE_MPI=ON -DUSE_MKL=ON -DUSE_OCC=ON -DUSE_MPI=ON -DUSE_MUMPS=ON -DUSE_PARDISO=ON -DUSE_UMFPACK=ON -DMKL_ROOT=/usr/share/intel-mkl -DCMAKE_INSTALL_PREFIX={BASEDIR}/ngsolve-install {BASEDIR}/ngsolve-src

this happens:

– Configuring incomplete, errors occurred!
See also “/home/walker/ngsuite/ngsolve-build/netgen/CMakeFiles/CMakeOutput.log”.
CMake Warning (dev) at cmake/SuperBuild.cmake:175 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT variables.
Run “cmake --help-policy CMP0074” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

CMake variable MKL_ROOT is set to:

/usr/share/intel-mkl

For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
CMakeLists.txt:56 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

– Could NOT find MKL (missing: MKL_DIR)
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MKL (missing: MKL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/cmake_modules/FindMKL.cmake:151 (find_package_handle_standard_args)
cmake/SuperBuild.cmake:175 (find_package)
CMakeLists.txt:56 (include)

I’m pretty sure that is the correct directory for MKL. However, it seems that cmake is just ignoring it. What should I do?

Hi,

there some changes to how NGSolve tries to find MKL, so that now it uses the oneAPI MKLConfig.cmake script to locate MKL. Maybe give it a try without specifying MKL_ROOT? Before this change to ngsolve, I used the flag -DMKL_LIBRARY=${MKL_ROOT}/lib/libmkl_rt.so.2 which helped to locate MKL.

Best wishes,
Henry

Ok, so I should install the oneAPI MKL stuff. I didn’t do that.

The actual flag I had to pass to cmake is:

-DMKL_INCLUDE_DIR=/usr/include/mkl

In other words, MKL_ROOT is not used anymore (NGSolve webpage about cmake flags is out of date).

Another issue:

So I proceed with “make”, and it hangs when trying to download mumps. Apparently, the URL for downloading it: http://mumps.enseeiht.fr/MUMPS_5.2.0.tar.gz

is no longer active. Also, it seems one is really supposed to get MUMPS through the official website. I’m trying to do that now. But what version is supported by NGSolve?

Alright, I made a little more progress. I was able to get the MUMPS tar ball, with the correct checksum.

However, when I proceed with “make”, it fails:

walker@LAPTOP-NGO6EPCF:~/ngsuite/ngsolve-build$ make
[ 0%] Built target check_submodules_start
[ 19%] Built target project_parmetis
[ 21%] Performing download step (download, verify and extract) for ‘project_mumps’
– verifying file…
file=‘/home/walker/ngsuite/ngsolve-src/external_dependencies/MUMPS_5.2.0.tar.gz’
– File already exists and hash match (skip download):
file=‘/home/walker/ngsuite/ngsolve-src/external_dependencies/MUMPS_5.2.0.tar.gz’
MD5=‘cd6d06f27ce2689eb0436e41fcc9caed’
– extracting…
src=‘/home/walker/ngsuite/ngsolve-src/external_dependencies/MUMPS_5.2.0.tar.gz’
dst=‘/home/walker/ngsuite/ngsolve-build/dependencies/src/project_mumps’
– extracting… [tar xfz]
– extracting… [analysis]
– extracting… [rename]
– extracting… [clean up]
– extracting… done
[ 23%] Performing update step for ‘project_mumps’
[ 26%] No patch step for ‘project_mumps’
[ 28%] No configure step for ‘project_mumps’
[ 30%] Performing build step for ‘project_mumps’
ana_orderings_wrappers_m.F:315:39:

314 | CALL MUMPS_COPY_INT_32TO64 (FRERE(1), NCMP, FRERE8)
| 2
315 | CALL MUMPS_COPY_INT_32TO64 (OPTIONS_METIS, LOPTIONS_METIS,
| 1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
ana_orderings_wrappers_m.F:318:29: …

I stopped the output. Similar errors are reported.

I guess I have the wrong compiler configured?? Any suggestions?

-Shawn

Ok, I was able to adjust the compiler flags, and it get past that previous post.

However, it seems to get hung up on MUMPS:

(NGS) walker@LAPTOP-NGO6EPCF:~/ngsuite/ngsolve-build$ make -j4
[ 38%] Built target project_parmetis
[ 38%] Built target suitesparse
[ 40%] Performing update step for ‘project_mumps’
[ 42%] Performing build step for ‘netgen_project’
make[3]: *** No targets specified and no makefile found. Stop.
make[2]: *** [CMakeFiles/netgen_project.dir/build.make:86: dependencies/src/netgen_project-stamp/netgen_project-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:150: CMakeFiles/netgen_project.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 45%] No patch step for ‘project_mumps’
[ 47%] No configure step for ‘project_mumps’
[ 47%] Built target check_submodules_start
[ 50%] Performing build step for ‘project_mumps’
make[3]: warning: -j1 forced in submake: resetting jobserver mode.
[ 52%] No install step for ‘project_mumps’
[ 54%] Completed ‘project_mumps’
[ 59%] Built target project_mumps
make: *** [Makefile:156: all] Error 2

What is the issue? It found MUMPS previously and was able to compile.

Also, I noticed in-between yesterday and today, the install script changed the MUMPS version from 5.2.0 to 5.0.2. Was this a mistake?

Hi Shawn,

I was about to fix your issues, yes the other Version was a mistake.

Also there was an issue with finding MKL Scalapack (a fix is in the pipeline and will be uploaded soon).

Best,
Matthias

Edit: The code is now up to date.

Ok, thanks. But in the meantime, I turned off MUMPS. I then ran into an issue with Pardiso. When I run cmake, I get this:

– Could NOT find MKL (missing: MKL_DIR)

Even if I include a flag: -DMKL_DIR=/the_path/

I still get that error. If I proceed with “make”, it goes through most stuff, except Pardiso.

Do I need to set a cmake policy? There is something about this:

Policy CMP0074 is not set: find_package uses _ROOT variables.
Run “cmake --help-policy CMP0074” for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

It seems that MKL_ROOT is ignored because of this policy. Do I need to change it? If so, then I have to modify the cmake files.

I always set MKLROOT and MKL_ROOT and I vaguely remember there is a reason for it… I think the find package needs both set

Are you kidding me? That is ridiculous.

Ok, I’m making slow progress. It seems that MKLROOT should be an environment variable. So I did that. However, when I run the following cmake command:

cmake -DUSE_MPI=ON -DUSE_MKL=ON -DMKL_INCLUDE_DIR=/opt/intel/oneapi/mkl/2023.2.0/include -DMKL_ROOT=/opt/intel/oneapi -DUSE_MUMPS=ON -DCMAKE_INSTALL_PREFIX={BASEDIR}/ngsolve-install {BASEDIR}/ngsolve-src

I get this:

…stuff…
– Found MKL: intelmpi
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MKL (missing: MKL_INCLUDE)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/local/lib/cmake/mkl-2023.2.0/MKLConfig.cmake:438 (find_package_handle_standard_args)
cmake/cmake_modules/FindMKL.cmake:36 (find_package)
cmake/SuperBuild.cmake:175 (find_package)
CMakeLists.txt:58 (include)

– Configuring incomplete, errors occurred!
See also “/home/walker/ngsuite/ngsolve-build/CMakeFiles/CMakeOutput.log”.


It says it is missing MKL_INCLUDE. I have not gotten this before; I got a missing a MKL_INCLUDE_DIR before, but not this.

Any suggestions?

-Shawn

I’m having better luck now…

Ok, I succeeded in compiling from source. With MPI and MKL. netgen works and I can run a navier-stokes example. However, I have an issue with jupyter notebook. I’ll post another thread.

Ok, I went back and tried to add OpenCascade to my cmake command with:
-DUSE_OCC=ON

After cmake, I run make, and I eventually get this:
No rule to make target ‘/usr/lib/x86_64-linux-gnu/libtbb.so’, needed by ‘libnglib.so’. Stop.

What exactly is the problem? Do I need to install something else beforehand? Note: I also added these flags to my cmake:
-DUSE_PARDISO=ON -DUSE_UMFPACK=ON

I was able to fix this by installing this package:

sudo apt-get install libtbb-dev

“make” goes further, but then I get this error message:

[ 86%] Building CXX object CMakeFiles/nglib.dir/nglib/nglib_occ.cpp.o
[ 87%] Linking CXX shared library libnglib.so
/usr/bin/ld: cannot find -lXi: No such file or directory
collect2: error: ld returned 1 exit status
make[8]: *** [CMakeFiles/nglib.dir/build.make:2674: libnglib.so] Error 1
make[7]: *** [CMakeFiles/Makefile2:567: CMakeFiles/nglib.dir/all] Error 2
make[6]: *** [Makefile:166: all] Error 2
make[5]: *** [CMakeFiles/netgen.dir/build.make:89: dependencies/src/netgen-stamp/netgen-build] Error 2
make[4]: *** [CMakeFiles/Makefile2:85: CMakeFiles/netgen.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/netgen_project.dir/build.make:86: dependencies/src/netgen_project-stamp/netgen_project-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:150: CMakeFiles/netgen_project.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Any suggestions?

can you try something like apt-get install libXi-dev ? I guess you are missing that package somehow

Oh, duh. The flag " -lXi " confused me. I didn’t realize it was a library to download.

Yes, doing:

sudo apt-get -y install libxi-dev

fixed it.