From 1c0afff56b3a179965cec6f61d392d7c43feecb4 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Fri, 13 Sep 2024 00:10:14 -0400 Subject: [PATCH] ci: add CI build for Digital Mars C/C++ Compiler --- .github/workflows/ci.yml | 149 +++++++++++++++++++++++---------------- test/Makefile | 8 +-- test/Makefile.dmc | 8 +-- 3 files changed, 95 insertions(+), 70 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b24ef5..a154ea6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,75 +23,100 @@ jobs: - name: Check for changes run: git diff --exit-code - nvhpc: - runs-on: ubuntu-latest + dmc: + runs-on: windows-latest strategy: 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" + - "8.57" + # http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip steps: - 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 + - name: Install Digital Mars C/C++ Compiler 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: /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++ + $version = "${{ matrix.version }}".Replace(".", "") + $url = "http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm${version}c.zip" + Invoke-WebRequest -Uri "http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip" -OutFile "dmc.zip" + Expand-Archive "dmc.zip" working-directory: test - 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: Debug + run: dir test - 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: dm/bin/dmc.exe + CXX: dm/bin/dmc.exe + run: make -f Makefile.dmc working-directory: test - run: make -f Makefile.pelles + + # nvhpc: + # runs-on: ubuntu-latest + # strategy: + # 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@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: /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 + + # 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 diff --git a/test/Makefile b/test/Makefile index 205be6b..ca3269e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -189,12 +189,12 @@ Makefile.iar: Makefile Makefile.dmc: Makefile @$(ECHO) -e "# Generated by Makefile. Do not edit.\r" > $@ - @$(ECHO) -e "CC = \"dmc.exe\"\r" >> $@ - @$(ECHO) -e "CXX = \x24(CC)\r" >> $@ + @$(ECHO) -e "CC ?= \"dmc.exe\"\r" >> $@ + @$(ECHO) -e "CXX ?= \x24(CC)\r" >> $@ @$(ECHO) -e "\r" >> $@ - @$(ECHO) -e "CFLAGS = -w -w17 -w18 -wx\r" >> $@ - @$(ECHO) -e "CXXFLAGS = -wc \x24(CFLAGS)\r" >> $@ + @$(ECHO) -e "CFLAGS ?= -w -w17 -w18 -wx\r" >> $@ + @$(ECHO) -e "CXXFLAGS ?= -wc \x24(CFLAGS)\r" >> $@ @$(ECHO) -e "\r" >> $@ @$(ECHO) -e "TESTS = \x5c\r" >> $@ diff --git a/test/Makefile.dmc b/test/Makefile.dmc index 2f52f12..d625f83 100644 --- a/test/Makefile.dmc +++ b/test/Makefile.dmc @@ -1,9 +1,9 @@ # Generated by Makefile. Do not edit. -CC = "dmc.exe" -CXX = $(CC) +CC ?= "dmc.exe" +CXX ?= $(CC) -CFLAGS = -w -w17 -w18 -wx -CXXFLAGS = -wc $(CFLAGS) +CFLAGS ?= -w -w17 -w18 -wx +CXXFLAGS ?= -wc $(CFLAGS) TESTS = \ array-param.exe array-param-cpp.exe \