Merge branch 'cmake' of magit1.mpie.de:damask/DAMASK into cmake

This commit is contained in:
Martin Diehl 2016-03-06 08:38:44 +01:00
commit 13072fedc5
2 changed files with 26 additions and 21 deletions

View File

@ -74,6 +74,7 @@ compiler:
linker: linker:
\t@echo \${LINKERNAME} \t@echo \${LINKERNAME}
") ")
find_program (MAKE_EXECUTABLE NAMES make gmake) find_program (MAKE_EXECUTABLE NAMES make gmake)
@ -93,6 +94,10 @@ execute_process(COMMAND ${MAKE_EXECUTABLE} -f ${petsc_config_makefile} "compiler
RESULT_VARIABLE MPIEXEC_RETURN RESULT_VARIABLE MPIEXEC_RETURN
OUTPUT_VARIABLE MPIEXEC OUTPUT_VARIABLE MPIEXEC
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${MPIEXEC} -v OUTPUT_QUIET
RESULT_VARIABLE MPINAME_RETURN
OUTPUT_VARIABLE MPINAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
file (REMOVE ${petsc_config_makefile}) file (REMOVE ${petsc_config_makefile})
# REMOVE DUPLICATE FLAGS FOR COMPILER AND LINKING # REMOVE DUPLICATE FLAGS FOR COMPILER AND LINKING
@ -355,10 +360,9 @@ set (PRECISION_ifort "-real-size 64 -integer-size 32")
################################################################################################### ###################################################################################################
set (PRECISION_gfortran "-fdefault-real-8 -fdefault-double-8") set (PRECISION_gfortran "-fdefault-real-8 -fdefault-double-8")
# set FLAGS
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
if (Fortran_COMPILER_NAME MATCHES "ifort.*") if (MPINAME MATCHES "(^ifort)*")
message("Intel fortran used for MPIF90\n")
set (INTEL_FORTRAN ON) set (INTEL_FORTRAN ON)
# for RELEASE # for RELEASE
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${OPENMP_FLAG_ifort}" ) set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${OPENMP_FLAG_ifort}" )
@ -378,7 +382,8 @@ if (Fortran_COMPILER_NAME MATCHES "ifort.*")
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${DEBUG_OPTIONS_ifort}" ) set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${DEBUG_OPTIONS_ifort}" )
# #
elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*") elseif (MPINAME MATCHES "(^gfortran)*")
message("GNU fortran used for MPIF90\n")
set (GNU_FORTRAN ON) set (GNU_FORTRAN ON)
# for RELEASE # for RELEASE
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${OPENMP_FLAG_gfortran}" ) set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${OPENMP_FLAG_gfortran}" )
@ -397,11 +402,11 @@ elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${DEBUG_OPTIONS_gfortran}") set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${DEBUG_OPTIONS_gfortran}")
# #
elseif (Fortran_COMPILER_NAME MATCHES "g77") elseif (MPINAME MATCHES "(^g77)*")
message (FATAL_ERROR "Fortran 77 is not supported.") message (FATAL_ERROR "Fortran 77 is not supported.")
else (Fortran_COMPILER_NAME MATCHES "ifort.*") else (MPINAME MATCHES "(^ifort)*")
message (FATAL_ERROR "Require Fortran90 from GNU or Intel.") message (FATAL_ERROR "Require Fortran90 from GNU or Intel.")
endif (Fortran_COMPILER_NAME MATCHES "ifort.*") endif (MPINAME MATCHES "(^ifort)*")
# Finalizing # Finalizing
set (CMAKE_Fortran_COMPILER "${MPIEXEC}") set (CMAKE_Fortran_COMPILER "${MPIEXEC}")

View File

@ -23,20 +23,20 @@ cd spectral
## ##
# CMake call # CMake call
# PETSC_DIR | PETSC directory # PETSC_DIR | PETSC directory
# DAMASK_V | DAMASK current revision # DAMASK_V | DAMASK current revision
# CMAKE_BUILD_TYPE | Default set to release (no debugging output) # CMAKE_BUILD_TYPE | Default set to release (no debugging output)
# OPENMP | [ON/OFF] # OPENMP | [ON/OFF]
# OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA] # OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA]
# DAMASK_DRIVER | [SPECTRAL, FEM] # DAMASK_DRIVER | [SPECTRAL, FEM]
# DAMASK_INSTALL | Directory to install binary output # DAMASK_INSTALL | Directory to install binary output
cmake -D PETSC_DIR=${PETSC_DIR} \ cmake -D PETSC_DIR=${PETSC_DIR} \
-D DAMASK_V=${DAMASKVERSION} \ -D DAMASK_V=${DAMASKVERSION} \
-D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_BUILD_TYPE=RELEASE \
-D OPENMP=ON \ -D OPENMP=ON \
-D OPTIMIZATION=DEFENSIVE \ -D OPTIMIZATION=DEFENSIVE \
-D DAMASK_DRIVER=SPECTRAL \ -D DAMASK_DRIVER=SPECTRAL \
-D DAMASK_INSTALL=${HOME}/bin \ -D DAMASK_INSTALL=${HOME}/bin \
../.. ../..
echo echo