From 89cc507cf6e5fb0c943b207a70a4f43d165c5ade Mon Sep 17 00:00:00 2001 From: "Tomoki, Karatsu" <49965247+t-karatsu@users.noreply.github.com> Date: Fri, 5 Jun 2020 20:29:36 +0900 Subject: [PATCH] cmake: add linker option for VerifyFortranC when using Fujitsu compiler. (#16963) --- .../packages/cmake/fujitsu_add_linker_option.patch | 10 ++++++++++ var/spack/repos/builtin/packages/cmake/package.py | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 var/spack/repos/builtin/packages/cmake/fujitsu_add_linker_option.patch diff --git a/var/spack/repos/builtin/packages/cmake/fujitsu_add_linker_option.patch b/var/spack/repos/builtin/packages/cmake/fujitsu_add_linker_option.patch new file mode 100644 index 0000000000..4a0cf7abbf --- /dev/null +++ b/var/spack/repos/builtin/packages/cmake/fujitsu_add_linker_option.patch @@ -0,0 +1,10 @@ +--- spack-src/Modules/FortranCInterface/Verify/CMakeLists.txt.org 2020-06-05 15:54:59.559043595 +0900 ++++ spack-src/Modules/FortranCInterface/Verify/CMakeLists.txt 2020-06-05 15:58:28.150062948 +0900 +@@ -4,6 +4,7 @@ + cmake_minimum_required(VERSION ${CMAKE_VERSION}) + project(VerifyFortranC C Fortran) + ++set (CMAKE_EXE_LINKER_FLAGS "--linkfortran") + option(VERIFY_CXX "Whether to verify C++ and Fortran" OFF) + if(VERIFY_CXX) + enable_language(CXX) diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index fe19bdb404..933f5e1995 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -142,6 +142,10 @@ class Cmake(Package): # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4681 patch('ignore_crayxc_warnings.patch', when='@3.7:3.17.2') + # The Fujitsu compiler requires the '--linkfortran' option + # to combine C++ and Fortran programs. + patch('fujitsu_add_linker_option.patch', when='%fj') + conflicts('+qt', when='^qt@5.4.0') # qt-5.4.0 has broken CMake modules # https://gitlab.kitware.com/cmake/cmake/issues/18166