-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
111 lines (86 loc) · 4.88 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
TOKENIZERS_VERSION=0.1
PREVIOUS_VERSION=1.11.0
VERSION=2.0.0
CUDA0=cu117
CUDA1=cu118
FILES=libtorch_$(VERSION)+cpu-1_amd64.deb \
libtorch_$(VERSION)+$(CUDA0)-1_amd64.deb \
libtorch_$(VERSION)+$(CUDA1)-1_amd64.deb \
libtokenizers_$(TOKENIZERS_VERSION)-1_amd64.deb \
cpu-libtorch-macos-latest.zip \
cpu-libtorch-cxx11-abi-shared-with-deps-latest.zip \
$(CUDA0)-libtorch-cxx11-abi-shared-with-deps-latest.zip \
$(CUDA1)-libtorch-cxx11-abi-shared-with-deps-latest.zip
all:$(FILES)
upload:$(FILES)
gh release create -t $(VERSION) -n "" $(VERSION)
for i in $(FILES) ; do echo $$i ; gh release upload $(VERSION) $$i ; done
cpu-libtorch-cxx11-abi-shared-with-deps-latest.zip: libtorch-cxx11-abi-shared-with-deps-$(VERSION)+cpu.zip
ln -s $< $@
$(CUDA0)-libtorch-cxx11-abi-shared-with-deps-latest.zip: libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA0).zip
ln -s $< $@
$(CUDA1)-libtorch-cxx11-abi-shared-with-deps-latest.zip: libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA1).zip
ln -s $< $@
cpu-libtorch-macos-latest.zip: libtorch-macos-$(VERSION).zip
ln -s $< $@
libtokenizers-linux.zip:
wget https://github.com/hasktorch/tokenizers/releases/download/libtokenizers-v$(TOKENIZERS_VERSION)/libtokenizers-linux.zip
libtokenizers_$(TOKENIZERS_VERSION)-1_amd64.deb:libtokenizers-linux.zip
rm -rf libtokenizers usr/
unzip libtokenizers-linux.zip
mkdir -p usr/
cp -r libtokenizers/* usr/
tar cvfz libtokenizers-$(TOKENIZERS_VERSION).tgz usr
fakeroot alien --to-deb --bump=0 --version=$(TOKENIZERS_VERSION) --target=amd64 libtokenizers-$(TOKENIZERS_VERSION).tgz
libtorch-macos-$(VERSION).zip:
wget -c https://download.pytorch.org/libtorch/cpu/libtorch-macos-$(VERSION).zip
libtorch-cxx11-abi-shared-with-deps-$(VERSION)+cpu.zip:
wget -c https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-$(VERSION)%2Bcpu.zip
libtorch-$(VERSION)+cpu.tgz:libtorch-cxx11-abi-shared-with-deps-$(VERSION)+cpu.zip
rm -rf libtorch usr/
unzip libtorch-cxx11-abi-shared-with-deps-$(VERSION)+cpu.zip
mkdir -p usr
cp -r libtorch/* usr/
cd usr/include/torch; for i in csrc/api/include/torch/* ; do ln -s $$i ;done
tar cvfz libtorch-$(VERSION)+cpu.tgz usr
libtorch_$(VERSION)+cpu-1_amd64.deb:libtorch-$(VERSION)+cpu.tgz
fakeroot alien --to-deb --bump=0 --version=$(VERSION)+cpu --target=amd64 libtorch-$(VERSION)+cpu.tgz
libtorch-$(VERSION)+cpu-1.x86_64.rpm:libtorch-$(VERSION)+cpu.tgz
fakeroot alien --to-rpm --bump=0 --version=$(VERSION)+cpu --target=amd64 libtorch-$(VERSION)+cpu.tgz
libtorch-cxx11-abi-shared-with-deps-$(VERSION)+cu92.zip:
wget -c https://download.pytorch.org/libtorch/cu92/libtorch-cxx11-abi-shared-with-deps-$(VERSION)%2Bcu92.zip
libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA0).zip:
wget -c https://download.pytorch.org/libtorch/$(CUDA0)/libtorch-cxx11-abi-shared-with-deps-$(VERSION)%2B$(CUDA0).zip
libtorch-$(VERSION)+$(CUDA0).tgz:libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA0).zip
rm -rf libtorch usr/
unzip libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA0).zip
mkdir -p usr/
cp -r libtorch/* usr/
cd usr/include/torch; for i in csrc/api/include/torch/* ; do ln -s $$i ;done
tar cvfz libtorch-$(VERSION)+$(CUDA0).tgz usr
libtorch_$(VERSION)+$(CUDA0)-1_amd64.deb:libtorch-$(VERSION)+$(CUDA0).tgz
fakeroot alien --to-deb --bump=0 --version=$(VERSION)+$(CUDA0) --target=amd64 libtorch-$(VERSION)+$(CUDA0).tgz
libtorch-$(VERSION)+$(CUDA0)-1.x86_64.rpm:libtorch-$(VERSION)+$(CUDA0).tgz
fakeroot alien --to-rpm --bump=0 --version=$(VERSION)+$(CUDA0) --target=amd64 libtorch-$(VERSION)+$(CUDA0).tgz
libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA1).zip:
wget -c https://download.pytorch.org/libtorch/$(CUDA1)/libtorch-cxx11-abi-shared-with-deps-$(VERSION)%2B$(CUDA1).zip
libtorch-$(VERSION)+$(CUDA1).tgz:libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA1).zip
rm -rf libtorch usr/
unzip libtorch-cxx11-abi-shared-with-deps-$(VERSION)+$(CUDA1).zip
mkdir -p usr/
cp -r libtorch/* usr/
cd usr/include/torch; for i in csrc/api/include/torch/* ; do ln -s $$i ;done
tar cvfz libtorch-$(VERSION)+$(CUDA1).tgz usr
libtorch_$(VERSION)+$(CUDA1)-1_amd64.deb:libtorch-$(VERSION)+$(CUDA1).tgz
fakeroot alien --to-deb --bump=0 --version=$(VERSION)+$(CUDA1) --target=amd64 libtorch-$(VERSION)+$(CUDA1).tgz
libtorch-$(VERSION)+$(CUDA1)-1.x86_64.rpm:libtorch-$(VERSION)+$(CUDA1).tgz
fakeroot alien --to-rpm --bump=0 --version=$(VERSION)+$(CUDA1) --target=amd64 libtorch-$(VERSION)+$(CUDA1).tgz
update-apt:
wget https://github.com/hasktorch/libtorch-binary-for-ci/releases/download/apt/Packages_$(PREVIOUS_VERSION).gz
zcat Packages_$(PREVIOUS_VERSION).gz > Packages.org
apt-ftparchive packages ./ > Packages.new
cat Packages.new Packages.org | gzip | dd of=Packages.gz bs=1M
for i in *.deb ; do echo $$i ; gh release upload apt $$i ; done
cp Packages.gz Packages_$(VERSION).gz
gh release upload apt Packages.gz --clobber
gh release upload apt Packages_$(VERSION).gz