forked from karpathy/llm.c
-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (73 loc) · 1.98 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Cmake
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-Clang-Linux:
strategy:
matrix:
target:
- 'Debug'
- 'Release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang
run: |
sudo apt update && sudo apt install build-essential software-properties-common clang
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Build
run: |
echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=${{ matrix.target }} ..
cmake --build . -j$(nproc)
ctest . -j$(nproc)
build-GCC-Linux:
strategy:
matrix:
target:
- 'Debug'
- 'Release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install GCC
run: |
sudo apt update && sudo apt install build-essential software-properties-common
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Build
run: |
echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=${{ matrix.target }} ..
cmake --build . -j$(nproc)
build-CUDA:
strategy:
matrix:
target:
- 'Debug'
- 'Release'
runs-on: ubuntu-20.04
container:
image: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: System Info
run: |
nvcc --version
g++ --version
- name: Build
run: |
apt-get update && apt-get install -y git cmake
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.target }} .. -DCUDALIB=1
cmake --build . -j$(nproc)