add support for prefix&suffix

This commit is contained in:
Chen Zhang 2016-04-15 16:26:43 -04:00
parent 5c5b8ee36a
commit 62008cb4b4
3 changed files with 17 additions and 5 deletions

View File

@ -424,16 +424,17 @@ set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${LINKER
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${CMAKE_Fortran_FLAGS_RELEASE}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${DEBUG_FLAGS}" )
# Finalizing
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${DAMASK_INCLUDE_FLAGS}")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${DAMASK_INCLUDE_FLAGS}")
# Finalizing, adding PREFIX and SUFFIX to compiler chain
set (CMAKE_Fortran_FLAGS_RELEASE "${DAMASK_PREFIX} ${CMAKE_Fortran_FLAGS_RELEASE} ${DAMASK_INCLUDE_FLAGS} ${DAMASK_SUFFIX}")
set (CMAKE_Fortran_FLAGS_DEBUG "${DAMASK_PREFIX} ${CMAKE_Fortran_FLAGS_DEBUG} ${DAMASK_INCLUDE_FLAGS} ${DAMASK_SUFFIX}")
set (CMAKE_LINKER "${PETSC_LINKER}")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set (CMAKE_Fortran_LINK_EXECUTABLE
"${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_RELEASE} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB}")
"${DAMASK_PREFIX} ${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_RELEASE} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB} ${DAMASK_SUFFIX}")
else("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set (CMAKE_Fortran_LINK_EXECUTABLE
"${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB}")
"${DAMASK_PREFIX} ${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> ${PETSC_EXTERNAL_LIB} ${DAMASK_SUFFIX}")
endif("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
message("***COMPILE FLAGS:\n${CMAKE_Fortran_FLAGS_RELEASE}\n")

View File

@ -26,6 +26,7 @@ cd FEM
# PETSC_DIR | PETSC directory
# DAMASK_V | DAMASK current revision
# CMAKE_BUILD_TYPE | Default set to release (no debugging output)
# CMAKE_VERBOSE_MAKEFILE | [ON/OFF] toggle makefile verbose output
# OPENMP | [ON/OFF]
# OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA]
# DAMASK_DRIVER | [SPECTRAL, FEM]
@ -34,10 +35,13 @@ cd FEM
cmake -D PETSC_DIR=${PETSC_DIR} \
-D DAMASK_V=${DAMASKVERSION} \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_VERBOSE_MAKEFILE=OFF \
-D OPENMP=ON \
-D OPTIMIZATION=DEFENSIVE \
-D DAMASK_DRIVER=FEM \
-D DAMASK_INSTALL=${HOME}/bin \
-D DAMASK_PREFIX="" \
-D DAMASK_SUFFIX="-Wl,--verbose" \
../..
echo

View File

@ -36,17 +36,24 @@ cd $BUILDDIR
# PETSC_DIR | PETSC directory
# DAMASK_V | DAMASK current revision
# CMAKE_BUILD_TYPE | Default set to release (no debugging output)
# CMAKE_VERBOSE_MAKEFILE | [ON/OFF] toggle makefile verbose output
# OPENMP | [ON/OFF]
# OPTIMIZATION | [OFF,DEFENSIVE,AGGRESSIVE,ULTRA]
# DAMASK_DRIVER | [SPECTRAL, FEM]
# DAMASK_INSTALL | Directory to install binary output
# DAMASK_PREFIX | Compiler prefix
# DAMASK_SUFFIX | Compiler suffix,
# | e.g. DAMASK_SUFFIX="-Wl,--verbose"
cmake -D PETSC_DIR=${PETSC_DIR} \
-D DAMASK_V=${DAMASKVERSION} \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_VERBOSE_MAKEFILE=OFF \
-D OPENMP=ON \
-D OPTIMIZATION=DEFENSIVE \
-D DAMASK_DRIVER=SPECTRAL \
-D DAMASK_INSTALL=${HOME}/bin \
-D DAMASK_PREFIX="" \
-D DAMASK_SUFFIX="-Wl,--verbose" \
../..
echo