Merge pull request #258 from rolk/258_nolto

Disable link-time, whole program optimization
This commit is contained in:
Bård Skaflestad 2013-06-14 01:10:56 -07:00
commit 2c85189c6c
4 changed files with 10 additions and 5 deletions

View File

@ -16,7 +16,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set (_opt_flags "")
# link-time (a.k.a. global) optimizations
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" ON)
# disabled due to widespread bugs in the linker plugin
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" OFF)
if (WHOLE_PROG_OPTIM)
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
if (HAVE_LINK_OPTS)

8
configure vendored
View File

@ -19,7 +19,7 @@ Optional Features:
of the options shared and static may be built.
--enable-debug build a non-optimized version of the library
[default=no]
--disable-lto do not use whole program optimization [default=yes]
--enable-lto use whole program optimization [default=no]
--disable-pch do not use precompiled headers (if buggy compiler)
--disable-silent-rules print every compilation statement as executed
--enable-system-debug put .debug files in global GDB debug dir
@ -104,7 +104,7 @@ use_mpi=
silent_rules=
#debug_loc=" -DSYSTEM_DEBUG=OFF"
debug_loc=
#use_lto=" -DWHOLE_PROG_OPTIM=ON"
#use_lto=" -DWHOLE_PROG_OPTIM=OFF"
use_lto=
# default is to warn for unknown options, but this can be disabled
@ -299,6 +299,10 @@ for OPT in "$@"; do
pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
shared=""
;;
lto)
use_lto=" -DWHOLE_PROG_OPTIM=ON"
shared=""
;;
# this flag is just for compatibility with the deprecation
# flag in DUNE, so we can build without warnings
fieldvector-size-is-method)

2
debian/rules vendored
View File

@ -19,7 +19,7 @@ override_dh_auto_build:
dh_auto_build --buildsystem=cmake
override_dh_auto_configure:
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-core1
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-core1 -DWHOLE_PROG_OPTIM=ON
override_dh_auto_install:
dh_auto_install -- install-html

View File

@ -59,7 +59,7 @@ This package contains the applications for opm-core
%setup -q
%build
cmake28 -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_DOCDIR=share/doc/%{name}-%{version}
cmake28 -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_DOCDIR=share/doc/%{name}-%{version} -DWHOLE_PROG_OPTIM=ON
make
%install