forked from GollyGang/ready
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.txt
190 lines (165 loc) · 7.54 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
Dependencies:
0) CMake: www.cmake.org
1) VTK (latest, or at least 6.0.*): www.vtk.org
2) wxWidgets (latest, or at least 2.9.2): www.wxwidgets.org
3) any OpenCL SDK.
Ready uses CMake for pre-build setup. You might need to read some CMake
documentation first to get the hang of it.
=============== Windows, 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 (64 bit if using).
- Ensure BUILD_SHARED_LIBS is off.
- Ensure BUILD_TESTING is 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.
- Hit Generate, then open the resulting VTK.sln and build the Debug and
Release targets.
B) Build wxWidgets:
- Open a 32/64-bit Visual Studio command prompt. (Google this if needed.)
- cd c:\wxWidgets\build\msw (or equivalent for your installation)
- Build both the release and debug versions:
For 32-bit: (in a 32-bit Visual Studio command prompt)
nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0
nmake -f makefile.vc BUILD=debug RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=1 DEBUG_FLAG=1
For 64-bit: (in a 64-bit Visual Studio command prompt)
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 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_lib (vc_x64_lib if using 64-bit).
- wxWidgets_USE_REL_AND_DBG should be checked.
- Set VTK_DIR to the build folder of VTK, if CMake didn't find the
right version automatically.
- Set OPENCL_LIBRARIES to the location of a suitable OpenCL.lib, e.g.
C:/CUDA/lib/OpenCL.lib, or C:/CUDA/lib64/OpenCL.lib for 64-bit.
- Set OPENCL_INCLUDE_DIRS to e.g.
C:/CUDA/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, using the command-line =====================
A) Build VTK:
- Open a 32/64-bit Visual Studio command prompt and 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 32/64-bit Visual Studio command prompt.
- cd c:\wxWidgets\build\msw (or equivalent for your installation)
- Build the release version:
For 32-bit: (in a 32-bit Visual Studio command prompt)
nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0
For 64-bit: (in a 64-bit Visual Studio command prompt)
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 32/64-bit Visual Studio command prompt and type: cmake-gui
- Create a target build folder, and select NMake Makefiles as the
generator.
- 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_lib (vc_x64_lib if 64-bit).
- Set VTK_DIR to the build folder of VTK.
- Set OPENCL_LIBRARIES to the location of a suitable OpenCL.lib, e.g.
C:/CUDA/lib/OpenCL.lib, or C:/CUDA/lib64/OpenCL.lib for 64-bit.
- Set OPENCL_INCLUDE_DIRS to e.g.
C:/CUDA/include
- 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.
- Configure, Generate, then exit CMake.
- Build Ready:
nmake
- Build the binary and source distributables:
nmake package
nmake package_source
=========================== Linux =================================
On Debian, install: libgtk2.0-dev, libxt-dev, ocl-icd-opencl-dev, libglu1-mesa-dev.
On other distros I'm not sure - please let us know!
Download source for: VTK, wxWidgets.
A) Build VTK:
cd VTK
mkdir bin
cd bin
ccmake ..
"c" (configure)
- Set BUILD_TESTING to off (we don't need it).
- Set BUILD_SHARED_LIBS to off (so we can distribute easily)
- Set CMAKE_BUILD_TYPE to: Release
"g" (generate)
make
B) Build wxWidgets:
cd wxWidgets
mkdir build-gtk
cd build-gtk
../configure --with-gtk --disable-shared --enable-unicode --with-opengl --with-zlib=builtin --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin
make
C) Build Ready:
mkdir Ready_build
cd Ready_build
ccmake ../Ready_source_folder
(configure, generate)
(set VTK_DIR to the build folder of VTK. e.g. VTK/bin)
(set wxWidgets_CONFIG_EXECUTABLE to e.g. wxWidgets/build-gtk/wx-config)
make
Optional, for packaging:
make package
make package_source
=========================== MacOS =================================
1. To avoid the error "-- Could NOT find wxWidgets (missing: wxWidgets_FOUND)",
manually build and install wxWidgets 2.9 even if you already have an
wxWidgets that works for other projects:
cd
cd devt # A directory for things I download and build but do not checkout/modify/checkin
svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wx-trunk
cd wx-trunk
mkdir build-osx
cd build-osx
../configure --enable-unicode --disable-shared --with-osx_cocoa
make # Take a nap, it'll be a while
sudo make install
2. If you have not already done do, build VTK 6.2 (no install is needed in this
case because we supply the option "-DVTK_DIR:PATH=$HOME/devt/VTK/build" when
cmake'ing Ready)
cd
cd devt # A directory for things I download and build but do not checkout/modify/checkin
curl 'http://www.vtk.org/files/release/6.2/vtk-6.2.0.tar.gz' > vtk-6.2.0.tar.gz
gunzip vtk-6.2.0.tar.gz
tar -xvf vtk-6.2.0.tar # (creates directory ./VTK)
cd VTK
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF
make # This also takes some time
3. Then do this to get, configure and build Ready (assuming VTK was built in
~/devt/VTK as shown above):
cd
cd proj # A directory for projects I am "working on"
svn checkout https://reaction-diffusion.googlecode.com/svn/trunk/ reaction-diffusion --username $MYEMAIL
#
# Or if not a project member do:
# svn checkout http://reaction-diffusion.googlecode.com/svn/trunk/ reaction-diffusion-read-only
# And substitute "reaction-diffusion-read-only" for "reaction-diffusion" in the following
#
mkdir Ready_gui_build
cd Ready_gui_build
cmake ../reaction-diffusion/Ready -DVTK_DIR:PATH=$HOME/devt/VTK/build
make
open Ready.app