From 4092f968b728a2ebf2ba9f7e7e57e174e5b2f4a3 Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Wed, 14 Sep 2022 13:28:15 +0200 Subject: [PATCH] Tell nvcc to use the correct MPICXX binary There was a bug related to https://gcc.gnu.org/pipermail/gcc-help/2021-June/140490.html where nvcc was getting other versions of the gcc compiler and the libstd++ version were mismatched, resulting in linking errors. --- include/atrip/Utils.hpp | 6 ++++-- src/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/atrip/Utils.hpp b/include/atrip/Utils.hpp index 42bf4f0..8bbe9e2 100644 --- a/include/atrip/Utils.hpp +++ b/include/atrip/Utils.hpp @@ -52,11 +52,13 @@ namespace atrip { #pragma GCC diagnostic ignored "-Wunused-parameter" template std::string pretty_print(T&& value) { - std::stringstream stream; #if ATRIP_DEBUG > 2 + std::stringstream stream; dbg::pretty_print(stream, std::forward(value)); -#endif return stream.str(); +#else + return ""; +#endif } #pragma GCC diagnostic pop // Pretty printing:1 ends here diff --git a/src/Makefile.am b/src/Makefile.am index 5e9c555..b0ee2fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,7 +16,7 @@ libatrip_a_CPPFLAGS += $(CUDA_CXXFLAGS) libatrip_a_DEPENDENCIES = $(NVCC_OBJS) libatrip_a_LIBADD = $(NVCC_OBJS) %.nvcc.o: %.cxx - $(NVCC) -c -x cu -I../ $(CPPFLAGS) $(CTF_CPPFLAGS) $(DEFS) $(libatrip_a_CPPFLAGS) $< -o $@ + $(NVCC) -c -x cu -ccbin="${MPICXX}" -I../ $(CPPFLAGS) $(CTF_CPPFLAGS) $(DEFS) $(libatrip_a_CPPFLAGS) $< -o $@ #./atrip/Equations.o: ./atrip/Equations.cxx # $(NVCC) -c -I../ $(CPPFLAGS) $(libatrip_a_CPPFLAGS) $< -o $@