Skip to content

Commit fdf84e0

Browse files
committed
start github pipeline; Changed default C to c17 and added HAVE_C23 flag in config.mk
1 parent a28f948 commit fdf84e0

6 files changed

Lines changed: 67 additions & 4 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Run Unit Tests
2+
3+
on:
4+
push:
5+
branches: [ "main", "dane_dev" ]
6+
pull_request:
7+
branches: [ "main", "dane_dev" ]
8+
9+
jobs:
10+
build_ICC_MPI:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Spack
17+
uses: spack/actions/setup-spack
18+
with:
19+
spack-version: latest
20+
21+
- name: Install OpenMPI
22+
run: |
23+
spack concretize openmpi
24+
spack install -j openmpi
25+
spack load openmpi
26+
27+
- name: Configure GCC_MPI
28+
run: |
29+
sed -E -i \
30+
-e 's/^(ENABLE_MPI[[:space:]]*\?=[[:space:]]*).*/\1true/' \
31+
-e 's/^(ENABLE_OPENMP[[:space:]]*\?=[[:space:]]*).*/\1false/' \
32+
-e 's/^(TOOLCHAIN[[:space:]]*\?=[[:space:]]*).*/\1GCC/' \
33+
Makefile
34+
35+
- name: Make GCC_MPI
36+
run: |
37+
make
38+

config.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TOOLCHAIN ?= ICC
44
MTX_FMT ?= CRS
55
ENABLE_MPI ?= true
66
ENABLE_OPENMP ?= false
7+
HAVE_C23 ?= false
78
FLOAT_TYPE ?= DP # SP for float, DP for double
89
UINT_TYPE ?= U # U for unsigned int, ULL for unsigned long long int
910

mk/include_CLANG.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ OPENMP = -fopenmp
1212
#OPENMP = -Xpreprocessor -fopenmp #required on Macos with homebrew libomp
1313
endif
1414

15+
# Set default
16+
C_VERSION = c17
17+
ifeq ($(strip $(HAVE_C23)),true)
18+
C_VERSION = c23
19+
endif
20+
1521
VERSION = --version
16-
CFLAGS = -O3 -ffast-math -std=c23 $(OPENMP)
22+
CFLAGS = -O3 -ffast-math -std=$(C_VERSION) $(OPENMP)
1723
# CFLAGS = -O0 -g -std=c99 $(OPENMP)
1824
LFLAGS = $(OPENMP)
1925
DEFINES += -D_GNU_SOURCE

mk/include_GCC.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ ifeq ($(strip $(ENABLE_OPENMP)),true)
1111
OPENMP = -fopenmp
1212
endif
1313

14+
# Set default
15+
C_VERSION = c17
16+
ifeq ($(strip $(HAVE_C23)),true)
17+
C_VERSION = c23
18+
endif
19+
1420
VERSION = --version
15-
CFLAGS = -O3 -ffast-math -std=c23 $(OPENMP)
21+
CFLAGS = -O3 -ffast-math -std=$(C_VERSION) $(OPENMP)
1622
# CFLAGS = -O0 -g -std=c99 $(OPENMP)
1723
LFLAGS = $(OPENMP)
1824
DEFINES += -D_GNU_SOURCE # -DVERBOSE

mk/include_ICC.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ ifeq ($(strip $(ENABLE_OPENMP)),true)
1111
OPENMP = -qopenmp
1212
endif
1313

14+
# Set default
15+
C_VERSION = c17
16+
ifeq ($(strip $(HAVE_C23)),true)
17+
C_VERSION = c23
18+
endif
19+
1420
VERSION = --version
15-
CFLAGS = -O3 -ffast-math -xHost -std=c23 $(OPENMP)
21+
CFLAGS = -O3 -ffast-math -xHost -std=$(C_VERSION) $(OPENMP)
1622
# CFLAGS = -O0 -g -std=c99 $(OPENMP)
1723
LFLAGS = $(OPENMP)
1824
DEFINES += -D_GNU_SOURCE # -DVERBOSE

tests/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ MOD2_OBJECTS=${MOD2}/spmvSCS.o ${MOD2}/solverTests.o
2323
OBJECTS := $(shell echo $(MOD1_OBJECTS) $(MOD2_OBJECTS) | tr ' ' '\n' | sort -u | tr '\n' ' ')
2424

2525
# Always leave debugging flag on
26-
CFLAGS=-g -qopenmp
26+
CFLAGS=-g
27+
28+
# Only enable OpenMP if it defined in the parent config.mk
29+
ifeq ($(strip $(ENABLE_OPENMP)),true)
30+
CFLAGS += $(OPENMP)
31+
endif
32+
# If enabled, MPI wrappers are already in CC
2733

2834
.PHONY: all clean
2935

0 commit comments

Comments
 (0)