96ec1ef
--- bundled/cdd/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/cdd/support/configure.pl	2021-10-03 13:58:33.367348371 -0600
79e44b1
@@ -56,7 +56,6 @@ sub proceed {
1bc623a
       my $cdd_lib=Polymake::Configure::get_libdir($cdd_path, "cddgmp");
1bc623a
       if (-f "$cdd_lib/libcddgmp.$Config::Config{so}" ) {
9647ad1
          $LDFLAGS = "-L$cdd_lib";
9647ad1
-         $LDFLAGS .= " -Wl,-rpath,$cdd_lib" if $cdd_path ne "/usr";
1bc623a
       }
9647ad1
       if (!$CFLAGS or !$LDFLAGS) {
1bc623a
          die "Invalid installation location of cddlib: header file cdd.h and/or library libcddgmp.$Config::Config{so} not found.\n",
79e44b1
@@ -69,7 +68,6 @@ sub proceed {
1bc623a
       $cdd_path .= "include: $cdd_inc ";
1bc623a
    }
1bc623a
    if (defined ($cdd_lib=$options->{'cdd-lib'})) {
9647ad1
-      $LDFLAGS = "-L$cdd_lib -Wl,-rpath,$cdd_lib";
1bc623a
       $cdd_path .= "lib: $cdd_lib";
1bc623a
    }
1bc623a
 
96ec1ef
--- bundled/flint/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/flint/support/configure.pl	2021-10-03 13:58:33.367348371 -0600
99b6072
@@ -23,7 +23,7 @@ sub proceed {
99b6072
       my $lib=Polymake::Configure::get_libdir($flint_path, "flint");
99b6072
       if (-f "$inc/flint/flint.h" && -f "$lib/libflint.$Config::Config{so}" ) {
99b6072
          $cxxflags .= " -I$inc";
99b6072
-         $ldflags .= " -L$lib -Wl,-rpath,$lib";
99b6072
+         $ldflags .= " -L$lib";
99b6072
       } else {
99b6072
          die "Invalid installation location of flint, header files and/or library not found\n";
99b6072
       }
96ec1ef
--- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc	2021-10-03 13:58:33.368348372 -0600
0f6db14
@@ -158,13 +158,7 @@ inline bool int_quotient(long long& Quot
79e44b1
 #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
9ce504e
 #endif
Jerry James 74d8a20
 
79e44b1
-#include "libnormaliz/linear_algebra.cpp"
79e44b1
-#include "libnormaliz/cone_and_control.cpp"
79e44b1
-#include "libnormaliz/enumeration.cpp"
79e44b1
-#include "libnormaliz/other_algorithms.cpp"
79e44b1
-#include "libnormaliz/nmz_nauty.cpp"
79e44b1
-#include "libnormaliz/primal.cpp"
79e44b1
-#include "libnormaliz/output.cpp"
Jerry James 74d8a20
+#include <libnormaliz/cone.h>
Jerry James 74d8a20
 
79e44b1
 
9647ad1
 #if defined(__clang__)
96ec1ef
--- bundled/libnormaliz/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/libnormaliz/support/configure.pl	2021-10-03 13:58:33.368348372 -0600
79e44b1
@@ -63,7 +63,7 @@ int main() {
99b6072
       my $nmz_lib=Polymake::Configure::get_libdir($nmz_path, "normaliz");
99b6072
       if (-f "$nmz_inc/libnormaliz/libnormaliz.h" && -f "$nmz_lib/libnormaliz.$Config::Config{so}" ) {
99b6072
          $CXXFLAGS = "-I$nmz_inc";
99b6072
-         $LDFLAGS = "-L$nmz_lib -Wl,-rpath,$nmz_lib";
99b6072
+         $LDFLAGS = "-L$nmz_lib";
99b6072
       } else {
99b6072
          die "Invalid installation location of libnormaliz header file libnormaliz/libnormaliz.h and/or library libnormaliz.$Config::Config{so} not found\n";
99b6072
       }
96ec1ef
@@ -177,6 +177,7 @@ int main (int argc, char *argv[])
9647ad1
          $message .= " [OpenMP support disabled]";
9647ad1
       }
9647ad1
    } else {
9647ad1
+      $CXXFLAGS='-I/usr/include/libnormaliz';
79e44b1
       $LIBS="$libs";
9647ad1
       $message = "$nmz_version @ ".($nmz_path//"system")
9647ad1
    }
96ec1ef
--- bundled/lrs/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/lrs/support/configure.pl	2021-10-03 13:58:33.369348373 -0600
9e8b0d3
@@ -67,7 +67,7 @@ sub proceed {
9e8b0d3
       $CFLAGS .= " -DHAVE_LRSDRIVER" if -f "$lrs_inc/lrsdriver.h";
9647ad1
 
d504817
       if (-f "$lrs_lib/lib$lrs_libname.$Config::Config{so}" ) {
9647ad1
-         $LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib";
9647ad1
+         $LDFLAGS = "-L$lrs_lib";
d504817
       } elsif (-f "$lrs_lib/lib$lrs_libname.a" ) {
9647ad1
          $LDFLAGS = "-L$lrs_lib";
d504817
       } else {
96ec1ef
--- bundled/nauty/apps/graph/src/build_flags.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/nauty/apps/graph/src/build_flags.pl	2021-10-03 15:21:40.200378442 -0600
96ec1ef
@@ -1,29 +1,11 @@
9647ad1
 # input for generate_ninja_targets.pl
9647ad1
 
96ec1ef
-my $foreign_src = $ConfigFlags{'bundled.nauty.NautySrc'} ne "bundled" && $ConfigFlags{'bundled.nauty.NautySrc'};
79e44b1
-my $nauty_src = $foreign_src ? '${bundled.nauty.NautySrc}' : '${root}/bundled/nauty/external/nauty';
0f6db14
-my $generated_dir = '${buildroot}/staticlib/nauty';
79e44b1
-my @generated_headers = qw( nauty.h naututil.h gtools.h );
79e44b1
-my @generated_in = map { /\.h$/; "$nauty_src/$`-h.in" } @generated_headers;
79e44b1
-my @generated_out = map { "$generated_dir/$_" } @generated_headers;
79e44b1
-my $include_generated = ($foreign_src && grep { -f "$foreign_src/$_" } @generated_headers)
79e44b1
-                        ? join(" ", map { "-include $_" } @generated_out)
79e44b1
-                        : "-I$generated_dir";
96ec1ef
-my $nauty_inc = $ConfigFlags{'bundled.nauty.NautySrc'}
96ec1ef
-                ? " -I$generated_dir -I$nauty_src"
96ec1ef
-                : "";
9647ad1
-
96ec1ef
-( 'GraphIso.cc' => $nauty_inc,
9ce504e
-
96ec1ef
-  $ConfigFlags{'bundled.nauty.NautySrc'}
96ec1ef
-  ? ( GENERATED => {
96ec1ef
-        out => "@generated_out", in => "@generated_in",
96ec1ef
-        command => "cd $generated_dir; CC=\"\${CC}\" CFLAGS=\"\${CFLAGS}\" $nauty_src/configure --quiet >/dev/null 2>/dev/null; rm -rf makefile nauty; ln -s . nauty",
96ec1ef
-      },
96ec1ef
-      staticlib => {
96ec1ef
-        SOURCEDIR => $nauty_src,
79e44b1
+(
9647ad1
+  $ConfigFlags{'bundled.nauty.UseBundled'}
9647ad1
+  ? ( staticlib => {
9647ad1
+        SOURCEDIR => '${root}/bundled/nauty/external/nauty',
96ec1ef
         SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ],
96ec1ef
-        CFLAGS => "$include_generated -I$nauty_src",
9647ad1
+        CFLAGS => "-I/usr/include/nauty",
96ec1ef
       } )
96ec1ef
   : ()
9647ad1
 )
96ec1ef
--- bundled/nauty/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/nauty/support/configure.pl	2021-10-03 20:07:08.156943848 -0600
96ec1ef
@@ -30,8 +30,7 @@ sub usage {
9647ad1
 }
9647ad1
 
96ec1ef
 sub check_nauty {
9647ad1
-   my $dir = @_ > 0 ? $_[0] : "bundled/nauty/external/nauty";
9647ad1
-   -e "$dir/nauty-h.in"
9647ad1
+   -e "bundled/nauty/external/nauty/nauty-h.in";
9647ad1
 }
9647ad1
 
9647ad1
 sub proceed {
96ec1ef
@@ -54,9 +53,16 @@ sub proceed {
96ec1ef
       $LDFLAGS = "-L$nauty_lib";
96ec1ef
       undef $NautySrc;
96ec1ef
    } elsif (defined ($nauty_src=$options->{"nauty-src"}) && $nauty_src ne "bundled") {
96ec1ef
-      check_nauty($nauty_src) or
96ec1ef
-         die "Specified nauty source directory invalid, could not find 'nauty-h.in' in $nauty_src.";
96ec1ef
-      $NautySrc = "$nauty_src";
96ec1ef
+      my $nauty_inc="$nauty_src/include/nauty";
96ec1ef
+      my $nauty_lib="@@LIBDIR@@";
9647ad1
+      if (-f "$nauty_inc/nauty.h") {
96ec1ef
+         $CXXFLAGS="-I$nauty_inc";
96ec1ef
+         $LDFLAGS="-L$nauty_lib";
96ec1ef
+         $LIBS="-lnauty";
96ec1ef
+         $NautySrc = 0;
96ec1ef
+      } else {
9647ad1
+         die "Could not locate a working nauty installation\n";
9647ad1
+      }
9647ad1
    }
9647ad1
 
96ec1ef
    if (!$nauty_src && $nauty_path ne "bundled" && $options->{prereq} ne ".none.") {
96ec1ef
--- bundled/singular/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/singular/support/configure.pl	2021-10-03 13:58:33.370348374 -0600
99b6072
@@ -43,7 +43,7 @@ sub singular_config_approach {
9647ad1
    # yes we need it twice ...
9ce504e
    chomp ($singular_prefix = `$singular_config --prefix`);
9ce504e
    chomp $singular_prefix;
9647ad1
-   $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g;
9647ad1
+   $LDFLAGS =~ s/-L(\S+)/-L$1/g;
1bc623a
    my $libdir = $1;
1bc623a
 
9ce504e
    # newer versions of singular need -lsingular_resources while older ones needed -lresources
99b6072
@@ -66,9 +66,6 @@ sub pkg_config_approach {
9647ad1
    chomp ($CXXFLAGS=`$pkg_config --cflags Singular`);
9ce504e
    die "$pkg_config failed: $!" if ($?);
9647ad1
    chomp ($LDFLAGS=`$pkg_config --libs-only-other --libs-only-L Singular`);
9ce504e
-   if (defined ($options->{singular})){
9647ad1
-      $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g;
9ce504e
-   }
9647ad1
    chomp ($LIBS=`$pkg_config --libs-only-l Singular`);
9ce504e
    return $pc_singular_prefix;
9ce504e
 }
96ec1ef
--- bundled/sympol/apps/polytope/src/build_flags.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/sympol/apps/polytope/src/build_flags.pl	2021-10-03 13:58:33.370348374 -0600
79e44b1
@@ -16,7 +16,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund
79e44b1
                         symmetrygroupconstruction/graphconstructiondefault.cpp symmetrygroupconstruction/matrixconstruction.cpp symmetrygroupconstruction/matrixconstructiondefault.cpp ) ],
9647ad1
        'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}',
d504817
        'raycomputationlrs.cpp' => '-DGMP -DMA ${bundled.lrs.CFLAGS}',
79e44b1
-       CXXFLAGS => $no_warnings . ($ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ ? ' -I${root}/include/external/permlib' : ''),
79e44b1
+       CXXFLAGS => $no_warnings . ($ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ ? ' -I/usr/include/permlib' : ''),
9647ad1
     },
9647ad1
   )
9647ad1
 } else {
96ec1ef
--- bundled/sympol/support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ bundled/sympol/support/configure.pl	2021-10-03 13:58:33.370348374 -0600
99b6072
@@ -147,6 +147,7 @@ int main() {
9647ad1
       undef $LIBS;
9647ad1
       $CXXFLAGS = '-I${root}/bundled/sympol/external/sympol';
9647ad1
    } else {
9647ad1
+      $CXXFLAGS="-I/usr/include/sympol";
9647ad1
       $LIBS="-lsympol";
1bc623a
    }
9ce504e
 
96ec1ef
--- perl/polymake-config.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ perl/polymake-config	2021-10-03 13:58:33.370348374 -0600
99b6072
@@ -140,9 +140,6 @@ while (defined ($_=shift)) {
Jerry James 74d8a20
 
Jerry James 74d8a20
    } elsif ($_ eq "--ldflags") {
9647ad1
       my $ldflags=$ConfigFlags{LDFLAGS};
9647ad1
-      if ($ldflags !~ /(?:^|\s)-L$ConfigFlags{InstallLib}(?:\s|$)/) {
9647ad1
-         $ldflags="-L$ConfigFlags{InstallLib} $ldflags";
Jerry James 74d8a20
-      }
Jerry James 74d8a20
       my $add_rpath=1;
9647ad1
 
9647ad1
       # collect standard library paths of the C++ compiler and exclude them from the result
99b6072
@@ -164,9 +161,6 @@ while (defined ($_=shift)) {
79e44b1
          $ldflags = "$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace";
d504817
       } else {
d504817
          $ldflags .= " -Wl,-E";
d504817
-         if ($add_rpath) {
d504817
-            $ldflags .= " -Wl,-rpath,$ConfigFlags{InstallLib}";
d504817
-         }
Jerry James 74d8a20
       }
79e44b1
       $ldflags =~ s/^\s+//; $ldflags =~ s/\s+$//; $ldflags =~ s/\s{2,}/ /g;
d5274d9
 
96ec1ef
--- support/configure.pl.orig	2021-09-29 06:13:35.000000000 -0600
96ec1ef
+++ support/configure.pl	2021-10-03 13:58:33.371348375 -0600
96ec1ef
@@ -477,7 +477,7 @@ sub parse_command_line {
9647ad1
       }
9647ad1
    }
4ad1335
 
9647ad1
-   $CXXOPT   =$vars{CXXOPT}   // "-O3";
9647ad1
+   $CXXOPT   =$vars{CXXOPT}   // "-O2";
d5274d9
    $CXXDEBUG =$vars{CXXDEBUG} // "-g";
9647ad1
    $CFLAGS   =$vars{CFLAGS}   // "";
9647ad1
    $CXXFLAGS =$vars{CXXFLAGS} // $CFLAGS;
96ec1ef
@@ -704,7 +704,7 @@ sub determine_cxx_library {
9647ad1
       }
9647ad1
       $CFLAGS   .= " -I$options{toolchain}/include";
9647ad1
       $CXXFLAGS .= " -I$options{toolchain}/include";
9647ad1
-      $LDFLAGS  .= " -L$libdir -Wl,-rpath,$libdir";
9647ad1
+      $LDFLAGS  .= " -L$libdir";
9647ad1
    }
Jerry James ba7c267
 
9647ad1
    if ($options{libcxx} eq ".true.") {
96ec1ef
@@ -1106,10 +1106,6 @@ sub locate_gmp_and_mpfr_libraries {
9647ad1
       $CXXFLAGS .= " -I$GMP/include";
9647ad1
       my $libdir=get_libdir($GMP, "gmp");
9647ad1
       $LDFLAGS .= " -L$libdir";
9647ad1
-      if (!$FinkBase) {
9647ad1
-         # non-standard location
9647ad1
-         $LDFLAGS .= " -Wl,-rpath,$libdir";
9647ad1
-      }
9647ad1
    }
Jerry James ba7c267
 
9647ad1
    my $MPFR=$options{mpfr};
96ec1ef
@@ -1118,10 +1114,6 @@ sub locate_gmp_and_mpfr_libraries {
9647ad1
       $CXXFLAGS .= " -I$MPFR/include";
9647ad1
       my $libdir=get_libdir($MPFR, "mpfr");
9647ad1
       $LDFLAGS .= " -L$libdir";
9647ad1
-      if (!$FinkBase) {
9647ad1
-         # non-standard location
9647ad1
-         $LDFLAGS .= " -Wl,-rpath,$libdir";
9647ad1
-      }
9647ad1
    } elsif ($FinkBase) {
9647ad1
       $MPFR=$FinkBase;
9647ad1
    }