I would like to try some Hertzian contact problems between two bodies using dolfinx. One of the approach is to use the Asimov-contact repo from Wells-group. However, I don’t know how to install the repo, or if is usable without installing. I’m getting the exact same error as in Problem with installing asimov-contact library bug in RayTracing.h.
Consolidate compiler generated dependencies of target dolfinx_contact
[ 5%] Building CXX object CMakeFiles/dolfinx_contact.dir/utils.cpp.o
[ 11%] Building CXX object CMakeFiles/dolfinx_contact.dir/contact_kernels.cpp.o
[ 17%] Building CXX object CMakeFiles/dolfinx_contact.dir/SubMesh.cpp.o
[ 23%] Building CXX object CMakeFiles/dolfinx_contact.dir/meshtie_kernels.cpp.o
In file included from /home/pietro/asimov-contact/cpp/utils.h:10,
from /home/pietro/asimov-contact/cpp/KernelData.h:11,
from /home/pietro/asimov-contact/cpp/meshtie_kernels.h:9,
from /home/pietro/asimov-contact/cpp/meshtie_kernels.cpp:7:
/home/pietro/asimov-contact/cpp/RayTracing.h:14:10: fatal error: spglog/spdlog.h: No such file or directory
14 | #include <spglog/spdlog.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/build.make:146: CMakeFiles/dolfinx_contact.dir/meshtie_kernels.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/pietro/asimov-contact/cpp/utils.h:10,
from /home/pietro/asimov-contact/cpp/utils.cpp:7:
/home/pietro/asimov-contact/cpp/RayTracing.h:14:10: fatal error: spglog/spdlog.h: No such file or directory
14 | #include <spglog/spdlog.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/build.make:76: CMakeFiles/dolfinx_contact.dir/utils.cpp.o] Error 1
In file included from /home/pietro/asimov-contact/cpp/utils.h:10,
from /home/pietro/asimov-contact/cpp/KernelData.h:11,
from /home/pietro/asimov-contact/cpp/contact_kernels.h:9,
from /home/pietro/asimov-contact/cpp/contact_kernels.cpp:7:
/home/pietro/asimov-contact/cpp/RayTracing.h:14:10: fatal error: spglog/spdlog.h: No such file or directory
14 | #include <spglog/spdlog.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/build.make:104: CMakeFiles/dolfinx_contact.dir/contact_kernels.cpp.o] Error 1
In file included from /home/pietro/asimov-contact/cpp/utils.h:10,
from /home/pietro/asimov-contact/cpp/SubMesh.cpp:8:
/home/pietro/asimov-contact/cpp/RayTracing.h:14:10: fatal error: spglog/spdlog.h: No such file or directory
14 | #include <spglog/spdlog.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/build.make:160: CMakeFiles/dolfinx_contact.dir/SubMesh.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/dolfinx_contact.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Maybe this is not the right place to ask, but I would like to know how to use this repo on a MacOS with anaconda environment (for example, what version of dolfinx to use?).
Well, the obvious question would be if you have spdlog installed. If so, and if it is not in a default location, maybe try to add that location to CPATH or a similar environment variable until the issue is fixed upstream.
It would have been helpful to post your own error message, rather than Pietro’s one.
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/anaconda3/envs/asimov-contact/bin/arm64-apple-darwin20.0.0-clang - 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: /opt/anaconda3/envs/asimov-contact/bin/arm64-apple-darwin20.0.0-clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 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 MPI_C: /opt/anaconda3/envs/asimov-contact/lib/libmpi.dylib (found version "4.1")
-- Found MPI_CXX: /opt/anaconda3/envs/asimov-contact/lib/libmpicxx.dylib (found version "4.1")
-- Found MPI: TRUE (found version "4.1")
CMake Warning (dev) at /opt/anaconda3/envs/asimov-contact/share/cmake-3.31/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
Call Stack (most recent call first):
/opt/anaconda3/envs/asimov-contact/lib/cmake/dolfinx/DOLFINXConfig.cmake:44 (find_dependency)
CMakeLists.txt:63 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found Boost 1.86.0 at /opt/anaconda3/envs/asimov-contact/lib/cmake/Boost-1.86.0
-- Requested configuration: QUIET REQUIRED COMPONENTS timer;filesystem
-- Found boost_headers 1.86.0 at /opt/anaconda3/envs/asimov-contact/lib/cmake/boost_headers-1.86.0
-- Found boost_timer 1.86.0 at /opt/anaconda3/envs/asimov-contact/lib/cmake/boost_timer-1.86.0
-- [x] libboost_timer.dylib
-- Adding boost_timer dependencies: headers
-- Found boost_filesystem 1.86.0 at /opt/anaconda3/envs/asimov-contact/lib/cmake/boost_filesystem-1.86.0
-- [x] libboost_filesystem.dylib
-- Adding boost_filesystem dependencies: atomic;headers
-- Found boost_atomic 1.86.0 at /opt/anaconda3/envs/asimov-contact/lib/cmake/boost_atomic-1.86.0
-- [x] libboost_atomic.dylib
-- Adding boost_atomic dependencies: headers
-- Found Boost: /opt/anaconda3/envs/asimov-contact/lib/cmake/Boost-1.86.0/BoostConfig.cmake (found suitable version "1.86.0", minimum required is "1.70") found components: timer filesystem
-- Found Python3: /opt/anaconda3/envs/asimov-contact/bin/python3.13 (found version "3.13.0") found components: Interpreter
-- Adding /opt/anaconda3/envs/asimov-contact/lib/python3.13/site-packages/basix to Basix search hints
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /opt/anaconda3/envs/asimov-contact/lib/libhdf5.dylib;/opt/anaconda3/envs/asimov-contact/lib/libcrypto.dylib;/opt/anaconda3/envs/asimov-contact/lib/libcurl.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libpthread.tbd;/opt/anaconda3/envs/asimov-contact/lib/libsz.dylib;/opt/anaconda3/envs/asimov-contact/lib/libz.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libdl.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd (found version "1.14.3") found components: C
-- HDF5_DIR: HDF5_DIR-NOTFOUND
-- HDF5_DEFINITIONS: -D_FORTIFY_SOURCE=2
-- HDF5_INCLUDE_DIRS: /opt/anaconda3/envs/asimov-contact/include
-- HDF5_LIBRARIES: /opt/anaconda3/envs/asimov-contact/lib/libhdf5.dylib;/opt/anaconda3/envs/asimov-contact/lib/libcrypto.dylib;/opt/anaconda3/envs/asimov-contact/lib/libcurl.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libpthread.tbd;/opt/anaconda3/envs/asimov-contact/lib/libsz.dylib;/opt/anaconda3/envs/asimov-contact/lib/libz.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libdl.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS: -D_FORTIFY_SOURCE=2
-- HDF5_C_INCLUDE_DIR:
-- HDF5_C_INCLUDE_DIRS: /opt/anaconda3/envs/asimov-contact/include
-- HDF5_C_LIBRARY:
-- HDF5_C_LIBRARIES: /opt/anaconda3/envs/asimov-contact/lib/libhdf5.dylib;/opt/anaconda3/envs/asimov-contact/lib/libcrypto.dylib;/opt/anaconda3/envs/asimov-contact/lib/libcurl.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libpthread.tbd;/opt/anaconda3/envs/asimov-contact/lib/libsz.dylib;/opt/anaconda3/envs/asimov-contact/lib/libz.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libdl.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES:
-- Defined targets (if any):
-- ... hdf5::hdf5
-- Found PkgConfig: /opt/anaconda3/envs/asimov-contact/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'PETSc;petsc'
-- Checking for one of the modules 'SLEPc;slepc'
-- Found ADIOS2: /opt/anaconda3/envs/asimov-contact/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.10.1", minimum required is "2.8.1") found components: C CXX MPI
-- The following features have been enabled:
* BUILD_SHARED_LIBS, Build DOLFINX_CONTACT with shared libraries.
* CMAKE_INSTALL_RPATH_USE_LINK_PATH, Add paths to linker search and installed rpath.
-- The following OPTIONAL packages have been found:
* Python3
-- The following REQUIRED packages have been found:
* boost_timer (required version == 1.86.0)
* boost_atomic (required version == 1.86.0)
* boost_headers (required version == 1.86.0)
* boost_filesystem (required version == 1.86.0)
* PkgConfig
* DOLFINX (required version >= 0.8.0.0)
* Basix (required version >= 0.8.0.0)
-- Configuring done (15.8s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/jesus/asimov-contact/cpp/build
Then, running make -j4 gives the following error output
[ 11%] Building CXX object CMakeFiles/dolfinx_contact.dir/utils.cpp.o
[ 11%] Building CXX object CMakeFiles/dolfinx_contact.dir/contact_kernels.cpp.o
[ 17%] Building CXX object CMakeFiles/dolfinx_contact.dir/elasticity.cpp.o
[ 23%] Building CXX object CMakeFiles/dolfinx_contact.dir/coefficients.cpp.o
[ 29%] Building CXX object CMakeFiles/dolfinx_contact.dir/geometric_quantities.cpp.o
In file included from /Users/jesus/asimov-contact/cpp/contact_kernels.cpp:7:
In file included from /Users/jesus/asimov-contact/cpp/contact_kernels.h:9:
In file included from /Users/jesus/asimov-contact/cpp/KernelData.h:11:
In file included from /Users/jesus/asimov-contact/cpp/utils.h:10:
/Users/jesus/asimov-contact/cpp/RayTracing.h:532:5: error: use of undeclared identifier 'spdlog'
532 | spdlog::warn("No ray through the facets have been found");
| ^
In file included from /Users/jesus/asimov-contact/cpp/utils.cpp:7:
In file included from /Users/jesus/asimov-contact/cpp/utils.h:10:
/Users/jesus/asimov-contact/cpp/RayTracing.h:532:5: error: use of undeclared identifier 'spdlog'
532 | spdlog::warn("No ray through the facets have been found");
| ^
[ 35%] Building CXX object CMakeFiles/dolfinx_contact.dir/meshtie_kernels.cpp.o
1 error generated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/contact_kernels.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/utils.cpp.o] Error 1
In file included from /Users/jesus/asimov-contact/cpp/meshtie_kernels.cpp:7:
In file included from /Users/jesus/asimov-contact/cpp/meshtie_kernels.h:9:
In file included from /Users/jesus/asimov-contact/cpp/KernelData.h:11:
In file included from /Users/jesus/asimov-contact/cpp/utils.h:10:
/Users/jesus/asimov-contact/cpp/RayTracing.h:532:5: error: use of undeclared identifier 'spdlog'
532 | spdlog::warn("No ray through the facets have been found");
| ^
1 error generated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/meshtie_kernels.cpp.o] Error 1
make[1]: *** [CMakeFiles/dolfinx_contact.dir/all] Error 2
make: *** [all] Error 2
Could you please guide me on how to perform this step?
Thank you @francesco-ballarin. I have made that modification to /Users/jesus/asimov-contact/cpp/RayTracing.h and /Users/jesus/asimov-contact/cpp/parallel_mesh_ghosting.h
Indeed @dokken, both versions produces very different error outputs.
Running make -j4 with fenicsx-dolfin=0.8.0 results in the error output
[ 5%] Building CXX object CMakeFiles/dolfinx_contact.dir/utils.cpp.o
[ 17%] Building CXX object CMakeFiles/dolfinx_contact.dir/elasticity.cpp.o
[ 17%] Building CXX object CMakeFiles/dolfinx_contact.dir/coefficients.cpp.o
[ 23%] Building CXX object CMakeFiles/dolfinx_contact.dir/contact_kernels.cpp.o
[ 29%] Building CXX object CMakeFiles/dolfinx_contact.dir/geometric_quantities.cpp.o
[ 35%] Building CXX object CMakeFiles/dolfinx_contact.dir/meshtie_kernels.cpp.o
[ 41%] Building CXX object CMakeFiles/dolfinx_contact.dir/SubMesh.cpp.o
[ 47%] Building CXX object CMakeFiles/dolfinx_contact.dir/QuadratureRule.cpp.o
[ 52%] Building CXX object CMakeFiles/dolfinx_contact.dir/Contact.cpp.o
[ 58%] Building CXX object CMakeFiles/dolfinx_contact.dir/MeshTie.cpp.o
[ 64%] Building CXX object CMakeFiles/dolfinx_contact.dir/RayTracing.cpp.o
[ 70%] Building CXX object CMakeFiles/dolfinx_contact.dir/KernelData.cpp.o
[ 76%] Building CXX object CMakeFiles/dolfinx_contact.dir/error_handling.cpp.o
[ 82%] Building CXX object CMakeFiles/dolfinx_contact.dir/rigid_surface_kernels.cpp.o
[ 88%] Building CXX object CMakeFiles/dolfinx_contact.dir/point_cloud.cpp.o
[ 94%] Building CXX object CMakeFiles/dolfinx_contact.dir/parallel_mesh_ghosting.cpp.o
/Users/jesus/asimov-contact/cpp/parallel_mesh_ghosting.cpp:197:19: error: no matching function for call to 'create_mesh'
197 | auto new_mesh = dolfinx::mesh::create_mesh(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/anaconda3/envs/asimov-contact/include/dolfinx/mesh/utils.h:785:64: note: candidate function template not viable: no known conversion from '(lambda at /Users/jesus/asimov-contact/cpp/parallel_mesh_ghosting.cpp:174:9)' to 'const CellPartitionFunction' (aka 'const function<AdjacencyList<int> (int, int, dolfinx::mesh::CellType, const AdjacencyList<long long> &)>') for 8th argument
785 | Mesh<typename std::remove_reference_t<typename U::value_type>> create_mesh(
| ^
786 | MPI_Comm comm, MPI_Comm commt, std::span<const std::int64_t> cells,
787 | const fem::CoordinateElement<
788 | typename std::remove_reference_t<typename U::value_type>>& element,
789 | MPI_Comm commg, const U& x, std::array<std::size_t, 2> xshape,
790 | const CellPartitionFunction& partitioner)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/anaconda3/envs/asimov-contact/include/dolfinx/mesh/utils.h:934:1: note: candidate function template not viable: requires 6 arguments, but 8 were provided
934 | create_mesh(MPI_Comm comm, std::span<const std::int64_t> cells,
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
935 | const fem::CoordinateElement<
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
936 | std::remove_reference_t<typename U::value_type>>& elements,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
937 | const U& x, std::array<std::size_t, 2> xshape, GhostMode ghost_mode)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/parallel_mesh_ghosting.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/dolfinx_contact.dir/all] Error 2
make: *** [all] Error 2
while running the same but with fenicsx-dolfin=0.9.0 produces the error
[ 11%] Building CXX object CMakeFiles/dolfinx_contact.dir/utils.cpp.o
[ 11%] Building CXX object CMakeFiles/dolfinx_contact.dir/elasticity.cpp.o
[ 17%] Building CXX object CMakeFiles/dolfinx_contact.dir/coefficients.cpp.o
[ 23%] Building CXX object CMakeFiles/dolfinx_contact.dir/contact_kernels.cpp.o
[ 29%] Building CXX object CMakeFiles/dolfinx_contact.dir/geometric_quantities.cpp.o
/Users/jesus/asimov-contact/cpp/utils.cpp:197:12: error: no member named 'argsort_radix' in namespace 'dolfinx'
197 | dolfinx::argsort_radix<std::int32_t>(cells, perm);
| ~~~~~~~~~^
/Users/jesus/asimov-contact/cpp/utils.cpp:197:38: error: expected '(' for function-style cast or type construction
197 | dolfinx::argsort_radix<std::int32_t>(cells, perm);
| ~~~~~~~~~~~~^
/Users/jesus/asimov-contact/cpp/utils.cpp:197:40: warning: left operand of comma operator has no effect [-Wunused-value]
197 | dolfinx::argsort_radix<std::int32_t>(cells, perm);
| ^~~~~
[ 35%] Building CXX object CMakeFiles/dolfinx_contact.dir/meshtie_kernels.cpp.o
/Users/jesus/asimov-contact/cpp/utils.cpp:697:14: error: no member named 'argsort_radix' in namespace 'dolfinx'
697 | dolfinx::argsort_radix<std::int32_t>(cells, perm);
| ~~~~~~~~~^
/Users/jesus/asimov-contact/cpp/utils.cpp:697:40: error: expected '(' for function-style cast or type construction
697 | dolfinx::argsort_radix<std::int32_t>(cells, perm);
| ~~~~~~~~~~~~^
/Users/jesus/asimov-contact/cpp/utils.cpp:697:42: warning: left operand of comma operator has no effect [-Wunused-value]
697 | dolfinx::argsort_radix<std::int32_t>(cells, perm);
| ^~~~~
[ 41%] Building CXX object CMakeFiles/dolfinx_contact.dir/SubMesh.cpp.o
[ 47%] Building CXX object CMakeFiles/dolfinx_contact.dir/QuadratureRule.cpp.o
2 warnings and 4 errors generated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/utils.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/Users/jesus/asimov-contact/cpp/SubMesh.cpp:24:12: error: 'radix_sort' does not name a template but is followed by template arguments
24 | dolfinx::radix_sort<std::int32_t>(std::span(cells.data(), cells.size()));
| ^ ~~~~~~~~~~~~~~
/opt/anaconda3/envs/asimov-contact090/include/dolfinx/common/sort.h:124:31: note: non-template declaration found by name lookup
124 | inline constexpr __radix_sort radix_sort{};
| ^
1 error generated.
make[2]: *** [CMakeFiles/dolfinx_contact.dir/SubMesh.cpp.o] Error 1
make[1]: *** [CMakeFiles/dolfinx_contact.dir/all] Error 2
make: *** [all] Error 2