I am trying to install FEniCSx from source on my MAC machine. I followed the instructions on the repository. I installed FFCx following the commands:
$ cmake -B build-dir -S cmake/
$ cmake --build build-dir
$ cmake --install build-dir
This went successfully. However, when I install FEniCSx I recieve this error:
CMake Error at /opt/homebrew/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find UFCx (missing: UFCX_INCLUDE_DIRS UFCX_VERSION) (Required is
at least version "0.9")
Reason given by package: UFCx could not be found.
I see that the file ufcx.h is located in /usr/local/bin. Can you help me resolve this issue?
Thank you.
I noticed that the FFCx that I installed is version 0.8. Perhaps that is the issue?
dokken
September 23, 2024, 9:09am
3
Please remove the $ ahead of each of the commands above, as it is meant to avoid people copy-pasting and executing at once.
The commands that should be run is
cmake -B build-dir -S cmake/
cmake --build build-dir
cmake --install build-dir
ref: bash - What does the dollar sign represent in front of lines? - Stack Overflow
Thank you for the answer. I did not use $ in the command line. The issue is still present.
dokken
September 23, 2024, 6:54pm
5
What is the output of the commands above?
These are the commands and the response (pwd: ffcx
):
❯ sudo cmake --install build-dir
Password:
-- Install configuration: ""
-- Up-to-date: /usr/local/share/ufcx/cmake/ufcxTargets.cmake
-- Up-to-date: /usr/local/share/ufcx/cmake/ufcxConfig.cmake
-- Up-to-date: /usr/local/share/ufcx/cmake/ufcxConfigVersion.cmake
-- Up-to-date: /usr/local/include/ufcx.h
-- Up-to-date: /usr/local/share/pkgconfig/ufcx.pc
Then in dolfinx/cpp/build
:
❯ cmake ..
-- Found Boost 1.86.0 at /opt/homebrew/lib/cmake/Boost-1.86.0
-- Requested configuration: REQUIRED COMPONENTS timer
-- Found boost_headers 1.86.0 at /opt/homebrew/lib/cmake/boost_headers-1.86.0
-- Found boost_timer 1.86.0 at /opt/homebrew/lib/cmake/boost_timer-1.86.0
-- [x] libboost_timer-mt.dylib
-- [ ] libboost_timer-mt.a
-- [ ] libboost_timer.dylib
-- [ ] libboost_timer.a
-- Adding boost_timer dependencies: headers
-- Checking for Basix hints with /opt/homebrew/Caskroom/miniconda/base/bin/python3.12
-- No Basix hint was found.
-- Found HDF5 at /opt/homebrew/lib/cmake/hdf5 via NO_MODULE. Now trying to extract locations etc.
-- Trying to get properties of target hdf5-shared
-- Found imported configurations: RELEASE
-- Start search through imported configurations in the following order: RelWithDebInfo;RELWITHDEBINFO;RELEASE;DEBUG;RELEASE
-- Selected imported configuration: RELEASE
-- HDF5_DIR: /opt/homebrew/lib/cmake/hdf5
-- HDF5_DEFINITIONS:
-- HDF5_INCLUDE_DIRS: /opt/homebrew/include
-- HDF5_LIBRARIES: hdf5-shared
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR:
-- HDF5_C_INCLUDE_DIRS: /opt/homebrew/include
-- HDF5_C_LIBRARY: /opt/homebrew/lib/libhdf5.310.3.0.dylib
-- 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
-- ... hdf5_cpp-static
-- ... hdf5_cpp-shared
-- ... hdf5_hl_cpp-static
-- ... hdf5_hl_cpp-shared
-- ... hdf5_fortran-static
-- ... hdf5_fortran-shared
-- ... hdf5_hl_fortran-static
-- ... hdf5_hl_fortran-shared
-- Asking Python module FFCx for location of ufcx.h...
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ffcx'
CMake Error at /opt/homebrew/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find UFCx (missing: UFCX_INCLUDE_DIRS UFCX_VERSION) (Required is
at least version "0.9")
Reason given by package: UFCx could not be found.
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.30.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindUFCx.cmake:80 (find_package_handle_standard_args)
CMakeLists.txt:391 (find_package)
-- Configuring incomplete, errors occurred!
dokken
September 24, 2024, 7:23am
7
You need to set the cmake_install_prefix if you insist on only installing UFCx, and not all of ffcx.
I am not sure why you would want to only have the UFCx interface, if you plan to use it with DOLFINx.
I would simply install it through
pip install fenics-ffcx