forked from GoldenCheetah/GoldenCheetah
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL-MAC
303 lines (214 loc) · 11.1 KB
/
INSTALL-MAC
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
Update Note: to build GoldenCheetah v3.6 we are using the Homebrew Package
Manager to install dependencies, including Qt and GSL, on Travis-ci
macOS High Sierra build environment.
You can check the travis/osx folder for the complete and updated build scripts,
the minimum Qt version known to work is 5.13 with Qt WebEngine and Qt Charts.
GSL - GNU Scientific Library is a mandatory dependency starting with v3.6
Ale Martinez - May, 2020
+++++++++++++++++++++++
MAC OSX BUILD WALKTHROUGH
+++++++++++++++++++++++
Mark Liversedge
Jan 2015
Version 1.2
A walkthrough of building GoldenCheetah from scratch on Mac OSX. This was performed
on Mac OSX Lion (10.7) but the instructions are largely the same for all versions of
Mac OS X.
CONTENTS
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
- Xcode
- Qt
2. ADDING OPTIONAL DEPENDENCIES
- FTDI D2XX
- SRMIO
- libkml
- libusb
- libical
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
=================================================
Depending upon the speed of your internet connection and availability of the
required software the steps in section 1 will take approximately 1 hour.
1.1 Ensure OS X is up-to-date
-----------------------------
Make sure you have applied all the latest updates to Mac OS X. This can be
found from the system menu, apple, about this mac, software update.
This walkthrough was performed on an iMac running 10.7.2 (Lion)
1.2 Install XCode from App Store
--------------------------------
If you are building on 10.6 or higher you should install Xcode4, for earlier
releases you will need Xcode 3.1.4. If you have capable hardware you should
consider upgrading to Lion to get the latest bug fixes and capabilities.
To install Xcode on Lion you need to download it via the App Store. You can
launch the App Store from launchpad, or it may be already in your dock.
Under the search box type in Xcode and it will return a few optios, generally
Xcode is the first item and shows a blueprint with a hammer icon. Click on
this to install it. It should be free. The usual app store process will apply
as the application is downloaded and installed. The download is about 2GB
so do bear this in mind if you have limits on your internet bandwidth or cap.
1.3 Run the Xcode installer
---------------------------
The app store download will have added an Install Xcode icon in the launchpad.
Go ahead and run it.
Xcode includes all the development tools such as a compiler, debugger and
SDKs. It also installs the 'git' tool for working with Git repositories.
It will run through a wizard to install, just read and then accept the license
agreement and let it get on with it. If you don't like the license then quit
and use the development builds from goldencheetah.stand2surtf.net.
You may find it borks at iTunes helper running, you will
need to force quit the iTunes helper via Finder, Applications, Utilities,
Activity Monitor if this happens.
1.4 Get the source code
-----------------------
We store all the Golden Cheetah source code on github.com, it is a great
site holding repositories for many open source projects.
First open up a terminal session, then;
$ cd
$ mkdir Projects
$ cd Projects
$ git clone git://github.com/GoldenCheetah/GoldenCheetah.git
You will now have the GoldenCheetah sources downloaded into a 'GoldenCheetah'
directory in your home directory, under another folder called 'Projects'.
$ cd GoldenCheetah
$ ls
You should see a number of directories such as doc, qwt, src etc. If you are
wanting to build a particular release you need to checkout the release. To
build a release you need to checkout the code at the tag for the release.
A list of releases can be found at: https://github.com/GoldenCheetah/GoldenCheetah/tags
$ git checkout V3.3-RC1
$ ls
You will now see an updated version of this walkthrough, please jump to using
that since it may be more up-to-date than this walkthrough (depending upon
where you got it from of course!).
1.5 Install the QT SDK
----------------------
GoldenCheetah is developed using the Nokia QT toolkit, it is large and will
need to be downloaded and installed from their website. Alternatively, you
can intall qt via macports (http://www.macports.org) as described in section
1.5.1.
As of today, the latest stable release is 5.6.0, we need 4.7 or higher so
go ahead and download the offline installer - it has everything you need
but is about 1.3GB. Please make sure you download the installer for Mac
OS X 10.6 or later, 64-bit.
The url for QT downloads is: https://www.qt.io/download-open-source/#section-2 and
whilst the offline installer is only 12mb it will still call back and download the
required objects as you install, I think it is better to get it all in
one hit (and you can save it to reinstall on another computer or if you
want to rebuild/reinstall for any other reason).
Once the QT SDK is downloaded you will have a .dmg (disk image) that you
need to mount by double clicking on it. You will then get a volume mounted
and shown on your desktop. Go ahead and double click that to start the install
process. It is probably called something like 'Qt SDK Installer'.
It will popup with a dialog warning that this is downloaded from the internet
and are you sure you want to open it? Go ahead and click Open.
A wizard will now guide you through the QT install process. Go ahead and accept
all the defaults, it will install in your home directory and avoid updating the
system directories, this means you are less likely to bork your Mac OSX installation.
Read and accept the license agreement and then continue and install.
We need to make sure that a program called qmake is installed in a directory where
it can be found. So, we need to create a link from what we just installed in the
user programs folder. For QT SDK (5.6) we need to:
$ sudo ln -s ~/Qt5.6.0/5.6/clang_64/bin/qmake /usr/local/bin/qmake
1.5.1 Install via Mac Ports
---------------------------
If you have macports installed, you can install the qt dependices
with the following commands:
$ sudo port install qt4-mac
$ sudo port install qt4-mac-sqlite3-plugin
1.6 DEPRECATED
--------------
No longer need this step (install boost)
1.7 Configure and Build GoldenCheetah (with no optional dependencies)
---------------------------------------------------------------------
First thing we need to do is set the build configuration, this means editing the
private build profile settings. There is one for qwt (a charting library) and
there is another for GoldenCheetah itself.
$ cd ~/Projects/GoldenCheetah/qwt
$ cp qwtconfig.pri.in qwtconfig.pri
$ cd ../src
$ cp gcconfig.pri.in gcconfig.pri
$ vi gcconfig.pri
In that last step you can use whatever editor you feel most comfortable with.
For now we will comment out some of the dependencies we have not installed
support for yet:
#SRMIO_INSTALL = /usr/local/srmio
#D2XX_INCLUDE = /usr/local/include/D2XX
we may need to additionally configure to use the local compression
libraries (at least I did), by adding the following line:
LIBS += -lz
Lastly, since we are on Lion, we can also uncomment and change the following line:
DEFINES += GC_HAVE_LION
Once the changes have been made we are now ready to build for the first time. You
may notice a lot of warning messages about the version of O/S not being supported.
This is because QT does not officially support Lion at this point in time (but it
does work). You can either ignore the warning messages or (like me) go and edit out
the warning (once you have seen the message once you don't need reminding every
time you compile).
To do this, edit the file in question as an administrator:
$ sudo vi ~/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qglobal.h
And comment out line 320 (or thereabouts):
//# warning "This version of Mac OS X is unsupported"
Once this is done you can kick off the build:
$ cd .. #this should put you in the top level dir containing this file
$ qmake -recursive
$ make
When build first time you get number of error messages on .qm files missing:
"RCC: Error in 'Resources/application.qrc': Cannot find file 'translations/gc_fr.qm'"
You can ignore these messages for your build. The .qm files will be created during the
build at a later point in time via the "lrelease" command you configured in gcconfig.pri)
If make fails to find a Makefile then qmake is configured, by default, to create
an xcode project file. You will need to change the qmake command above to tell it
to create a makefile with the following:
$ qmake -spec macx-g++ -recursive
$ make
Once this completes you will have a GoldenCheetah.app in the src directory which
can be launched:
$ open src/GoldenCheetah.app
And you're up and running.
Now, if you would like to use XCode to debug the project, you can generate
the necessary project file.
$ qmake --recursive -spec macx-xcode
This will create a project as: build.xcodeproj Please be sure to build via
the standard method before checkin to prevent build errors. If the build
fails to launch with "couldn't be opened because you don't have permission
to view it" Then a work around would be to open the project and attach
the debugger.
$ open src/GoldenCheetah.app
2. ADDING OPTIONAL DEPENDENCIES
===============================
- SRMIO
- libkml
- libusb
- libical
Since these optional dependencies are more complex and require more advanced
technical skills we do not provide a walkthrough for building them all but
instead provide the configure settings and any special considerations that
should be taken into account.
2.1 SRMIO - For working with PC 5/6/7
-------------------------------------
SRMIO (git)
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" CPPFLAGS=-I/usr/local/D2XX/ --disable-dependency-tracking
2.2 libkml - For export to Google Earth
---------------------------------------
expat (2.0.1)
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking
libkml (pulled down from the svn repo)
./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"
note: the added CXXFLAGS helped clear the -Werror flag that stopped compilation.
2.3 libusb - For Garmin USB2 stick support
------------------------------------------
libusb (0.1.12)
To compile on OSX you need to apply the patch here:
https://trac.macports.org/browser/trunk/dports/devel/libusb-legacy/files?rev=97840
Then:
./configure --prefix=/opt/libusb/ CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" --disable-dependency-tracking
then
sed -i 'bak' 's|CC -dynamiclib|CC -dynamiclib -arch x86_64|g' libtool
make
make install
note: that the sed line updates some commands in libtool. not sure why the arch clags are not getting passed.
2.4 libical
-----------
libical (0.46)
first run autogen.sh
then
./configure CFLAGS="-isysroot /Developer/SDKs/MacOSX10.7.sdk -arch x86_64" --disable-dependency-tracking