From 62008cb4b4048037148e851e1c6726870afe2d15 Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Fri, 15 Apr 2016 16:26:43 -0400 Subject: [PATCH] add support for prefix&suffix --- CMakeLists.txt | 11 ++++++----- build_FEM.sh | 4 ++++ build_spectral.sh | 7 +++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f76631a61..255c8a6ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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} -o ${PETSC_EXTERNAL_LIB}") + "${DAMASK_PREFIX} ${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_RELEASE} -o ${PETSC_EXTERNAL_LIB} ${DAMASK_SUFFIX}") else("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE") set (CMAKE_Fortran_LINK_EXECUTABLE - "${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} -o ${PETSC_EXTERNAL_LIB}") + "${DAMASK_PREFIX} ${CMAKE_LINKER} ${CMAKE_EXE_LINKER_FLAGS_DEBUG} -o ${PETSC_EXTERNAL_LIB} ${DAMASK_SUFFIX}") endif("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE") message("***COMPILE FLAGS:\n${CMAKE_Fortran_FLAGS_RELEASE}\n") diff --git a/build_FEM.sh b/build_FEM.sh index 56e26c45b..2333bc16c 100755 --- a/build_FEM.sh +++ b/build_FEM.sh @@ -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 diff --git a/build_spectral.sh b/build_spectral.sh index eb614f41c..0034554a5 100755 --- a/build_spectral.sh +++ b/build_spectral.sh @@ -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