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

Fix gnu14 related build errors #2026

Merged
merged 8 commits into from
Sep 26, 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
1 change: 1 addition & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
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"
export SKIP_CI_SPECS="${SKIP_CI_SPECS} components/serial-libs/R/SPECS/R.spec"
export SKIP_CI_SPECS="${SKIP_CI_SPECS} components/perf-tools/tau/SPECS/tau.spec"
fi
. /etc/profile.d/lmod.sh
chown ohpc -R tests
Expand Down
7 changes: 6 additions & 1 deletion components/io-libs/adios2/SPECS/adios2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ BuildRequires: %{python_prefix}-devel %{python_prefix}-setuptools
BuildRequires: %{python_prefix}-numpy-%{compiler_family}%{PROJ_DELIM}
BuildRequires: %{python_prefix}-mpi4py-%{compiler_family}-%{mpi_family}%{PROJ_DELIM}

Requires: %{python_prefix}-numpy-%{compiler_family}%{PROJ_DELIM}
Requires: %{python_prefix}-mpi4py-%{compiler_family}-%{mpi_family}%{PROJ_DELIM}

# Default library install path
%define install_path %{OHPC_LIBS}/%{compiler_family}/%{mpi_family}/%{pname}/%{version}

Expand Down Expand Up @@ -73,12 +76,14 @@ module load openblas
module load %{python_module_prefix}numpy
module load %{python_module_prefix}mpi4py

%if "%{compiler_family}" == "arm1" || "%{compiler_family}" == "intel"
export CFLAGS="${CFLAGS} -Wno-implicit-int"
export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration"
%if "%{compiler_family}" == "arm1" || "%{compiler_family}" == "intel"
export CFLAGS="${CFLAGS} -Wno-incompatible-function-pointer-types"
export CXXFLAGS="${CXXFLAGS} -Wno-implicit-int"
export CXXFLAGS="${CXXFLAGS} -Wno-implicit-function-declaration"
%else
export CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types"
%endif
%if "%{compiler_family}" == "arm1"
export CXXFLAGS="${CXXFLAGS} -fsimdmath"
Expand Down
2 changes: 0 additions & 2 deletions components/perf-tools/dimemas/SPECS/dimemas.spec
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ module load boost
module load flex
export LDFLAGS="-L$FLEX_LIB"
%endif
%if "%{compiler_family}" == "arm1" || "%{compiler_family}" == "intel"
export CFLAGS="${CFLAGS} -Wno-implicit-int"
export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration"
export CXXFLAGS="${CXXFLAGS} -Wno-implicit-int"
export CXXFLAGS="${CXXFLAGS} -Wno-implicit-function-declaration"
export CXXFLAGS="${CXXFLAGS} -Wno-register"
%endif
%if "%{compiler_family}" == "arm1"
export CFLAGS="${CFLAGS} -fsimdmath"
export CXXFLAGS="${CXXFLAGS} -fsimdmath"
Expand Down
18 changes: 10 additions & 8 deletions components/perf-tools/extrae/SPECS/extrae.spec
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,20 @@ export compiler_vars="CC=${CC} CXX=${CXX} MPIF90=mpiifort $compiler_vars"
export PATH=%{OHPC_UTILS}/autotools/bin:${PATH}
./bootstrap
export LDFLAGS="$LDFLAGS -lz"
%if 0%{?sle_version}
export LDFLAGS="$LDFLAGS -lsframe"
%endif
export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration"
export CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types"
%if "%{compiler_family}" == "arm1"
export CFLAGS="${CFLAGS} -fsimdmath -fPIC"
export CXXFLAGS="${CXXFLAGS} -fsimdmath -fPIC"
export FCFLAGS="${FCFLAGS} -fsimdmath -fPIC"
%endif
./configure $compiler_vars --with-xml-prefix=/usr --with-papi=$PAPI_DIR --without-unwind \
--without-dyninst --disable-openmp-intel --prefix=%{install_path} --with-mpi=$MPI_DIR \
%if "%{mpi_family}" == "impi"
--with-mpi-libs=$MPI_DIR/lib/release \
%endif
%if "%{compiler_family}" == "arm1"
CFLAGS="${CFLAGS} -fsimdmath -fPIC -Wno-implicit-function-declaration" \
CXXFLAGS="${CXXFLAGS} -fsimdmath -fPIC" \
FCFLAGS="${FCFLAGS} -fsimdmath -fPIC" \
%endif
%if "%{compiler_family}" == "intel"
CFLAGS="${CFLAGS} -Wno-implicit-function-declaration" \
%endif
|| { cat config.log && exit 1; }

Expand Down
2 changes: 1 addition & 1 deletion components/perf-tools/tau/SPECS/tau.spec
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ export FFLAGS="$FFLAGS -I${MPI_INCLUDE_DIR}"
%if "%{compiler_family}" == "arm1"
export CFLAGS="${CFLAGS} -fsimdmath"
%endif
%if "%{compiler_family}" == "intel"
export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration"
%if "%{compiler_family}" == "intel"
export CFLAGS="${CFLAGS} -Wno-register"
%endif

Expand Down
8 changes: 8 additions & 0 deletions tests/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ codespell-lint:
../../components/rms/slurm/SOURCES/slurm.epilog.clean \
../../tests/user-env/mem_limits \
../../tests/user-env/ompi_info \
../../tests/perf-tools/dimemas/tests/test_module \
../../tests/perf-tools/extrae/tests/test_module \
../../tests/perf-tools/omb/tests/rm_execution \
../../tests/perf-tools/scalasca/tests/rm_execution \
../../tests/perf-tools/scalasca/tests/test_module \
Expand Down Expand Up @@ -41,6 +43,8 @@ whitespace-lint:
components/rms/slurm/SOURCES/slurm.epilog.clean \
tests/user-env/mem_limits \
tests/user-env/ompi_info \
tests/perf-tools/dimemas/tests/test_module \
tests/perf-tools/extrae/tests/test_module \
tests/perf-tools/omb/tests/rm_execution \
tests/perf-tools/scalasca/tests/rm_execution \
tests/perf-tools/scalasca/tests/test_module \
Expand Down Expand Up @@ -73,6 +77,8 @@ shellcheck-lint:
../../tests/apps/hpcg/run \
../../tests/user-env/mem_limits \
../../tests/user-env/ompi_info \
../../tests/perf-tools/dimemas/tests/test_module \
../../tests/perf-tools/extrae/tests/test_module \
../../tests/perf-tools/omb/tests/rm_execution \
../../tests/perf-tools/scalasca/tests/rm_execution \
../../tests/perf-tools/scalasca/tests/test_module \
Expand All @@ -92,6 +98,8 @@ shfmt-lint:
../../tests/apps/hpcg/run \
../../tests/user-env/mem_limits \
../../tests/user-env/ompi_info \
../../tests/perf-tools/dimemas/tests/test_module \
../../tests/perf-tools/extrae/tests/test_module \
../../tests/perf-tools/omb/tests/rm_execution \
../../tests/perf-tools/scalasca/tests/rm_execution \
../../tests/perf-tools/scalasca/tests/test_module \
Expand Down
3 changes: 1 addition & 2 deletions tests/ci/setup_slurm_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ fi

# First install slurm and needed packages
"${PKG[@]}" install \
autoconf \
automake \
hostname \
make \
openssh-clients \
which \
sudo \
ohpc-autotools \
prun-ohpc \
openmpi5-"${COMPILER_FAMILY}"-ohpc \
mpich-"${COMPILER_FAMILY}"-ohpc \
Expand Down
21 changes: 20 additions & 1 deletion tests/ci/spec_to_test_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# and which tests to enable in the test suite.
# This script will return three shell arrays (TESTS, ADMIN_TESTS and PKGS).

import os
import sys
import csv
import os

# This dictionary defines the mapping
# 'path/to/file.spec': [
Expand Down Expand Up @@ -255,6 +256,22 @@
],
}

# Check which base OS we are using
reader = csv.DictReader(open('/etc/os-release'), delimiter="=")

python_prefix = 'python3'

for row in reader:
key = row.pop('NAME')
if key in ['ID_LIKE', 'ID']:
for item in list(row.items())[0]:
if 'rhel' in item:
python_prefix = 'python3.11'
break
if 'suse' in item:
python_prefix = 'python311'
break

skip_ci_specs = []
skip_ci_specs_env = os.getenv('SKIP_CI_SPECS')
if skip_ci_specs_env:
Expand Down Expand Up @@ -286,6 +303,8 @@
admin_tests += f'--enable-{test_map[i][1]}'
pkgs += test_map[i][2]

pkgs = pkgs.replace('python3', python_prefix)

print(
'TESTS=(%s) ADMIN_TESTS=(%s) PKGS=(%s)' % (
tests,
Expand Down
2 changes: 1 addition & 1 deletion tests/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
AC_PREREQ([2.69])
AC_INIT([test-suite], [2.0.0], [https://github.com/openhpc/ohpc])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.14])
AM_INIT_AUTOMAKE([1.14 -Wno-portability])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

OHPC_DISTRO_FAMILY
Expand Down
4 changes: 2 additions & 2 deletions tests/m4/distro_family.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ if test -r "/etc/os-release"; then
else
AC_MSG_RESULT([unknown])
echo
AC_ERROR([Unknown or unsupported distribution specified in /etc/os-release.])
AC_MSG_ERROR(Unknown or unsupported distribution specified in /etc/os-release.)
fi

AC_SUBST(DISTRO_FAMILY)

else
AC_MSG_RESULT([unknown])
echo
AC_ERROR([Expected /etc/os-release file not present.])
AC_MSG_ERROR(Expected /etc/os-release file not present.)
fi

])
10 changes: 5 additions & 5 deletions tests/perf-tools/dimemas/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
#

AC_PREREQ(2.59)
AC_INIT(dimemas,5.3.4, https://github.com/openhpc/ohpc)
AC_PREREQ([2.71])
AC_INIT([dimemas],[5.3.4],[https://github.com/openhpc/ohpc])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Expand All @@ -16,7 +16,7 @@ AC_MSG_CHECKING([for DIMEMAS_INC environment variable])
if test "x$DIMEMAS_INC" = "x"; then
AC_MSG_RESULT([no])
echo
AC_ERROR([DIMEMAS_INC not defined - please load dimemas environment.])
AC_MSG_ERROR(DIMEMAS_INC not defined - please load dimemas environment.)
else
AC_MSG_RESULT([yes])
fi
Expand All @@ -27,13 +27,13 @@ OHPC_COMPILER_FAMILY
AC_CONFIG_FILES(Makefile tests/Makefile)

# Configure
AC_OUTPUT()
AC_OUTPUT

echo
echo '-------------------------------------------------- SUMMARY --------------------------------------------------'
echo
echo Package version............... : $PACKAGE-$VERSION
echo OHPC compiler toolchain....... : $LMOD_FAMILY_COMPILER
echo OHPC MPI toolchain............ : $LMOD_FAMILY_MPI
echo
echo
echo '-------------------------------------------------------------------------------------------------------------'
114 changes: 55 additions & 59 deletions tests/perf-tools/dimemas/tests/test_module
Original file line number Diff line number Diff line change
@@ -1,98 +1,94 @@
#!/usr/bin/env -S bats --report-formatter junit --formatter tap
#!/usr/bin/env -S bats --report-formatter junit --formatter tap -j 6
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
if [ -s ./common/TEST_ENV ]; then
source ./common/TEST_ENV
fi

PKG=DIMEMAS
testname="Dimemas"
export testname="Dimemas"
module=dimemas
header=extern_comm_model.h

setup() {
module purge
module load ohpc
module load $module
OUTPUT=$(mktemp)
}

teardown() {
rm -f "${OUTPUT}"
}

@test "[$testname] Verify $module module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
module list $module | grep "1) $module" >&"${OUTPUT}" || exit 1
run grep $module "${OUTPUT}"
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version
version="$(rpm -q --queryformat='%{VERSION}\n' "$rpm")"
run cat "${OUTPUT}"
assert_output " 1) $module/$version"
}

@test "[$testname] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
DIR=${PKG}_DIR
if [ -z ${!DIR} ];then
flunk "${PKG}_DIR directory not defined"
fi
if [ ! -d ${!DIR} || -z "${!DIR}" ];then
flunk "directory ${!DIR} does not exist"
fi
DIR=${PKG}_DIR
if [ -z ${!DIR} ]; then
flunk "${PKG}_DIR directory not defined"
fi

if [ ! -d ${!DIR} ] || [ -z "${!DIR}" ]; then
flunk "directory ${!DIR} does not exist"
fi
}

# ----------
# Binaries
# ----------

@test "[$testname] Verify module ${PKG}_BIN is defined and exists ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
BIN=${PKG}_BIN
if [ -z ${!BIN} ];then
flunk "${PKG}_BIN directory not defined"
fi
if [ ! -d ${!BIN} || -z "${!BIN}" ];then
flunk "directory ${!BIN} does not exist"
fi
BIN=${PKG}_BIN
if [ -z ${!BIN} ]; then
flunk "${PKG}_BIN directory not defined"
fi

if [ ! -d ${!BIN} ] || [ -z "${!BIN}" ]; then
flunk "directory ${!BIN} does not exist"
fi
}

@test "[$testname] Verify availability of prv2dim binary ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
run which prv2dim
assert_success
run which prv2dim
assert_success
}

@test "[$testname] Verify availability of Dimemas binary ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
run which Dimemas
assert_success
run which Dimemas
assert_success
}

# Run Dimemas
@test "[$testname] Convert Paraver trace file to Dimemas format ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
@test "[$testname] Run Dimemas simulation ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
rm -f prediction.prv ./*.dim ./*.pcf

rm -f *.dim *.pcf
# Convert Paraver trace file to Dimemas format
run prv2dim lulesh2_27p.prv lulesh2_27p.dim
assert_success

run prv2dim lulesh2_27p.prv lulesh2_27p.dim
assert_success
run ls lulesh2_27p.dim
assert_success

run ls lulesh2_27p.dim
assert_success
run ls lulesh2_27p.pcf

run ls lulesh2_27p.pcf
assert_success
}
# Run Dimemas simulation
run Dimemas -S 32K -p prediction.prv MN.128.1ppn.cfg
assert_success

@test "[$testname] Run Dimemas simulation ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
run ls prediction.prv
assert_success

rm -f prediction.prv

run Dimemas -S 32K -p prediction.prv MN.128.1ppn.cfg
assert_success

run ls prediction.prv
assert_success
rm -f prediction.prv ./*.dim ./*.pcf
}

rm -f .cmd_output

Loading
Loading