|
| 1 | +name: 'build libcloudph++' |
| 2 | +description: 'builds libcloudph++, libcloudph++ code needs to be check out before running this action' |
| 3 | +inputs: |
| 4 | + disable_cuda: |
| 5 | + description: 'disable CUDA build?' |
| 6 | + required: true |
| 7 | + default: false |
| 8 | + build_type: |
| 9 | + description: 'CMake build type: Release, Debug, ...' |
| 10 | + required: true |
| 11 | + default: "Release" |
| 12 | + threads: |
| 13 | + description: "number of threads used by make" |
| 14 | + required: true |
| 15 | + default: 1 |
| 16 | + |
| 17 | +runs: |
| 18 | + using: "composite" |
| 19 | + steps: |
| 20 | + - name: Install Nvidia driver |
| 21 | + if: ${{!inputs.disable_cuda}} |
| 22 | + run: sudo apt install --no-install-recommends nvidia-driver-470 |
| 23 | + |
| 24 | + - name: Install Singularity |
| 25 | + #when installed from this action, .SIF is always converted to sandbox (could be related to: https://githubmemory.com/repo/hpcng/singularity/issues/6065) |
| 26 | + uses: eWaterCycle/setup-singularity@v6 |
| 27 | + with: |
| 28 | + singularity-version: 3.7.1 |
| 29 | + #apt installation following https://sylabs.io/guides/3.0/user-guide/installation.html, but this is a too old version and uninstalls python-is-python3 |
| 30 | +# run: | |
| 31 | +# wget -O- http://neuro.debian.net/lists/focal.de-fzj.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list |
| 32 | +# sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9 |
| 33 | +# sudo apt-get update |
| 34 | +# sudo apt-get install -y singularity-container |
| 35 | + |
| 36 | + - name: Cache UWLCM Singularity image |
| 37 | + id: cache_singularity |
| 38 | + uses: actions/cache@v2 |
| 39 | + with: |
| 40 | + path: '${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif' |
| 41 | + key: 'sng_ubuntu_20_04_cuda_11_4' |
| 42 | + |
| 43 | + - name: Download UWLCM Singularity image |
| 44 | + if: steps.cache_singularity.outputs.cache-hit != 'true' |
| 45 | + run: | |
| 46 | + mkdir '${{ github.workspace }}/singularity_images' |
| 47 | + singularity pull --disable-cache --dir '${{ github.workspace }}/singularity_images' library://pdziekan/default/uwlcm:ubuntu_20_04_cuda_11_4 |
| 48 | + # disable Singularity cache, we cache manually |
| 49 | + |
| 50 | + - name: Set friendly Singularity image name |
| 51 | + uses: allenevans/[email protected] |
| 52 | + with: |
| 53 | + SI: '${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif' |
| 54 | + |
| 55 | + - name: Configure CMake |
| 56 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 57 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 58 | + run: singularity exec $SI cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{inputs.build_type}} -DLIBCLOUDPHXX_FORCE_MULTI_CUDA=True -DLIBCLOUDPHXX_DISABLE_CUDA=${{inputs.disable_cuda}} |
| 59 | +# |
| 60 | + - name: Build libcloudph++ |
| 61 | + # Build your program with the given configuration |
| 62 | + run: VERBOSE=1 singularity exec $SI cmake --build ${{github.workspace}}/build --config ${{inputs.build_type}} -j${{inputs.threads}} |
0 commit comments