From 380b2e54f778078ac55c5f605924997dde99ea9f Mon Sep 17 00:00:00 2001 From: knarf Date: Tue, 9 Jul 2013 19:02:24 +0000 Subject: Currently Cactus sets up flags like CPPFLAGS or CFLAGS by adding e.g. CPP_OPENMP_FLAGS. However, later it overwrites these again by their original value in sbin/ProcessConfiguration.pl (search for FIXME). This patch implements what the 'FIXME' suggests - accepting the drawbacks that are mentioned there: that configuration settings not originating from a thorn might not be forwarded from e.g., a .cactus/config file. MPI was one of these, but this is now handled differently anyway. With this patch, we would need to be aware of these and might need to add them to @allowed_opts in the future. Without the patch however, compilation might fail for perfectly valid setups. One of these is when using openmp, setting all the corresponding *_OPENMP_FLAGS, but not setting CPPFLAGS (only CPP_OPENMP_FLAGS). In this case ProcessConfiguration.pl will set CFLAGS to the version in the config file (*without* the -openmp), but it will leave CPPFLAGS to the version *with* -openmp. This later leads to a linker error in external libraries, since compilation there uses CPPFLAGS (with openmp), but the linker doesn't (It correctly uses CFLAGS, but this doesn't have openmp flags here). git-svn-id: http://svn.cactuscode.org/flesh/trunk@5034 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/ProcessConfiguration.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/sbin/ProcessConfiguration.pl b/lib/sbin/ProcessConfiguration.pl index 9dffcba9..e82bbb67 100644 --- a/lib/sbin/ProcessConfiguration.pl +++ b/lib/sbin/ProcessConfiguration.pl @@ -109,13 +109,12 @@ sub ProcessConfiguration } # Now setup the environment - # FIXME: Would like to restrict this to just the @allowed_opts, but then - # flesh configuration options like MPI or arch specific ones like - # IRIX_BITS would not be propogated 8-( - - foreach $option (keys %$configinfo) + foreach $option (@allowed_opts) { - $ENV{$option} = $configinfo->{$option}; + if (defined($configinfo->{$option})) + { + $ENV{$option} = $configinfo->{$option}; + } } # Ok, can now run the configuration scripts. -- cgit v1.2.3