Skip to content

Commit

Permalink
handle linker_language differently
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Aug 28, 2024
1 parent 402e82a commit c01fe85
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions recipe/patches/0005-set-languages-for-subprojects.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
From 8ab07675110c0ae8647b083285290a79fe1b621f Mon Sep 17 00:00:00 2001
From 6e4bae3eeb09b0a20db87506b3b302f546d42b64 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 28 Aug 2024 15:51:03 +1100
Subject: [PATCH 5/5] set languages for subprojects

avoids `CMake can not determine linker language for target:`
---
AmberTools/src/cpptraj/CMakeLists.txt | 2 +-
AmberTools/src/quick/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
AmberTools/src/cpptraj/src/cuda_kernels/CMakeLists.txt | 1 +
AmberTools/src/quick/src/libxc/maple2c_device/CMakeLists.txt | 1 +
2 files changed, 2 insertions(+)

diff --git a/AmberTools/src/cpptraj/CMakeLists.txt b/AmberTools/src/cpptraj/CMakeLists.txt
index 25e66a6c..5f6a533e 100644
--- a/AmberTools/src/cpptraj/CMakeLists.txt
+++ b/AmberTools/src/cpptraj/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.3) # need 3.3 for POLICY CMP0057
-project(cpptraj NONE)
+project(cpptraj C CXX Fortran)
diff --git a/AmberTools/src/cpptraj/src/cuda_kernels/CMakeLists.txt b/AmberTools/src/cpptraj/src/cuda_kernels/CMakeLists.txt
index fcf2ceae..f998cede 100644
--- a/AmberTools/src/cpptraj/src/cuda_kernels/CMakeLists.txt
+++ b/AmberTools/src/cpptraj/src/cuda_kernels/CMakeLists.txt
@@ -1,6 +1,7 @@
set(CPPTRAJ_CUDA_SOURCES core_kernels.cu kernel_wrappers.cu GistCudaCalc.cu GistCudaSetup.cu kernel_rdf.cu)

#version number
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/AmberTools/src/quick/CMakeLists.txt b/AmberTools/src/quick/CMakeLists.txt
index 475f6d80..e4594af3 100644
--- a/AmberTools/src/quick/CMakeLists.txt
+++ b/AmberTools/src/quick/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.9.0) # version 3.9.0 needed for FindMPI and FindOpenMP versions which provide imported targets

-project(quick LANGUAGES NONE VERSION 22.03)
+project(quick LANGUAGES C CXX Fortran VERSION 22.03)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/quick-cmake)
add_library(cpptraj_cuda_routines STATIC ${CPPTRAJ_CUDA_SOURCES})
+set_target_properties(cpptraj_cuda_routines PROPERTIES LINKER_LANGUAGE CUDA)
#make_pic_if_needed does not appear to work for NVCC. Instead, added
# logic to $CPPTRAJHOME/CMakeLists.txt
#make_pic_if_needed(cpptraj_cuda_routines)
diff --git a/AmberTools/src/quick/src/libxc/maple2c_device/CMakeLists.txt b/AmberTools/src/quick/src/libxc/maple2c_device/CMakeLists.txt
index 98ae9658..909a165a 100644
--- a/AmberTools/src/quick/src/libxc/maple2c_device/CMakeLists.txt
+++ b/AmberTools/src/quick/src/libxc/maple2c_device/CMakeLists.txt
@@ -46,6 +46,7 @@ else()
endif()

add_library(xc_${QUICK_GPU_TARGET_NAME} STATIC ${LIBXC_CUDA_SOURCES})
+set_target_properties(xc_${QUICK_GPU_TARGET_NAME} PROPERTIES LINKER_LANGUAGE CUDA)
target_compile_options(xc_${QUICK_GPU_TARGET_NAME} PRIVATE
${GPU_RDC_FLAGS}
${CUDA_DEVICE_CODE_FLAGS}

0 comments on commit c01fe85

Please sign in to comment.