From 8d2be4d8a2ae120a018662782ffe2f9943533976 Mon Sep 17 00:00:00 2001 From: "Parshutin, Eugeny" Date: Fri, 31 May 2024 11:58:02 -0700 Subject: [PATCH] search fortran compiler via envvar and do apt-get update on linux buildbox --- .github/workflows/release.yml | 6 +++--- CMakeLists.txt | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc35b68..740cb76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,11 +17,11 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - name: Chechout sources + - name: Checkout sources uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Config environment if: runner.os == 'Linux' - run: sudo apt-get install gcc-multilib + run: sudo apt-get update && sudo apt-get install gcc-multilib - name: Setup Fortran Compiler uses: fortran-lang/setup-fortran@v1 with: @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - name: Chechout sources + - name: Checkout sources uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Create Release id: create_release diff --git a/CMakeLists.txt b/CMakeLists.txt index 87010de..2ef3d6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,8 +92,17 @@ else() endif() if(ITT_API_FORTRAN_SUPPORT) - # TODO: current build command is ok for ifort and not ok for ifx. Need to check with other compilers - enable_language(Fortran) + # TODO: current build command works fine with ifort and fails with ifx + # since ifx doesn't support 32-bit compilation. Need to check with other compilers. + + # Workaround to find the installed Fortran compiler via FC environment variable + # since enable_language(Fortran) does not work with setup-fortran github action + if(DEFINED ENV{FC}) + find_program(CMAKE_Fortran_COMPILER $ENV{FC}) + else() + message(FATAL_ERROR "The Fortran compiler was found on the system") + endif() + set(ITT_FORTRAN_SRC ${CMAKE_CURRENT_SOURCE_DIR}/include/fortran/${PLATFORM_PATH}/ittnotify.f90) set(ADVISOR_ANNOTATION_SRC ${CMAKE_CURRENT_SOURCE_DIR}/include/fortran/advisor_annotate.f90) set(FORTRAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/fortran)