First dependencies for optional capabilities is ignored

Create issue
Issue #911 closed
Erik Schnetter created an issue

The first optional dependency for a thorn is not taken into account when deciding the build order for capabilities. The reason is a missing space, which accidentally concatenates the names for the last required and the first optional dependency. The patch below corrects this.

$ svn diff
Index: sbin/
--- sbin/ (revision 4825)
+++ sbin/ (working copy)
@@ -81,7 +81,7 @@
               if ($providedcaps{$optionalcap})
-                  $cfg->{"\U$thorn\E REQUIRES"} .= "$optionalcap ";
+                  $cfg->{"\U$thorn\E REQUIRES"} .= " $optionalcap";


Comments (10)

  1. Erik Schnetter reporter
    • changed status to open
    • removed comment

    There exists a second problem that makes all optional dependencies be ignored. There is code that unifies optional with required capabilities (for those optional capabilities that are provided), but this code is executed too late.

    The attached patch likely corrects this situation. I'm unsure whether to apply it before the release.

  2. Frank Löffler
    • removed comment

    Please apply the first patch. The second also looks ok to me, but please only commit once an additional maintainer gave its ok.

  3. Roland Haas
    • removed comment

    While we are at fixing capabilities: cctk.h does not include cctk_Capabilities in its FCODE section but only in CCODE. This makes the Capabilities invisible to Fortran thorns. Attached please find a patch to fix this.

    The patch almost works for me but I had to move the code block further up before the check that all REQUIRES are satisfied since the verification loop set up the thorn dependencies as well. I attach an updated patch.

    Other than that: ok to apply the updated second of the two patches.

  4. Roland Haas
    • removed comment

    I think we now have too much code applied. I had intended optional.patch to be a replacement for optional.diff (but had gotten the file name wrong so trac did not generate a optional.2.diff), not an addition. The second copy of the "Turn optional capabilities..." seems unnecessary. Ok to remove it (and leave only the first one in, the one before "verify that all required capabilities are there in the ThornList"?

  5. Log in to comment