Skip to content

Commit

Permalink
use enable_language() again
Browse files Browse the repository at this point in the history
  • Loading branch information
eparshut committed May 31, 2024
1 parent 8d2be4d commit e1dc367
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,21 @@ else()
endif()

if(ITT_API_FORTRAN_SUPPORT)
# 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.
# TODO: current build command works fine only with ifort that will be deprecated soon
# - fails with ifx since ifx doesn't support 32-bit compilation;
# - fails with gfortran due to differetn command line option needed
#
# The best solution is to drop 32-bit support for Fortran and use ifx compiler
# But I'm not sure because almost only dinosaurs use Fortran

# 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()
#if(DEFINED ENV{FC})
# find_program(CMAKE_Fortran_COMPILER $ENV{FC})
#else()
# message(FATAL_ERROR "The Fortran compiler was found on the system")
#endif()
enable_language(Fortran)

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)
Expand Down

0 comments on commit e1dc367

Please sign in to comment.