-
Notifications
You must be signed in to change notification settings - Fork 34
/
appveyor.yml
116 lines (102 loc) · 3.91 KB
/
appveyor.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
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
112
113
114
115
116
branches:
only:
- master
cache:
- c:\protobuf-3.6.0-msvc
platform:
- x64
image:
- Visual Studio 2017
environment:
matrix:
- TARGET: mingw
- TARGET: mingw
STATIC: 1
- TARGET: mingw
BUILD_SHARED_LIBS: 0
- TARGET: msvc
install:
- git submodule update --init
- for /f "usebackq tokens=*" %%A in (`git rev-parse --short HEAD`) do set "MENOH_REV=%%A"
- echo %MENOH_REV%
- set SSL_CERT_FILE=C:\msys64\mingw64\ssl\cert.pem
- set SSL_CERT_DIR=C:\msys64\mingw64\ssl\certs
- if [%TARGET%]==[mingw] set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%
- if [%TARGET%]==[msvc] set PATH=C:\Miniconda3-x64;C:\Miniconda3-x64\Scripts;C:\Miniconda3-x64\Library\bin;%PATH%
- set MKL_DNN_VER=0.16
- set MINGW_MKL_DNN_PKG_REL=1
- if [%TARGET%]==[mingw] (
pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-opencv mingw-w64-x86_64-protobuf mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-numpy mingw-w64-x86_64-hdf5 mingw-w64-x86_64-ca-certificates &&
curl -omingw-w64-x86_64-mkl-dnn-%MKL_DNN_VER%-%MINGW_MKL_DNN_PKG_REL%-x86_64.pkg.tar.xz -L https://github.com/pfnet-research/menoh/releases/download/v1.0.3/mingw-w64-x86_64-mkl-dnn-%MKL_DNN_VER%-%MINGW_MKL_DNN_PKG_REL%-x86_64.pkg.tar.xz &&
pacman -U --noconfirm mingw-w64-x86_64-mkl-dnn-%MKL_DNN_VER%-%MINGW_MKL_DNN_PKG_REL%-x86_64.pkg.tar.xz
) else (
curl -omkl-dnn-%MKL_DNN_VER%-win64.zip -L --insecure https://github.com/pfnet-research/menoh/releases/download/v1.0.3/mkl-dnn-%MKL_DNN_VER%-win64.zip &&
7z x mkl-dnn-%MKL_DNN_VER%-win64.zip &&
call appveyor\install_protoc_msvc.bat
)
- if [%TARGET%]==[mingw] (
pip3 install --user chainer &&
mkdir -p data &&
python3 scripts/retrieve_data.py &&
python3 scripts/gen_test_data.py
) else (
pip install --user chainer &&
md data &&
python scripts/retrieve_data.py &&
python scripts/gen_test_data.py
)
before_build:
- if [%TARGET%]==[mingw] (
echo 'Checking tools and libraries version:' &&
pacman -Q &&
cmake --version &&
make --version
)
build_script:
- mkdir build
- cd build
- if [%TARGET%]==[msvc] set PATH=%PATH%;c:\protobuf-3.6.0-msvc\bin;c:\protobuf-3.6.0-msvc\include;c:\protobuf-3.6.0-msvc\lib;c:\projects\menoh\mkl-dnn-%MKL_DNN_VER%-win64\bin;c:\projects\menoh\mkl-dnn-%MKL_DNN_VER%-win64\include;c:\projects\menoh\mkl-dnn-%MKL_DNN_VER%-win64\lib
- if [%TARGET%]==[mingw] (
if [%STATIC%]==[1] (
set STATIC_OPTION="-DLINK_STATIC_LIBPROTOBUF=ON -DLINK_STATIC_LIBSTDCXX=ON -DLINK_STATIC_LIBGCC=ON"
) else (
set STATIC_OPTION=""
)
)
- if [%TARGET%]==[mingw] (
if [%BUILD_SHARED_LIBS%]==[0] (
set BUILD_SHARED_LIBS_OPTION="-DBUILD_SHARED_LIBS=OFF"
) else (
set BUILD_SHARED_LIBS_OPTION=""
)
)
- if [%TARGET%]==[mingw] (
cmake -G "MSYS Makefiles" -DENABLE_TEST=ON %STATIC_OPTION% %BUILD_SHARED_LIBS_OPTION% -DCMAKE_INSTALL_PREFIX=/mingw64 -DPYTHON_EXECUTABLE=/mingw64/bin/python3 .. &&
make
) else (
cmake -G "Visual Studio 14 Win64" -DENABLE_TEST=OFF -DENABLE_BENCHMARK=OFF -DENABLE_EXAMPLE=OFF -DCMAKE_INSTALL_PREFIX=c:\menoh-%MENOH_REV%-msvc .. &&
cmake --build . --config Release --target install
)
test_script:
# to find libmenoh.dll, libgtest.dll and libgtest_main.dll
- if [%TARGET%]==[mingw] set PATH=C:\projects\menoh\build\menoh;C:\projects\menoh\build\test\lib\googletest\googlemock\gtest;C:\msys64\mkl-dnn-86b7129-mingw\bin;%PATH%
- if [%TARGET%]==[mingw] (
if not [%BUILD_SHARED_LIBS%]==[0] (
echo "ldd libmenoh.dll" &&
ldd /c/projects/menoh/build/menoh/libmenoh.dll
)
)
- if [%TARGET%]==[mingw] (
echo "ldd libmkldnn.dll" &&
ldd /mingw64/bin/libmkldnn.dll &&
echo "ldd menoh_test.exe" &&
ldd test/menoh_test.exe &&
test\menoh_test
)
- cd ..
after_test:
- if [%TARGET%]==[msvc] (
7z a menoh-%MENOH_REV%-msvc.zip c:\menoh-%MENOH_REV%-msvc
)
artifacts:
- path: '*.zip'