Well, after weeks attempt, I've succeeded in compiling (and running of course) deal.ii with CUDA through built-in Kokkos in Trilinos with the great advice from Bruno. I leaves my configuration information of both Trilinos and deal.ii here for reference by those who need it.
*Trilinos configuration:* cmake -DTrilinos_ENABLE_Amesos=ON -DTrilinos_ENABLE_Epetra=ON -DTrilinos_ENABLE_EpetraExt=ON -DTrilinos_ENABLE_Ifpack=ON -DTrilinos_ENABLE_AztecOO=ON -DTrilinos_ENABLE_Sacado=ON -DTrilinos_ENABLE_SEACAS=OFF -DTrilinos_ENABLE_Teuchos=ON -DTrilinos_ENABLE_MueLu=ON -DTrilinos_ENABLE_ML=ON -DTrilinos_ENABLE_NOX=ON -DTrilinos_ENABLE_ROL=ON -DTrilinos_ENABLE_Tpetra=ON -DTrilinos_ENABLE_FLOAT=ON -DTrilinos_ENABLE_Zoltan=ON -DTrilinos_VERBOSE_CONFIGURE=OFF -DTPL_ENABLE_MPI=ON -DMPI_BASE_DIR=/home/fengshw/libraries/openmpi -DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/home/fengshw/libraries/trilinos -DTrilinos_ENABLE_Kokkos=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_CONSTEXPR=ON -DTpetra_INST_SERIAL:BOOL=ON -DMueLu_ENABLE_Tutorial:BOOL=OFF -DTrilinos_SHOW_DEPRECATED_WARNINGS=OFF -DShyLU_NodeTacho_ENABLE_CUSOLVER=ON -DShyLU_NodeTacho_ENABLE_CUBLAS=ON .. *deal.ii configuration:* cmake -DCMAKE_CXX_COMPILER=/home/fengshw/libraries/trilinos/bin/nvcc_wrapper -DCMAKE_INSTALL_PREFIX=/home/fengshw/libraries/dealii -DDEAL_II_WITH_MPI=ON -DMPI_DIR=/home/fengshw/libraries/openmpi -DDEAL_II_MPI_WITH_DEVICE_SUPPORT=ON -DDEAL_II_WITH_64BIT_INDICES=ON -DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=/home/fengshw/libraries/trilinos -DDEAL_II_WITH_TBB=ON -DTBB_DIR=/home/fengshw/libraries/oneTBB -DDEAL_II_WITH_P4EST=ON -DP4EST_DIR=/home/fengshw/libraries/p4est .. *Notes:* 1. Compare to Trilinos configuration example provided in deal.ii README <https://dealii.org/developer/external-libs/trilinos.html>, I cancel option -DTrilinos_ENABLE_SEACAS because I don't have NetCDF and cancel option -DTrilinos_ENABLE_COMPLEX since with this option CMake will give warning that requires -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL turns to ON. However, turn on the latter flag will result in no input file for nvcc. 2. One have to firstly export OMPI_CXX to nvcc_wrapper that comes with Kokkos if MPI and CUDA work together, details see this site <https://trilinos.github.io/building_with_CUDA_support.html>. 3. The additional flags -DShyLU_NodeTacho_ENABLE_CUSOLVER=ON and -DShyLU_NodeTacho_ENABLE_CUBLAS=ON are necessary if use CUDA, otherwise deal.ii will complain about no cusolver-related libraries can be found even when running tutorial step-1. 4. Another additional flag -DTrilinos_SHOW_DEPRECATED_WARNINGS=OFF just turns off deprecated warning therefore Trilinos stays quiet during the compile phase. 5. deal.ii with configurations above is able to pass the tests within the release package and I've run successfully the tutorial step 1, step 9 and step 64. 6. oneTBB is built with default setting and p4est is built with the script provided by deal.ii website <https://dealii.org/9.7.0/external-libs/p4est.html>. 7. Finally, my gcc, g++ and gfortran version is 12.3; nvcc version, as the advice by Bruno, is 12.6; MPI is OpenMPI 5.0.8, oneTBB is of version 2022.2.0 and p4est is of version 2.8.7. OS: Ubuntu 22.04. Best, Severin 在2025年8月20日星期三 UTC+8 03:26:55<[email protected]> 写道: > Hello Severin, > > The last error is a compiler issue. One thing that is strange in your > detailed.log is that your CMAKE_CXX_COMPILER is set to mpicxx. I always set > it to the nvcc_wrapper. Normally any version of nvcc should work. I use > nvcc 12.6 but 12.4 should be fine too. > > Best, > > Bruno > > On Tuesday, August 19, 2025 at 1:37:40 PM UTC-4 [email protected] wrote: > >> Dear dealii developers, >> I've followed readme.html <https://dealii.org/developer/readme.html> to >> try installing deal.ii with Trilinos 16.0 and the internal Kokkos is >> configured with -DKokkos_ENABLE_CUDA=ON. And I've exported >> OMPI_CXX=/path/to/kokkos's/nvcc_wrapper when compiling Trilinos and deal.ii. >> >> Now problems are that >> 1. the bundled version of boost library has problem with my nvcc (12.4), >> this issue has been reported here >> <https://github.com/boostorg/geometry/issues/1259>, then I compiled >> another version of boost (1.89.0) by myself. >> >> 2. after replacing to a newer version of boost, I still met a problem >> related to boost: >> /home/fengshw/Downloads/dealii-9.7.0/source/non_matching/quadrature_generator.cc(581): >> >> error: namespace "boost::math::tools" has no member "toms748_solve" >> boost::math::tools::toms748_solve(lambda, >> ^ >> >> 1 error detected in the compilation of >> "/home/fengshw/Downloads/dealii-9.7.0/source/non_matching/quadrature_generator.cc". >> >> It seems that using the bundled version is a better choice >> >> 3. and a new problem took place in matrix-free module (only for debug >> version, release version can be built): >> Building CXX object >> source/numerics/CMakeFiles/object_numerics_debug.dir/vector_tools_project_qpmf.cc.o >> /home/fengshw/Downloads/dealii-9.7.0/include/deal.II/matrix_free/tools.h: >> In member function ‘void >> dealii::MatrixFreeTools::internal::ComputeDiagonalHelper<dim, >> VectorizedArrayType, is_face>::reinit(unsigned int)’: >> /home/fengshw/Downloads/dealii-9.7.0/include/deal.II/matrix_free/tools.h:1003:924: >> >> error: ‘__T0’ was not declared in this scope; did you mean ‘__y0’? >> 1003 | >> AssertIndexRange(constraint_position[std::get<1>(hn)], >> | >> >> >> >> >> >> >> >> >> >> >> >> ^ >> | >> >> >> >> >> >> >> >> >> >> >> >> __y0 >> /home/fengshw/Downloads/dealii-9.7.0/include/deal.II/matrix_free/tools.h:1003:979: >> >> error: template argument 1 is invalid >> 1003 | >> AssertIndexRange(constraint_position[std::get<1>(hn)], >> >> >> I wonder the last one is caused by nvcc or not since I succeed in >> compiling deal.ii with gcc (without setting MPI, Trilinos). If it is the >> case, which version of nvcc should I choose? My device is RTX 4060 Ti. >> >> log.txt is the output during make. >> >> Thank you >> Severin >> > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/dealii/d2a26d4f-abd2-4d58-9024-7172eec61804n%40googlegroups.com.
