Thanks dokken.Unfortunately, the HPC system I am using does not have Spack, and I prefer not to use Conda to set up the DOLFINx environment
I will describe whole process.
On HPC, some module coule be load.
module load gcc/13.2.0
module load cmake/3.31.10
module load mkl/2025.2
module load mpi/2021.16
module load anaconda3
Some dependencies for dolfinx is install in $HOME
such that petsc :$HOME/petsc boost :$HOME/boost
They were all installed by me from source code.
I think the most important is FFcx. Since, Iām not sure. I will desctibe FFCx install process.
In the directory: $HOME/wh/download/ffcx/
I run
python3 -m venv ffcx-env
source ffcx-env/bin/activate
pip install numpy cffi
pip install fenics-ffcx fenics-ufl fenics-basix
fenics-basix==0.9.0 fenics-ffcx==0.9.0 fenics-ufl==2024.2.0
After that, Configure DOLFINx with CMake
cmake .. \
-DHDF5_ROOT=$HOME/hdf5 \
-DHDF5_PREFER_PARALLEL=TRUE \
-DPARMETIS_ROOT=$HOME/parmetis-install \
-DCMAKE_INSTALL_PREFIX=$HOME/dolfinx \
-DPython3_EXECUTABLE=$HOME/wh/download/ffcx/ffcx-env/bin/python \
-DCMAKE_MODULE_PATH=$HOME \
-DMETIS_ROOT=$HOME/metis_install \
-DBasix_DIR=$HOME/fenicsx-install/lib64/cmake/basix \
-DPARMETIS_TEST_RUNS=TRUE \
-DMETIS_LIBRARY=$HOME/metis_install/lib/libmetis.so \
-DMETIS_INCLUDE_DIR=$HOME/metis_install/include \
-DCMAKE_INCLUDE_PATH=$HOME/metis_install/include
obtan:
-- The C compiler identification is GNU 11.4.1
-- The CXX compiler identification is GNU 11.4.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found MPI_C: /public/software/oneapi-2025.2/mpi/2021.16/lib/libmpi.so (found suitable version "4.1", minimum required is "3")
-- Found MPI_CXX: /public/software/oneapi-2025.2/mpi/2021.16/lib/libmpicxx.so (found suitable version "4.1", minimum required is "3")
-- Found MPI: TRUE (found suitable version "4.1", minimum required is "3")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_PIPE
-- Performing Test HAVE_PIPE - Success
-- Performing Test HAVE_PEDANTIC
-- Performing Test HAVE_PEDANTIC - Success
-- Performing Test HAVE_DEBUG
-- Performing Test HAVE_DEBUG - Success
-- Performing Test HAVE_O2_OPTIMISATION
-- Performing Test HAVE_O2_OPTIMISATION - Success
-- Found Boost 1.84.0 at /hpcdata/home/research/hzhang01/boost/lib/cmake/Boost-1.84.0
-- Requested configuration: REQUIRED COMPONENTS timer
-- Found boost_headers 1.84.0 at /hpcdata/home/research/hzhang01/boost/lib/cmake/boost_headers-1.84.0
-- Found boost_timer 1.84.0 at /hpcdata/home/research/hzhang01/boost/lib/cmake/boost_timer-1.84.0
-- [x] libboost_timer.so.1.84.0
-- [ ] libboost_timer.a
-- Adding boost_timer dependencies: headers
-- Checking for Basix hints with /hpcdata/home/research/hzhang01/wh/download/ffcx/ffcx-env/bin/python
-- Adding /hpcdata/home/research/hzhang01/wh/download/ffcx/ffcx-env/lib64/python3.9/site-packages/basix to Basix search hints
-- Found HDF5 at /hpcdata/home/research/hzhang01/hdf5/cmake via NO_MODULE. Now trying to extract locations etc.
-- Trying to get properties of target hdf5-shared
-- Found imported configurations: NOCONFIG
-- Start search through imported configurations in the following order: RelWithDebInfo;RELWITHDEBINFO;RELEASE;DEBUG;NOCONFIG
-- Selected imported configuration: NOCONFIG
-- Found HDF5: hdf5-shared (found version "1.14.3") found components: C
-- HDF5_DIR: /hpcdata/home/research/hzhang01/hdf5/cmake
-- HDF5_DEFINITIONS:
-- HDF5_INCLUDE_DIRS: /hpcdata/home/research/hzhang01/hdf5/include
-- HDF5_LIBRARIES: hdf5-shared
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR:
-- HDF5_C_INCLUDE_DIRS: /hpcdata/home/research/hzhang01/hdf5/include
-- HDF5_C_LIBRARY: /hpcdata/home/research/hzhang01/hdf5/lib/libhdf5.so.310.3.0
-- HDF5_C_LIBRARIES: hdf5-shared
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES:
-- Defined targets (if any):
-- ... hdf5::hdf5
-- ... hdf5-static
-- ... hdf5-shared
-- ... hdf5_hl-static
-- ... hdf5_hl-shared
-- Found Python3: /hpcdata/home/research/hzhang01/wh/download/ffcx/ffcx-env/bin/python (found version "3.9.18") found components: Interpreter
-- Asking Python module FFCx for location of ufcx.h...
-- Found UFCx: /hpcdata/home/research/hzhang01/wh/download/ffcx/ffcx-env/lib64/python3.9/site-packages/ffcx/codegeneration (found suitable version "0.9.0", minimum required is "0.9")
CMake Warning at CMakeLists.txt:406 (find_package):
By not providing "FindADIOS2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "ADIOS2", but
CMake did not find one.
Could not find a package configuration file provided by "ADIOS2" (requested
version 2.8.1) with any of the following names:
ADIOS2Config.cmake
adios2-config.cmake
Add the installation prefix of "ADIOS2" to CMAKE_PREFIX_PATH or set
"ADIOS2_DIR" to a directory containing one of the above files. If "ADIOS2"
provides a separate development package or SDK, be sure it has been
installed.
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
-- Checking for one of the modules 'OPTIONAL;PETSc>=3.15;petsc>=3.15'
-- Found PETSc version 3.25.0, prefix: /hpcdata/home/research/hzhang01/petsc
-- Checking for one of the modules 'slepc>=3.15'
-- Could NOT find SCOTCH (missing: SCOTCH_DIR)
-- Checking for package 'SCOTCH-PT'
-- SCOTCH could not be found. Be sure to set SCOTCH_DIR. (missing: SCOTCH_LIBRARIES SCOTCH_INCLUDE_DIRS SCOTCH_TEST_RUNS)
CMake Warning (dev) at CMakeLists.txt:491 (find_package):
Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
variables. Run "cmake --help-policy CMP0144" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
CMake variable PARMETIS_ROOT is set to:
/hpcdata/home/research/hzhang01/parmetis-install
For compatibility, find_package is ignoring the variable, but code in a
.cmake module might still use it.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found ParMETIS: /hpcdata/home/research/hzhang01/parmetis-install/lib/libparmetis.so;/hpcdata/home/research/hzhang01/metis_install/lib/libmetis.so (Required is at least version "4.0.2")
-- Checking for package 'KaHIP'
-- KaHIP could not be found/configured. (missing: KAHIP_INCLUDE_DIRS KAHIP_LIBRARIES KAHIP_TEST_RUNS)
-- The following features have been enabled:
* BUILD_SHARED_LIBS, Build DOLFINx with shared libraries.
* CMAKE_INSTALL_RPATH_USE_LINK_PATH, Add paths to linker search and installed rpath.
* DOLFINX_BASIX_PYTHON, Ask Python basix module for hint where to find Basix C++ install using CONFIG mode.
* DOLFINX_UFCX_PYTHON, Ask Python FFCx module where to find ufcx.h header using MODULE mode. Otherwise use CONFIG mode.
-- The following RECOMMENDED packages have been found:
* PETSc, Portable, Extensible Toolkit for Scientific Computation, <https://petsc.org/>
Linear and nonlinear solvers
* ParMETIS (required version >= 4.0.2), Parallel Graph Partitioning and Fill-reducing Matrix Ordering, <http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview>
Parallel graph partitioning
-- The following REQUIRED packages have been found:
* Threads
* spdlog
* pugixml
* boost_headers (required version == 1.84.0)
* boost_timer (required version == 1.84.0)
* Boost (required version >= 1.70), Boost C++ libraries, <http://www.boost.org>
* Basix (required version >= 0.8)
* MPI
* HDF5, Hierarchical Data Format 5 (HDF5), <https://www.hdfgroup.org/HDF5>
* Python3
* UFCx (required version >= 0.9), Interface for form-compilers (part of FFCx), <https://github.com/fenics/ffcx>
* PkgConfig
-- The following features have been disabled:
* INSTALL_RUNTIME_DEPENDENCIES, Include runtime dependencies in install (Windows-only)
* DOLFINX_SKIP_BUILD_TESTS, Skip build tests for testing usability of dependency packages.
-- The following OPTIONAL packages have not been found:
* ADIOS2 (required version >= 2.8.1), Adaptable Input/Output (I/O) System., <https://adios2.readthedocs.io/en/latest/>
IO, including in parallel
* SCOTCH, Programs and libraries for graph, mesh and hypergraph partitioning, <https://www.labri.fr/perso/pelegrin/scotch>
Parallel graph partitioning
* KaHIP, A family of graph partitioning programs, <https://kahip.github.io/>
Parallel graph partitioning
-- The following RECOMMENDED packages have not been found:
* SLEPc, Scalable Library for Eigenvalue Problem Computations, <http://slepc.upv.es/>
Eigenvalue computation
-- Configuring done (2.8s)
-- Generating done (0.0s)
CMake Warning:
Manually-specified variables were not used by the project:
METIS_INCLUDE_DIR
METIS_ROOT
-- Build files have been written to: /hpcdata/home/research/hzhang01/wh/dolfinx/cpp/build
METIS_INCLUDE_DIR METIS_ROOTwere not used.But I think is unimportant.
After that,I created a Python virtual environment using conda and activated it.
conda create --name wh_dolfinx python=3.10
conda activate wh_dolfinx
Then I ran the following commands in the python/ directory: As describe Installation ā DOLFINx 0.11.0.dev0 documentation
pip install scikit-build-core
python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
pip install --check-build-dependencies --no-build-isolation .
There are some message that you want:
(wh_dolfinx) [hzhang01@login python]$ pip install -v --check-build-dependencies --no-build-isolation .
Using pip 26.0.1 from /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/pip (python 3.10)
Processing ./.
Running command Preparing metadata (pyproject.toml)
2026-04-10 20:44:35,603 - scikit_build_core - WARNING - Could not determine CMake version via --version, got '' '/usr/bin/cmake3: symbol lookup error: /lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_3.0.0\n'
*** scikit-build-core 0.12.2 using CMake 3.31.10 (metadata_wheel)
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.21 in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from fenics-dolfinx==0.9.0) (2.2.6)
Requirement already satisfied: cffi<1.17 in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from fenics-dolfinx==0.9.0) (1.16.0)
Requirement already satisfied: mpi4py in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from fenics-dolfinx==0.9.0) (4.1.1)
Requirement already satisfied: fenics-basix<0.10.0,>=0.9.0 in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from fenics-dolfinx==0.9.0) (0.9.0)
Requirement already satisfied: fenics-ffcx<0.10.0,>=0.9.0 in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from fenics-dolfinx==0.9.0) (0.9.0)
Requirement already satisfied: fenics-ufl<2024.3.0,>=2024.2.0 in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from fenics-dolfinx==0.9.0) (2024.2.0)
Requirement already satisfied: pycparser in /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages (from cffi<1.17->fenics-dolfinx==0.9.0) (3.0)
Building wheels for collected packages: fenics-dolfinx
Running command Building wheel for fenics-dolfinx (pyproject.toml)
2026-04-10 20:44:35,801 - scikit_build_core - WARNING - Could not determine CMake version via --version, got '' '/usr/bin/cmake3: symbol lookup error: /lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_3.0.0\n'
*** scikit-build-core 0.12.2 using CMake 3.31.10 (wheel)
*** Configuring CMake...
loading initial cache file /tmp/tmpawr_to4p/build/CMakeInit.txt
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /public/software/gcc-13.2.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /public/software/gcc-13.2.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/bin/python3.10 (found version "3.10.20") found components: Interpreter Development Development.Module Development.Embed
-- Found MPI_C: /public/software/oneapi-2025.2/mpi/2021.16/lib/libmpi.so (found version "4.1")
-- Found MPI_CXX: /public/software/oneapi-2025.2/mpi/2021.16/lib/libmpicxx.so (found version "4.1")
-- Found MPI: TRUE (found version "4.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Boost 1.84.0 at /hpcdata/home/research/hzhang01/boost/lib/cmake/Boost-1.84.0
-- Requested configuration: REQUIRED COMPONENTS timer
-- Found boost_headers 1.84.0 at /hpcdata/home/research/hzhang01/boost/lib/cmake/boost_headers-1.84.0
-- Found boost_timer 1.84.0 at /hpcdata/home/research/hzhang01/boost/lib/cmake/boost_timer-1.84.0
-- [x] libboost_timer.so.1.84.0
-- [ ] libboost_timer.a
-- Adding boost_timer dependencies: headers
-- Checking for Basix hints with /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/bin/python3.10
-- Adding /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/basix to Basix search hints
-- Found HDF5 at /hpcdata/home/research/hzhang01/hdf5/cmake via NO_MODULE. Now trying to extract locations etc.
-- Trying to get properties of target hdf5-shared
-- Found imported configurations: NOCONFIG
-- Start search through imported configurations in the following order: Release;RELWITHDEBINFO;RELEASE;DEBUG;NOCONFIG
-- Selected imported configuration: NOCONFIG
-- Found HDF5: hdf5-shared (found version "1.14.3") found components: C
-- HDF5_DIR: /hpcdata/home/research/hzhang01/hdf5/cmake
-- HDF5_DEFINITIONS:
-- HDF5_INCLUDE_DIRS: /hpcdata/home/research/hzhang01/hdf5/include
-- HDF5_LIBRARIES: hdf5-shared
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR:
-- HDF5_C_INCLUDE_DIRS: /hpcdata/home/research/hzhang01/hdf5/include
-- HDF5_C_LIBRARY: /hpcdata/home/research/hzhang01/hdf5/lib/libhdf5.so.310.3.0
-- HDF5_C_LIBRARIES: hdf5-shared
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES:
-- Defined targets (if any):
-- ... hdf5::hdf5
-- ... hdf5-static
-- ... hdf5-shared
-- ... hdf5_hl-static
-- ... hdf5_hl-shared
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
-- Checking for one of the modules 'PETSc;petsc'
-- Found DOLFINx at /hpcdata/home/research/hzhang01/dolfinx/lib64/cmake/dolfinx
-- Found petsc4py include directory at /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/petsc4py/include
-- Found mpi4py include directory at /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/mpi4py/include
-- Configuring done (1.6s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/tmpawr_to4p/build
*** Building project with Ninja...
[1/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/dolfinx.cpp.o
[2/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/nb_static_property.cpp.o
[3/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/implicit.cpp.o
[4/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/trampoline.cpp.o
[5/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/error.cpp.o
[6/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/nb_internals.cpp.o
[7/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/nb_ndarray.cpp.o
[8/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/common.cpp.o
[9/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/nb_enum.cpp.o
[10/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/nb_func.cpp.o
[11/24] Building CXX object CMakeFiles/nanobind-static.dir/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/nanobind/src/nb_type.cpp.o
[12/24] Linking CXX static library libnanobind-static.a
[13/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/log.cpp.o
[14/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/graph.cpp.o
[15/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/common.cpp.o
[16/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/io.cpp.o
[17/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/geometry.cpp.o
[18/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/refinement.cpp.o
[19/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/petsc.cpp.o
[20/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/la.cpp.o
[21/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/mesh.cpp.o
[22/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/fem.cpp.o
[23/24] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/assemble.cpp.o
[24/24] Linking CXX shared module cpp.cpython-310-x86_64-linux-gnu.so
*** Installing project into wheel...
-- Install configuration: "Release"
-- Installing: /tmp/tmpawr_to4p/wheel/platlib/dolfinx/cpp.cpython-310-x86_64-linux-gnu.so
-- Set non-toolchain portion of runtime path of "/tmp/tmpawr_to4p/wheel/platlib/dolfinx/cpp.cpython-310-x86_64-linux-gnu.so" to "/hpcdata/home/research/hzhang01/dolfinx/lib64:/hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/basix/lib:/hpcdata/home/research/hzhang01/boost/lib:/hpcdata/home/research/hzhang01/hdf5/lib:/hpcdata/home/research/hzhang01/petsc/lib"
*** Making wheel...
*** Created fenics_dolfinx-0.9.0-cp310-cp310-linux_x86_64.whl
Building wheel for fenics-dolfinx (pyproject.toml) ... done
Created wheel for fenics-dolfinx: filename=fenics_dolfinx-0.9.0-cp310-cp310-linux_x86_64.whl size=1721393 sha256=e8ff9513cf7a4122bc65a7d26cdc48e9ac55f1f3c6aa0921dcb5bf2b040531c4
Stored in directory: /tmp/pip-ephem-wheel-cache-cnr1z9lz/wheels/bf/ac/e5/ce526b019af8b28c73afba4bfbbe1cf28ab0d946e5e9881652
Successfully built fenics-dolfinx
Installing collected packages: fenics-dolfinx
Attempting uninstall: fenics-dolfinx
Found existing installation: fenics-dolfinx 0.9.0
Uninstalling fenics-dolfinx-0.9.0:
Removing file or directory /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/dolfinx/
Removing file or directory /hpcdata/home/research/hzhang01/.conda/envs/wh_dolfinx/lib/python3.10/site-packages/fenics_dolfinx-0.9.0.dist-info/
Successfully uninstalled fenics-dolfinx-0.9.0
Successfully installed fenics-dolfinx-0.9.0
After that, I installed petsc4py:
pip install petsc4py