Fix compilation issues with master branch when OpenMPI is built with --enable-cxx...
authorGaurav Garg <gaugarg@nvidia.com>
Fri, 24 Sep 2021 19:45:17 +0000 (19:45 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 24 Sep 2021 19:45:17 +0000 (19:45 +0000)
cmake/gmxCFlags.cmake

index bbbcacc39904cdf2feae9121c7c9b6498896a4f7..597d425f04bd410f8b2b56272582733df62ac0ab 100644 (file)
@@ -62,11 +62,23 @@ ENDMACRO(GMX_TEST_CXXFLAG VARIABLE FLAGS CXXFLAGSVAR)
 # Prepare some local variables so CUDA and non-CUDA code in targets
 # works the same way.
 function(gmx_target_compile_options_inner)
-    set (CFLAGS "${SIMD_C_FLAGS};${MPI_COMPILE_FLAGS};${EXTRA_C_FLAGS};${GMXC_CFLAGS}" PARENT_SCOPE)
+    set(CFLAGS
+            ${SIMD_C_FLAGS}
+            ${MPI_C_COMPILE_OPTIONS}
+            ${EXTRA_C_FLAGS}
+            ${GMXC_CFLAGS}
+         PARENT_SCOPE)
+
     # When SYCL support has been enabled (so the flag is non-empty), we still *disable* things
     # by default to avoid running each file three passes through the compiler. Then we'll explicitly
     # enable SYCL for the few files using it, as well as the linker.
-    set (CXXFLAGS "${SIMD_CXX_FLAGS};${MPI_COMPILE_FLAGS};${DISABLE_SYCL_CXX_FLAGS};${EXTRA_CXX_FLAGS};${GMXC_CXXFLAGS}" PARENT_SCOPE)
+    set(CXXFLAGS
+            ${SIMD_CXX_FLAGS}
+            ${MPI_CXX_COMPILE_OPTIONS}
+            ${DISABLE_SYCL_CXX_FLAGS}
+            ${EXTRA_CXX_FLAGS}
+            ${GMXC_CXXFLAGS}
+        PARENT_SCOPE)
 endfunction()
 
 # Implementation function to add compiler flags expected for all