From 42677ded8ebe4bdd2e53c7f1e9014a50c37b7522 Mon Sep 17 00:00:00 2001 From: AMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:15:17 +0530 Subject: [PATCH] Fix for OpenFOAM pthread issue for AOCC 3.2 (#27949) * Fix for OpenFOAM pthread issue for AOCC 3.2 * addressing the review comments * updating when command for aocc v3.2.0 and above Co-authored-by: mohan babu --- var/spack/repos/builtin/packages/openfoam/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py index 146b8a838b..118f780602 100644 --- a/var/spack/repos/builtin/packages/openfoam/package.py +++ b/var/spack/repos/builtin/packages/openfoam/package.py @@ -559,6 +559,18 @@ def configure_trapFpe_off(self): filter_file(r'trapFpe\s+\d+\s*;', 'trapFpe 0;', controlDict, backup=False) + @when('@:2106 %aocc@3.2.0:') + @run_before('configure') + def make_amd_rules(self): + """Due to the change in the linker behavior in AOCC v3.2, it is now + issuing diagnostic messages for the unreferenced symbols in the + shared objects as it may lead to run time failures. + """ + general_rules = 'wmake/rules/General' + src = join_path(general_rules, 'Clang') + filter_file('clang++', spack_cxx + ' -pthread', join_path(src, 'c++'), + backup=False, string=True) + @when('@1812: %fj') @run_before('configure') def make_fujitsu_rules(self):