cmake changes for pgf90
[unres.git] / source / unres / src_CSA / CMakeLists.txt
index 53337fe..3caa356 100644 (file)
@@ -176,6 +176,10 @@ elseif (Fortran_COMPILER_NAME STREQUAL "f95")
 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
   # Add old gfortran flags
   set(CPPFLAGS "${CPPFLAGS} -DG77") 
+elseif (Fortran_COMPILER_NAME STREQUAL "pgf90")
+  set(CPPFLAGS "${CPPFLAGS} -DPGI")
+  FILE(COPY ${CMAKE_SOURCE_DIR}/source/lib/isnan_pgi.f DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
+  list(APPEND UNRES_CSA_SRC0 ${CMAKE_CURRENT_BINARY_DIR}/isnan_pgi.f)
 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
 
 #=========================================
@@ -394,14 +398,27 @@ endif(UNRES_CSA_FF STREQUAL "E0LL2Y")
      set (boot_lam "")
   endif()
 
+
+  if (UNRES_SRUN)
+   set (np "-n")
+   set (mpiexec "srun")
+  elseif(UNRES_MPIRUN)
+   set (np "-np")
+   set (mpiexec "mpirun")
+  else()
+   set (np "-np")
+   set (mpiexec "mpiexec")
+  endif()
+
+
 if(UNRES_CSA_FF STREQUAL "4P")
-    add_test(NAME UNRES_CSA_global COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_4P )
-    add_test(NAME UNRES_CSA_local COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_local_4P )
+    add_test(NAME UNRES_CSA_global COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_4P )
+    add_test(NAME UNRES_CSA_local COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_local_4P )
 endif(UNRES_CSA_FF STREQUAL "4P")
 
 if(UNRES_CSA_FF STREQUAL "E0LL2Y")
-    add_test(NAME UNRES_CSA_global_E0LL2Y COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa )
-    add_test(NAME UNRES_CSA_local_E0LL2Y COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa_local )
+    add_test(NAME UNRES_CSA_global_E0LL2Y COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa )
+    add_test(NAME UNRES_CSA_local_E0LL2Y COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa_local )
 endif(UNRES_CSA_FF STREQUAL "E0LL2Y")