2020-07-25 13:50:08 +01:00
|
|
|
language: go
|
|
|
|
|
|
|
|
go:
|
|
|
|
- 1.14.x
|
|
|
|
|
|
|
|
env:
|
|
|
|
- GO111MODULE=on
|
|
|
|
|
2020-07-26 01:41:02 +01:00
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
2020-07-26 01:30:20 +01:00
|
|
|
dist: bionic
|
|
|
|
|
2020-07-25 13:50:08 +01:00
|
|
|
before_install:
|
2020-10-13 07:10:59 +01:00
|
|
|
- ls -la
|
2020-07-26 01:30:20 +01:00
|
|
|
- sudo apt-get install clang-tools-9
|
2020-10-13 07:23:11 +01:00
|
|
|
- export GOTCH=$TRAVIS_BUILD_DIR
|
2020-10-13 07:10:59 +01:00
|
|
|
- export LIBTORCH_VERSION=${LIBTORCH_VER:-1.5.1}
|
|
|
|
- export LIBTORCH=${GOTCH}/libtch/libtorch
|
|
|
|
- export LIBRARY_PATH=${LIBTORCH}/lib
|
|
|
|
- export CPATH=${LIBTORCH}/lib:${LIBTORCH}/include:${LIBTORCH}/include/torch/csrc:${LIBTORCH}/include/torch/csrc/api/include
|
|
|
|
- export LD_LIBRARY_PATH=${LIBTORCH}/lib
|
2020-10-12 10:43:53 +01:00
|
|
|
|
|
|
|
# Precompiled libtorch
|
|
|
|
- sudo rm -rf $LIBTORCH
|
|
|
|
- sudo mkdir -p $LIBTORCH
|
|
|
|
- wget -O /tmp/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}+cpu.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}%2Bcpu.zip
|
2020-10-13 07:10:59 +01:00
|
|
|
- sudo unzip /tmp/libtorch-cxx11-abi-shared-with-deps-${LIBTORCH_VERSION}+cpu.zip -d ${GOTCH}/libtch
|
|
|
|
- sudo rm ${GOTCH}/libtch/lib.go
|
|
|
|
- sudo cp ${GOTCH}/libtch/lib.go.cpu ${GOTCH}/libtch/lib.go
|
|
|
|
- sudo mv ${GOTCH}/libtch/dummy_cuda_dependency.cpp ${GOTCH}/libtch/dummy_cuda_dependency.cpp.gpu
|
|
|
|
- sudo mv ${GOTCH}/libtch/fake_cuda_dependency.cpp.cpu ${GOTCH}/libtch/fake_cuda_dependency.cpp
|
|
|
|
- cd $GOTCH
|
|
|
|
- go install
|
2020-07-25 13:50:08 +01:00
|
|
|
script:
|
2020-10-13 07:10:59 +01:00
|
|
|
- printenv
|
2020-10-13 07:23:11 +01:00
|
|
|
- export GOTCH=$TRAVIS_BUILD_DIR
|
2020-10-13 07:10:59 +01:00
|
|
|
- export LIBTORCH_VERSION=${LIBTORCH_VER:-1.5.1}
|
|
|
|
- export LIBTORCH=${GOTCH}/libtch/libtorch
|
|
|
|
- export LIBRARY_PATH=${LIBTORCH}/lib
|
|
|
|
- export CPATH=${LIBTORCH}/lib:${LIBTORCH}/include:${LIBTORCH}/include/torch/csrc:${LIBTORCH}/include/torch/csrc/api/include
|
|
|
|
- export LD_LIBRARY_PATH=${LIBTORCH}/lib
|
2020-07-25 13:54:59 +01:00
|
|
|
- go test -v github.com/sugarme/gotch/tensor
|
|
|
|
- go test -v github.com/sugarme/gotch/nn
|
|
|
|
- go test -v github.com/sugarme/gotch/vision
|