trying to fix the subdirectory issue
This commit is contained in:
parent
9d89570ffb
commit
e3f82f7629
|
@ -79,7 +79,8 @@ endif (DAMASK_DRIVER STREQUAL "SPECTRAL")
|
|||
|
||||
|
||||
# set system include directories
|
||||
include_directories(${PETSC_DIR}/include
|
||||
include_directories(${CMAKE_SOURCE_DIR}
|
||||
${PETSC_DIR}/include
|
||||
lib
|
||||
${HDF5_DIR}/include
|
||||
)
|
||||
|
@ -113,7 +114,7 @@ else (OPTIMIZATION STREQUAL "OFF")
|
|||
set (OPTIMIZATION_gfortran "-O2")
|
||||
endif (OPTIMIZATION STREQUAL "OFF")
|
||||
|
||||
set (STANDARD_CHECK_ifort "-stand f08 -standard-semantics")
|
||||
set (STANDARD_CHECK_ifort "-stand none -standard-semantics")
|
||||
set (STANDARD_CHECK_gfortran "-std=f2008ts -pedantic-errors" )
|
||||
|
||||
###################################################################################################
|
||||
|
@ -144,7 +145,10 @@ set (STANDARD_CHECK_gfortran "-std=f2008ts -pedantic-errors" )
|
|||
# all:
|
||||
# -name as_is: case sensitive Fortran!
|
||||
###################################################################################################
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -DDAMASKVERSION=${DAMASK_V}" )
|
||||
# -diag-disable 7410 should disable warning about directory statement in inquire function,
|
||||
# but does not work. hence the other 2 statements
|
||||
###################################################################################################
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -DDAMASKVERSION=\\\"${DAMASK_V}\\\"" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -fpp" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -ftz" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -assume byterecl,fpe_summary")
|
||||
|
@ -156,7 +160,9 @@ set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn interfaces"
|
|||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn ignore_loc" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn alignments" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn unused" )
|
||||
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -diag-remark 7410" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -stand none" )
|
||||
set (COMPILE_OPTIONS_ifort "${COMPILE_OPTIONS_ifort} -warn nostderrors" )
|
||||
###################################################################################################
|
||||
# COMPILE SWITCHES FOR RUNTIME DEBUGGING
|
||||
# -g: Generate symbolic debugging information in the object file
|
||||
|
@ -272,6 +278,14 @@ set (LINK_OPTIONS_ifort "-shared-intel")
|
|||
# -Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
|
||||
# -Wstrict-overflow:
|
||||
###################################################################################################
|
||||
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
|
||||
# --> allows the definition of DAMASK_NaN
|
||||
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
|
||||
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
|
||||
# --> allows the use of 'isnan'
|
||||
#-fno-fast-math:
|
||||
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
|
||||
###################################################################################################
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -DDAMASKVERSION=${DAMASKVERSION}")
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -xf95-cpp-input" )
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -ffree-line-length-240" )
|
||||
|
@ -286,7 +300,10 @@ set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wsuggest-attribute=n
|
|||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wconversion-extra" )
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wimplicit-procedure" )
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -Wno-unused-parameter" )
|
||||
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fno-range-check" )
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fall-intrinsics" )
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fno-fast-math" )
|
||||
set (COMPILE_OPTIONS_gfortran "${COMPILE_OPTIONS_gfortran} -fall-intrinsics" )
|
||||
###################################################################################################
|
||||
# COMPILE SWITCHES FOR RUNTIME DEBUGGING
|
||||
# -ffpe-trap=invalid,\ stop execution if floating point exception is detected (NaN is silent)
|
||||
|
@ -348,6 +365,7 @@ if (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
|||
|
||||
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${LINK_OPTIONS_ifort}" )
|
||||
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${DEBUG_OPTIONS_ifort}")
|
||||
#
|
||||
elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
|
||||
set (CMAKE_Fortran_COMPILER "${PETSC_DIR}/bin/mpif90")
|
||||
# for RELEASE
|
||||
|
@ -398,6 +416,7 @@ set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -DPETSc"
|
|||
# NOTE: some file might need different flags for compiling, DAMASK_$FLAGS
|
||||
# are essentially the swap for this purpose
|
||||
set (DAMASK_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE}" )
|
||||
set (DAMASK_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}" )
|
||||
set (DAMASK_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
|
||||
set (DAMASK_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" )
|
||||
|
||||
|
|
|
@ -1,51 +1,17 @@
|
|||
# The dependency detection in CMake is not functioning for Fortran
|
||||
# !!! EXPLICIT DEPENDENCY DECLARATION !!!
|
||||
###################################################################################################
|
||||
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
|
||||
# --> allows the definition of DAMASK_NaN
|
||||
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
|
||||
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
|
||||
# --> allows the use of 'isnan'
|
||||
#-fno-fast-math:
|
||||
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
|
||||
###################################################################################################
|
||||
if (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
set (SPEICAL_FLAGS "")
|
||||
elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
|
||||
set (SPEICAL_FLAGS "-fno-range-check -fall-intrinsics -fno-fast-math")
|
||||
else (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
message (FATAL_ERROR "Unknown Fortrna compiler.")
|
||||
endif (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "${DAMASK_Fortran_FLAGS_RELEASE} ${SPEICAL_FLAGS}")
|
||||
add_library(DAMASK_PREC "prec.f90")
|
||||
|
||||
add_library(DAMASK_prec "prec.f90")
|
||||
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "${DAMASK_Fortran_FLAGS_RELEASE}")
|
||||
|
||||
###################################################################################################
|
||||
# -diag-disable 7410 should disable warning about directory statement in inquire function,
|
||||
# but does not work. hence the other 2 statements
|
||||
###################################################################################################
|
||||
if (SPECTRAL)
|
||||
if (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
set (SPEICAL_FLAGS "-diag-remark 7410 -stand none -warn nostderrors")
|
||||
elseif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
|
||||
set (SPEICAL_FLAGS "-fall-intrinsics")
|
||||
else (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
message (FATAL_ERROR "Unknown Fortrna compiler.")
|
||||
endif (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "${DAMASK_Fortran_FLAGS_RELEASE} ${SPEICAL_FLAGS}")
|
||||
|
||||
add_library(DAMASK_interface "spectral_interface.f90")
|
||||
target_link_libraries(DAMASK_interface DAMASK_prec)
|
||||
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "${DAMASK_Fortran_FLAGS_RELEASE}")
|
||||
add_library(DAMASK_INTERFACE "spectral_interface.f90")
|
||||
target_link_libraries(DAMASK_INTERFACE DAMASK_PREC)
|
||||
elseif(SPECTRAL)
|
||||
message(FATAL_ERROR "NOT IMPLEMENTED YET")
|
||||
endif(SPECTRAL)
|
||||
|
||||
add_library(DAMASK_IO "IO.f90")
|
||||
target_link_libraries(DAMASK_IO DAMASK_interface)
|
||||
target_link_libraries(DAMASK_IO DAMASK_INTERFACE)
|
||||
|
||||
add_library(DAMASK_LIBS "libs.f90")
|
||||
target_link_libraries(DAMASK_LIBS DAMASK_IO)
|
||||
|
@ -56,49 +22,38 @@ target_link_libraries(DAMASK_NUMERICS DAMASK_LIBS)
|
|||
add_library(DAMASK_DEBUG "debug.f90")
|
||||
target_link_libraries(DAMASK_DEBUG DAMASK_NUMERICS)
|
||||
|
||||
add_library(DAMASK_BASICS ALIAS DAMASK_DEBUG)
|
||||
add_library(DAMASK_FEsolving "FEsolving.f90")
|
||||
target_link_libraries(DAMASK_FEsolving DAMASK_DEBUG)
|
||||
|
||||
# group sources for base modules
|
||||
# the FEM modules would require special attention
|
||||
# will take care of it later.
|
||||
set (SRC "CPFEM"
|
||||
"CPFEM2"
|
||||
"core_quit"
|
||||
"commercialFEM_fileList"
|
||||
"compilation_info"
|
||||
"constitutive"
|
||||
"crystallite"
|
||||
"damask_hdf5"
|
||||
"lattice"
|
||||
"material"
|
||||
"math"
|
||||
"mesh"
|
||||
"quit__genmod"
|
||||
)
|
||||
add_library(DAMASK_MATH "math.f90")
|
||||
target_link_libraries(DAMASK_MATH DAMASK_FEsolving)
|
||||
|
||||
# compiler base modules
|
||||
foreach (p ${SRC})
|
||||
add_library (${p} "${p}.f90")
|
||||
target_link_libraries(${p} DAMASK_BASICS)
|
||||
endforeach (p)
|
||||
# SPECTRAL solver and FEM solver use different mesh
|
||||
# source files
|
||||
if (SPECTRAL)
|
||||
add_library(DAMASK_MESH "mesh.f90")
|
||||
endif(SPECTRAL)
|
||||
if (FEM)
|
||||
add_library(DAMASK_MESH "${FEM_DIR}/meshFEM.f90")
|
||||
endif(FEM)
|
||||
target_link_libraries(DAMASK_MESH DAMASK_MATH)
|
||||
|
||||
# set libraries/modules for linking
|
||||
foreach (p ${SRC})
|
||||
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||
endforeach (p)
|
||||
add_library(DAMASK_MATERIAL "material.f90")
|
||||
target_link_libraries(DAMASK_MATERIAL DAMASK_MESH)
|
||||
|
||||
# compile each sub moudel
|
||||
add_subdirectory(damage)
|
||||
add_subdirectory(homogenization)
|
||||
add_subdirectory(hydrogenflux)
|
||||
add_subdirectory(kinematics)
|
||||
add_library(DAMASK_LATTICE "lattice.f90")
|
||||
target_link_libraries(DAMASK_LATTICE DAMASK_MATERIAL)
|
||||
add_library(DAMASK_DRIVERS ALIAS DAMASK_LATTICE)
|
||||
|
||||
# For each modular section
|
||||
add_subdirectory(plastic)
|
||||
add_subdirectory(porosity)
|
||||
add_subdirectory(source)
|
||||
add_subdirectory(spectral)
|
||||
add_subdirectory(thermal)
|
||||
add_subdirectory(vacancyflux)
|
||||
# add_subdirectory(kinematics)
|
||||
# add_subdirectory(source)
|
||||
|
||||
# add_library(DAMASK_CONSTITUTIVE "constitutive.f90")
|
||||
# target_link_libraries(DAMASK_CONSTITUTIVE DAMASK_DRIVERS)
|
||||
# add_library(DAMASK_DRIVERS ALIAS DAMASK_CONSTITUTIVE)
|
||||
|
||||
# compile spectral solver
|
||||
add_executable(DAMASKSpectral.exe DAMASK_spectral.f90)
|
||||
target_link_libraries (DAMASKSpectral.exe ${DAMASK_LIB})
|
||||
target_link_libraries (DAMASKSpectral.exe DAMASK_PLASTIC)
|
|
@ -98,7 +98,7 @@ OPTIMIZATION_AGGRESSIVE_gfortran :=-O3 -ffast-math -funroll-loops -ftree-vectori
|
|||
|
||||
|
||||
LINK_OPTIONS_ifort :=-shared-intel
|
||||
COMPILE_OPTIONS_ifort :=-DDAMASKVERSION=\"${DAMASKVERSION}\"\
|
||||
COMPILE_OPTIONS_ifort :=-DDAMASKVERSION='${DAMASKVERSION}'\
|
||||
-fpp\
|
||||
-ftz\
|
||||
-assume byterecl,fpe_summary\
|
||||
|
|
|
@ -6,12 +6,10 @@ set (KINEMATICS "kinematics_cleavage_opening"
|
|||
"kinematics_hydrogen_strain"
|
||||
)
|
||||
|
||||
# compile kinamtic modules
|
||||
# compile module and cumulatively link the
|
||||
# compiled libraries
|
||||
foreach (p ${KINEMATICS})
|
||||
add_library (${p} "${p}.f90")
|
||||
endforeach (p)
|
||||
|
||||
# set libraries/modules for linking
|
||||
foreach (p ${KINEMATICS})
|
||||
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||
target_link_libraries(${p} DAMASK_DRIVERS)
|
||||
add_library (DAMASK_DRIVERS ALIAS ${p})
|
||||
endforeach (p)
|
|
@ -10,12 +10,20 @@ set (PLASTIC "plastic_dislotwin"
|
|||
"plastic_phenoplus"
|
||||
)
|
||||
|
||||
# compile module
|
||||
foreach (p ${PLASTIC})
|
||||
add_library (${p} "${p}.f90")
|
||||
endforeach (p)
|
||||
|
||||
# set libraries/modules for linking
|
||||
foreach (p ${PLASTIC})
|
||||
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||
endforeach (p)
|
||||
# compile module and cumulatively link the
|
||||
# compiled libraries
|
||||
add_library (DAMASK_PLASTIC "plastic_dislotwin.f90"
|
||||
"plastic_disloUCLA.f90"
|
||||
"plastic_isotropic.f90"
|
||||
"plastic_j2.f90"
|
||||
"plastic_phenopowerlaw.f90"
|
||||
"plastic_titanmod.f90"
|
||||
"plastic_nonlocal.f90"
|
||||
"plastic_none.f90"
|
||||
"plastic_phenoplus.f90")
|
||||
target_link_libraries(DAMASK_PLASTIC DAMASK_DRIVERS)
|
||||
# foreach (p ${PLASTIC})
|
||||
# add_library (${p} "${p}.f90")
|
||||
# target_link_libraries(${p} DAMASK_DRIVERS)
|
||||
# add_library (DAMASK_DRIVERS ALIAS ${p})
|
||||
# endforeach (p)
|
|
@ -10,12 +10,10 @@ set (SOURCE "source_thermal_dissipation"
|
|||
"source_vacancy_thermalfluc"
|
||||
)
|
||||
|
||||
# compile modules for source
|
||||
foreach (p ${SOURCE})
|
||||
# compile module and cumulatively link the
|
||||
# compiled libraries
|
||||
foreach (p ${KINEMATICS})
|
||||
add_library (${p} "${p}.f90")
|
||||
endforeach (p)
|
||||
|
||||
# set libraries/modules for linking
|
||||
foreach (p ${SOURCE})
|
||||
set (DAMASK_LIB ${DAMASK_LIB} ${p})
|
||||
target_link_libraries(${p} DAMASK_DRIVERS)
|
||||
add_library (DAMASK_DRIVERS ALIAS ${p})
|
||||
endforeach (p)
|
Loading…
Reference in New Issue