--- bundled/cdd/support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/cdd/support/configure.pl 2019-08-18 16:18:04.859818172 -0600 @@ -52,7 +52,6 @@ sub proceed { my $cdd_lib=Polymake::Configure::get_libdir($cdd_path, "cddgmp"); if (-f "$cdd_lib/libcddgmp.$Config::Config{so}" ) { $LDFLAGS = "-L$cdd_lib"; - $LDFLAGS .= " -Wl,-rpath,$cdd_lib" if $cdd_path ne "/usr"; } if (!$CFLAGS or !$LDFLAGS) { die "Invalid installation location of cddlib: header file cdd.h and/or library libcddgmp.$Config::Config{so} not found.\n", @@ -65,7 +64,6 @@ sub proceed { $cdd_path .= "include: $cdd_inc "; } if (defined ($cdd_lib=$options->{'cdd-lib'})) { - $LDFLAGS = "-L$cdd_lib -Wl,-rpath,$cdd_lib"; $cdd_path .= "lib: $cdd_lib"; } --- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc 2019-08-18 16:18:04.873818163 -0600 @@ -136,7 +136,7 @@ inline bool int_quotient(long long& Quot #endif #endif -#include "libnormaliz/libnormaliz-all.cpp" +#include #if defined(__GNUC__) #if defined(__clang__) --- bundled/libnormaliz/support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/libnormaliz/support/configure.pl 2019-08-18 16:18:04.874818162 -0600 @@ -135,6 +135,7 @@ int main (int argc, char *argv[]) $message .= " [OpenMP support disabled]"; } } else { + $CXXFLAGS='-I/usr/include/libnormaliz'; $LIBS="-lnormaliz"; $message = "$nmz_version @ ".($nmz_path//"system") } --- bundled/lrs/support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/lrs/support/configure.pl 2019-08-18 16:18:04.875818162 -0600 @@ -65,7 +65,7 @@ sub proceed { } if (-f "$lrs_lib/lib$lrs_libname.$Config::Config{so}" ) { - $LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib"; + $LDFLAGS = "-L$lrs_lib"; } elsif (-f "$lrs_lib/lib$lrs_libname.a" ) { $LDFLAGS = "-L$lrs_lib"; } else { --- bundled/nauty/apps/graph/src/build_flags.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/nauty/apps/graph/src/build_flags.pl 2019-08-18 16:18:04.875818162 -0600 @@ -1,25 +1,11 @@ # input for generate_ninja_targets.pl -my $foreign_src=$ConfigFlags{'bundled.nauty.NautySrc'}; -my $nauty_src= $foreign_src ? '${bundled.nauty.NautySrc}' : '${root}/bundled/nauty/external/nauty'; -my $generated_dir='${buildroot}/staticlib/nauty'; -my @generated_headers=qw( nauty.h naututil.h gtools.h ); -my @generated_in=map { /\.h$/; "$nauty_src/$`-h.in" } @generated_headers; -my @generated_out=map { "$generated_dir/$_" } @generated_headers; -my $include_generated= ($foreign_src && grep { -f "$foreign_src/$_" } @generated_headers) - ? join(" ", map { "-include $_" } @generated_out) - : "-I$generated_dir"; - -( CXXFLAGS => "-DBIGNAUTY -I$generated_dir -I$nauty_src", - - GENERATED => { - out => "@generated_out", in => "@generated_in", - command => "cd $generated_dir; CC=\"\${CC}\" CFLAGS=\"\${CFLAGS}\" $nauty_src/configure --quiet >/dev/null 2>/dev/null; rm -f makefile", - }, - - staticlib => { - SOURCEDIR => $nauty_src, - SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ], - CFLAGS => "-DBIGNAUTY $include_generated -I$nauty_src", - } +( + $ConfigFlags{'bundled.nauty.UseBundled'} + ? ( staticlib => { + SOURCEDIR => '${root}/bundled/nauty/external/nauty', + SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ], + CFLAGS => "-I/usr/include/nauty", + } ) + : () ) --- bundled/nauty/support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/nauty/support/configure.pl 2019-08-18 16:18:04.875818162 -0600 @@ -13,7 +13,7 @@ # GNU General Public License for more details. #------------------------------------------------------------------------------- -@conf_vars=qw( NautySrc ); +@conf_vars=qw( UseBundled CFLAGS LDFLAGS LIBS ); sub allowed_options { my ($allowed_options, $allowed_with)=@_; @@ -28,24 +28,27 @@ sub usage { " directory containing the nauty sources.\n"; } -sub check_nauty { - my $dir = @_ > 0 ? $_[0] : "bundled/nauty/external/nauty"; - -e "$dir/nauty-h.in" +sub check_bundled { + -e "bundled/nauty/external/nauty/nauty-h.in"; } sub proceed { my ($options)=@_; my $nautysrc; + $UseBundled = 1; if (defined ($nautysrc=$options->{"nauty-src"})) { - check_nauty($nautysrc) or - die "Specified nauty source directory invalid, could not find 'nauty-h.in'."; - $NautySrc = $nautysrc; - } elsif (!check_nauty()) { - die "Bundled nauty directory seems to be missing, to use the nauty interface\n", - "with the minimal tarball please specify a nauty source directory\n", - "via --with-nauty-src=PATH."; + my $nauty_inc="$nautysrc/include/nauty"; + my $nauty_lib=Polymake::Configure::get_libdir($nautysrc, "nauty"); + if (-f "$nauty_inc/nauty.h") { + $CFLAGS="-I$nauty_inc"; + $LDFLAGS="-L$nauty_lib"; + $LIBS="-lnauty"; + $UseBundled = 0; + } else { + die "Could not locate a working nauty installation\n"; + } } - return $NautySrc ? "$NautySrc" : "bundled"; + return $UseBundled ? "bundled" : ($nautysrc//"system"); } --- bundled/singular/support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/singular/support/configure.pl 2019-08-18 16:18:04.876818161 -0600 @@ -42,7 +42,7 @@ sub singular_config_approach { # yes we need it twice ... chomp ($singular_prefix = `$singular_config --prefix`); chomp $singular_prefix; - $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g; + $LDFLAGS =~ s/-L(\S+)/-L$1/g; my $libdir = $1; # newer versions of singular need -lsingular_resources while older ones needed -lresources @@ -65,9 +65,6 @@ sub pkg_config_approach { chomp ($CXXFLAGS=`$pkg_config --cflags Singular`); die "$pkg_config failed: $!" if ($?); chomp ($LDFLAGS=`$pkg_config --libs-only-other --libs-only-L Singular`); - if (defined ($options->{singular})){ - $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g; - } chomp ($LIBS=`$pkg_config --libs-only-l Singular`); return $pc_singular_prefix; } --- bundled/sympol/apps/polytope/src/build_flags.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/sympol/apps/polytope/src/build_flags.pl 2019-08-18 16:18:04.876818161 -0600 @@ -10,7 +10,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund 'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}', 'raycomputationlrs.cpp' => '-DGMP -DMA ${bundled.lrs.CFLAGS}', CXXFLAGS => '-Wno-shadow' . ($ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ - ? ' -I${root}/include/external/permlib' : ''), + ? ' -I/usr/include/permlib' : ''), }, ) } else { --- bundled/sympol/support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ bundled/sympol/support/configure.pl 2019-08-18 16:18:04.876818161 -0600 @@ -146,6 +146,7 @@ int main() { undef $LIBS; $CXXFLAGS = '-I${root}/bundled/sympol/external/sympol'; } else { + $CXXFLAGS="-I/usr/include/sympol"; $LIBS="-lsympol"; } --- perl/polymake-config.orig 2019-08-13 04:16:37.000000000 -0600 +++ perl/polymake-config 2019-08-18 16:18:04.877818161 -0600 @@ -139,9 +139,6 @@ while (defined ($_=shift)) { } elsif ($_ eq "--ldflags") { my $ldflags=$ConfigFlags{LDFLAGS}; - if ($ldflags !~ /(?:^|\s)-L$ConfigFlags{InstallLib}(?:\s|$)/) { - $ldflags="-L$ConfigFlags{InstallLib} $ldflags"; - } my $add_rpath=1; # collect standard library paths of the C++ compiler and exclude them from the result @@ -163,9 +160,6 @@ while (defined ($_=shift)) { $ldflags="$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace"; } else { $ldflags .= " -Wl,-E"; - if ($add_rpath) { - $ldflags .= " -Wl,-rpath,$ConfigFlags{InstallLib}"; - } } $ldflags=~s/^\s+//; $ldflags=~s/\s+$//; $ldflags=~s/\s{2,}/ /g; --- support/configure.pl.orig 2019-08-13 04:16:37.000000000 -0600 +++ support/configure.pl 2019-08-18 16:18:04.877818161 -0600 @@ -460,7 +460,7 @@ sub parse_command_line { } } - $CXXOPT =$vars{CXXOPT} // "-O3"; + $CXXOPT =$vars{CXXOPT} // "-O2"; $CXXDEBUG =$vars{CXXDEBUG} // "-g"; $CFLAGS =$vars{CFLAGS} // ""; $CXXFLAGS =$vars{CXXFLAGS} // $CFLAGS; @@ -688,7 +688,7 @@ sub determine_cxx_library { } $CFLAGS .= " -I$options{toolchain}/include"; $CXXFLAGS .= " -I$options{toolchain}/include"; - $LDFLAGS .= " -L$libdir -Wl,-rpath,$libdir"; + $LDFLAGS .= " -L$libdir"; } if ($options{libcxx} eq ".true.") { @@ -1076,10 +1076,6 @@ sub locate_gmp_and_mpfr_libraries { $CXXFLAGS .= " -I$GMP/include"; my $libdir=get_libdir($GMP, "gmp"); $LDFLAGS .= " -L$libdir"; - if (!$FinkBase) { - # non-standard location - $LDFLAGS .= " -Wl,-rpath,$libdir"; - } } my $MPFR=$options{mpfr}; @@ -1088,10 +1084,6 @@ sub locate_gmp_and_mpfr_libraries { $CXXFLAGS .= " -I$MPFR/include"; my $libdir=get_libdir($MPFR, "mpfr"); $LDFLAGS .= " -L$libdir"; - if (!$FinkBase) { - # non-standard location - $LDFLAGS .= " -Wl,-rpath,$libdir"; - } } elsif ($FinkBase) { $MPFR=$FinkBase; }