Skip to content

Commit 3e30b1c

Browse files
committed
try to make mutation accesible in test scripts
1 parent be559bc commit 3e30b1c

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP]
2727
include:
2828
- config_set: BaseMPI
29-
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2'
29+
flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Dinstall-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2'
3030
- config_set: ReverseMPI
3131
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3232
- config_set: ForwardMPI

TestCases/parallel_regression.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@
2929
from __future__ import print_function
3030

3131
import sys
32+
import os
3233
from TestCase import TestCase
3334

3435
def main():
36+
os.environ['MPP_DATA_DIRECTORY'] = os.environ['SU2_RUN'] + "../mpp-data"
37+
os.environ['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + ":" + os.environ['SU2_RUN'] + "../lib"
38+
3539
'''This program runs SU2 and ensures that the output matches specified values.
3640
This will be used to do checks when code is pushed to github
3741
to make sure nothing is broken. '''

meson.build

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,20 @@ if get_option('enable-mpp')
238238
cmake_opts = cmake.subproject_options()
239239
cmake_opts.set_override_option('warning_level', '0')
240240
cmake_opts.add_cmake_defines({
241-
'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja',
242-
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
241+
'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja',
242+
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
243243
})
244+
cmake_opts.set_install(get_option('install-mpp'))
244245
endif
245246
mpp_subproj = cmake.subproject('Mutationpp', options: cmake_opts)
246247
mpp_dep = mpp_subproj.dependency('mutation++')
247248
su2_deps += mpp_dep
248249
su2_cpp_args += '-DHAVE_MPP'
250+
251+
if get_option('install-mpp')
252+
run_command('cp', '-r', join_paths(meson.source_root(), '/subprojects/Mutationpp/data'),
253+
join_paths(get_option('prefix'), '/mpp-data'), check: true)
254+
endif
249255
endif
250256

251257
if get_option('enable-coolprop')
@@ -340,12 +346,21 @@ message('''---------------------------------------------------------------------
340346
get_option('enable-mlpcpp'), meson.project_build_root().startswith(meson.project_source_root()) ? meson.project_build_root().split('/')[-1] : meson.project_build_root()))
341347

342348
if get_option('enable-mpp')
343-
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
349+
if get_option('install-mpp')
350+
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
344351
345-
export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data
346-
export LD_LIBRARY_PATH=$SU2_HOME/<build_dir>/subprojects/Mutationpp
352+
export MPP_DATA_DIRECTORY=$SU2_RUN/../mpp-data
353+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_RUN/../lib
347354
348-
''')
355+
''')
356+
else
357+
message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file:
358+
359+
export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data
360+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_HOME/<build_dir>/subprojects/Mutationpp
361+
362+
''')
363+
endif
349364
endif
350365

351366
if get_option('enable-librom')

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ option('enable-tests', type : 'boolean', value : false, description: 'compile U
1818
option('enable-mixedprec', type : 'boolean', value : false, description: 'use single precision floating point arithmetic for sparse algebra')
1919
option('extra-deps', type : 'string', value : '', description: 'comma-separated list of extra (custom) dependencies to add for compilation')
2020
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
21+
option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix')
2122
option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support')
2223
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support')
2324
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')

0 commit comments

Comments
 (0)