Skip to content

Conversation

@Sbozzolo
Copy link
Contributor

@Sbozzolo Sbozzolo commented Dec 29, 2025

When MFEM is build with +umpire~shared~examples, MFEM still calls

make("-C", "examples", "ex1p" if ("+mpi" in self.spec) else "ex1", parallel=False)

This compilation fails with errors like:

/usr/bin/ld: /home/ubuntu/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/linux-x86_64_v3/umpire-2025.09.0-l6vuanc7nlbfgjkteq2movqh24nhrafo/lib/libumpire.a(ResourceAwarePool.cpp.o): in function `umpire::strategy::ResourceAwarePool::allocate_resource(unsigned long, camp::resources::v1::Resource)':
ResourceAwarePool.cpp:(.text+0x7683): undefined reference to `camp::throw_re(char const*)'
/usr/bin/ld: /home/ubuntu/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/linux-x86_64_v3/umpire-2025.09.0-l6vuanc7nlbfgjkteq2movqh24nhrafo/lib/libumpire.a(ResourceAwarePool.cpp.o): in function `umpire::strategy::ResourceAwarePool::deallocate_resource(void*, camp::resources::v1::Resource, unsigned long)':
ResourceAwarePool.cpp:(.text+0xae45): undefined reference to `camp::throw_re(char const*)'
/usr/bin/ld: /home/ubuntu/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/linux-x86_64_v3/umpire-2025.09.0-l6vuanc7nlbfgjkteq2movqh24nhrafo/lib/libumpire.a(ResourceAwarePool.cpp.o): in function `camp::resources::v1::Resource::ContextModel<camp::resources::v1::Host>::compare(camp::resources::v1::Resource const&) const':
ResourceAwarePool.cpp:(.text._ZNK4camp9resources2v18Resource12ContextModelINS1_4HostEE7compareERKS2_[_ZNK4camp9resources2v18Resource12ContextModelINS1_4HostEE7compareERKS2_]+0x3c): undefined reference to `camp::throw_re(char const*)'
collect2: error: ld returned 1 exit status
make: *** [makefile:86: ex1p] Error 1
make: Leaving directory '/tmp/ubuntu/spack-stage/spack-stage-mfem-develop-bqp7664gmcfp6szafha3xabjyvcwv3ig/spack-src/examples'

This does not occur for shared builds because of transitive linking (I guess). A simple way to fix this is ensuring that camp is explicitely linked when available.

When MFEM is build with `+umpire~shared~examples`, MFEM still calls
```
make("-C", "examples", "ex1p" if ("+mpi" in self.spec) else "ex1",
parallel=False)
```
This compilation fails with errors like:
```
/usr/bin/ld: /home/ubuntu/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/linux-x86_64_v3/umpire-2025.09.0-l6vuanc7nlbfgjkteq2movqh24nhrafo/lib/libumpire.a(ResourceAwarePool.cpp.o): in function `umpire::strategy::ResourceAwarePool::allocate_resource(unsigned long, camp::resources::v1::Resource)':
ResourceAwarePool.cpp:(.text+0x7683): undefined reference to `camp::throw_re(char const*)'
/usr/bin/ld: /home/ubuntu/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/linux-x86_64_v3/umpire-2025.09.0-l6vuanc7nlbfgjkteq2movqh24nhrafo/lib/libumpire.a(ResourceAwarePool.cpp.o): in function `umpire::strategy::ResourceAwarePool::deallocate_resource(void*, camp::resources::v1::Resource, unsigned long)':
ResourceAwarePool.cpp:(.text+0xae45): undefined reference to `camp::throw_re(char const*)'
/usr/bin/ld: /home/ubuntu/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac/linux-x86_64_v3/umpire-2025.09.0-l6vuanc7nlbfgjkteq2movqh24nhrafo/lib/libumpire.a(ResourceAwarePool.cpp.o): in function `camp::resources::v1::Resource::ContextModel<camp::resources::v1::Host>::compare(camp::resources::v1::Resource const&) const':
ResourceAwarePool.cpp:(.text._ZNK4camp9resources2v18Resource12ContextModelINS1_4HostEE7compareERKS2_[_ZNK4camp9resources2v18Resource12ContextModelINS1_4HostEE7compareERKS2_]+0x3c): undefined reference to `camp::throw_re(char const*)'
collect2: error: ld returned 1 exit status
make: *** [makefile:86: ex1p] Error 1
make: Leaving directory '/tmp/ubuntu/spack-stage/spack-stage-mfem-develop-bqp7664gmcfp6szafha3xabjyvcwv3ig/spack-src/examples'
```

This does not occur for shared builds because of transitive linking (I
guess). A simple way to fix this is ensuring that camp is explicitely
linked when available.
@alalazo alalazo self-assigned this Jan 7, 2026
@alalazo alalazo merged commit 2ae1027 into spack:develop Jan 7, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants