-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake: Enforce >= C++17 for ROCm #3355
CMake: Enforce >= C++17 for ROCm #3355
Conversation
Check if this adds the C++17 flags again or if there is an undocumented change in defaults that we need to manually address for AMD's Clang fork'd compilers now.
No, this does not work:
I downloaded this commit I configured like this: cmake \
-DAMReX_GPU_BACKEND=HIP \
-DAMReX_AMD_ARCH=gfx90a \
-DAMReX_OMP=OFF \
-DAMReX_PARTICLES=ON \
-DAMReX_PRECISION="$precision" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_PREFIX_PATH='/opt/rocm/lib/cmake/AMDDeviceLibs;/opt/rocm/lib/cmake/amd_comgr;/opt/rocm/lib/cmake/hip;/opt/rocm/lib/cmake/hiprand;/opt/rocm/lib/cmake/hsa-runtime64;/opt/rocm/lib/cmake/rocprim;/opt/rocm/lib/cmake/rocrand' \
-DMPI_C_ADDITIONAL_INCLUDE_DIRS='/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include' \
-DMPI_C_LIB_NAMES='mpi;open-rte;open-pal;hwloc' \
-DMPI_CXX_ADDITIONAL_INCLUDE_DIRS='/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi;/usr/lib/x86_64-linux-gnu/openmpi/include' \
-DMPI_CXX_LIB_NAMES='mpi_cxx;mpi;open-rte;open-pal;hwloc' \
-DMPI_hwloc_LIBRARY=/lib/x86_64-linux-gnu/libhwloc.so \
-DMPI_mpi_LIBRARY=/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so \
-DMPI_mpi_cxx_LIBRARY=/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so \
-DMPI_open-pal_LIBRARY=/lib/x86_64-linux-gnu/libopen-pal.so \
-DMPI_open-rte_LIBRARY=/lib/x86_64-linux-gnu/libopen-rte.so \
.. && \ |
Does I think cmake is trying to be smart. Its logic might be that since the official Clang 16 supports C++17 by default and you ask for the C++17 feature so I don't have to do anything. |
Yes, I agree that this is probably exactly what is happening. Looks like the ROCm clang fork changed the CXX default of Clang -.- |
CMake deduplicates the std C++17 flags in the assumption that the default did not change to vanilla LLVM.
Fun fact: |
@eschnett does this work for you now? :) |
@ax3l this works. AMReX builds with ROCM 5.5.1. |
Ok, let's now triage this with AMD as well. |
Summary
Check if this adds the C++17 flags again or if there is an undocumented change in defaults that we need to manually address for AMD's Clang fork'd compilers now.
Additional background
For #3337
Checklist
The proposed changes: