Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Intel ifx compiler #101

Merged
merged 4 commits into from
May 6, 2024
Merged
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
3 changes: 3 additions & 0 deletions packages/cice4/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def edit(self, spec, prefix):
LDFLAGS := $(FFLAGS) -v -static-intel
"""

# Add support for the ifx compiler
config["oneapi"] = config["intel"]
penguian marked this conversation as resolved.
Show resolved Hide resolved

# Based on https://github.com/ACCESS-NRI/cice4/blob/access-esm1.5/bld/Macros.nci
config["post"] = """
MOD_SUFFIX := mod
Expand Down
3 changes: 3 additions & 0 deletions packages/cice5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@
FREEFLAGS :=
"""

config["gcc"] = f"""
# TODO: removed -std=f2008 due to compiler errors
FFLAGS = -Wall -fdefault-real-8 -fdefault-double-8 -ffpe-trap=invalid,zero,overflow -fallow-argument-mismatch
"""

Check failure on line 137 in packages/cice5/package.py

View workflow job for this annotation

GitHub Actions / Check syntax

Ruff (F541)

packages/cice5/package.py:134:25: F541 f-string without any placeholders

# module load intel-compiler/2019.5.281
config["intel"] = f"""
Expand All @@ -150,6 +150,9 @@
endif
"""

# Add support for the ifx compiler
config["oneapi"] = config["intel"]

# Copied from bld/Macros.nci
config["post"] = """
MOD_SUFFIX := mod
Expand Down
3 changes: 3 additions & 0 deletions packages/mom5/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ def edit(self, spec, prefix):
LDFLAGS += $(LIBS)
"""

# Add support for the ifx compiler
config["oneapi"] = config["intel"]

# Copied from bin/mkmf.template.t90
config["post"] = """
# you should never need to change any lines below.
Expand Down
5 changes: 4 additions & 1 deletion packages/oasis3-mct/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import install, join_path, mkdirp
from pprint import pprint
# from pprint import pprint
penguian marked this conversation as resolved.
Show resolved Hide resolved

# https://spack.readthedocs.io/en/latest/build_systems/makefilepackage.html
class Oasis3Mct(MakefilePackage):
Expand Down Expand Up @@ -242,19 +242,19 @@
f = $(F90)
"""

config["gcc"] = f"""
# Compiling and other commands
MAKE = make
F90 = mpif90 -Wall -fallow-argument-mismatch
CC = gcc
LD = mpif90
MCT_FCFLAGS =
#
# CPP keys and compiler options
#
CPPDEF = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY
F90FLAGS_1 =
"""

Check failure on line 257 in packages/oasis3-mct/package.py

View workflow job for this annotation

GitHub Actions / Check syntax

Ruff (F541)

packages/oasis3-mct/package.py:245:25: F541 f-string without any placeholders

# module load intel-compiler/2019.5.281
config["intel"] = f"""
Expand Down Expand Up @@ -283,33 +283,36 @@
endif
"""

# Add support for the ifx compiler
config["oneapi"] = config["intel"]

config["post"] = f"""
f90FLAGS_1 = $(F90FLAGS_1)
FFLAGS_1 = $(F90FLAGS_1)
fFLAGS_1 = $(F90FLAGS_1)
CCFLAGS_1 =
LDFLAGS =
#
###################
#
# Additional definitions that should not be changed
#
FLIBS = ""
# BINDIR : directory for executables
BINDIR = $(ARCHDIR)/bin
# LIBBUILD : contains a directory for each library
LIBBUILD = $(ARCHDIR)/build/lib
# INCPSMILE : includes all *o and *mod for each library
INCPSMILE = -I$(LIBBUILD)/psmile.$(CHAN) -I$(LIBBUILD)/mct

F90FLAGS = $(F90FLAGS_1) $(INCPSMILE) $(CPPDEF)
f90FLAGS = $(f90FLAGS_1) $(INCPSMILE) $(CPPDEF)
FFLAGS = $(FFLAGS_1) $(INCPSMILE) $(CPPDEF)
fFLAGS = $(fFLAGS_1) $(INCPSMILE) $(CPPDEF)
CCFLAGS = $(CCFLAGS_1) $(INCPSMILE) $(CPPDEF)
#
#############################################################################
"""

Check failure on line 315 in packages/oasis3-mct/package.py

View workflow job for this annotation

GitHub Actions / Check syntax

Ruff (F541)

packages/oasis3-mct/package.py:289:26: F541 f-string without any placeholders

with open(makeinc_path, "w") as makeinc:
makeinc.write(
Expand Down
Loading