Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/build-ci/manifests/intel.spack.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spack:
packages:
access3-share:
require:
'@git.{{ ref }}=stable'
'@git.{{ ref }}'
all:
require:
- '%{{ intel_compiler }} target={{ target }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/build-ci/manifests/oneapi.spack.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spack:
specs:
- access3 @git.{{ ref }} configurations={{ all_configurations }}
- access3 @git.{{ ref }}=stable configurations={{ all_configurations }}
packages:
access3-share:
require:
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ include(GNUInstallDirs)
include(FortranLib)
include(AddPatchedSource)

# Use llvm-ar for IntelLLVM Fortran compiler
include(UseLlvmArchive)

# Common compiler flags and definitions
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none")
Expand Down
35 changes: 35 additions & 0 deletions cmake/UseLlvmArchive.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use llvm-ar with `rcs` so we dont need to setup a separate ranlib.

# Identify compiler is IntelLLVM
# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
if (NOT (CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM"))
return()
endif()

# set a temp variable to hold the Fortran compiler path
set(_TMP_VAR "")
if (CMAKE_Fortran_COMPILER)
set(_TMP_VAR "${CMAKE_Fortran_COMPILER}")
endif()

# try to discover full paths to llvm-ar
# https://cmake.org/cmake/help/latest/command/execute_process.html
if (_TMP_VAR)
execute_process(
COMMAND "${_TMP_VAR}" -print-prog-name=llvm-ar
OUTPUT_VARIABLE LLVM_AR_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()

# enforce llvm-ar
set(CMAKE_AR "${LLVM_AR_PATH}" CACHE FILEPATH "" FORCE)

# write index table via `s` flag, which disables separate ranlib step.
# https://github.com/Kitware/CMake/blob/1c7fe4dc0b47de90bec6918b33f0aca47d688887/Modules/CMakeCInformation.cmake#L152-L162
# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_ARCHIVE_FINISH.html
#
set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <OBJECTS>")
set(CMAKE_Fortran_ARCHIVE_FINISH "")

unset(_TMP_VAR)
Loading