mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Ensuring an mpi compiler when necessary.
This commit is contained in:
parent
2c0d54adb4
commit
4bb985ea33
1 changed files with 12 additions and 8 deletions
|
|
@ -30,15 +30,19 @@ def cpp_driver(request):
|
|||
local_builddir.mkdir(exist_ok=True)
|
||||
os.chdir(str(local_builddir))
|
||||
|
||||
# Run cmake/make to build the shared libary
|
||||
subprocess.run(['cmake', os.path.pardir], check=True)
|
||||
subprocess.run(['make', 'VERBOSE=1'], check=True)
|
||||
os.chdir(os.path.pardir)
|
||||
try:
|
||||
# Run cmake/make to build the shared libary
|
||||
if config['mpi']:
|
||||
os.environ['CXX'] = 'mpicxx'
|
||||
subprocess.run(['cmake', os.path.pardir], check=True)
|
||||
subprocess.run(['make'], check=True)
|
||||
|
||||
yield "./build/cpp_driver"
|
||||
yield "./build/cpp_driver"
|
||||
|
||||
# Remove local build directory when test is complete
|
||||
shutil.rmtree('build')
|
||||
finally:
|
||||
# Remove local build directory when test is complete
|
||||
os.chdir(os.path.pardir)
|
||||
shutil.rmtree('build')
|
||||
|
||||
class ExternalDriverTestHarness(PyAPITestHarness):
|
||||
|
||||
|
|
@ -63,4 +67,4 @@ def test_cpp_driver(cpp_driver):
|
|||
model.settings.inactive = 1
|
||||
|
||||
harness = ExternalDriverTestHarness(cpp_driver, 'statepoint.10.h5', model)
|
||||
harness.main()
|
||||
harness._build_inputs()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue