summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2011-08-25 18:52:53 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2011-08-25 18:52:53 +0000
commit54aea95a18c6fc26c5319f071fb8b21307478be2 (patch)
treeeb2ef8b2388fb5476eb75f0c61bab20dd0f83608 /lib
parent830484bf7e70a76e2f1b6c2495a937f558dd3b5a (diff)
Allow a configuration.ccl file for the flesh
The mechanism in Cactus that handles configuration.ccl files currently cannot handle a configuration.ccl for the flesh. This patch corrects this. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4720 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r--lib/make/make.configuration4
-rw-r--r--lib/sbin/CST7
-rw-r--r--lib/sbin/ConfigurationParser.pl2
-rw-r--r--lib/sbin/CreateConfigurationBindings.pl31
4 files changed, 25 insertions, 19 deletions
diff --git a/lib/make/make.configuration b/lib/make/make.configuration
index 2707a96b..f145eb89 100644
--- a/lib/make/make.configuration
+++ b/lib/make/make.configuration
@@ -212,7 +212,7 @@ include $(CONFIG)/make.config.deps
rebuild: $(CONFIG)/make.thornlist
-$(CONFIG)/make.thornlist: $(TOP)/ThornList $(foreach lib, $(CCTK_HOME)/src $(THORNS:%=$(PACKAGE_DIR)/%), $(lib)/param.ccl $(lib)/interface.ccl $(lib)/schedule.ccl) $(CONFIG_THORNS:%=$(PACKAGE_DIR)/%/configuration.ccl) $(CCTK_HOME)/lib/make/force-rebuild
+$(CONFIG)/make.thornlist: $(TOP)/ThornList $(foreach lib, $(CCTK_HOME)/src $(THORNS:%=$(PACKAGE_DIR)/%), $(lib)/param.ccl $(lib)/interface.ccl $(lib)/schedule.ccl) $(CCTK_HOME)/src/configuration.ccl $(CONFIG_THORNS:%=$(PACKAGE_DIR)/%/configuration.ccl) $(CCTK_HOME)/lib/make/force-rebuild
if [ -r $@ ] ; then echo Reconfiguring thorns ; rm $@ ;\
else echo Processing CCL files ; fi
+$(PERL) -s $(CST) -config_dir=$(CONFIG) -cctk_home=$(CCTK_HOME) -top=$(TOP) $<
@@ -244,7 +244,7 @@ ifneq ($(strip $(THORNS)),)
endif
# Catch the special case of a thorn being removed from the disk entirely.
-$(foreach lib, $(CCTK_HOME)/src $(THORNS:%=$(PACKAGE_DIR)/%), $(lib)/param.ccl $(lib)/interface.ccl $(lib)/schedule.ccl) $(CONFIG_THORNS:%=$(PACKAGE_DIR)/%/configuration.ccl):
+$(foreach lib, $(CCTK_HOME)/src $(THORNS:%=$(PACKAGE_DIR)/%), $(lib)/param.ccl $(lib)/interface.ccl $(lib)/schedule.ccl) $(CCTK_HOME)/src/configuration.ccl $(CONFIG_THORNS:%=$(PACKAGE_DIR)/%/configuration.ccl):
@echo "Missing file $@"
@echo "Possibly from a thorn deleted from an arrangement"
@echo "Deleting make.thornlist"
diff --git a/lib/sbin/CST b/lib/sbin/CST
index 0032b499..d19a357f 100644
--- a/lib/sbin/CST
+++ b/lib/sbin/CST
@@ -331,14 +331,15 @@ sub CreateMakeThornlist
foreach $thorn (sort keys %$thorns)
{
- if($config->{"\U$thorn\E OPTIONS"} ne 'NO_SOURCE' &&
- $thorn ne 'Cactus')
+ next if $thorn eq 'Cactus';
+
+ if($config->{"\U$thorn\E OPTIONS"} ne 'NO_SOURCE')
{
$thorns->{$thorn} =~ m:.*/(.*/.*):;
$thornlist .= " $1";
}
- if( -r "$thorns->{$thorn}/configuration.ccl")
+ if(-r "$thorns->{$thorn}/configuration.ccl")
{
$thorns->{$thorn} =~ m:.*/(.*/.*):;
$config_thornlist .= " $1";
diff --git a/lib/sbin/ConfigurationParser.pl b/lib/sbin/ConfigurationParser.pl
index 40f7906f..3454cb5d 100644
--- a/lib/sbin/ConfigurationParser.pl
+++ b/lib/sbin/ConfigurationParser.pl
@@ -42,6 +42,8 @@ sub CreateConfigurationDatabase
# if ($cfg{"\U$thorn\E PROVIDES"});
# print " Requires: ", $cfg{"\U$thorn\E REQUIRES"}, "\n"
# if ($cfg{"\U$thorn\E REQUIRES"});
+# print " Optional: ", $cfg{"\U$thorn\E OPTIONAL"}, "\n"
+# if ($cfg{"\U$thorn\E OPTIONAL"});
# }
$cfg{"\U$thorn\E USES THORNS"} = '';
diff --git a/lib/sbin/CreateConfigurationBindings.pl b/lib/sbin/CreateConfigurationBindings.pl
index 296280d6..bbdbad05 100644
--- a/lib/sbin/CreateConfigurationBindings.pl
+++ b/lib/sbin/CreateConfigurationBindings.pl
@@ -136,6 +136,23 @@ sub CreateConfigurationBindings
}
}
+ # turn optional capabilities into required capabilities, if the
+ # capability is provided
+ foreach $thorn (sort keys %thorns)
+ {
+ if ($cfg->{"\U$thorn\E OPTIONAL"})
+ {
+ foreach $cap (split (' ', $cfg->{"\U$thorn\E OPTIONAL"}))
+ {
+ # TODO: prevent matches of partial words
+ if ($providedcaplist =~ m/$cap/i)
+ {
+ $cfg->{"\U$thorn\E REQUIRES"} .= "$cap ";
+ }
+ }
+ }
+ }
+
# here we add the files to the thorns that require capabilities
foreach $thorn (sort keys %thorns)
{
@@ -159,20 +176,6 @@ sub CreateConfigurationBindings
}
}
- if ($cfg->{"\U$thorn\E OPTIONAL"})
- {
- foreach $providedcap (split (' ', $cfg->{"\U$thorn\E OPTIONAL"}))
- {
- if ($providedcaplist =~ m/$providedcap/i)
- {
- $defs .= $providedcap . " = 1\n";
- $defs .= "include $bindings_dir/Configuration/Capabilities/make.\U$providedcap\E.defn\n";
- $incs .= "#include \"../Capabilities/cctki_\U$providedcap\E.h\"\n";
- $deps .= "include $bindings_dir/Configuration/Capabilities/make.\U$providedcap\E.deps\n";
- }
- }
- }
-
if ($cfg->{"\U$thorn\E REQUIRES"} || $cfg->{"\U$thorn\E OPTIONAL"})
{
# write everything to file