aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@043a8217-7a68-40fe-abfd-36aa7d4fa6a8>2014-11-01 00:53:08 +0000
committereschnett <eschnett@043a8217-7a68-40fe-abfd-36aa7d4fa6a8>2014-11-01 00:53:08 +0000
commit2d80d39e6aea859c757fc2cb09938406081cf035 (patch)
tree257cdc52737c69e726fc1b541d52809f3c22aa26
parent33cb2f1df03f577d82d2bcf0e848c442f66e0eaf (diff)
Update handling standard include/library paths
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/MPI/trunk@53 043a8217-7a68-40fe-abfd-36aa7d4fa6a8
-rw-r--r--configure.pl26
1 files changed, 22 insertions, 4 deletions
diff --git a/configure.pl b/configure.pl
index b6737a1..47ad422 100644
--- a/configure.pl
+++ b/configure.pl
@@ -275,30 +275,33 @@ if($mpi_info_set) {
message("MPI was manually configured.");
} else {
- error("MPI could not be configured.",5);
+ error("MPI could not be configured: neither automatic nor manual configuration succeeded",5);
}
################################################################################
# Configure Cactus
################################################################################
+# Strip standard paths
+$ENV{MPI_INC_DIRS} = strip_inc_dirs($ENV{MPI_INC_DIRS});
+$ENV{MPI_LIB_DIRS} = strip_lib_dirs($ENV{MPI_LIB_DIRS});
+
# Pass options to Cactus
begin_message("DEFINE");
print "CCTK_MPI 1\n";
-print "HAVE_MPI 1\n";
+# print "HAVE_MPI 1\n";
end_message();
begin_message("MAKE_DEFINITION");
print "CCTK_MPI = 1\n";
-print "HAVE_MPI = 1\n";
+# print "HAVE_MPI = 1\n";
print "MPI_DIR = $ENV{MPI_DIR}\n";
print "MPI_INC_DIRS = $ENV{MPI_INC_DIRS}\n";
print "MPI_LIB_DIRS = $ENV{MPI_LIB_DIRS}\n";
print "MPI_LIBS = $ENV{MPI_LIBS}\n";
end_message();
-# These must be magic
print "INCLUDE_DIRECTORY \$(MPI_INC_DIRS)\n";
print "LIBRARY_DIRECTORY \$(MPI_LIB_DIRS)\n";
print "LIBRARY \$(MPI_LIBS)\n";
@@ -400,3 +403,18 @@ sub is_set {
my $var = shift;
return (defined($ENV{$var}) and !($ENV{$var} =~ /^\s*$/));
}
+
+sub strip_inc_dirs {
+ my $dirlist = shift;
+ my @dirs = split / /, $dirlist;
+ map { s{//}{/}g } @dirs;
+ @dirs = grep { !m{^/(usr/(local/)?)?include/?$} } @dirs;
+ return join ' ', @dirs;
+}
+sub strip_lib_dirs {
+ my $dirlist = shift;
+ my @dirs = split / /, $dirlist;
+ map { s{//}{/}g } @dirs;
+ @dirs = grep { !m{^/(usr/(local/)?)?lib(64?)/?$} } @dirs;
+ return join ' ', @dirs;
+}