set different compiling flags for FEM and SPECTRAL
This commit is contained in:
parent
a8f0624849
commit
a0e98c328c
213
CMakeLists.txt
213
CMakeLists.txt
|
@ -20,58 +20,68 @@ project (DAMASK Fortran)
|
||||||
set (DAMASK_VERSION_MAJOR 1)
|
set (DAMASK_VERSION_MAJOR 1)
|
||||||
set (DAMASK_VERSION_MINOR ${DAMASK_V})
|
set (DAMASK_VERSION_MINOR ${DAMASK_V})
|
||||||
|
|
||||||
##
|
# PETSC and HDF5 is required
|
||||||
# find_package() might not work on customized system.
|
if (NOT DEFINED PETSC_DIR)
|
||||||
# it is recommended for the user to specify the location
|
message (FATAL_ERROR "PETSC_DIR is not found!")
|
||||||
# of PETSc and HDF5 library
|
endif (NOT DEFINED PETSC_DIR)
|
||||||
if (defined PETSC_DIR)
|
if (NOT DEFINED HDF5_DIR)
|
||||||
set (PETSC ${PETSC_DIR})
|
message (FATAL_ERROR "HDF5_DIR is not found!" )
|
||||||
else (defined PETSC_DIR)
|
endif (NOT DEFINED HDF5_DIR)
|
||||||
find_package(PETSC)
|
|
||||||
endif (defined PETSC_DIR)
|
# OUTPUT TYPE
|
||||||
|
set (SPECTRAL OFF)
|
||||||
|
set (FEM OFF)
|
||||||
|
set (MARC OFF)
|
||||||
|
set (ABAQUS OFF)
|
||||||
|
if (DAMASK_DRIVER STREQUAL "SPECTRAL")
|
||||||
|
set (SPECTRAL ON )
|
||||||
|
elseif (DAMASK_DRIVER STREQUAL "FEM")
|
||||||
|
set (FEM ON )
|
||||||
|
elseif (DAMASK_DRIVER STREQUAL "MARC")
|
||||||
|
set (MARC ON )
|
||||||
|
elseif (DAMASK_DRIVER STREQUAL "ABAQUS")
|
||||||
|
set (ABAQUS ON )
|
||||||
|
else (DAMASK_DRIVER STREQUAL "SPECTRAL")
|
||||||
|
message (FATAL_ERROR "Unknown output, check build script!")
|
||||||
|
endif (DAMASK_DRIVER STREQUAL "SPECTRAL")
|
||||||
|
|
||||||
if (defined HDF5_DIR)
|
|
||||||
set (HDF5 ${HDF5_DIR})
|
|
||||||
else (defined HDF5_DIR)
|
|
||||||
find_package(HDF5)
|
|
||||||
endif (defined HDF5_DIR)
|
|
||||||
|
|
||||||
##
|
|
||||||
# set system include directories
|
# set system include directories
|
||||||
include_directories(
|
include_directories(
|
||||||
${PETSC}/lib/petsc/conf/variables
|
${PETSC_DIR}/lib/petsc/conf/variables
|
||||||
${PETSC}/lib/petsc/conf/rules
|
${PETSC_DIR}/lib/petsc/conf/rules
|
||||||
../lib
|
../lib
|
||||||
${HDF5}/include
|
${HDF5_DIR}/include
|
||||||
)
|
)
|
||||||
|
link_directories(${HDF5_DIR}/lib)
|
||||||
|
|
||||||
##
|
##
|
||||||
# set compile and debug flags
|
# set compile and debug flags
|
||||||
if (OPENMP MATCHES 'ON')
|
if (OPENMP)
|
||||||
set (OPENMP_FLAG_ifort "-openmp -openmp-report0 -parallel")
|
set (OPENMP_FLAG_ifort "-openmp -openmp-report0 -parallel")
|
||||||
set (OPENMP_FLAG_gfortran "-fopenmp")
|
set (OPENMP_FLAG_gfortran "-fopenmp")
|
||||||
else (OPENMP MATCHES 'ON')
|
else (OPENMP)
|
||||||
message("No openmp support specified")
|
message("No openmp support specified")
|
||||||
set (OPENMP_FLAG_ifort "")
|
set (OPENMP_FLAG_ifort "")
|
||||||
set (OPENMP_FLAG_gfortran "")
|
set (OPENMP_FLAG_gfortran "")
|
||||||
endif (OPENMP MATCHES 'ON')
|
endif (OPENMP)
|
||||||
|
|
||||||
if (OPTIMIZATION MATCHES "OFF")
|
if (OPTIMIZATION STREQUAL "OFF")
|
||||||
set (OPTIMIZATION_ifort "-O0 -no-ip")
|
set (OPTIMIZATION_ifort "-O0 -no-ip")
|
||||||
set (OPTIMIZATION_gfortran "-O0" )
|
set (OPTIMIZATION_gfortran "-O0" )
|
||||||
elseif (OPTIMIZATION MATCHES "DEFENSIVE")
|
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
|
||||||
set (OPTIMIZATION_ifort "-O2")
|
set (OPTIMIZATION_ifort "-O2")
|
||||||
set (OPTIMIZATION_gfortran "-O2")
|
set (OPTIMIZATION_gfortran "-O2")
|
||||||
elseif (OPTIMIZATION MATCHES "AGGRESSIVE")
|
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
|
||||||
set (OPTIMIZATION_ifort "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost" ) #-fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
|
set (OPTIMIZATION_ifort "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost" ) #-fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
|
||||||
set (OPTIMIZATION_gfortran "-O3 -ffast-math -funroll-loops -ftree-vectorize")
|
set (OPTIMIZATION_gfortran "-O3 -ffast-math -funroll-loops -ftree-vectorize")
|
||||||
elseif (OPTIMIZATION MATCHES "ULTRA")
|
elseif (OPTIMIZATION STREQUAL "ULTRA")
|
||||||
set (OPTIMIZATION_ifort "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost" ) #-fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
|
set (OPTIMIZATION_ifort "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost" ) #-fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost"
|
||||||
set (OPTIMIZATION_gfortran "-O3 -ffast-math -funroll-loops -ftree-vectorize")
|
set (OPTIMIZATION_gfortran "-O3 -ffast-math -funroll-loops -ftree-vectorize")
|
||||||
else (OPTIMIZATION MATCHES "OFF")
|
else (OPTIMIZATION STREQUAL "OFF")
|
||||||
set (OPTIMIZATION_ifort "-O2")
|
set (OPTIMIZATION_ifort "-O2")
|
||||||
set (OPTIMIZATION_gfortran "-O2")
|
set (OPTIMIZATION_gfortran "-O2")
|
||||||
endif (OPTIMIZATION MATCHES "OFF")
|
endif (OPTIMIZATION STREQUAL "OFF")
|
||||||
|
|
||||||
set (STANDARD_CHECK_ifort "-stand f08 -standard-semantics")
|
set (STANDARD_CHECK_ifort "-stand f08 -standard-semantics")
|
||||||
set (STANDARD_CHECK_gfortran "-std=f2008ts -pedantic-errors" )
|
set (STANDARD_CHECK_gfortran "-std=f2008ts -pedantic-errors" )
|
||||||
|
@ -104,19 +114,18 @@ set (STANDARD_CHECK_gfortran "-std=f2008ts -pedantic-errors" )
|
||||||
# all:
|
# all:
|
||||||
# -name as_is: case sensitive Fortran!
|
# -name as_is: case sensitive Fortran!
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
set (COMPILE_OPTIONS_ifort "-DDAMASKVERSION=${DAMASK_V}"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -DDAMASKVERSION=${DAMASK_V}" )
|
||||||
"-fpp"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -fpp" )
|
||||||
"-ftz"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -ftz" )
|
||||||
"-assume byterecl,fpe_summary"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -assume byterecl,fpe_summary" )
|
||||||
"-diag-disable 5268"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -diag-disable 5268" )
|
||||||
"-warn declarations"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn declarations" )
|
||||||
"-warn general"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn general" )
|
||||||
"-warn usage"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn usage" )
|
||||||
"-warn interfaces"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn interfaces" )
|
||||||
"-warn ignore_loc"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn ignore_loc" )
|
||||||
"-warn alignments"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn alignments" )
|
||||||
"-warn unused"
|
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn unused" )
|
||||||
)
|
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
# COMPILE SWITCHES FOR RUNTIME DEBUGGING
|
# COMPILE SWITCHES FOR RUNTIME DEBUGGING
|
||||||
|
@ -143,18 +152,17 @@ set (COMPILE_OPTIONS_ifort "-DDAMASKVERSION=${DAMASK_V}"
|
||||||
# arg_temp_created: will cause a lot of warnings because we create a bunch of temporary arrays (performance?)
|
# arg_temp_created: will cause a lot of warnings because we create a bunch of temporary arrays (performance?)
|
||||||
# stack:
|
# stack:
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
set (DEBUG_OPTIONS_ifort "-g"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -g" )
|
||||||
"-traceback"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -traceback" )
|
||||||
"-gen-interfaces"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -gen-interfaces" )
|
||||||
"-fp-stack-check"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -fp-stack-check" )
|
||||||
"-fp-model strict"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -fp-model strict" )
|
||||||
"-check bounds,format,output_conversion,pointers,uninit"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -check bounds,format,output_conversion,pointers,uninit" )
|
||||||
"-ftrapuv"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -ftrapuv" )
|
||||||
"-fpe-all0"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -fpe-all0" )
|
||||||
"-warn errors"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -warn errors" )
|
||||||
"-warn stderrors"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -warn stderrors" )
|
||||||
"-debug-parameters all"
|
set (DEBUG_OPTIONS_ifort "${DEBUG_OPTIONS_ifort} -debug-parameters all" )
|
||||||
)
|
|
||||||
|
|
||||||
set (LINK_OPTIONS_ifort "-shared-intel")
|
set (LINK_OPTIONS_ifort "-shared-intel")
|
||||||
|
|
||||||
|
@ -163,7 +171,7 @@ set (LINK_OPTIONS_ifort "-shared-intel")
|
||||||
# -shared
|
# -shared
|
||||||
# -Wl,-undefined,dynamic_lookup:ensure to link against dynamic libraries
|
# -Wl,-undefined,dynamic_lookup:ensure to link against dynamic libraries
|
||||||
# -xf95-cpp-input: preprocessor
|
# -xf95-cpp-input: preprocessor
|
||||||
# -ffree-line-length-132: restrict line length to the standard 132 characters
|
# -ffree-line-length-132: restrict line length to the standard 240 characters (lattice.f90 require larger)
|
||||||
# -ffpe-summary: print summary of floating point exeptions (‘invalid’, ‘zero’, ‘overflow’, ‘underflow’, ‘inexact’ and ‘denormal’)
|
# -ffpe-summary: print summary of floating point exeptions (‘invalid’, ‘zero’, ‘overflow’, ‘underflow’, ‘inexact’ and ‘denormal’)
|
||||||
# -fimplicit-none: assume "implicit-none" even if not present in source
|
# -fimplicit-none: assume "implicit-none" even if not present in source
|
||||||
# -fmodule-private: assume "private" even if not present in source
|
# -fmodule-private: assume "private" even if not present in source
|
||||||
|
@ -234,21 +242,20 @@ set (LINK_OPTIONS_ifort "-shared-intel")
|
||||||
# -Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
|
# -Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
|
||||||
# -Wstrict-overflow:
|
# -Wstrict-overflow:
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
set (COMPILE_OPTIONS_gfortran "-DDAMASKVERSION=${DAMASKVERSION}"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -DDAMASKVERSION=${DAMASKVERSION}")
|
||||||
"-xf95-cpp-input"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -xf95-cpp-input" )
|
||||||
"-ffree-line-length-132"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -ffree-line-length-240" )
|
||||||
"-fimplicit-none"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fimplicit-none" )
|
||||||
"-fmodule-private"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fmodule-private" )
|
||||||
"-Wall"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wall" )
|
||||||
"-Wextra"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wextra" )
|
||||||
"-Wcharacter-truncation"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wcharacter-truncation" )
|
||||||
"-Wunderflow"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wunderflow" )
|
||||||
"-Wsuggest-attribute=pure"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wsuggest-attribute=pure" )
|
||||||
"-Wsuggest-attribute=noreturn"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wsuggest-attribute=noreturn" )
|
||||||
"-Wconversion-extra"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wconversion-extra" )
|
||||||
"-Wimplicit-procedure"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wimplicit-procedure" )
|
||||||
"-Wno-unused-parameter"
|
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wno-unused-parameter" )
|
||||||
)
|
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
# COMPILE SWITCHES FOR RUNTIME DEBUGGING
|
# COMPILE SWITCHES FOR RUNTIME DEBUGGING
|
||||||
|
@ -268,39 +275,48 @@ set (COMPILE_OPTIONS_gfortran "-DDAMASKVERSION=${DAMASKVERSION}"
|
||||||
# denormal, \
|
# denormal, \
|
||||||
# underflow
|
# underflow
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
set (DEBUG_OPTIONS_gfortran "-g"
|
set (DEBUG_OPTIONS_gfortran "${DEBUG_OPTIONS_gfortran} -g" )
|
||||||
"-fbacktrace"
|
set (DEBUG_OPTIONS_gfortran "${DEBUG_OPTIONS_gfortran} -fbacktrace" )
|
||||||
"-fdump-core"
|
set (DEBUG_OPTIONS_gfortran "${DEBUG_OPTIONS_gfortran} -fdump-core" )
|
||||||
"-fcheck=all"
|
set (DEBUG_OPTIONS_gfortran "${DEBUG_OPTIONS_gfortran} -fcheck=all" )
|
||||||
"-ffpe-trap=invalid,zero,overflow"
|
set (DEBUG_OPTIONS_gfortran "${DEBUG_OPTIONS_gfortran} -ffpe-trap=invalid,zero,overflow")
|
||||||
)
|
|
||||||
|
|
||||||
set (LINK_OPTIONS_gfortran "-Wl,-undefined,dynamic_lookup")
|
set (LINK_OPTIONS_gfortran "-Wl,-undefined,dynamic_lookup")
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
#-real-size 32: set precision to one of those 32/64/128 (= 4/8/16 bytes) for standard real (=8 for pReal)
|
||||||
|
#-integer-size 16: set precision to one of those 16/32/64 (= 2/4/8 bytes) for standard integer (=4 for pInt)
|
||||||
|
###################################################################################################
|
||||||
|
set (PRECISION_ifort "-real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4")
|
||||||
|
|
||||||
|
###################################################################################################
|
||||||
|
#-fdefault-real-8: set precision to 8 bytes for standard real (=8 for pReal). Will set size of double to 16 bytes as long as -fdefault-double-8 is not set
|
||||||
|
#-fdefault-double-8: set precision to 8 bytes for double real, would be 16 bytes because -fdefault-real-8 is used
|
||||||
|
#-fdefault-integer-8: Use it to set precision to 8 bytes for integer, don't use it for the standard case of pInt=4 (there is no -fdefault-integer-4)
|
||||||
|
###################################################################################################
|
||||||
|
set (PRECISION_gfortran "-fdefault-real-8 -fdefault-double-8 -DFLOAT=8 -DINT=4")
|
||||||
|
|
||||||
# set FLAGS
|
# set FLAGS
|
||||||
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
|
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
|
||||||
|
|
||||||
if (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
if (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||||
|
# need the PETSC wrapped version of ifort
|
||||||
|
set (CMAKE_Fortran_COMPILER "${PETSC_DIR}/bin/mpifort")
|
||||||
# for RELEASE
|
# for RELEASE
|
||||||
set (CMAKE_Fortran_FLAGS_RELEASE ${COMPILE_OPTIONS_ifort})
|
set (CMAKE_Fortran_FLAGS_RELEASE "${COMPILE_OPTIONS_ifort}")
|
||||||
set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${LINK_OPTIONS_ifort}
|
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${LINK_OPTIONS_ifort}")
|
||||||
${OPTIMIZATION_ifort} )
|
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OPTIMIZATION_ifort}")
|
||||||
# for DEBUG
|
# for DEBUG
|
||||||
set (CMAKE_Fortran_FLAGS_DEBUG ${COMPILE_OPTIONS_ifort}
|
set (CMAKE_Fortran_FLAGS_DEBUG "${COMPILE_OPTIONS_ifort} ${DEBUG_OPTIONS_ifort}")
|
||||||
${DEBUG_OPTIONS_ifort} )
|
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${LINK_OPTIONS_ifort} ${DEBUG_OPTIONS_ifort}")
|
||||||
set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${LINK_OPTIONS_ifort}
|
|
||||||
${DEBUG_OPTIONS_ifort} )
|
|
||||||
#
|
|
||||||
elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
|
elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
|
||||||
|
set (CMAKE_Fortran_COMPILER "${PETSC_DIR}/bin/mpif90")
|
||||||
# for RELEASE
|
# for RELEASE
|
||||||
set (CMAKE_Fortran_FLAGS_RELEASE ${COMPILE_OPTIONS_gfortran})
|
set (CMAKE_Fortran_FLAGS_RELEASE "${COMPILE_OPTIONS_gfortran}")
|
||||||
set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${LINK_OPTIONS_gfortran}
|
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${LINK_OPTIONS_gfortran} ${OPTIMIZATION_gfortran}")
|
||||||
${OPTIMIZATION_gfortran} )
|
|
||||||
# for DEBUG
|
# for DEBUG
|
||||||
set (CMAKE_Fortran_FLAGS_DEBUG ${COMPILE_OPTIONS_gfortran}
|
set (CMAKE_Fortran_FLAGS_DEBUG "${COMPILE_OPTIONS_gfortran} ${DEBUG_OPTIONS_gfortran}")
|
||||||
${DEBUG_OPTIONS_gfortran} )
|
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${LINK_OPTIONS_gfortran} ${DEBUG_OPTIONS_gfortran}")
|
||||||
set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${LINK_OPTIONS_gfortran}
|
|
||||||
${DEBUG_OPTIONS_gfortran} )
|
|
||||||
#
|
#
|
||||||
elseif (Fortran_COMPILER_NAME MATCHES "g77")
|
elseif (Fortran_COMPILER_NAME MATCHES "g77")
|
||||||
message (FATAL_ERROR "Fortran 77 is not supported.")
|
message (FATAL_ERROR "Fortran 77 is not supported.")
|
||||||
|
@ -308,14 +324,27 @@ else (Fortran_COMPILER_NAME 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 (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||||
|
|
||||||
|
# additional flag for SPECTRAL solver
|
||||||
|
if (SPECTRAL)
|
||||||
|
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -DSpectral")
|
||||||
|
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -DSpectral")
|
||||||
|
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${LINK_OPTIONS_ifort} -DSpectral")
|
||||||
|
endif (SPECTRAL)
|
||||||
|
# additional flags for FEM solver
|
||||||
|
if (FEM)
|
||||||
|
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -DFEM")
|
||||||
|
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -DFEM")
|
||||||
|
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${LINK_OPTIONS_ifort} -DFEM")
|
||||||
|
endif (FEM)
|
||||||
|
|
||||||
##
|
##
|
||||||
# ADD CODE(SOURCE) DIRECTORY
|
# ADD CODE DIRECTORY
|
||||||
add_subdirectory(code)
|
add_subdirectory(code)
|
||||||
|
|
||||||
##
|
##
|
||||||
# ADD TESTING CASES
|
# ADD TESTING CASES
|
||||||
add_test (SmokeTestRun
|
# add_test (SmokeTestRun
|
||||||
DAMASK_spectral.exe -g test/test1.geom -l test/test.load)
|
# DAMASK_spectral.exe -g test/test1.geom -l test/test.load)
|
||||||
|
|
||||||
# Enable Dashboard scripting
|
# Enable Dashboard scripting
|
||||||
# include (CTest)
|
# include (CTest)
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cat README
|
cat README
|
||||||
|
echo
|
||||||
echo "Building spectral solver with ${FC}"
|
echo "Building spectral solver with ${FC}"
|
||||||
DAMASKVERSION :=$(sh cat ../VERSION)
|
DAMASKVERSION=$(cat VERSION)
|
||||||
|
|
||||||
# prepare building directory
|
# prepare building directory
|
||||||
|
# structure:
|
||||||
|
# BUILD_DIR
|
||||||
|
# |-BUILD_SPECTRAL
|
||||||
|
# |-BUILD_FEM
|
||||||
|
# |-BUILD_MARC
|
||||||
|
if [ ! -d build ]; then
|
||||||
|
mkdir build
|
||||||
|
fi
|
||||||
|
cd build
|
||||||
if [ -d build_spectral ] ; then
|
if [ -d build_spectral ] ; then
|
||||||
rm -rf build_spectral
|
rm -rf build_spectral
|
||||||
fi
|
fi
|
||||||
|
@ -17,16 +27,17 @@ cd build_spectral
|
||||||
# HDF5_DIR | HDF5 library (same compiler for DAMASK)
|
# HDF5_DIR | HDF5 library (same compiler for DAMASK)
|
||||||
# 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" will turn on OPENMP support
|
# OPENMP | [ON/OFF]
|
||||||
# OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA]
|
# OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA]
|
||||||
|
# DAMASK_DRIVER | [SPECTRAL, FEM, MARC]
|
||||||
cmake -D PETSC_DIR=${PETSC_DIR} \
|
cmake -D PETSC_DIR=${PETSC_DIR} \
|
||||||
-D HDF5_DIR=${HDF5_DIR} \
|
-D HDF5_DIR=${HDF5_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 \
|
||||||
|
../..
|
||||||
|
|
||||||
# instruction for compiling
|
# instruction for compiling
|
||||||
echo "Please go into build_spectral directory and use make"
|
echo "Please go into the directory above and use make to build DAMASK_spectal.exe"
|
||||||
echo "to build DAMASK_spectal.exe"
|
|
|
@ -1,4 +1,19 @@
|
||||||
|
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/damage)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/homogenization)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/hydrogenflux)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/kinematics)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/plastic)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/porosity)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/source)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/spectral)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/thermal)
|
||||||
|
include_directories(${PROJECT_SRC_DIR}/code/vacancyflux)
|
||||||
|
|
||||||
# group sources for base modules
|
# group sources for base modules
|
||||||
|
# the FEM modules would require special attention
|
||||||
|
# will take care of it later.
|
||||||
set (SRC "CPFEM"
|
set (SRC "CPFEM"
|
||||||
"CPFEM2"
|
"CPFEM2"
|
||||||
"core_quit"
|
"core_quit"
|
||||||
|
@ -6,7 +21,7 @@ set (SRC "CPFEM"
|
||||||
"compilation_info"
|
"compilation_info"
|
||||||
"constitutive"
|
"constitutive"
|
||||||
"crystallite"
|
"crystallite"
|
||||||
"damask_hdf5.f90"
|
"damask_hdf5"
|
||||||
"debug"
|
"debug"
|
||||||
"FEsolving"
|
"FEsolving"
|
||||||
"IO"
|
"IO"
|
||||||
|
@ -22,12 +37,12 @@ set (SRC "CPFEM"
|
||||||
|
|
||||||
# compiler base modules
|
# compiler base modules
|
||||||
foreach (p ${SRC})
|
foreach (p ${SRC})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${SRC})
|
foreach (p ${SRC})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# compile each sub moudel
|
# compile each sub moudel
|
||||||
|
@ -37,11 +52,11 @@ add_subdirectory(hydrogenflux)
|
||||||
add_subdirectory(kinematics)
|
add_subdirectory(kinematics)
|
||||||
add_subdirectory(plastic)
|
add_subdirectory(plastic)
|
||||||
add_subdirectory(porosity)
|
add_subdirectory(porosity)
|
||||||
add_subdirectory(sources)
|
add_subdirectory(source)
|
||||||
add_subdirectory(spectral)
|
add_subdirectory(spectral)
|
||||||
add_subdirectory(thermal)
|
add_subdirectory(thermal)
|
||||||
add_subdirectory(vacancyflux)
|
add_subdirectory(vacancyflux)
|
||||||
|
|
||||||
# compile spectral solver
|
# compile spectral solver
|
||||||
add_executable(DAMASKSpectral.exe DAMASK_spectral.f90)
|
add_executable(DAMASKSpectral.exe DAMASK_spectral.f90)
|
||||||
target_link_libraries (DAMASKSpectral.exe ${AUX_LIB})
|
target_link_libraries (DAMASKSpectral.exe ${DAMASK_LIB})
|
|
@ -6,10 +6,10 @@ set (DAMAGE "damage_none"
|
||||||
|
|
||||||
# compile damage module
|
# compile damage module
|
||||||
foreach (p ${DAMAGE})
|
foreach (p ${DAMAGE})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries for linking
|
# set libraries for linking
|
||||||
foreach (p ${DAMAGE})
|
foreach (p ${DAMAGE})
|
||||||
set (AUX_LIB ${AUX_LIB} ${P})
|
set (DAMASK_LIB ${DAMASK_LIB} ${P})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -7,10 +7,10 @@ set (HOMOGENIZATION "homogenization"
|
||||||
|
|
||||||
# compile modules
|
# compile modules
|
||||||
foreach (p ${HOMOGENIZATION})
|
foreach (p ${HOMOGENIZATION})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${HOMOGENIZATION})
|
foreach (p ${HOMOGENIZATION})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -5,10 +5,10 @@ set (HYDROGENFLUX "hydrogenflux_isoconc"
|
||||||
|
|
||||||
# compile hydrogenflux modules
|
# compile hydrogenflux modules
|
||||||
foreach (p ${HYDROGENFLUX})
|
foreach (p ${HYDROGENFLUX})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${HYDROGENFLUX})
|
foreach (p ${HYDROGENFLUX})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -8,10 +8,10 @@ set (KINEMATICS "kinematics_cleavage_opening"
|
||||||
|
|
||||||
# compile kinamtic modules
|
# compile kinamtic modules
|
||||||
foreach (p ${KINEMATICS})
|
foreach (p ${KINEMATICS})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${KINEMATICS})
|
foreach (p ${KINEMATICS})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -12,10 +12,10 @@ set (PLASTIC "plastic_dislotwin"
|
||||||
|
|
||||||
# compile module
|
# compile module
|
||||||
foreach (p ${PLASTIC})
|
foreach (p ${PLASTIC})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${PLASTIC})
|
foreach (p ${PLASTIC})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -5,10 +5,10 @@ set (POROSITY "porosity_none"
|
||||||
|
|
||||||
# compile porosity modules
|
# compile porosity modules
|
||||||
foreach (p ${POROSITY})
|
foreach (p ${POROSITY})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${POROSITY})
|
foreach (p ${POROSITY})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -12,10 +12,10 @@ set (SOURCE "source_thermal_dissipation"
|
||||||
|
|
||||||
# compile modules for source
|
# compile modules for source
|
||||||
foreach (p ${SOURCE})
|
foreach (p ${SOURCE})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${SOURCE})
|
foreach (p ${SOURCE})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -10,10 +10,10 @@ set (SPECTRAL "spectral_damage"
|
||||||
|
|
||||||
# compile spectral solver driver module
|
# compile spectral solver driver module
|
||||||
foreach (p ${SPECTRAL})
|
foreach (p ${SPECTRAL})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${SPECTRAL})
|
foreach (p ${SPECTRAL})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -6,10 +6,10 @@ set (THERMAL "thermal_isothermal"
|
||||||
|
|
||||||
# compiler theraml module
|
# compiler theraml module
|
||||||
foreach (p ${THERMAL})
|
foreach (p ${THERMAL})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${THERMAL})
|
foreach (p ${THERMAL})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
|
@ -6,10 +6,10 @@ set (VACANCYFLUX "vacancyflux_isoconc"
|
||||||
|
|
||||||
# compiler as module
|
# compiler as module
|
||||||
foreach (p ${VACANCYFLUX})
|
foreach (p ${VACANCYFLUX})
|
||||||
add_library (${p} MODULE "${p}.f90")
|
add_library (${p} "${p}.f90")
|
||||||
endforeach (p)
|
endforeach (p)
|
||||||
|
|
||||||
# set libraries/modules for linking
|
# set libraries/modules for linking
|
||||||
foreach (p ${VACANCYFLUX})
|
foreach (p ${VACANCYFLUX})
|
||||||
set (AUX_LIB ${AUX_LIB} ${p})
|
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||||
endforeach (p)
|
endforeach (p)
|
Loading…
Reference in New Issue