diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5de7a986b81a9cdf4d1afe3454db144b5eef3e..f230ddb7ebc7ea5821955a96aab70963015b5d41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # FSL base project changelog +## 2111.5 (Friday 19th November 2021) + +* Set `-std=c++14` for `nvcc`-compiled code, as CUDA 11.0 is the first version + to support `-std=c++17`, and we are targeting older CUDA versions. + + ## 2111.4 (Wednesday 17th November 2021) * The default C++ language standard is now `-std=c++17`. diff --git a/config/buildSettings.mk b/config/buildSettings.mk index 7492b5fb012101d466d1564762ca6b2c8064e74c..a958de299a892946a94b6a63a52cad1d3041c35f 100644 --- a/config/buildSettings.mk +++ b/config/buildSettings.mk @@ -65,7 +65,7 @@ ARCHLIBS = # armadillo structures may have different byte-alignment # to equivalent g++-compiled structures (see # include/armadillo_bits/compiler_setup.hpp) -ARCHNVCCFLAGS = -DARMA_ALLOW_FAKE_GCC +ARCHNVCCFLAGS = -DARMA_ALLOW_FAKE_GCC -std=c++14 # Linker flags for CUDA projects. ARCHNVCCLDFLAGS = diff --git a/config/vars.mk b/config/vars.mk index 86df5b48cb86d6ba428e143d05f09411e3786cf7..dd4358974a964c3ad267dcc4f4ead73acc7dc532 100644 --- a/config/vars.mk +++ b/config/vars.mk @@ -119,11 +119,16 @@ CXXFLAGS += ${CPPFLAGS} ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${INCFLAGS} LDFLAGS += ${ARCHLDFLAGS} ${USRLDFLAGS} \ -L. -L${DEVLIBDIR} -L${LIBDIR} \ ${LIBS} ${ARCHLIBS} -NVCCFLAGS += --compiler-options "${CPPFLAGS}" \ - ${ARCHNVCCFLAGS} \ - --compiler-options "${ARCHCXXFLAGS}" \ - ${USRNVCCFLAGS} \ - --compiler-options "${USRCXXFLASG}" \ +# Remove any -std=c++ options, as we are already setting +# -std in ARCHNVCCFLAGS (seee buildSettings.mk), and +# passing another one via --compiler-options will confuse +# nvcc. We assume that project Makefile has not added +# -std to USRCXXFLAGGS/USRCPPFLAGS. +NVCCFLAGS += --compiler-options "${CPPFLAGS}" \ + ${ARCHNVCCFLAGS} \ + --compiler-options "$(patsubst -std=c++%,,${ARCHCXXFLAGS})" \ + ${USRNVCCFLAGS} \ + --compiler-options "${USRCXXFLAGS}" \ ${INCFLAGS} NVCCLDFLAGS += ${ARCHNVCCLDFLAGS} \ --compiler-options "${ARCHLDFLAGS}" \