Link error when building a configuration containing only MPI thorn

Create issue
Issue #1008 closed
Ian Hinder created an issue

If I create a thornlist containing just


the configuration will compile but it won't link. The linker errors indicate that the "Cactus" virtual thorn is using MPI symbols which are not available. The mpi library is not on the linker command line, nor in LIBS. LIBS is set from MPI_LIBS in, but MPI_LIBS is empty. MPI_LIBS is picked up from the MPI script, and it is inserted into bindings/Configuration/Capabilities/make.MPI.defn. This is picked up by bindings/Configuration/Thorns/make.Cactus.defn, but I don't think that this file is used by anything. If I create a new empty thorn which uses the MPI capability, the executable is linked successfully. I think that nothing is loading the make.Cactus.defn definitions for the Cactus virtual thorn.

This subtle bug might have other effects so it should probably be fixed.


Comments (9)

  1. Erik Schnetter
    • removed comment

    Internally, the flesh is treated as a thorn that is called "Cactus", and there is also a pseudo-thorn "CactusBindings" containing most of the auto-generated code from the CST stage. These two thorns are treated specially in several places. It seems that "make.Cactus.defn" is ignored, although it should not be.

    My file "make.thornlib" contains the lines

    ifneq ($(THORN), CactusBindings) -include $(BINDINGS_DIR)/Configuration/Thorns/make.$(THORN).defn endif which should include "make.Cactus.defn". Can you confirm that you have these lines as well?

  2. Ian Hinder reporter
    • removed comment

    Yes, these lines are there. And I have checked that this code is triggered when THORN is Cactus. Is it possible that this is happening in a subshell or sub-make process and these values are not available at link time? Can you reproduce the problem? Just create a configuration with a thornlist containing only the MPI thorn and try to build it.

  3. Erik Schnetter
    • removed comment

    Yes, this makefile builds the thorn library, it does not build.

    I think the problem is that the auto-generated file "" does not take the flesh into account. This would be the routine CreateConfigurationBindings, which accepts as input a hashmap "thorns" that does not include the flesh Cactus pseudo-thorn. The big foreach loop in file probably needs to be extended to include "Cactus" as well.

  4. Frank Löffler
    • removed comment

    I agree that this should be fixed in Cactus. One possibility for a workaround would be to REQUIRE mpi in thorn MPI.

  5. Erik Schnetter
    • removed comment

    Did you try adding 'Cactus' to the foreach loops

    foreach my $thorn (sort keys %thorns)


  6. Frank Löffler
    • removed comment

    Yes, that didn't work, but I didn't investigate further. I don't recommend the REQUIRES as solution - just a possible workaround.

  7. Log in to comment