Openmp-target-offload Compile error

I cloned https://github.com/exasmr/openmc.git, then when I make it, an error occurred:

[ 29%] Building CXX object CMakeFiles/libopenmc.dir/src/math_functions.cpp.o
/mnt/d/gpu-openmc/openmc/openmc/src/math_functions.cpp: In function ‘std::complex openmc::zpf8h(std::complex)’:
/mnt/d/gpu-openmc/openmc/openmc/src/math_functions.cpp:828:6: error: call to non-‘constexpr’ function ‘std::complex<_Tp> std::operator-(const std::complex<_Tp>&) [with _Tp = double]’
828 | -32.310199761603i, -21.9357456686406, 31.490536152863i, 6.75847413957232,
| ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/libopenmc.dir/build.make:440: CMakeFiles/libopenmc.dir/src/math_functions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:156: CMakeFiles/libopenmc.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Does anyone know the reason? Many thanks for any pointers

The OpenMP target offloading version needs to be built using the LLVM clang compiler to target AMD or NVIDIA GPUs, or the Intel OneAPI compiler for targeting Intel GPUs. Compilation for the various devices is facilitated in OpenMC by using a CMake preset for a specific target architecture. E.g., cmake --preset=llvm_a100 More information on this is available at: GitHub - jtramm/openmc_offloading_builder: Script to help download, configure, install, and run the OpenMP offloading version of OpenMC.

1 Like

Thank you for your reply!

First of all, I’m sorry for the delay of a month before replying, because I am a newbie in computer programming. During this time, I successfully compiled the openmc version using openmp offload through your prompts (the compilation supports openmp offload clang takes a lot of time)

When I couldn’t wait to try some calculations, I found that tally could not be counted using Rectilinear Meshes. This seems to be because the GitHub - exasmr/openmc: OpenMC Monte Carlo Code source code itself does not support it. And some functions don’t seem to be supported either, e.g. openmc.stats.PowerLaw. I would like to know if anyone is continuing to develop the function of this openmp offload version?

run.log:

Minimum neutron data temperature: 294.0 K
Maximum neutron data temperature: 294.0 K
Reading tallies XML file…
ERROR: Rectilinear Meshes Not Yet Supported On Device!


image

Thank you, best wishes.