diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index bb4b8f06082..129913c82cf 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -26,7 +26,7 @@ jobs: config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP] include: - config_set: BaseMPI - flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2 --werror' + flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Dinstall-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2' - config_set: ReverseMPI flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ForwardMPI @@ -52,23 +52,23 @@ jobs: key: ${{ matrix.config_set }}-${{ github.sha }} restore-keys: ${{ matrix.config_set }} - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 with: args: -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries - run: tar -zcvf install_bin.tgz install/bin + run: tar -zcvf install_bin.tgz install/* - name: Upload Binaries uses: actions/upload-artifact@v3 with: name: ${{ matrix.config_set }} path: install_bin.tgz - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -95,23 +95,23 @@ jobs: key: ${{ matrix.config_set }}-${{ github.sha }} restore-keys: ${{ matrix.config_set }} - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 with: args: -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries - run: tar -zcvf install_bin.tgz install/bin + run: tar -zcvf install_bin.tgz install/* - name: Upload Binaries uses: actions/upload-artifact@v3 with: name: ${{ matrix.config_set }} path: install_bin.tgz - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -142,7 +142,7 @@ jobs: tag: OMP steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -161,19 +161,19 @@ jobs: ls -lah tar -zxvf install_bin.tgz ls -lah install/bin/ - cp -r install/bin/* $BIN_FOLDER; + cp -r install/* $BIN_FOLDER/../ popd; fi done chmod a+x $BIN_FOLDER/* ls -lahR $BIN_FOLDER - name: Run Tests in Container - uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: # -t -c args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} - name: Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -188,7 +188,7 @@ jobs: testscript: ['hybrid_regression.py', 'hybrid_regression_AD.py'] steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -207,19 +207,19 @@ jobs: ls -lah tar -zxvf install_bin.tgz ls -lah install/bin/ - cp -r install/bin/* $BIN_FOLDER; + cp -r install/* $BIN_FOLDER/../ popd; fi done chmod a+x $BIN_FOLDER/* ls -lahR $BIN_FOLDER - name: Run Tests in Container - uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 with: # -t -c args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan" - name: Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -240,7 +240,7 @@ jobs: tag: MPI steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -273,7 +273,7 @@ jobs: ls -lah tar -zxvf install_bin.tgz ls -laH install/bin/ - cp -r install/bin/* $BIN_FOLDER; + cp -r install/* $BIN_FOLDER/../ popd; else echo "$TYPE_FOLDER does not exist!" @@ -301,11 +301,11 @@ jobs: echo $PWD ls -lahR - name: Run Unit Tests - uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: install/bin/${{matrix.testdriver}} - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:230704-1323 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} diff --git a/.github/workflows/release-management.yml b/.github/workflows/release-management.yml index 45bb698198f..f0b680a6485 100644 --- a/.github/workflows/release-management.yml +++ b/.github/workflows/release-management.yml @@ -35,7 +35,7 @@ jobs: key: ${{ matrix.os_bin }}-${{ github.sha }} restore-keys: ${{ matrix.os_bin }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2-cross:230704-1323 + uses: docker://ghcr.io/su2code/su2/build-su2-cross:230813-0103 with: args: -b ${{ github.sha }} -f "${{matrix.flags}}" - name: Create Archive diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index be3aa73a744..42329dc979d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -3983,9 +3983,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } - if (Kind_FluidModel == MUTATIONPP && - (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) { - SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG transport model instead..", + if (Kind_FluidModel == MUTATIONPP && (Kind_TransCoeffModel == TRANSCOEFFMODEL::SUTHERLAND)) { + SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE, GUPTAYOS, or CHAPMANN_ENSKOG transport model instead.", CURRENT_FUNCTION); } diff --git a/SU2_PY/copy_directory.py b/SU2_PY/copy_directory.py new file mode 100755 index 00000000000..aa42e27cc61 --- /dev/null +++ b/SU2_PY/copy_directory.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + +import sys +import os +import shutil + +if __name__ == "__main__": + src = os.path.abspath(sys.argv[1]) + dst = os.path.abspath(sys.argv[2]) + shutil.copytree(src, dst) diff --git a/meson.build b/meson.build index d1a5b3b91fb..2a45b4838de 100644 --- a/meson.build +++ b/meson.build @@ -245,11 +245,28 @@ endforeach catch2_dep = declare_dependency(include_directories: 'externals/catch2/') if get_option('enable-mpp') - cmake = import('cmake') - mpp_subproj = cmake.subproject('Mutationpp') + if build_machine.cpu_family() == 'x86' or build_machine.cpu_family() == 'x86_64' + cmake = import('cmake') + cmake_opts = cmake.subproject_options() + cmake_opts.set_override_option('warning_level', '0') + cmake_opts.add_cmake_defines({ + 'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'), + 'CMAKE_POSITION_INDEPENDENT_CODE': 'ON' + }) + cmake_opts.set_install(get_option('install-mpp')) + endif + mpp_subproj = cmake.subproject('Mutationpp', options: cmake_opts) mpp_dep = mpp_subproj.dependency('mutation++') su2_deps += mpp_dep su2_cpp_args += '-DHAVE_MPP' + + if get_option('install-mpp') + py = find_program('python3', 'python') + p = run_command(py, 'SU2_PY/copy_directory.py', 'subprojects/Mutationpp/data', join_paths(get_option('prefix'), 'mpp-data')) + if p.returncode() != 0 + error(p.stderr()) + endif + endif endif if get_option('enable-coolprop') @@ -259,7 +276,7 @@ if get_option('enable-coolprop') cmake_opts.set_override_option('warning_level', '0') cmake_opts.add_cmake_defines({ 'COOLPROP_STATIC_LIBRARY': true, - 'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja', + 'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'), 'CMAKE_POSITION_INDEPENDENT_CODE': 'ON' }) coolprop_subproj = cmake.subproject('CoolProp', options: cmake_opts) @@ -344,12 +361,21 @@ message('''--------------------------------------------------------------------- get_option('enable-mlpcpp'), meson.project_build_root().startswith(meson.project_source_root()) ? meson.project_build_root().split('/')[-1] : meson.project_build_root())) if get_option('enable-mpp') - message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file: + if get_option('install-mpp') + message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file: - export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data - export LD_LIBRARY_PATH=$SU2_HOME//subprojects/Mutationpp + export MPP_DATA_DIRECTORY=$SU2_RUN/../mpp-data + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_RUN/../lib - ''') + ''') + else + message(''' To run SU2 with Mutation++ library, add these lines to your .bashrc file: + + export MPP_DATA_DIRECTORY=$SU2_HOME/subprojects/Mutationpp/data + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SU2_HOME//subprojects/Mutationpp + + ''') + endif endif if get_option('enable-librom') diff --git a/meson_options.txt b/meson_options.txt index 4fbc35b82d7..7b2902bba0b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -18,6 +18,7 @@ option('enable-tests', type : 'boolean', value : false, description: 'compile U option('enable-mixedprec', type : 'boolean', value : false, description: 'use single precision floating point arithmetic for sparse algebra') option('extra-deps', type : 'string', value : '', description: 'comma-separated list of extra (custom) dependencies to add for compilation') option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support') +option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix') option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support') option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support') option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')