-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall.cmake.bat
111 lines (92 loc) · 2.85 KB
/
install.cmake.bat
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
@ECHO OFF
REM Expecting the Torch path as the first argument
set "cmake_prefix_path_tmp=subprojects/libtorch/share/cmake"
echo cmake_prefix_path_tmp: %cmake_prefix_path_tmp%
REM ... use %TORCH_PATH% as needed ...
SET CC=clang-cl
SET CXX=clang-cl
SET WINDRES=rc
rem --- check architecture ---
set "ARCH=%PROCESSOR_ARCHITECTURE%"
if /I "%ARCH%"=="x86" (
if defined PROCESSOR_ARCHITEW6432 (
set "ARCH=x86_64"
) else (
set "ARCH=i386"
)
) else if /I "%ARCH%"=="AMD64" (
set "ARCH=x86_64"
)
echo Detected architecture: %ARCH%
REM ========= pull git repo =========
git submodule update --init --recursive
REM ========= deflate =========
cd subprojects\libdeflate
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=%ARCH% -S . -B build
cmake --build build --config Release --target libdeflate_static
if errorlevel 1 (
echo "CMake delfate failed."
goto :error
) else (
echo "CMake delfate completed successfully."
)
cd ..\..\
REM ========= libtorch =========
REM remove libtorch from current version
REM download_libtorch_win.bat
REM ========= blas =========
@REM REM Install OpenBLAS if its build directory does not exist
@REM if not exist "subprojects\OpenBLAS\build" (
@REM cd subprojects\OpenBLAS
@REM cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DNOFORTRAN=1
@REM cmake --build build --config Release -j 8
@REM if errorlevel 1 (
@REM echo "OpenBLAS build failed."
@REM goto :error_blas
@REM )
@REM cd ..\..
@REM )
REM ========= Build the project =========
if exist build_cmake (
rmdir /s /q build_cmake
echo "Removed existing build directory."
)
if exist app (
rmdir /s /q app
echo "Removed existing app directory."
)
cmake -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_WAYLAND=OFF -DGLFW_BUILD_X11=OFF -DWITH_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=app -DCMAKE_PREFIX_PATH=%cmake_prefix_path_tmp% -S . -B build_cmake
if errorlevel 1 (
echo "CMake configuration failed."
goto :error
) else (
echo "CMake configuration completed successfully."
)
@REM cmake --build build_cmake --config Release
@REM if errorlevel 1 (
@REM echo "Build failed."
@REM goto :error
@REM ) else (
@REM echo "Build completed successfully."
@REM )
@REM cmake --install build_cmake --config Release
@REM if errorlevel 1 (
@REM echo "Install failed."
@REM goto :error
@REM ) else (
@REM echo "Install completed successfully."
@REM )
@REM echo Build and installation completed successfully.
cmake --build build_cmake --target package --config Release
if errorlevel 1 (
echo "Package failed."
goto :error
) else (
echo "Package completed successfully."
)
echo Finished successfully.
goto :eof
:error
echo An error occurred during the build process.
exit /b 1
goto :eof