[Bug]: Environment variables upset testing
- Dominant language
- C++
- Stars
- 6
- Forks
- 11
- Avg merge
- 18h 7m
- Merged PRs (30d)
- 1
Description
### What happened?
When building with MPI disabled and vernier loaded from the software stack, the build fails with a cryptic error:
```
[ 30%] Built target vernier
[ 32%] Linking CXX executable test_profiler
$PWD/build/tests/unit_tests/c++/test_profiler: symbol lookup error: $PWD/build/tests/unit_tests/c++/test_profiler: undefined symbol: _Z8MPI_InitPiPPPc
CMake Error at /data/apps/spack/releases/2025.11.19/install/linux-rhel9-zen2/gcc-12.2.0/cmake-3.30.5-ktdsgm4ll462blorzs6imncxit2ddt5k/share/cmake-3.30/Modules/GoogleTestAddTests.cmake:112 (message):
Error running test executable.
Path: '$PWD/build/tests/unit_tests/c++/test_profiler'
Working directory: '$PWD/build/tests/unit_tests/c++'
Result: 127
Output:
```
This happens because `$LDFLAGS` also contains a reference to vernier and the build system is picking this up rather than the version that should be being tested. This should probably trigger an error.
Contributor guide
Research direction
Reproduce the failure with MPI disabled and Vernier supplied through the software stack, using the test executable at build/tests/unit_tests/c++/test_profiler. Start by tracing how LDFLAGS and the CMake test configuration select Vernier during linking. Done means the conflicting environment setup is detected with a clear error instead of producing an undefined-symbol failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100