1
+++++++++++++++++++++++
2
MAC OSX BUILD WALKTHROUGH
3
+++++++++++++++++++++++
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
16
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
20
2. ADDING OPTIONAL DEPENDENCIES
31
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
32
=================================================
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.
37
1.1 Ensure OS X is up-to-date
38
-----------------------------
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.
43
This walkthrough was performed on an iMac running 10.7.2 (Lion)
45
1.2 Install XCode from App Store
46
--------------------------------
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.
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.
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.
61
1.3 Run the Xcode installer
62
---------------------------
64
The app store download will have added an Install Xcode icon in the launchpad.
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.
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.
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.
78
1.4 Get the source code
79
-----------------------
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.
84
First open up a terminal session, then;
89
$ git clone git://github.com/GoldenCheetah/GoldenCheetah.git
91
You will now have the GoldenCheetah sources downloaded into a 'GoldenCheetah'
92
directory in your home directory, under another folder called 'Projects'.
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
103
$ checkout release_3.0.0dev
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!).
110
1.5 Install the QT SDK
111
----------------------
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
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.
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).
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'.
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.
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.
141
Read and accept the license agreement and then continue and install.
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:
147
$ sudo ln -s ~/QtSDK/Desktop/Qt/474/gcc/bin/qmake /usr/bin/qmake
149
1.5.1 Install via Mac Ports
150
---------------------------
152
If you have macports installed, you can install the qt dependices
153
with the following commands:
155
$ sudo port install qt4-mac
156
$ sudo port install qt4-mac-sqlite3-plugin
161
No longer need this step (install boost)
163
1.7 Configure and Build GoldenCheetah (with no optional dependencies)
164
---------------------------------------------------------------------
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.
170
$ cd ~/Projects/GoldenCheetah/qwt
171
$ cp qwtconfig.pri.in qwtconfig.pri
173
$ cp gcconfig.pri.in gcconfig.pri
176
In that last step you can use whatever editor you feel most comfortable with.
178
For now we will comment out some of the dependencies we have not installed
181
#SRMIO_INSTALL = /usr/local/srmio
182
#D2XX_INCLUDE = /usr/local/include/D2XX
184
we may need to additionally configure to use the local compression
185
libraries (at least I did), by adding the following line:
189
Lastly, since we are on Lion, we can also uncomment and change the following line:
191
DEFINES += GC_HAVE_LION
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
200
To do this, edit the file in question as an administrator:
202
$ sudo vi ~/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qglobal.h
204
And comment out line 320 (or thereabouts):
206
//# warning "This version of Mac OS X is unsupported"
208
Once this is done you can kick off the build:
210
$ cd .. #this should put you in the top level dir containing this file
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
220
Once this completes you will have a GoldenCheetah.app in the src directory which
223
$ open src/GoldenCheetah.app
225
And you're up and running.
227
2. ADDING OPTIONAL DEPENDENCIES
228
===============================
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.
242
2.1 SRMIO - For working with PC 5/6/7
243
-------------------------------------
246
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" CPPFLAGS=-I/usr/local/D2XX/ --disable-dependency-tracking
248
2.2 Liboauth - For Twitter support
249
----------------------------------
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
255
2.3 QwtPlot3d - For 3d plot support
256
-----------------------------------
258
qwtplot3d (maintain_0_2_x)
260
Add the following to qwtplot3d.pro:
261
CONFIG += x86_64 static
262
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.7.sdk
264
2.4 libkml - For export to Google Earth
265
---------------------------------------
268
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking
270
libkml (pulled down from the svn repo)
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"
274
note: the added CXXFLAGS helped clear the -Werror flag that stopped compilation.
276
2.5 libusb - For Garmin USB2 stick support
277
------------------------------------------
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
285
./configure --prefix=/opt/libusb/ CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" --disable-dependency-tracking
287
sed -i 'bak' 's|CC -dynamiclib|CC -dynamiclib -arch x86_64|g' libtool
291
note: that the sed line updates some commands in libtool. not sure why the arch clags are not getting passed.
299
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking
304
DO NOT USE THE MACPORTS VERSION (0.9.23) IT DOES NOT WORK.
306
git clone git://clucene.git.sourceforge.net/gitroot/clucene/clucene
307
cmake -G "Unix Makefiles"
311
will install clucene into /usr/local/include/clucene and /usr/local/lib