ORNL / ReSolve

Library of GPU-resident linear solvers
Other
58 stars 2 forks source link

c++: error: unrecognized command-line option ‘--offload-arch=gfx1103’ #204

Closed kalmarek closed 1 month ago

kalmarek commented 1 month ago

this is how I try to compile ReSolve:

git clone git@github.com:ORNL/ReSolve.git
cd ReSolve
mkdir build
cd build
cmake -D RESOLVE_USE_HIP=true -D CMAKE_PREFIX_PATH=/opt/rocm ..
make

Result:

$ make                                                           
[  1%] Building CXX object resolve/utilities/logger/CMakeFiles/resolve_logger.dir/Logger.cpp.o
[  2%] Linking CXX shared library libresolve_logger.so
[  2%] Built target resolve_logger
[  3%] Building HIP object resolve/hip/CMakeFiles/resolve_backend_hip.dir/hipKernels.hip.o
[  5%] Building HIP object resolve/hip/CMakeFiles/resolve_backend_hip.dir/VectorKernels.hip.o
[  6%] Building HIP object resolve/hip/CMakeFiles/resolve_backend_hip.dir/MemoryUtils.hip.o
[  7%] Linking HIP shared library libresolve_backend_hip.so
[  7%] Built target resolve_backend_hip
[  8%] Building CXX object resolve/utilities/version/CMakeFiles/resolve_version.dir/version.cpp.o
[  8%] Built target resolve_version
[ 10%] Building CXX object resolve/workspace/CMakeFiles/resolve_workspace.dir/LinAlgWorkspaceCpu.cpp.o
c++: error: unrecognized command-line option ‘--offload-arch=gfx1103’
make[2]: *** [resolve/workspace/CMakeFiles/resolve_workspace.dir/build.make:76: resolve/workspace/CMakeFiles/resolve_workspace.dir/LinAlgWorkspaceCpu.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:489: resolve/workspace/CMakeFiles/resolve_workspace.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
pelesh commented 1 month ago

Hi @kalmarek! Which host compiler are you using? I believe you would need to use amdclang from the ROCm distribution as the host compiler. So your CMake command would be something like

CC=amdclang CXX=amdclang++ cmake -D RESOLVE_USE_HIP=true -D CMAKE_PREFIX_PATH=/opt/rocm ..

This assumes amdclang is on your system path. Let us know if this works.

kalmarek commented 1 month ago

It does, thanks! Update to the docs and/or the README is then due ;) also CMakeLists.txt still declares

project(ReSolve VERSION "0.99.1")

even on branch version-1.0 (is this the official and recommended version to use?)

pelesh commented 1 month ago

It does, thanks! Update to the docs and/or the README is then due ;) also CMakeLists.txt still declares

project(ReSolve VERSION "0.99.1")

even on branch version-1.0 (is this the official and recommended version to use?)

I would suggest using most recent develop. This is still alpha release and it is intended for developers and software enthusiasts.

CC @kswirydo