~ubuntu-branches/ubuntu/saucy/goldencheetah/saucy

« back to all changes in this revision

Viewing changes to INSTALL-MAC

  • Committer: Package Import Robot
  • Author(s): KURASHIKI Satoru
  • Date: 2013-08-18 07:02:45 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130818070245-zgdvb47e1k3mtgil
Tags: 3.0-3
debian/control: remove needless dependency. (Closes: #719571)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
                                 +++++++++++++++++++++++
 
2
                                MAC OSX BUILD WALKTHROUGH
 
3
                                 +++++++++++++++++++++++
 
4
 
 
5
                                     Mark Liversedge
 
6
 
 
7
                                        Nov 2011
 
8
                                      Version 1.1
 
9
 
 
10
A walkthrough of building GoldenCheetah from scratch on Mac OSX. This was performed
 
11
on Mac OSX Lion (10.7) but the instructions are largely the same for all versions of
 
12
Mac OS X.
 
13
 
 
14
CONTENTS
 
15
 
 
16
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
 
17
   - Xcode
 
18
   - Qt
 
19
 
 
20
2. ADDING OPTIONAL DEPENDENCIES
 
21
   - FTDI D2XX
 
22
   - SRMIO
 
23
   - liboauth
 
24
   - QwtPlot3d
 
25
   - libkml
 
26
   - libusb
 
27
   - libical
 
28
   - libclucene
 
29
 
 
30
 
 
31
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
 
32
=================================================
 
33
 
 
34
Depending upon the speed of your internet connection and availability of the
 
35
required software the steps in section 1 will take approximately 1 hour.
 
36
 
 
37
1.1 Ensure OS X is up-to-date
 
38
-----------------------------
 
39
 
 
40
Make sure you have applied all the latest updates to Mac OS X. This can be
 
41
found from the system menu, apple, about this mac, software update.
 
42
 
 
43
This walkthrough was performed on an iMac running 10.7.2 (Lion)
 
44
 
 
45
1.2 Install XCode from App Store
 
46
--------------------------------
 
47
 
 
48
If you are building on 10.6 or higher you should install Xcode4, for earlier
 
49
releases you will need Xcode 3.1.4. If you have capable hardware you should
 
50
consider upgrading to Lion to get the latest bug fixes and capabilities.
 
51
 
 
52
To install Xcode on Lion you need to download it via the App Store. You can
 
53
launch the App Store from launchpad, or it may be already in your dock.
 
54
 
 
55
Under the search box type in Xcode and it will return a few optios, generally
 
56
Xcode is the first item and shows a blueprint with a hammer icon. Click on
 
57
this to install it. It should be free. The usual app store process will apply
 
58
as the application is downloaded and installed. The download is about 2GB
 
59
so do bear this in mind if you have limits on your internet bandwidth or cap.
 
60
 
 
61
1.3 Run the Xcode installer
 
62
---------------------------
 
63
 
 
64
The app store download will have added an Install Xcode icon in the launchpad.
 
65
Go ahead and run it.
 
66
 
 
67
Xcode includes all the development tools such as a compiler, debugger and
 
68
SDKs. It also installs the 'git' tool for working with Git repositories.
 
69
 
 
70
It will run through a wizard to install, just read and then accept the license
 
71
agreement and let it get on with it. If you don't like the license then quit
 
72
and use the development builds from goldencheetah.stand2surtf.net.
 
73
 
 
74
You may find it borks at iTunes helper running, you will
 
75
need to force quit the iTunes helper via Finder, Applications, Utilities,
 
76
Activity Monitor if this happens.
 
77
 
 
78
1.4 Get the source code
 
79
-----------------------
 
80
 
 
81
We store all the Golden Cheetah source code on github.com, it is a great
 
82
site holding repositories for many open source projects. 
 
83
 
 
84
First open up a terminal session, then;
 
85
 
 
86
$ cd
 
87
$ mkdir Projects
 
88
$ cd Projects
 
89
$ git clone git://github.com/GoldenCheetah/GoldenCheetah.git
 
90
 
 
91
You will now have the GoldenCheetah sources downloaded into a 'GoldenCheetah'
 
92
directory in your home directory, under another folder called 'Projects'.
 
93
 
 
94
$ cd GoldenCheetah
 
95
$ ls
 
96
 
 
97
You should see a number of directories such as doc, qwt, src etc. If you are
 
98
building the latest development release you may need to check it out. At the
 
99
time of writing the latest development release is release_3.0.0dev, if you
 
100
want to build version 3 then you should perform the next command, otherwise 
 
101
skip to 1.5.
 
102
 
 
103
$ checkout release_3.0.0dev
 
104
$ ls
 
105
 
 
106
You will now see an updated version of this walkthrough, please jump to using
 
107
that since it may be more up-to-date than this walkthrough (depending upon
 
108
where you got it from of course!).
 
109
 
 
110
1.5 Install the QT SDK
 
111
----------------------
 
112
 
 
113
GoldenCheetah is developed using the Nokia QT toolkit, it is large and will
 
114
need to be downloaded and installed from their website. Alternatively, you 
 
115
can intall qt via macports (http://www.macports.org) as described in section 
 
116
1.5.1. 
 
117
 
 
118
As of today, the latest stable release is 4.7.4, we need 4.7 or higher so
 
119
go ahead and download the offline installer - it has everything you need
 
120
but is about 1.3GB. Please make sure you download the installer for Mac
 
121
OS X 10.6 or later, 64-bit.
 
122
 
 
123
The url for QT downloads is: http://qt.nokia.com/downloads and whilst the
 
124
offline installer is only 12mb it will still call back and download the
 
125
required objects as you install, I think it is better to get it all in
 
126
one hit (and you can save it to reinstall on another computer or if you
 
127
want to rebuild/reinstall for any other reason).
 
128
 
 
129
Once the QT SDK is downloaded you will have a .dmg (disk image) that you
 
130
need to mount by double clicking on it. You will then get a volume mounted
 
131
and shown on your desktop. Go ahead and double click that to start the install
 
132
process. It is probably called something like 'Qt SDK Installer'.
 
133
 
 
134
It will popup with a dialog warning that this is downloaded from the internet
 
135
and are you sure you want to open it? Go ahead and click Open.
 
136
 
 
137
A wizard will now guide you through the QT install process. Go ahead and accept
 
138
all the defaults, it will install in your home directory and avoid updating the
 
139
system directories, this means you are less likely to bork your Mac OSX installation.
 
140
 
 
141
Read and accept the license agreement and then continue and install.
 
142
 
 
143
We need to make sure that a program called qmake is installed in a directory where
 
144
it can be found. So, we need to create a link from what we just installed in the
 
145
user programs folder. For QT SDK1.1 (4.7.4) we need to:
 
146
 
 
147
$ sudo ln -s ~/QtSDK/Desktop/Qt/474/gcc/bin/qmake /usr/bin/qmake
 
148
 
 
149
1.5.1 Install via Mac Ports
 
150
---------------------------
 
151
 
 
152
If you have macports installed, you can install the qt dependices 
 
153
with the following commands: 
 
154
 
 
155
$ sudo port install qt4-mac
 
156
$ sudo port install qt4-mac-sqlite3-plugin
 
157
 
 
158
1.6 DEPRECATED
 
159
--------------
 
160
 
 
161
No longer need this step (install boost)
 
162
 
 
163
1.7 Configure and Build GoldenCheetah (with no optional dependencies)
 
164
---------------------------------------------------------------------
 
165
 
 
166
First thing we need to do is set the build configuration, this means editing the
 
167
private build profile settings. There is one for qwt (a charting library) and
 
168
there is another for GoldenCheetah itself.
 
169
 
 
170
$ cd ~/Projects/GoldenCheetah/qwt
 
171
$ cp qwtconfig.pri.in qwtconfig.pri
 
172
$ cd ../src
 
173
$ cp gcconfig.pri.in gcconfig.pri
 
174
$ vi gcconfig.pri 
 
175
 
 
176
In that last step you can use whatever editor you feel most comfortable with.
 
177
 
 
178
For now we will comment out some of the dependencies we have not installed
 
179
support for yet:
 
180
 
 
181
#SRMIO_INSTALL = /usr/local/srmio
 
182
#D2XX_INCLUDE = /usr/local/include/D2XX
 
183
 
 
184
we may need to additionally configure to use the local compression
 
185
libraries (at least I did), by adding the following line:
 
186
 
 
187
LIBS += -lz
 
188
 
 
189
Lastly, since we are on Lion, we can also uncomment and change the following line:
 
190
 
 
191
DEFINES += GC_HAVE_LION
 
192
 
 
193
Once the changes have been made we are now ready to build for the first time. You
 
194
may notice a lot of warning messages about the version of O/S not being supported.
 
195
This is because QT does not officially support Lion at this point in time (but it
 
196
does work). You can either ignore the warning messages or (like me) go and edit out
 
197
the warning (once you have seen the message once you don't need reminding every
 
198
time you compile).
 
199
 
 
200
To do this, edit the file in question as an administrator:
 
201
 
 
202
$ sudo vi ~/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qglobal.h
 
203
 
 
204
And comment out line 320 (or thereabouts):
 
205
 
 
206
//#    warning "This version of Mac OS X is unsupported"
 
207
 
 
208
Once this is done you can kick off the build:
 
209
 
 
210
$ cd .. #this should put you in the top level dir containing this file
 
211
$ qmake -recursive
 
212
$ make
 
213
 
 
214
If make fails to find a Makefile then qmake is configured, by default, to create
 
215
an xcode project file. You will need to change the qmake command above to tell it
 
216
to create a makefile with the following:
 
217
$ qmake -spec macx-g++ -recursive
 
218
$ make
 
219
 
 
220
Once this completes you will have a GoldenCheetah.app in the src directory which
 
221
can be launched:
 
222
 
 
223
$ open src/GoldenCheetah.app
 
224
 
 
225
And you're up and running.
 
226
 
 
227
2. ADDING OPTIONAL DEPENDENCIES
 
228
===============================
 
229
 
 
230
   - SRMIO
 
231
   - liboauth
 
232
   - QwtPlot3d
 
233
   - libkml
 
234
   - libusb
 
235
   - libical
 
236
 
 
237
Since these optional dependencies are more complex and require more advanced
 
238
technical skills we do not provide a walkthrough for building them all but
 
239
instead provide the configure settings and any special considerations that
 
240
should be taken into account.
 
241
 
 
242
2.1 SRMIO - For working with PC 5/6/7
 
243
-------------------------------------
 
244
 
 
245
SRMIO (git)
 
246
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" CPPFLAGS=-I/usr/local/D2XX/ --disable-dependency-tracking
 
247
 
 
248
2.2 Liboauth - For Twitter support
 
249
----------------------------------
 
250
 
 
251
oauth (0.8.8)
 
252
 
 
253
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64 CURL_CFLAGS="-I/Developer/SDKs/MacOSX10.7.sdk/usr/include/curl"  CURL_LIBS="-lcurl" --disable-dependency-tracking
 
254
 
 
255
2.3 QwtPlot3d - For 3d plot support
 
256
-----------------------------------
 
257
 
 
258
qwtplot3d (maintain_0_2_x)
 
259
 
 
260
Add the following to qwtplot3d.pro:
 
261
CONFIG += x86_64 static
 
262
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.7.sdk
 
263
 
 
264
2.4 libkml - For export to Google Earth
 
265
---------------------------------------
 
266
 
 
267
expat (2.0.1)
 
268
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking 
 
269
 
 
270
libkml (pulled down from the svn repo)
 
271
 
 
272
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking --with-expat-include-dir=/usr/local/include --with-expat-lib-dir=/usr/local/lib --disable-swig CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64"
 
273
 
 
274
note: the added CXXFLAGS helped clear the -Werror flag that stopped compilation.
 
275
 
 
276
2.5 libusb - For Garmin USB2 stick support
 
277
------------------------------------------
 
278
 
 
279
libusb (0.1.12)
 
280
 
 
281
To compile on OSX you need to apply the patch here:
 
282
https://trac.macports.org/browser/trunk/dports/devel/libusb-legacy/files?rev=97840
 
283
 
 
284
Then:
 
285
./configure --prefix=/opt/libusb/ CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" --disable-dependency-tracking
 
286
then 
 
287
sed -i 'bak' 's|CC -dynamiclib|CC -dynamiclib -arch x86_64|g' libtool
 
288
make
 
289
make install
 
290
 
 
291
note: that the sed line updates some commands in libtool.  not sure why the arch clags are not getting passed.  
 
292
 
 
293
2.6 libical
 
294
-----------
 
295
 
 
296
libical (0.46)
 
297
first run autogen.sh
 
298
then
 
299
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking
 
300
 
 
301
2.7 clucene
 
302
-----------
 
303
 
 
304
DO NOT USE THE MACPORTS VERSION (0.9.23) IT DOES NOT WORK.
 
305
 
 
306
git clone git://clucene.git.sourceforge.net/gitroot/clucene/clucene 
 
307
cmake -G "Unix Makefiles"
 
308
make
 
309
sudo make install
 
310
 
 
311
will install clucene into /usr/local/include/clucene and /usr/local/lib