Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Adjusted flags to attempt to get cross compiling working with enough …
Browse files Browse the repository at this point in the history
…vector instructions
  • Loading branch information
daminton committed May 23, 2023
1 parent 7aa1c81 commit 9ada3e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ RUN apt-get -y update && apt-get upgrade -y
RUN apt-get install -y intel-oneapi-runtime-openmp intel-oneapi-runtime-mkl intel-oneapi-runtime-mpi intel-oneapi-runtime-fortran
ENV NETCDF_HOME="/usr/local"
ENV LANG=C.UTF-8
ENV LD_LIBRARY_PATH=/opt/intel/oneapi/lib
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/intel/oneapi/lib"
RUN apt-get -y update && apt-get upgrade -y
RUN apt-get install -y libhdf5-dev libxml2-dev

Expand Down
11 changes: 2 additions & 9 deletions cmake/Modules/SetFortranFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}"

# There is some bug where -march=native doesn't work on Mac
IF(APPLE)
SET(GNUNATIVE "-mtune=native")
SET(GNUNATIVE "-mtune=CORE-AVX2 -xCORE-AVX2")
ELSE()
SET(GNUNATIVE "-march=native")
SET(GNUNATIVE "-march=CORE-AVX2 -axCORE-AVX2")
ENDIF()

###################
Expand Down Expand Up @@ -350,13 +350,6 @@ IF (USE_SIMD)
)
ENDIF (NOT USE_OPENMP)

# Optimize for the host's architecture
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}"
Fortran "-xhost" # Intel
"/QxHost" # Intel Windows
${GNUNATIVE} # GNU
)

# Generate an extended set of vector functions
SET_COMPILE_FLAG(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}"
Fortran "-vecabi=cmdtarget" # Intel
Expand Down

0 comments on commit 9ada3e7

Please sign in to comment.