openmc
openmc copied to clipboard
Temporary Directory Dependency in CMake Configuration
Description
During the wheel testing process for OpenMC PR #3087, the build configuration uses the OpenMCTargets.cmake
file to fetch relevant information for the OpenMC library. The target sets the _IMPORT_PREFIX
variable to a /tmp
directory during the building process. However, this causes issues during test runs because the /tmp
directory is already deleted by the time the test runs, leading to failures in finding required files.
Current Behavior
- The
OpenMCTargets.cmake
file defines the installation prefix_IMPORT_PREFIX
to a temporary path (/tmp/...
). - After the wheel is built, the
/tmp
directory gets removed, causing the test process to fail when trying to access the necessary files.
Proposed Solution
Redesign OpenMCConfig.cmake
:
- Remove the reliance on the
OpenMCTargets.cmake
file. - Manually set the necessary variables in
OpenMCConfig.cmake
, which will be configured during the initialization of the CMake process. - This approach ensures the variables are correctly configured for the wheel installation and test runs, without relying on paths in
/tmp
that no longer exist.
Impact of Removing Target Dependency
Since the target settings are causing issues due to reliance on the temporary directory, removing the dependency on OpenMCTargets.cmake
seems necessary to avoid failures during the test phase of the pip wheel build.