Allow whole program optimization to be switched off
This commit is contained in:
@@ -22,10 +22,13 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
set (_opt_flags "")
|
set (_opt_flags "")
|
||||||
|
|
||||||
# link-time (a.k.a. global) optimizations
|
# link-time (a.k.a. global) optimizations
|
||||||
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
|
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" ON)
|
||||||
if (HAVE_LINK_OPTS)
|
if (WHOLE_PROG_OPTIM)
|
||||||
list (APPEND _opt_flags "-flto")
|
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
|
||||||
endif (HAVE_LINK_OPTS)
|
if (HAVE_LINK_OPTS)
|
||||||
|
list (APPEND _opt_flags "-flto")
|
||||||
|
endif (HAVE_LINK_OPTS)
|
||||||
|
endif (WHOLE_PROG_OPTIM)
|
||||||
|
|
||||||
# native instruction set tuning
|
# native instruction set tuning
|
||||||
option (WITH_NATIVE "Use native instruction set" ON)
|
option (WITH_NATIVE "Use native instruction set" ON)
|
||||||
|
|||||||
10
configure
vendored
10
configure
vendored
@@ -18,6 +18,7 @@ Optional Features:
|
|||||||
--enable-static build a static library [default=no]. Note: only one
|
--enable-static build a static library [default=no]. Note: only one
|
||||||
of the options shared and static may be built.
|
of the options shared and static may be built.
|
||||||
--disable-debug build a release version of the library [default=no]
|
--disable-debug build a release version of the library [default=no]
|
||||||
|
--disable-lto do not use whole program optimization [default=yes]
|
||||||
--disable-pch do not use precompiled headers (if buggy compiler)
|
--disable-pch do not use precompiled headers (if buggy compiler)
|
||||||
--disable-silent-rules print every compilation statement as executed
|
--disable-silent-rules print every compilation statement as executed
|
||||||
--enable-system-debug put .debug files in global GDB debug dir
|
--enable-system-debug put .debug files in global GDB debug dir
|
||||||
@@ -101,6 +102,8 @@ use_mpi=
|
|||||||
silent_rules=
|
silent_rules=
|
||||||
#debug_loc=" -DSYSTEM_DEBUG=OFF"
|
#debug_loc=" -DSYSTEM_DEBUG=OFF"
|
||||||
debug_loc=
|
debug_loc=
|
||||||
|
#use_lto=" -DWHOLE_PROG_OPTIM=ON"
|
||||||
|
use_lto=
|
||||||
|
|
||||||
# default is to warn for unknown options, but this can be disabled
|
# default is to warn for unknown options, but this can be disabled
|
||||||
option_check=yes
|
option_check=yes
|
||||||
@@ -232,6 +235,11 @@ for OPT in "$@"; do
|
|||||||
debug_loc=" -DSYSTEM_DEBUG=OFF"
|
debug_loc=" -DSYSTEM_DEBUG=OFF"
|
||||||
pkgname=""
|
pkgname=""
|
||||||
;;
|
;;
|
||||||
|
wpo |\
|
||||||
|
lto )
|
||||||
|
use_lto=" -DWHOLE_PROG_OPTIM=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
openmp)
|
openmp)
|
||||||
use_openmp=" -DUSE_OPENMP=OFF"
|
use_openmp=" -DUSE_OPENMP=OFF"
|
||||||
pkgname=""
|
pkgname=""
|
||||||
@@ -333,7 +341,7 @@ for a in "${VARS[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# pass everything on to CMake
|
# pass everything on to CMake
|
||||||
CMDLINE="env ${ENVVARS} ${CMAKE_COMMAND} \"${srcdir}\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc}${use_openmp}${use_mpi} ${FEATURES}"
|
CMDLINE="env ${ENVVARS} ${CMAKE_COMMAND} \"${srcdir}\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc}${use_openmp}${use_mpi}${use_lto} ${FEATURES}"
|
||||||
echo --- calling CMake ---
|
echo --- calling CMake ---
|
||||||
echo ${CMDLINE}
|
echo ${CMDLINE}
|
||||||
eval exec ${CMDLINE}
|
eval exec ${CMDLINE}
|
||||||
|
|||||||
Reference in New Issue
Block a user