Skip to content
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 CUDA: Cleanups & CCache #964

Merged
merged 2 commits into from
Jun 2, 2020
Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Jun 2, 2020

  • gencode: use no-space syntax; this confuses/breaks with CCache<4.0 (all available releases today) and is complicating deduplication operations on lists (see e.g. fix CMake compiler option handling alpaka-group/alpaka#991)
  • min. CXX standard in CUDA: technically the right thing to set this as well for the CMake CUDA C++ language

Now AMReX + CMake 3.17 + CUDA works with CCache 3.7.9 (more cross-links, more). Since this is a severe productivity plus I label this "install" + "performance" ;-)

Note: downstream projects might want to add this to their CMakeLists.txt:

find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
    set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
    if(ENABLE_CUDA)
        set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
    endif()
endif()

CCache does not support Fortran.

- gencode: use no-space syntax; this confuses CCache<4.0
  (all available releases today) and is complicating deduplication
  operations on lists
- min CXX standard in CUDA: technically the right thing to set
  this as well for the CMake CUDA C++ language
@ax3l ax3l force-pushed the cmake-cudaCleanup branch from 32c7321 to 7e6b79f Compare June 2, 2020 05:45
@mic84 mic84 merged commit 2940666 into AMReX-Codes:development Jun 2, 2020
@ax3l ax3l deleted the cmake-cudaCleanup branch June 2, 2020 20:41
target_compile_features(amrex PUBLIC cxx_std_11) # minimum: C++11

if (ENABLE_CUDA AND (CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) )
set_target_properties(amrex PROPERTIES CUDA_EXTENSIONS OFF)
target_compile_features(amrex PUBLIC cuda_std_11) # minimum: C++11

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was already committed 6 days ago, was it not?

Copy link
Member Author

@ax3l ax3l Jun 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was just a confused fellow and forgot you already caught the version guard during review.

@ax3l ax3l mentioned this pull request Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants