Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to cross-compilation for linux_aarch64 and linux_ppc64le #39

Merged
merged 3 commits into from
May 8, 2024
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
8 changes: 8 additions & 0 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cxx_compiler:
cxx_compiler_version:
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-aarch64
- quay.io/condaforge/linux-anvil-cos7-x86_64
target_platform:
- linux-aarch64
zip_keys:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cxx_compiler:
cxx_compiler_version:
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-ppc64le
- quay.io/condaforge/linux-anvil-cos7-x86_64
target_platform:
- linux-ppc64le
zip_keys:
Expand Down
2 changes: 2 additions & 0 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ c_compiler:
- vs2019
c_stdlib:
- vs
c_stdlib_version:
- '2019'
channel_sources:
- conda-forge
channel_targets:
Expand Down
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

29 changes: 11 additions & 18 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
build_platform:
linux_aarch64: linux_64
linux_ppc64le: linux_64
conda_build:
error_overlinking: true
conda_forge_output_validation: true
Expand Down
17 changes: 8 additions & 9 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% set name = "cuda-nvcc-split" %}
{% set version = "12.4.131" %}
{% set cuda_version = "12.4" %}
{% set exists = "which" %} # [not win]
{% set exists = "where" %} # [win]

package:
name: {{ name|lower }}
Expand All @@ -12,7 +14,7 @@ source:
sha256: e2c71babfd18a8e69542dd7e9ca018f9caa438094001a58e6bc4d8c999bf0d07

build:
number: 0
number: 1
skip: true # [osx]
skip: true # [target_platform != "linux-64" and target_platform != cross_target_platform]

Expand Down Expand Up @@ -73,15 +75,12 @@ outputs:
- test.cpp
- test.cu
- CMakeLists.txt
- run_cmake_cuda_tests.sh # [linux]
- run_nvcc_tests.sh # [linux]
- run_nvcc_tests.bat # [win]
commands:
- nvcc --version
- $CXX --verbose ${CXXFLAGS} -lcuda -lcudart_static test.cpp # [linux]
- cl /Tp test.cpp /link /LIBPATH:"%CONDA_PREFIX%\Library\lib" cudart_static.lib /out:test_nvcc.exe # [win]
- nvcc --verbose test.cu
- cmake ${CMAKE_ARGS} -S . -B ./build -G=Ninja
- cmake --build ./build -v
- bash ./run_cmake_cuda_tests.sh # [linux]
- {{ exists }} nvcc
- ./run_nvcc_tests.sh # [linux]
- .\run_nvcc_tests.bat # [win]
- test -f $PREFIX/etc/conda/activate.d/~cuda-nvcc_activate.sh # [linux]
- test -f $PREFIX/etc/conda/deactivate.d/~cuda-nvcc_deactivate.sh # [linux]
about:
Expand Down
18 changes: 18 additions & 0 deletions recipe/run_nvcc_tests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo on

nvcc --version
if errorlevel 1 exit 1


cl /Tp test.cpp /link /LIBPATH:"%CONDA_PREFIX%\Library\lib" cudart_static.lib /out:test_nvcc.exe
if errorlevel 1 exit 1

nvcc --verbose test.cu
if errorlevel 1 exit 1


cmake %CMAKE_ARGS% -S . -B ./build -G=Ninja
if errorlevel 1 exit 1

cmake --build ./build -v
if errorlevel 1 exit 1
31 changes: 31 additions & 0 deletions recipe/run_cmake_cuda_tests.sh → recipe/run_nvcc_tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
#!/bin/bash
set -e
set -x

kernel_name="$(uname -s)"
if [[ "${kernel_name}" != "Linux" ]]
then
echo "Unknown OS. Expected Linux, but found ${kernel_name}"
exit 1
fi

processor_name="$(uname -m)"
case "${processor_name}" in
"x86_64") test_platform="linux-64" ;;
"aarch64") test_platform="linux-aarch64" ;;
"ppc64le") test_platform="linux-ppc64le" ;;
*) echo "Unknown architecture: ${processor_name}" && exit 1 ;;
esac

if [[ "${test_platform}" != "${target_platform}" ]]
then
echo "Skipping NVCC testing as current platform is ${test_platform}, whereas; NVCC is built for ${target_platform}."
exit 0
fi

cmake_version=$(cmake --version | grep version | awk '{print $3}')

nvcc --version

$CXX --verbose ${CXXFLAGS} -lcuda -lcudart_static test.cpp

nvcc --verbose test.cu

cmake ${CMAKE_ARGS} -S . -B ./build -G=Ninja
cmake --build ./build -v

mkdir -p cmake-tests
git clone -b v${cmake_version} --depth 1 https://gitlab.kitware.com/cmake/cmake.git cmake-tests
cmake -S cmake-tests -B cmake-tests/build ${CMAKE_ARGS} -DCMake_TEST_HOST_CMAKE=ON -DCMake_TEST_CUDA=nvcc -G "Ninja"
Expand Down