Building GetFEM package for Windows

Hello Kostas,

May I ask which MPIs you used for C and FORTRAN for the installation?

I am having trouble during the cmake process in the Intel oneAPI command prompt for Intel 64 for Visual Studio, where I get the error messages

C:\Users\Admin\Documents\Important Files\GT\Research\getfem_windows_no_edits\mumps>cmake -B build -Dparallel=OFF -DBUILD_COMPLEX=ON -DBUILD_COMPLEX16=ON -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="E:\\opt"
-- MUMPS 5.7.3.2 upstream 5.7.3 install prefix: E:/opt
-- CMake 4.0.1  Toolchain
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_LIB_NAMES MPI_Fortran_F77_HEADER_DIR MPI_Fortran_MODULE_DIR MPI_Fortran_WORKS)
CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:227 (message):
  Could NOT find MPI (missing: MPI_C_FOUND MPI_Fortran_FOUND C Fortran)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-4.0/Modules/FindPackageHandleStandardArgs.cmake:591 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-4.0/Modules/FindMPI.cmake:1845 (find_package_handle_standard_args)
  CMakeLists.txt:50 (find_package)


-- Configuring incomplete, errors occurred!

I have Microsoft MPI installed for C, but it does not seem to be recognized by cmake.

Sincerely,
Eric A. Comstock

No support for MPI parallel build in the cmake build system for GetFEM. I would recommend you to succeed in building the sequential version first before trying anything else.

As a second step you can try to build with OpenMP parallelization, which is theoretically supported in the cmake build.

Then for adding MPI support to the cmake build system we need to edit the CMakeList.txt file accordingly.

1 Like

Hello Kostas,

Thank you so much!

I am going off of the post from March 5th, 2024, and was on the

cmake -B build -Dparallel=OFF -DBUILD_COMPLEX=ON -DBUILD_COMPLEX16=ON -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="E:\\opt"

step. How do I change this to not require the MPI software? It caused a fatal error in my installation.

Sincerely,
Eric Comstock

It sounds like cmake on your system picks up the MPI version of the compilers as your default C++/Fortran compilers. This is not GetFEM specific. If this is the case, you need to tell cmake what compiler to use

Use the cmake options:
-DCMAKE_C_COMPILER=...
-DCMAKE_CXX_COMPILER=...

for that purpose.

Hello Kostas,

Thank you again!

It turned out that I needed an additional option on cmake, -DMUMPS_parallel=no, in addition to -Dparallel=OFF, since the CMakeLists.txt file required MPI components of C and Fortran if it was not given as no on lines 49-50.

My code for this step was

C:\Users\Admin\Documents\Important Files\GT\Research\getfem_windows_no_edits\mumps>cmake -B build -Dparallel=OFF -DBUILD_COMPLEX=ON -DBUILD_COMPLEX16=ON -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="E:\\opt" -DMUMPS_parallel=no
-- MUMPS 5.7.3.2 upstream 5.7.3 install prefix: E:/opt
-- CMake 4.0.1  Toolchain
-- MKL_VERSION: 2025.1.0
-- MKL_ROOT: C:/Program Files (x86)/Intel/oneAPI/mkl/latest
-- MKL_ARCH: intel64
-- MKL_LINK: None, set to ` dynamic` by default
-- MKL_INTERFACE_FULL: intel_lp64
-- MKL_THREADING: sequential
-- MKL_MPI: None, set to ` intelmpi` by default
-- Found C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_scalapack_lp64_dll.lib
-- Found DLL: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/bin/mkl_scalapack_lp64.2.dll
-- Found C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_cdft_core_dll.lib
-- Found DLL: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/bin/mkl_cdft_core.2.dll
-- Found C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_intel_lp64_dll.lib
-- Found C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_sequential_dll.lib
-- Found DLL: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/bin/mkl_sequential.2.dll
-- Found C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_core_dll.lib
-- Found DLL: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/bin/mkl_core.2.dll
-- Found C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/mkl_blacs_lp64_dll.lib
-- Found DLL: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/bin/mkl_blacs_lp64.2.dll
-- Performing Test LAPACK_s_FOUND
-- Performing Test LAPACK_s_FOUND - Success
-- Performing Test LAPACK_d_FOUND
-- Performing Test LAPACK_d_FOUND - Success
-- Found LAPACK: $<IF:$<BOOL:OFF>,,>;MKL::mkl_intel_lp64;MKL::mkl_sequential;MKL::mkl_core  found components: MKL
-- Performing Test BLAS_HAVE_dGEMMT
-- Performing Test BLAS_HAVE_dGEMMT - Success
-- Performing Test BLAS_HAVE_sGEMMT
-- Performing Test BLAS_HAVE_sGEMMT - Success
-- Performing Test BLAS_HAVE_cGEMMT
-- Performing Test BLAS_HAVE_cGEMMT - Success
-- Performing Test BLAS_HAVE_zGEMMT
-- Performing Test BLAS_HAVE_zGEMMT - Success
-- MUMPS ORDERING_DEFS: pord
-- MUMPS ORDERING_LIBS: pord
-- MUMPS LAPACK_VENDOR: MKL
-- MUMPS SCALAPACK_VENDOR:
-- [download 0% complete]
...
-- [download 100% complete]
-- Configured MUMPS 5.7.3 source in C:/Users/Admin/Documents/Important Files/GT/Research/getfem_windows_no_edits/mumps/build/mumps-src
-- The following features have been enabled:

 * GEMMT, use GEMMT for symmetric matrix-matrix multiplication
 * ScalaPACK, Scalapack linear algebra library https://www.netlib.org/scalapack/
 * real32, Build with single precision
 * real64, Build with double precision
 * complex32, Build with complex precision
 * complex64, Build with complex16 precision

-- The following features have been disabled:

 * Parallel, parallel MUMPS (using MPI and Scalapack)
 * 64-bit-integer, use 64-bit integers in C and Fortran
 * METIS, METIS graph partitioning https://github.com/KarypisLab/METIS
 * parMETIS, parMETIS parallel graph partitioning
 * Scotch, Scotch graph partitioning https://www.labri.fr/perso/pelegrin/scotch/
 * Openmp, OpenMP API https://www.openmp.org/
 * shared, Build shared libraries

-- Configuring done (26.9s)
-- Generating done (0.2s)
-- Build files have been written to: C:/Users/Admin/Documents/Important Files/GT/Research/getfem_windows_no_edits/mumps/build

However, I got an error at the next step, cmake --build build, which gives the error

C:/Users/Admin/Documents/Important Files/GT/Research/getfem_windows_no_edits/mumps/build/mumps-src/src/mumps_io_err.h:20:22: fatal error: pthread.h: No such file or directory
 # include <pthread.h>
                      ^
compilation terminated.

I am unsure why this is being called, since my installation is not using the parallel versions of anything. Do you know how to get around this?

Sincerely,
Eric Comstock

Oh, I misunderstood your question entirely. I missed that you are still in the compilation of MUMPS, you have not started trying anything with GetFEM yet.

The cmake system that you use for building MUMPS is not the official system of MUMPS, it is created by scivision, and since my post they have changed quite a bit their cmake options.

I can see parallel was replaced with MUMPS_parallel here:

Regarding the pthread.h issue, it might be related to this change:

If you cannot build MUMPS on your system, you should rather ask scivision directly

Hello Kostas,

Okay, that makes sense - thank you!

Sincerely,
Eric Comstock

1 Like

First successful windows build of GetFEM with GitHub actions on the windows-latest runner:

https://github.com/getfem/getfem/actions/runs/21016009911

:partying_face:

No tests run so far, but at least it compiles, again with:

  • intel ifx fortran compiler (used for MUMPS)
  • intel mkl blas/lapack (used both by MUMPS and GetFEM)
  • msvc cl.exe c++ compiler (used for GetFEM and qhull)