Skip to content

Commit

Permalink
Merge branch 'spack-stack-dev' into feature/pull_gcc_13_from_spack_de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
climbfuji authored Jun 12, 2024
2 parents d8feea8 + 0cb9e28 commit 1fc9a26
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
21 changes: 20 additions & 1 deletion lib/spack/env/cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,26 +233,45 @@ fi

command="${0##*/}"
comp="CC"
vcheck_flags=""
case "$command" in
cpp)
mode=cpp
debug_flags="-g"
;;
cc|c89|c99|gcc|clang|armclang|icc|icx|pgcc|nvc|xlc|xlc_r|fcc|amdclang|cl.exe|craycc)
# Edge case for Intel's oneAPI compilers when using the legacy classic compilers:
# Pass flags to disable deprecation warnings to vcheck mode, since the warnings
# to stderr confuse tools that parse the output of compiler version checks.
if [[ ${SPACK_CFLAGS} == *"-diag-disable=10441"* ]]; then
vcheck_flags="-diag-disable=10441"
fi
command="$SPACK_CC"
language="C"
comp="CC"
lang_flags=C
debug_flags="-g"
;;
c++|CC|g++|clang++|armclang++|icpc|icpx|pgc++|nvc++|xlc++|xlc++_r|FCC|amdclang++|crayCC)
# Edge case for Intel's oneAPI compilers when using the legacy classic compilers:
# Pass flags to disable deprecation warnings to vcheck mode, since the warnings
# to stderr confuse tools that parse the output of compiler version checks.
if [[ ${SPACK_CXXFLAGS} == *"-diag-disable=10441"* ]]; then
vcheck_flags="-diag-disable=10441"
fi
command="$SPACK_CXX"
language="C++"
comp="CXX"
lang_flags=CXX
debug_flags="-g"
;;
ftn|f90|fc|f95|gfortran|flang|armflang|ifort|ifx|pgfortran|nvfortran|xlf90|xlf90_r|nagfor|frt|amdflang|crayftn)
# Edge case for Intel's oneAPI compilers when using the legacy classic compilers:
# Pass flags to disable deprecation warnings to vcheck mode, since the warnings
# to stderr confuse tools that parse the output of compiler version checks.
if [[ ${SPACK_FFLAGS} == *"-diag-disable=10448"* ]]; then
vcheck_flags="-diag-disable=10448"
fi
command="$SPACK_FC"
language="Fortran 90"
comp="FC"
Expand Down Expand Up @@ -365,7 +384,7 @@ unset IFS
export PATH="$new_dirs"

if [ "$mode" = vcheck ]; then
exec "${command}" "$@"
exec "${command}" ${vcheck_flags} "$@"
fi

# Darwin's linker has a -r argument that merges object files together.
Expand Down
6 changes: 5 additions & 1 deletion var/spack/repos/builtin/packages/hdf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ def flag_handler(self, name, flags):
):
flags.append("-Wno-error=implicit-function-declaration")

if self.spec.satisfies("%clang@16:") or self.spec.satisfies("%apple-clang@15:"):
if (
self.spec.satisfies("%clang@16:")
or self.spec.satisfies("%apple-clang@15:")
or self.spec.satisfies("%oneapi")
):
flags.append("-Wno-error=implicit-int")

return flags, None, None
Expand Down
4 changes: 4 additions & 0 deletions var/spack/repos/builtin/packages/netcdf-c/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class NetcdfC(CMakePackage, AutotoolsPackage):
variant("fsync", default=False, description="Enable fsync support")
variant("nczarr_zip", default=False, description="Enable NCZarr zipfile format storage")
variant("optimize", default=True, description="Enable -O2 for a more optimized lib")
variant("logging", default=False, description="Enable logging")

variant("szip", default=True, description="Enable Szip compression plugin")
variant("blosc", default=True, description="Enable Blosc compression plugin")
Expand Down Expand Up @@ -337,6 +338,7 @@ def cmake_args(self):
self.define("ENABLE_PARALLEL_TESTS", False),
self.define_from_variant("ENABLE_FSYNC", "fsync"),
self.define("ENABLE_LARGE_FILE_SUPPORT", True),
self.define_from_variant("NETCDF_ENABLE_LOGGING", "logging"),
]
if "+parallel-netcdf" in self.pkg.spec:
base_cmake_args.append(self.define("ENABLE_PNETCDF", True))
Expand Down Expand Up @@ -432,6 +434,8 @@ def configure_args(self):

config_args += self.enable_or_disable("fsync")

config_args += self.enable_or_disable("logging")

if any(self.spec.satisfies(s) for s in ["+mpi", "+parallel-netcdf", "^hdf5+mpi~shared"]):
config_args.append("CC={0}".format(self.spec["mpi"].mpicc))

Expand Down

0 comments on commit 1fc9a26

Please sign in to comment.