-
Notifications
You must be signed in to change notification settings - Fork 60
/
BUILD.txt
159 lines (133 loc) · 6.05 KB
/
BUILD.txt
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
Dependencies:
0) CMake (latest version, or at least 3.3): www.cmake.org
1) VTK (latest version, or at least 6.2): www.vtk.org
2) wxWidgets (latest version, or at least 2.9.2): www.wxwidgets.org
3) any OpenCL SDK (e.g. NVidia GPU Computing Toolkit)
Ready uses CMake for pre-build setup. You might need to read some CMake
documentation first to get the hang of it.
=============== Windows 64-bit, using the Visual Studio IDE =================
A) Build VTK:
- Use CMake (cmake-gui.exe) and make a separate build folder, e.g. C:\VTK\build
- Hit Configure and select the Visual Studio generator that corresponds
to whichever version you have installed (e.g. 2019 x64).
- Ensure BUILD_SHARED_LIBS is off.
- Ensure BUILD_TESTING is off (saves time).
- Check the Advanced checkbox. Look for CMAKE_CXX_* and CMAKE_C_*. Change all
occurences of /MD to /MT, and /MDd to /MTd. This ensures that the C runtime
is statically-linked, so we don't need to distribute it.
- Hit Configure again.
- Hit Generate, then open the resulting VTK.sln and build the Debug and
Release targets.
B) Build wxWidgets:
- Open a 64-bit command prompt, e.g. "x64 Native Tools Command Prompt for VS 2019"
- cd c:\wxWidgets\build\msw (or equivalent for your installation)
- Build both the release and debug versions:
nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0 TARGET_CPU=AMD64
nmake -f makefile.vc BUILD=debug RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=1 DEBUG_FLAG=1 TARGET_CPU=AMD64
C) Build Ready:
- Run CMake and make a separate build folder for Ready.
- Set VTK_DIR to the build folder of VTK, if CMake didn't find the
right version automatically.
- Set wxWidgets_ROOT_DIR to your wxWidgets installation folder, if
CMake didn't find the right version automatically.
- Set wxWidgets_LIB_DIR to e.g. c:\wxWidgets\lib\vc_x64_lib
- wxWidgets_USE_REL_AND_DBG should be checked.
- Set OPENCL_LIBRARIES to e.g.
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/OpenCL.lib
- Set OPENCL_INCLUDE_DIRS to e.g.
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include
- Generate, then open the resulting Ready.sln and build the Debug and
Release targets. Set Ready as the "StartUp Project" to have it run
by default.
- Build the PACKAGE target to build the distributable binary zip. The
source package doesn't seem to be supported by CMake in the IDE yet,
so use the command-line approach below for this.
================ Windows 64-bit, using the command-line =====================
A) Build VTK:
- Open a 64-bit command prompt, e.g. "x64 Native Tools Command Prompt for VS 2019"
- Type: cmake-gui
- Create a target build folder, and select NMake Makefiles as the
generator.
- Ensure BUILD_SHARED_LIBS is off.
- Ensure BUILD_TESTING to off (saves time).
- Check the Advanced checkbox. Look for CMAKE_CXX_FLAGS_RELEASE and
similar. Change all occurences of /MD to /MT, and /MDd to /MTd.
This ensures that the C runtime is statically-linked, so we don't
need to distribute it.
- Set CMAKE_BUILD_TYPE to Release
- Configure, Generate, then close CMake and build with NMake from
the build folder: nmake
B) Build wxWidgets:
- Open a 64-bit command prompt, e.g. "x64 Native Tools Command Prompt for VS 2019"
- cd c:\wxWidgets\build\msw (or equivalent for your installation)
- Build the release version:
nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0 TARGET_CPU=AMD64
C) Build Ready:
- Open a 64-bit command prompt, e.g. "x64 Native Tools Command Prompt for VS 2019"
- Type: cmake-gui
- Create a target build folder, and select NMake Makefiles as the
generator.
- Set VTK_DIR to the build folder of VTK.
- Set CMAKE_BUILD_TYPE to Release
- Set wxWidgets_ROOT_DIR to your wxWidgets installation folder, if
CMake didn't find the right version automatically.
- Set wxWidgets_LIB_DIR to e.g. c:\wxWidgets\lib\vc_x64_lib
- Set OPENCL_LIBRARIES to e.g.
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/lib/x64/OpenCL.lib
- Set OPENCL_INCLUDE_DIRS to e.g.
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/include
- Configure, Generate, then exit CMake.
- Build Ready:
nmake
- Build the binary and source distributables:
nmake package
nmake package_source
=========================== Linux =================================
A) Dependencies:
On Debian/Ubuntu:
sudo apt-get install libgtk-3-dev libxt-dev ocl-icd-opencl-dev libglu1-mesa-dev libvtk9-dev libwxgtk3.2-dev cmake-curses-gui build-essential git
(Or look at .github/workflows/build_ubuntu.yml)
On Fedora:
sudo dnf install vtk-devel wxGTK3-devel ocl-icd-devel opencl-headers gcc-c++
(and for recent versions of Fedora you will need to start Ready using 'GDK_BACKEND=x11 ./ready')
On other distros I'm not sure - please let us know!
B) Download and build Ready:
mkdir Ready
cd Ready
git clone https://github.com/GollyGang/ready.git
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../ready
make
./ready
Optional, for packaging:
make package
make package_source
=========================== macOS =================================
1. Build wxWidgets (best to use latest source code from github):
git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git wxWidgets
cd /path/to/wxWidgets
mkdir build-macos
cd build-macos
../configure --enable-unicode --disable-shared --with-osx_cocoa --with-macosx-version-min=10.10
make # take a nap, it'll be a while
sudo make install
2. Build VTK (assuming you've downloaded and unzipped VTK-8.2.0.zip from
http://www.vtk.org/download/):
cd /path/to/VTK-8.2.0
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET="10.10" ..
make # this also takes some time
3. Build Ready:
mkdir Ready
cd Ready
git clone https://github.com/GollyGang/ready.git
mkdir build
cd build
cmake -DVTK_DIR:PATH=/path/to/VTK-8.2.0/build -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_DEPLOYMENT_TARGET="10.10" ../ready
make
open Ready.app
Optional commands for packaging Ready:
make package
make package_source