NVIDIA / cuDecomp

An Adaptive Pencil Decomposition Library for NVIDIA GPUs

Home Page:https://nvidia.github.io/cuDecomp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with CMake when cuDecomp is used a subdirectory

ASKabalan opened this issue · comments

First of all, thank you very much for adding a CMake build system in #15 .

I would like to point out that in your CMakeLists.txt you set the compilers name (nvc++) as the CXX compiler, while this works well when cuDecomp is the top project, it fails for us when we add cuDecomp as subdirectory with this error

"nvc++ " is not a full path and was not found in the PATH.

All you have to do is replace this code

# Use NVHPC compilers by default
set(CMAKE_CXX_COMPILER "nvc++")
set(CMAKE_Fortran_COMPILER "nvfortran")

# Locate and use NVHPC CMake configuration
find_program(NVHPC_CXX_BIN "nvc++")

With this one

# find NVHPC compilers
find_program(NVHPC_CXX_BIN "nvc++")
find_program(NVHPC_Fortran_BIN "nvfortran")
# Use NVHPC compilers by default
set(CMAKE_CXX_COMPILER ${NVHPC_CXX_BIN})
set(CMAKE_Fortran_COMPILER ${NVHPC_Fortran_BIN})

I would be happy to make PR if you want.

Thank you.

Hi @ASKabalan, thanks for reporting the issue and the suggestion. I've added this in #26 if you want to give it a try. Let me know if it works for your use case and I will merge the change.

By the way, I see this is part of a big PR to update jaxDecomp (DifferentiableUniverseInitiative/jaxDecomp#7). I am planning to cut a new release of cuDecomp soon so do let me know if there are any other changes that you'd like to be included before I make the release.

Everything is great on our end, I have some debugging to do but the PR should be ready to merge.
If I can make a request, it would be to just upgrade the CMake CXX compiler to C++20
It seems that I can use C++20 myself while your CMake is in C++14, but It will probably be better if we have the same standard.

Good to hear the change works for you! I'd prefer not to update the C++ standard for cuDecomp unless there is change to this codebase that requires it.

Good to hear the change works for you! I'd prefer not to update the C++ standard for cuDecomp unless there is change to this codebase that requires it.

Yes it makes sense,
I can link with a c++14 built Library anyway.

Thank you.