Skip to content

Commit

Permalink
ci: add GitHub Action for testing NVidia C/C++ compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
nemequ committed Sep 13, 2024
1 parent 2d47a50 commit 4f4e36a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 24 deletions.
87 changes: 67 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,75 @@ jobs:
- name: Check for changes
run: git diff --exit-code

pelles-c:
runs-on: windows-latest
nvhpc:
runs-on: ubuntu-latest
strategy:
matrix:
version:
# https://community.chocolatey.org/packages/pelles-c#versionhistory
- "12.0.2"
- "11.0.2"
- "10.0.6"
- "9.00.0.0"
# - "8.00.0.0" ## Installation times out.
matrix:
version:
# For available versions, see https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64/Packages
# - "20.11"
# - "21.1" ## BROKEN. File size mismatch.
- "21.2"
- "21.3"
- "21.5"
- "21.7"
- "21.9"
# - "21.11"
# - "22.1"
# - "22.2"
# - "22.3"
# - "22.5"
# - "22.7"
# - "22.9"
# - "22.11"
# - "23.1"
# - "23.3"
# - "23.5"
# - "23.7"
# - "23.9"
# - "23.11"
# - "24.1"
# - "24.3"
# - "24.7"
steps:
- uses: actions/checkout@v2
- name: Install Pelles-C
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install pelles-c --version "${{ matrix.version }}" --no-progress
- uses: actions/checkout@v4
- name: Free some disk space
run: sudo rm -rf /usr/local/lib/android /usr/local/.ghcup/ghc
- name: Install NVidia HPC SDK
run: |
curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list
sudo apt-get update -y
sudo apt-get install -y nvhpc-$(echo "${{ matrix.version }}" | tr '.' '-')
- name: Compile
env:
CC: 'C:\Program Files\PellesC\bin\pocc.exe'
LD: 'C:\Program Files\PellesC\bin\polink.exe'
CFLAGS: '/IC:\Progra~1\PellesC\Include'
LDFLAGS: '/LIBPATH:C:\Progra~1\PellesC\lib /LIBPATH:C:\Progra~1\PellesC\Lib\Win64'
CC: /opt/nvidia/hpc_sdk/Linux_x86_64/"${{ matrix.version }}"/compilers/bin/nvc
CXX: /opt/nvidia/hpc_sdk/Linux_x86_64/"${{ matrix.version }}"/compilers/bin/nvc++
working-directory: test
run: make -f Makefile.pelles
run: make

# pelles-c:
# runs-on: windows-latest
# strategy:
# matrix:
# version:
# # https://community.chocolatey.org/packages/pelles-c#versionhistory
# - "12.0.2"
# - "11.0.2"
# - "10.0.6"
# - "9.00.0.0"
# # - "8.00.0.0" ## Installation times out.
# steps:
# - uses: actions/checkout@v2
# - name: Install Pelles-C
# uses: crazy-max/ghaction-chocolatey@v3
# with:
# args: install pelles-c --version "${{ matrix.version }}" --no-progress
# - name: Compile
# env:
# CC: 'C:\Program Files\PellesC\bin\pocc.exe'
# LD: 'C:\Program Files\PellesC\bin\polink.exe'
# CFLAGS: '/IC:\Progra~1\PellesC\Include'
# LDFLAGS: '/LIBPATH:C:\Progra~1\PellesC\lib /LIBPATH:C:\Progra~1\PellesC\Lib\Win64'
# working-directory: test
# run: make -f Makefile.pelles
11 changes: 7 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ else ifeq ($(notdir $(CC)), suncc)
else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),armcl cl2000 cl430 cl6x cl7x clpru))
CFLAGS ?= --display_error_number --emit_warnings_as_errors --issue_remarks -i $(dir $(shell readlink -f $(shell which $(CC))))../include
C_OUTPUT_FILE := --output_file=
else ifeq ($(notdir $(CC)), pgcc)
else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),pgcc nvc))
CFLAGS ?= -Minform=inform -c11
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), pgc++)
CFLAGS ?= --display_error_number -Minform=inform -Werror
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), nvcc)
CFLAGS ?= --Werror all-warnings
C_OUTPUT_FILE := --output-file=
else ifeq ($(notdir $(CC)), xlc)
CFLAGS ?= $(CLANG_C_FLAGS)
C_OUTPUT_FILE := -o
Expand Down Expand Up @@ -48,6 +48,9 @@ else ifeq ($(notdir $(CXX)), sunCC)
else ifeq ($(notdir $(CXX)), pgc++)
CXXFLAGS ?= --display_error_number -Minform=inform -Werror
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), nvc++)
CXXFLAGS ?= --display_error_number -Minform=inform -Werror
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)),$(filter $(notdir $(CC)),armcl cl2000 cl430 cl6x cl7x clpru))
CXXFLAGS ?= --display_error_number --emit_warnings_as_errors --issue_remarks -i $(dir $(shell readlink -f $(shell which $(CC))))../include
CXX_OUTPUT_FILE := --output_file=
Expand Down

0 comments on commit 4f4e36a

Please sign in to comment.