Skip to content

Commit

Permalink
switch to use ifx
Browse files Browse the repository at this point in the history
  • Loading branch information
eparshut committed Jun 13, 2024
1 parent e1dc367 commit 6e404b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@v1
with:
compiler: intel-classic
compiler: intel
- name: Build C library
run: python buildall.py -ft ${{ runner.os != 'macOS' && '-pt -v' || '-v' }}
- name: Display structure of files
Expand Down
20 changes: 6 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif()

project(ittapi)

option(FORCE_32 "Force a 32bit compile on 64bit" OFF)
option(FORCE_32 "Force a 32-bit compile on 64-bit" OFF)
option(ITT_API_IPT_SUPPORT "ptmarks support" OFF)
option(ITT_API_FORTRAN_SUPPORT "fortran support" OFF)

Expand All @@ -36,6 +36,11 @@ if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE_32))
set(ARCH_64 ON)
endif()

if(FORCE_32 AND ITT_API_FORTRAN_SUPPORT)
message(WARNING "Fortran support for 32-bit has been discontinued")
set(ITT_API_FORTRAN_SUPPORT OFF)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
# override default -O3
string(REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
Expand Down Expand Up @@ -92,13 +97,6 @@ else()
endif()

if(ITT_API_FORTRAN_SUPPORT)
# 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})
Expand All @@ -116,16 +114,10 @@ if(ITT_API_FORTRAN_SUPPORT)
set(ADVISOR_ANNOTATION ${FORTRAN_BINARY_DIR}/advisor_annotate.${PLATFORM_EXT})
if(NOT WIN32)
set(FORTRAN_BUILD_CMD ${CMAKE_Fortran_COMPILER} -g -c -fPIC -O2 -module ${FORTRAN_BINARY_DIR})
if(FORCE_32)
set(FORTRAN_BUILD_CMD ${FORTRAN_BUILD_CMD} -m32)
endif()
set(ITT_FORTRAN_BUILD_CMD ${FORTRAN_BUILD_CMD} -o ${ITT_FORTRAN} ${ITT_FORTRAN_SRC})
set(ADVISOR_ANNOTATION_BUILD_CMD ${FORTRAN_BUILD_CMD} -o ${ADVISOR_ANNOTATION} ${ADVISOR_ANNOTATION_SRC})
else()
set(FORTRAN_BUILD_CMD ${CMAKE_Fortran_COMPILER} /Z7 /nologo /libdir:noauto /O2 /c /module:${FORTRAN_BINARY_DIR})
if(FORCE_32)
set(FORTRAN_BUILD_CMD ${FORTRAN_BUILD_CMD} /Qm32)
endif()
set(ITT_FORTRAN_BUILD_CMD ${FORTRAN_BUILD_CMD} /object:${ITT_FORTRAN} ${ITT_FORTRAN_SRC})
set(ADVISOR_ANNOTATION_BUILD_CMD ${FORTRAN_BUILD_CMD} /object:${ADVISOR_ANNOTATION} ${ADVISOR_ANNOTATION_SRC})
endif()
Expand Down

0 comments on commit 6e404b0

Please sign in to comment.