diff --git a/.github/workflows/lantern.yaml b/.github/workflows/lantern.yaml index 0f841efd8f..9d80d586e7 100644 --- a/.github/workflows/lantern.yaml +++ b/.github/workflows/lantern.yaml @@ -5,7 +5,7 @@ on: branches: - master - 'cran/**' - - re-add-cuda10.1 + - non-abi jobs: build: @@ -41,6 +41,19 @@ jobs: flavor: Release artifacts: liblantern.so upload: Linux + - os: ubuntu-18.04 + cuda: -1 + library: liblantern.so + test: ./lanterntest + make: make + build: build + cmakevars: -D_GLIBCXX_USE_CXX11_ABI=0 + libext: + exeext: + fixlib: chrpath -r '$ORIGIN/.' liblantern.so + flavor: Release + artifacts: liblantern.so + upload: LinuxNonABI - os: macos-10.15 cuda: 0 library: liblantern.dylib @@ -67,6 +80,19 @@ jobs: flavor: Release artifacts: liblantern.so upload: Linux-Cuda-101 + - os: ubuntu-18.04 + cuda: 10.1 + library: liblantern.so + test: ./lanterntest + make: make + build: build + cmakevars: -D_GLIBCXX_USE_CXX11_ABI=0 + libext: + exeext: + fixlib: chrpath -r '$ORIGIN/.' liblantern.so + flavor: Release + artifacts: liblantern.so + upload: LinuxNonABI-Cuda-101 - os: ubuntu-18.04 cuda: 10.2 library: liblantern.so @@ -243,7 +269,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - name: [macOS, Linux, Windows, Cuda101, Cuda102, Cuda111, WindowsCuda101, WindowsCuda102, WindowsCuda111] + name: [macOS, Linux, LinuxNonABI, Windows, Cuda101, NonABICuda101, Cuda102, Cuda111, WindowsCuda101, WindowsCuda102, WindowsCuda111] include: - name: macOS artifact: macOS @@ -253,6 +279,10 @@ jobs: artifact: Linux upload: Linux hw: cpu + - name: LinuxNonABI + artifact: LinuxNonABI + upload: LinuxNonABI + hw: cpu - name: Windows artifact: Windows upload: Windows @@ -262,6 +292,11 @@ jobs: upload: Linux hw: gpu version: -101 + - name: NonABICuda101 + artifact: LinuxNonABI-Cuda-101 + upload: LinuxNonABI + hw: gpu + version: -101 - name: Cuda102 artifact: Linux-Cuda-102 upload: Linux diff --git a/lantern/CMakeLists.txt b/lantern/CMakeLists.txt index b1a6e3e91f..16bc7f4189 100644 --- a/lantern/CMakeLists.txt +++ b/lantern/CMakeLists.txt @@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.16) project(lantern) + +if(NOT DEFINED _GLIBCXX_USE_CXX11_ABI) + set(_GLIBCXX_USE_CXX11_ABI 1) +endif() +message("-- _GLIBCXX_USE_CXX11_ABI=${_GLIBCXX_USE_CXX11_ABI}") + +add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${_GLIBCXX_USE_CXX11_ABI}) + ############################################################ # Helpers ############################################################ @@ -54,17 +62,33 @@ elseif(UNIX) message(FATAL_ERROR, "CUDA 9.2 is no longer supported") elseif(DEFINED ENV{CUDA} AND '$ENV{CUDA}' STREQUAL '10.1') add_compile_definitions(CUDA101) - retrieve_lib("https://download.pytorch.org/libtorch/cu101/libtorch-cxx11-abi-shared-with-deps-1.8.0%2Bcu101.zip" "libtorch") + if ('${_GLIBCXX_USE_CXX11_ABI}' STREQUAL '1') + retrieve_lib("https://download.pytorch.org/libtorch/cu101/libtorch-cxx11-abi-shared-with-deps-1.8.0%2Bcu101.zip" "libtorch") + else() + retrieve_lib("https://download.pytorch.org/libtorch/cu101/libtorch-shared-with-deps-1.8.0%2Bcu101.zip" "libtorch") + endif() elseif(DEFINED ENV{CUDA} AND '$ENV{CUDA}' STREQUAL '10.2') add_compile_definitions(CUDA102) - retrieve_lib("https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu102.zip" "libtorch") + if ('${_GLIBCXX_USE_CXX11_ABI}' STREQUAL '1') + retrieve_lib("https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu102.zip" "libtorch") + else() + retrieve_lib("https://download.pytorch.org/libtorch/cu102/libtorch-shared-with-deps-1.8.1%2Bcu102.zip" "libtorch") + endif() elseif(DEFINED ENV{CUDA} AND '$ENV{CUDA}' STREQUAL '11.0') message(FATAL_ERROR, "CUDA 11.0 is no longer supported") elseif(DEFINED ENV{CUDA} AND '$ENV{CUDA}' STREQUAL '11.1') add_compile_definitions(CUDA111) - retrieve_lib("https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu111.zip" "libtorch") + if ('${_GLIBCXX_USE_CXX11_ABI}' STREQUAL '1') + retrieve_lib("https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu111.zip" "libtorch") + else() + retrieve_lib("https://download.pytorch.org/libtorch/cu111/libtorch-shared-with-deps-1.8.1%2Bcu111.zip" "libtorch") + endif() else() + if ('${_GLIBCXX_USE_CXX11_ABI}' STREQUAL '1') retrieve_lib("https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcpu.zip" "libtorch") + else() + retrieve_lib("https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.8.1%2Bcpu.zip" "libtorch") + endif() endif() else() message(FATAL_ERROR, "OS not supported.")