forked from sugarme/gotch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
46 lines (40 loc) · 1.66 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
language: go
go:
- 1.14.x
env:
- GO111MODULE=on
branches:
only:
- master
dist: bionic
before_install:
- ls -la
- sudo apt-get install clang-tools-9
- export GOTCH=$TRAVIS_BUILD_DIR
- 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
# 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
- 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
script:
- printenv
- export GOTCH=$TRAVIS_BUILD_DIR
- 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
- go test -v github.com/sugarme/gotch/tensor
- go test -v github.com/sugarme/gotch/nn
- go test -v github.com/sugarme/gotch/vision