Skip to content
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
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: Jimver/cuda-toolkit@v0.2.30
id: cuda-toolkit
with:
cuda: "13.1.0"

- name: CUDA info
run: |
echo "Installed cuda version is: ${{ steps.cuda-toolkit.outputs.cuda }}"
echo "Cuda install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}"
nvcc -V

- name: Install build deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build zlib1g-dev

- name: Configure (Linux)
if: runner.os == 'Linux'
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCUPDLPX_BUILD_TESTS=OFF

- name: Build (Linux)
if: runner.os == 'Linux'
run: |
cmake --build build --clean-first

- name: Configure (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake -B build `
-DCMAKE_CONFIGURATION_TYPES=Release `
-DCUPDLPX_BUILD_TESTS=OFF

- name: Build (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake --build build --clean-first --config Release
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ set(CUPDLPX_VERSION_PATCH 5)
set(CUPDLPX_VERSION "${CUPDLPX_VERSION_MAJOR}.${CUPDLPX_VERSION_MINOR}.${CUPDLPX_VERSION_PATCH}")
add_compile_definitions(CUPDLPX_VERSION="${CUPDLPX_VERSION}")

if (WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)

# C/C++ standards
Expand All @@ -31,7 +35,12 @@ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
endif()

# Global Compile flags (corresponding to CFLAGS/NVCCFLAGS)
add_compile_options(-O3 -Wall -Wextra -g)
if(MSVC)
add_compile_options(/O2 /W4 /Zi)
else()
add_compile_options(-O3 -Wall -Wextra -g)
endif()

if (NOT WIN32)
add_compile_options(-fPIC)
endif()
Expand Down