Skip to content
Snippets Groups Projects
Commit 8171351c authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'bf/cudacxxflags' into 'master'

Bf/cudacxxflags

See merge request !35
parents 833861db 0b626129
No related branches found
No related tags found
1 merge request!35Bf/cudacxxflags
Pipeline #11598 passed
# FSL base project changelog # FSL base project changelog
## 2111.7 (Friday 19th November 2021)
* Fixed an issue in the construction of `${NVCCFLAGS}` and `${CUDACXXFLAGS}`.
## 2111.6 (Friday 19th November 2021) ## 2111.6 (Friday 19th November 2021)
* New convention for compiling C++ files which are part of a CUDA library or * New convention for compiling C++ files which are part of a CUDA library or
......
...@@ -168,16 +168,30 @@ ifneq (${NVCC}, ) ...@@ -168,16 +168,30 @@ ifneq (${NVCC}, )
CUDA_VER = $(shell ${NVCC} --version | grep -Po "release \K[0-9\.]+") CUDA_VER = $(shell ${NVCC} --version | grep -Po "release \K[0-9\.]+")
GENCODEFLAGS ?= $(shell ${FSLCONFDIR}/supportedGencodes.sh ${CUDA_VER}) GENCODEFLAGS ?= $(shell ${FSLCONFDIR}/supportedGencodes.sh ${CUDA_VER})
# We use nvcc to compile .cu files, g++ to
# compile .cc/.cpp files, and nvcc to perform
# the final linking. So we need to manage
# compiler/linker flags carefully.
# CUDACXXFLAGS is to be used when compiling
# .cc/.cpp files which are to be linked into
# CUDA applications - CUDA-specific include
# paths, and any USRNVCCFLAGS are added to it.
#
# In contrast, NVCCFLAGS is used for compiling
# .cu files (and final linking) - it contains
# nvcc-specific options.
CUDACXXFLAGS ?= -I${CUDA_HOME}/include
# We specify the compiler to use with -ccbin, as # We specify the compiler to use with -ccbin, as
# nvcc might otherwise naively call "g++", rather # nvcc might otherwise naively call "g++", rather
# than honouring $(CXX). We specifically use # than honouring $(CXX). We specifically use
# "-ccbin" rather than "--compiler-bindir" here, # "-ccbin" rather than "--compiler-bindir" here,
# because the conda-forge nvcc wrapper checks for # because the conda-forge nvcc wrapper checks for
# -ccbin, and adds its own if not present. # -ccbin, and adds its own if not present.
CUDACXXFLAGS ?= -I${CUDA_HOME}/include NVCCFLAGS ?= ${GENCODEFLAGS} \
NVCCFLAGS ?= ${GENCODEFLAGS} \ -ccbin $(CXX) \
-ccbin $(CXX) \ -I${CUDA_HOME}/include
${CUDACXXFLAGS}
NVCCLDFLAGS ?= -L${CUDA_HOME}/lib \ NVCCLDFLAGS ?= -L${CUDA_HOME}/lib \
-L${CUDA_HOME}/lib64 \ -L${CUDA_HOME}/lib64 \
-L${CUDA_HOME}/lib/stubs \ -L${CUDA_HOME}/lib/stubs \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment