Open reuterbal opened 7 months ago
Hi @reuterbal which version of CMake is used?
From my tests of a "find_package( CUDAToolkit )" it is not required that CUDA is enabled as language, so that find_dependency( CUDAToolkit )
should be sufficient.
CUDA should also not be required for find_package( OpenACC )
The reason that find_dependency( OpenACC )
might not have worked here, is when you have this triggered due to
find_package( ectrans REQUIRED )
it then implicitly adds the REQUIRED keyword to all find_dependency
: find_dependency( OpenACC REQUIRED )
which fails due to the "usual" workaround issue. That is in fact the only difference between find_package
and find_dependency
: find_dependency
inherits REQUIRED from the parent find_package
.
Thanks! As discussed offline, CUDA is probably redundant, I didn't check this carefully enough.
The CMake version was 3.24.3, so you're likely right that this may be the issue with OpenACC_FOUND
not being set.
For $reason I attempted a standalone build of redgreengpu (outside of a bundle) on an NVIDIA GPU machine and link IFS in a bundle build against it. (I can share more details if required.)
In that scenario, ectrans is imported into ifs-source via the CMake config files. The link interfaces in ectrans-targets.cmake include (correctly)
CUDA::cufft
,CUDA::cublas
andOpenACC::OpenACC_Fortran
. However, the dependencies to CUDAToolkit and OpenACC are not captured in the correspondingectrans-import.cmake
.The import file does correctly issue the dependencies on OpenMP and fiat, but from a quick glance I wasn't able to figure out how to achieve the same for OpenACC, CUDA and CUDAToolkit. Manually editing the file and adding the following worked:
For some reason, using
find_dependency(OpenACC)
did not work and made the entire ectrans import fail. Using insteadfind_package
and doing the usualset(OpenACC_FOUND ON)
hack worked.Presumably, similar issues would appear with HIP on AMD platforms, and are likely affecting the optimised GPU branch, too.
@wdeconinck might have an idea where the CMake needs to be changed for this?