Skip to content

Commit

Permalink
Make everything gnu14 ready
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Reber <[email protected]>
  • Loading branch information
adrianreber committed Sep 15, 2024
1 parent 7cdbba7 commit d4b592c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
run: |
if [ "${{ matrix.compiler }}" == "intel" ]; then
export SKIP_CI_SPECS="${{ env.SKIP_CI_SPECS }} components/serial-libs/openblas/SPECS/openblas.spec"
export SKIP_CI_SPECS="${SKIP_CI_SPECS} components/dev-tools/scipy/SPECS/python-scipy.spec"
fi
. /etc/profile.d/lmod.sh
tests/ci/run_build.py ohpc ${{ steps.files.outputs.added_modified }} --compiler-family ${{ matrix.compiler }}
Expand Down Expand Up @@ -139,6 +140,7 @@ jobs:
export SKIP_CI_SPECS="${{ env.SKIP_CI_SPECS }}${{ env.JOB_SKIP_CI_SPECS }}"
if [ "${{ matrix.compiler }}" == "intel" ]; then
export SKIP_CI_SPECS="${SKIP_CI_SPECS} components/serial-libs/openblas/SPECS/openblas.spec"
export SKIP_CI_SPECS="${SKIP_CI_SPECS} components/dev-tools/scipy/SPECS/python-scipy.spec"
fi
. /etc/profile.d/lmod.sh
chown ohpc -R tests
Expand Down
7 changes: 5 additions & 2 deletions components/dev-tools/scipy/SPECS/python-scipy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%define ohpc_python_dependent 1
%include %{_sourcedir}/OHPC_macros

%global gnu_family gnu13
%global gnu_family gnu14

%if "%{compiler_family}" != "intel" && "%{compiler_family}" != "arm"
BuildRequires: openblas-%{compiler_family}%{PROJ_DELIM}
Expand Down Expand Up @@ -79,9 +79,13 @@ find . -type f -name "*.py" -exec sed -i "s|#!/usr/bin/env python3||" {} \;
# OpenHPC compiler/mpi designation
%ohpc_setup_compiler

export CFLAGS="${CFLAGS} -fno-strict-aliasing"

%if "%{compiler_family}" != "intel" && "%{compiler_family}" != "arm"
module load openblas
module load fftw
export CFLAGS="${CFLAGS} -Wno-implicit-int"
export CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types"
%endif

module load %{python_module_prefix}numpy
Expand Down Expand Up @@ -114,7 +118,6 @@ include_dirs = $OPENBLAS_INC
EOF
%endif

CFLAGS="%{optflags} -fno-strict-aliasing" \
%if "%{compiler_family}" == "intel"
LDSHARED="icc -shared" \
%__python setup.py config --compiler=intelm --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem build
Expand Down
2 changes: 1 addition & 1 deletion components/io-libs/phdf5/SPECS/hdf5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export MPICC=mpicc
export MPIFC=mpifc
export MPICXX=mpicxx

%if "%{mpi_family}" == "impi" && "%{compiler_family}" == "gnu13"
%if "%{mpi_family}" == "impi" && "%{compiler_family}" == "gnu14"
# This is not really the perfect solution, but impi does not have
# the necessary files for gfortran 12. It seems to work with
# the files from gfortran 11.1.0.
Expand Down
4 changes: 2 additions & 2 deletions components/io-libs/sionlib/SPECS/sionlib.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CONFIGURE_OPTIONS="--compiler=arm "
%if "%{compiler_family}" == "llvm"
CONFIGURE_OPTIONS="--compiler=llvm "
%endif
%if "%{compiler_family}" == "gnu13"
%if "%{compiler_family}" == "gnu14"
CONFIGURE_OPTIONS="--compiler=gnu "
%endif
%if "%{compiler_family}" == "gnu14"
Expand Down Expand Up @@ -111,7 +111,7 @@ sed -i "s/-mieee-fp//g;s/-wd161//g;" build-*/Makefile.defs
sed -i 's/$(CPP)/ifx/g' src/fortraninterface/Makefile
%endif

%if "%{compiler_family}" == "gnu13"
%if "%{compiler_family}" == "gnu14"
sed -i 's/FFLAGS.*/& -fallow-argument-mismatch/g' build-*/Makefile.defs
sed -i 's/F90FLAGS.*/& -fallow-argument-mismatch/g' build-*/Makefile.defs
sed -i 's/F90 .*/& -fallow-argument-mismatch/g' build-*/Makefile.defs
Expand Down
2 changes: 1 addition & 1 deletion components/parallel-libs/mumps/SPECS/mumps.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
%define ohpc_mpi_dependent 1
%include %{_sourcedir}/OHPC_macros

%global gnu_family gnu13
%global gnu_family gnu14

# Base package name
%define pname mumps
Expand Down
6 changes: 3 additions & 3 deletions components/perf-tools/geopm/SPECS/geopm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Release: 1
License: BSD-3-Clause
Group: %{PROJ_NAME}/perf-tools
URL: https://geopm.github.io
Source0: https://github.com/geopm/geopm/releases/download/v%{version}/geopm-%{version}.tar.gz
Source0: https://github.com/geopm/geopm/archive/refs/tags/v%{version}.tar.gz
# Based on https://patch-diff.githubusercontent.com/raw/geopm/geopm/pull/1141.patch
Patch0: gnu12.patch
Patch1: https://github.com/geopm/geopm/commit/4b70c27c058fc826270a487778226f4719a1df8a.patch
Expand Down Expand Up @@ -87,15 +87,15 @@ including support for static control.

%build
%ohpc_setup_compiler
%if "%{compiler_family}" == "gnu13"
%if "%{compiler_family}" == "gnu14"
export CFLAGS="$CFLAGS -Wno-error=stringop-truncation"
%endif
%if "%{compiler_family}" == "intel"
export CXXFLAGS="${CXXFLAGS} -Wno-error"
%endif
./autogen.sh

%if "%{mpi_family}" == "impi" && "%{compiler_family}" == "gnu13"
%if "%{mpi_family}" == "impi" && "%{compiler_family}" == "gnu14"
# The combination of impi and GCC 12 does not work as
# expected and needs these additional fixes.
sed -e 's,\sFFLAGS=$MPI_F77FLAGS,FFLAGS="-I$MPI_DIR/include $MPI_F77FLAGS",g' -i configure
Expand Down
10 changes: 5 additions & 5 deletions components/perf-tools/scorep/SPECS/scorep.spec
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ make V=1 %{?_smp_mflags}
# GNU compilers bring their own libstdc++, which is required for C++
# code to work correctly. Due to rpathing issues however, Score-P
# causes the wrong libstdc++ to be linked (the system one instead of
# the gnu13 installation). This causes issues when running code.
# the gnu14 installation). This causes issues when running code.
# This will be fixed in Score-P v9.0. Until then, fix the paths
# manually be replacing the added /usr/lib64 and /lib64 library paths
# by the gnu13 ones. We need to do this after make, since it is
# by the gnu14 ones. We need to do this after make, since it is
# generated during the build process.
%if "%{compiler_family}" == "gnu13"
%{__sed} -i -e 's#"/lib64"#"/opt/ohpc/pub/compiler/gcc/13.2.0/lib64"#g' src/scorep_config_library_dependencies_backend_inc.hpp
%{__sed} -i -e 's#"/usr/lib64"#"/opt/ohpc/pub/compiler/gcc/13.2.0/lib/../lib64"#g' src/scorep_config_library_dependencies_backend_inc.hpp
%if "%{compiler_family}" == "gnu14"
%{__sed} -i -e 's#"/lib64"#"/opt/ohpc/pub/compiler/gcc/14.2.0/lib64"#g' src/scorep_config_library_dependencies_backend_inc.hpp
%{__sed} -i -e 's#"/usr/lib64"#"/opt/ohpc/pub/compiler/gcc/14.2.0/lib/../lib64"#g' src/scorep_config_library_dependencies_backend_inc.hpp
make V=1 %{?_smp_mflags}
%endif

Expand Down

0 comments on commit d4b592c

Please sign in to comment.