From 7103c69c194b8699f1ff4afaadaec6e27d16fd34 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 29 Apr 2021 08:53:03 -0300 Subject: [PATCH 1/8] Try building a non-ABI version of liblantern --- .github/workflows/lantern.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lantern.yaml b/.github/workflows/lantern.yaml index 0f841efd8f..2c59d6c5a5 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: 0 + 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: Linux-Non-ABI - os: macos-10.15 cuda: 0 library: liblantern.dylib From 687b42f35a1d3957b515722f9b4b060c7a8b367f Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 29 Apr 2021 09:35:10 -0300 Subject: [PATCH 2/8] build lantern once for each ABI version --- .github/workflows/lantern.yaml | 4 ++-- lantern/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lantern.yaml b/.github/workflows/lantern.yaml index 2c59d6c5a5..50e71c9817 100644 --- a/.github/workflows/lantern.yaml +++ b/.github/workflows/lantern.yaml @@ -34,7 +34,7 @@ jobs: test: ./lanterntest make: make build: build - cmakevars: + cmakevars: -D_GLIBCXX_USE_CXX11_ABI=1 libext: exeext: fixlib: chrpath -r '$ORIGIN/.' liblantern.so @@ -42,7 +42,7 @@ jobs: artifacts: liblantern.so upload: Linux - os: ubuntu-18.04 - cuda: 0 + cuda: -1 library: liblantern.so test: ./lanterntest make: make diff --git a/lantern/CMakeLists.txt b/lantern/CMakeLists.txt index b1a6e3e91f..d1bb1f0d1d 100644 --- a/lantern/CMakeLists.txt +++ b/lantern/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(lantern) +add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${_GLIBCXX_USE_CXX11_ABI}) + ############################################################ # Helpers ############################################################ From 15b66493ac8e1f90a53ce00cf820000096a18eb0 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 29 Apr 2021 09:59:50 -0300 Subject: [PATCH 3/8] default to 1 --- lantern/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lantern/CMakeLists.txt b/lantern/CMakeLists.txt index d1bb1f0d1d..c5f09cf65d 100644 --- a/lantern/CMakeLists.txt +++ b/lantern/CMakeLists.txt @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.16) project(lantern) +# first check +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}) ############################################################ @@ -66,7 +73,11 @@ elseif(UNIX) add_compile_definitions(CUDA111) retrieve_lib("https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.8.1%2Bcu111.zip" "libtorch") 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.") From 1d86d25ac5bbec12ba74a3a3d169523983aa6a92 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 29 Apr 2021 10:00:01 -0300 Subject: [PATCH 4/8] no need to set to 1 anymore --- .github/workflows/lantern.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lantern.yaml b/.github/workflows/lantern.yaml index 50e71c9817..9d4cd48047 100644 --- a/.github/workflows/lantern.yaml +++ b/.github/workflows/lantern.yaml @@ -34,7 +34,7 @@ jobs: test: ./lanterntest make: make build: build - cmakevars: -D_GLIBCXX_USE_CXX11_ABI=1 + cmakevars: libext: exeext: fixlib: chrpath -r '$ORIGIN/.' liblantern.so From 09dae7885fdb6e4fcc684853d7342f26b3486aba Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 29 Apr 2021 10:11:58 -0300 Subject: [PATCH 5/8] correctly check if variable is set --- lantern/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lantern/CMakeLists.txt b/lantern/CMakeLists.txt index c5f09cf65d..d155073786 100644 --- a/lantern/CMakeLists.txt +++ b/lantern/CMakeLists.txt @@ -2,11 +2,10 @@ cmake_minimum_required(VERSION 3.16) project(lantern) -# first check -if(NOT DEFINED ${_GLIBCXX_USE_CXX11_ABI}) + +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}) From b8e0f38051a1513396b2b6c5c9b547a261d8df7f Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Thu, 29 Apr 2021 10:19:04 -0300 Subject: [PATCH 6/8] Add linux non abi to uploads --- .github/workflows/lantern.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lantern.yaml b/.github/workflows/lantern.yaml index 9d4cd48047..dcb51861ae 100644 --- a/.github/workflows/lantern.yaml +++ b/.github/workflows/lantern.yaml @@ -53,7 +53,7 @@ jobs: fixlib: chrpath -r '$ORIGIN/.' liblantern.so flavor: Release artifacts: liblantern.so - upload: Linux-Non-ABI + upload: LinuxNonABI - os: macos-10.15 cuda: 0 library: liblantern.dylib @@ -256,7 +256,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, Cuda102, Cuda111, WindowsCuda101, WindowsCuda102, WindowsCuda111] include: - name: macOS artifact: macOS @@ -266,6 +266,10 @@ jobs: artifact: Linux upload: Linux hw: cpu + - name: LinuxNonABI + artifact: LinuxNonABI + upload: LinuxNonABI + hw: cpu - name: Windows artifact: Windows upload: Windows From 9341d9dfc92496c9979b5fc758a567c81bc7da4c Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 3 May 2021 10:20:44 -0300 Subject: [PATCH 7/8] add non-abi build for CUDA libtorch's --- lantern/CMakeLists.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lantern/CMakeLists.txt b/lantern/CMakeLists.txt index d155073786..16bc7f4189 100644 --- a/lantern/CMakeLists.txt +++ b/lantern/CMakeLists.txt @@ -62,15 +62,27 @@ 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") From eb03c9e8b67e3019d85e5ad9f8a9f3874a83e3b2 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 3 May 2021 10:26:13 -0300 Subject: [PATCH 8/8] Include non abi CUDA 101 in the build matrix --- .github/workflows/lantern.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lantern.yaml b/.github/workflows/lantern.yaml index dcb51861ae..9d80d586e7 100644 --- a/.github/workflows/lantern.yaml +++ b/.github/workflows/lantern.yaml @@ -80,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 @@ -256,7 +269,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - name: [macOS, Linux, LinuxNonABI, Windows, Cuda101, Cuda102, Cuda111, WindowsCuda101, WindowsCuda102, WindowsCuda111] + name: [macOS, Linux, LinuxNonABI, Windows, Cuda101, NonABICuda101, Cuda102, Cuda111, WindowsCuda101, WindowsCuda102, WindowsCuda111] include: - name: macOS artifact: macOS @@ -279,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