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
# 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")
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} )
# 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")