-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Qulacs-Osaka/24-GPUenv
setup of build environment for GPU
- Loading branch information
Showing
27 changed files
with
887 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,29 +15,27 @@ on: | |
- "*.md" | ||
|
||
jobs: | ||
gcc10-build: | ||
name: GCC10 build | ||
gcc11-build: | ||
name: GCC11 build | ||
strategy: | ||
matrix: | ||
python-version: ["3.10"] | ||
runs-on: "ubuntu-20.04" | ||
runs-on: "ubuntu-22.04" | ||
env: | ||
CXX_COMPILER: "/usr/lib/ccache/g++" | ||
C_COMPILER: "/usr/lib/ccache/gcc" | ||
QULACS_OPT_FLAGS: "-mtune=haswell -march=haswell -mfpmath=both" | ||
COVERAGE: "Yes" | ||
USE_TEST: "Yes" | ||
QULACS_USE_TEST: "Yes" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install gcc-10/g++-10 | ||
uses: sudo apt-get update && \ | ||
apt-get install -y software-properties-common && \ | ||
add-apt-repository ppa:ubuntu-toolchain-r/test && \ | ||
apt-get update && \ | ||
apt-get install -y gcc-10 g++-10 && \ | ||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && \ | ||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 \ | ||
- name: Install gcc-11/g++-11 | ||
run: | | ||
sudo apt update && \ | ||
sudo apt install -y software-properties-common && \ | ||
sudo apt update && \ | ||
sudo apt install -y gcc-11 g++-11 && \ | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && \ | ||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 | ||
- name: Setup cmake | ||
uses: lukka/get-cmake@latest | ||
|
@@ -48,12 +46,65 @@ jobs: | |
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: "${{ github.job }}-ubuntu-20.04" | ||
key: "${{ github.job }}-ubuntu-22.04" | ||
verbose: 2 | ||
|
||
- name: Install qulacs for Ubuntu | ||
run: ./script/build_gcc.sh | ||
run: CMAKE_BUILD_TYPE=Debug ./script/build_gcc.sh | ||
|
||
- name: Test in Ubuntu | ||
run: | | ||
ninja test -C build -j $(nproc) | ||
nvcc-build: | ||
name: NVCC build | ||
strategy: | ||
matrix: | ||
python-version: ["3.10"] | ||
runs-on: "ubuntu-22.04" | ||
env: | ||
CXX_COMPILER: "/usr/lib/ccache/g++" | ||
C_COMPILER: "/usr/lib/ccache/gcc" | ||
QULACS_USE_TEST: "Yes" | ||
QULACS_USE_CUDA: "Yes" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install gcc-11/g++-11 | ||
run: | | ||
sudo apt update && \ | ||
sudo apt install -y software-properties-common && \ | ||
sudo apt update && \ | ||
sudo apt install -y gcc-11 g++-11 && \ | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && \ | ||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 | ||
- name: Setup cmake | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: Install Ninja | ||
run: sudo apt install ninja-build | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: "${{ github.job }}-ubuntu-22.04" | ||
verbose: 2 | ||
|
||
- name: Install CUDA toolkit | ||
uses: Jimver/[email protected] | ||
with: | ||
cuda: "12.2.0" | ||
method: "network" | ||
|
||
- name: Show installed Compiler version | ||
run: | | ||
nvcc --version | ||
gcc --version | ||
g++ --version | ||
cmake --version | ||
- name: Install qulacs for Ubuntu | ||
run: ./script/build_gcc.sh | ||
|
||
# GitHub Actions cannot run CUDA program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
# qulacs2023 | ||
# qulacs2023 | ||
|
||
## 依存ライブラリ | ||
- GCC 11 以上 | ||
- CMake 3.21 以上 | ||
- CUDA 12.2 以上(GPU利用時のみ) | ||
|
||
## ビルド・実行方法 | ||
|
||
### ビルド (CPU) | ||
``` | ||
script/build_gcc.sh | ||
``` | ||
|
||
### ビルド(GPU) | ||
``` | ||
QULACS_USE_CUDA script/build_gcc.sh | ||
``` | ||
|
||
※キャッシュ変数がセットされるため、ターゲットを変えてビルドする際は `build/CMakeCache.txt` を削除する | ||
|
||
### テスト | ||
``` | ||
ninja -C build test | ||
``` | ||
|
||
### qulacs2023 を用いての C++ 単一ファイルの手元実行 | ||
`exe` の中に cpp ファイルを作成し、`exe/CMakeLists.txt` に追記してビルド | ||
|
||
### フォーマット | ||
``` | ||
ninja -C build format | ||
``` | ||
|
||
### Python へのインストール | ||
要確認 |
Oops, something went wrong.