added 32/64-bit architecture detection
authorDawid Jagiela <lightnir@chem.univ.gda.pl>
Thu, 10 May 2012 11:45:30 +0000 (13:45 +0200)
committerDawid Jagiela <lightnir@chem.univ.gda.pl>
Thu, 10 May 2012 11:45:30 +0000 (13:45 +0200)
CMakeLists.txt
source/unres/src_MD-M/CMakeLists.txt
source/unres/src_MD/CMakeLists.txt

index 71105b2..a343543 100644 (file)
@@ -90,10 +90,25 @@ if (MPIF_FOUND)
   message("MPIF_INCLUDE_DIRECTORIES=${MPIF_INCLUDE_DIRECTORIES}" )
 endif(MPIF_FOUND) 
 
+
+
+#======================================
+# Detect system architecture
+#
+
+if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
+  set(architektura "32")
+else (CMAKE_SIZEOF_VOID_P EQUAL 4)
+  set(architektura "64")
+endif( CMAKE_SIZEOF_VOID_P EQUAL 4 )
+
+message("Detected ${architektura}-bit architecture")   
+
+
 #=======================================
 #  Create diractories for build targets
 #=======================================
-execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/unres/MD )
+#execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/unres/MD )
 
 #=======================================
 # Add source files
index 5576b81..c1f570f 100644 (file)
@@ -160,17 +160,17 @@ set(UNRES_MDM_PP_SRC
 # Set comipiler flags for different sourcefiles  
 #================================================
 if (Fortran_COMPILER_NAME STREQUAL "ifort")
-  set(FFLAGS0 "-c -ip -w" ) 
-  set(FFLAGS1 "-c -w -g -d2 -CA -CB" ) 
-  set(FFLAGS2 "-c -w -g -00 ")
+  set(FFLAGS0 "-ip -w" ) 
+  set(FFLAGS1 "-w -g -d2 -CA -CB" ) 
+  set(FFLAGS2 "-w -g -00 ")
   #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" )
-  set(FFLAGS3 "-c -w -ipo " )
+  set(FFLAGS3 "-w -ipo " )
 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
-  set(FFLAGS0 "-c -I. " ) 
-  set(FFLAGS1 "-c -g -I. " ) 
-  set(FFLAGS2 "-c -I. ")
+  set(FFLAGS0 "-I. " ) 
+  set(FFLAGS1 "-g -I. " ) 
+  set(FFLAGS2 "-I. ")
   #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" )
-  set(FFLAGS3 "-c -I. " )
+  set(FFLAGS3 "-I. " )
 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
 
 
@@ -224,6 +224,14 @@ if (UNRES_WITH_MPI)
   set(CPPFLAGS "${CPPFLAGS} -DMP -DMPI") 
 endif(UNRES_WITH_MPI)
 
+
+# add 64-bit specific preprocessor flags
+if (architektura STREQUAL "64")
+  set(CPPFLAGS "${CPPFLAGS} -DAMD64")
+endif (architektura STREQUAL "64")
+
+
+
 # Apply preprocesor flags to *.F files
 set_property(SOURCE ${UNRES_MDM_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )  
 
index bea362d..32d86c2 100644 (file)
@@ -38,17 +38,17 @@ set(UNRES_MD_PP_SRC cartder.F chainbuild.F checkder_p.F compare_s1.F dihed_cons.
 # Set comipiler flags for different sourcefiles  
 #================================================
 if (Fortran_COMPILER_NAME STREQUAL "ifort")
-  set(FFLAGS0 "-c -ip -w" ) 
-  set(FFLAGS1 "-c -w -g -d2 -CA -CB" ) 
-  set(FFLAGS2 "-c -w -g -00 ")
+  set(FFLAGS0 "-ip -w" ) 
+  set(FFLAGS1 "-w -g -d2 -CA -CB" ) 
+  set(FFLAGS2 "-w -g -00 ")
   #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" )
-  set(FFLAGS3 "-c -w -ipo " )
+  set(FFLAGS3 "-w -ipo " )
 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
-  set(FFLAGS0 "-c -I. " ) 
-  set(FFLAGS1 "-c -g -I. " ) 
-  set(FFLAGS2 "-c -I. ")
+  set(FFLAGS0 "-I. " ) 
+  set(FFLAGS1 "-g -I. " ) 
+  set(FFLAGS2 "-I. ")
   #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" )
-  set(FFLAGS3 "-c -I. " )
+  set(FFLAGS3 "-I. " )
 endif (Fortran_COMPILER_NAME STREQUAL "ifort")