forked from OpenCPN/OpenCPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
208 lines (150 loc) · 7.45 KB
/
INSTALL
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
----------------------------------------------------------------------
1. Overview
----------------------------------------------------------------------
----------------------------------------------------------------------
2. Library Notes & Requirements
----------------------------------------------------------------------
a. OpenCPN S57 ENC support works best with access to the OpenGL Utility
library GLU. GLU is used to tesselate large polygon areas into small
triangles for faster display rendering. If you cannot use, or do not have
the OpenGL Utility library, you may choose to build OpenCPN with internal
tesselator support. The internal tesselator is sub-optimal compared to GLU,
but it does work, if somewhat slower. OpenGLU is better.
See the Build Notes section for applicable tesselator configuration options.
b. OpenCPN requires WxWidgets Version 2.8.8 or greater. It has been tested
with the following wxWidgets hosts:
GTK2 (__WXGTK__)
MSWindows (__WXMSW__)
MAC OSx (__WXOSX__)
----------------------------------------------------------------------
3. Platform Specific Build Notes
----------------------------------------------------------------------
------------------------
Build OpenCPN
------------------------
Opencpn uses the cmake system, so...
cd {wherever the opencpn base directory is}
mkdir build
cd build
cmake ../
make
su, <password>
make install
----------------------------------------------------------------------
4. File and Directory Permissions under Linux
----------------------------------------------------------------------
It is sufficient for all other directories in /usr/share/opencpn
to have permissions 0755, i.e. exec/searchable and readable by all.
----------------------------------------------------------------------
5. Support File Locations
----------------------------------------------------------------------
a. Opencpn requires numerous auxiliary data files. These files
are installed by the installer into the following locations by default:
Linux - /usr/local/share/opencpn/
Windows - \Program Files\opencpn\
Mac - /Users/YourUserName/openCPNfiles/
The following directories exist within the above:
.../bitmaps - self evident
.../tcdata - tide and current location data
.../s57data - data files for S57ENC support
.../wvsdata - World Vector Shoreline data
b. Opencpn config files are expected in the following locations:
Linux - ~/.opencpn/opencpn.conf
Windows - \Program Files\opencpn\opencpn.ini
The installer will place nice default files for your use. The first
execution of opencpn will update as needed. If for some reason the
config file is not found, opencpn will offer to create a useable
starting configuration.
----------------------------------------------------------------------
6. Serial Port GPS/AIS Data Input and Autopilot Output
----------------------------------------------------------------------
a. LINUX
Opencpn runs at user privilege. This means that in order to
read GPS input data and/or write autopilot output data, the serial
devices to be used must exhibit read and write permission for the
user in question. For linux, these devices are created at startup.
Typically, the devices as created are owned by root, with additional
specific group (e.g. "uucp") r/w access, i.e. permissions are 0660.
This configuration WILL NOT WORK for OpenCPN unless the user happens
to belong to the group under which the devices were created,
typically "uucp". Not likely...
For the more general case, you must ensure that device permissions
will enable opencpn to read and write serial devices without root
privileges. There are several ways to do this.
On a Linux with udev, check the files in /etc/udev/rules.d to
ensure that /dev/tty* devices are all created with the same group
and with 0666 permissions. More generally, you may need to run mknod
or MAKEDEV as root to create a properly permissioned serial device before
executing opencpn. For example:
linux# mknod -m 666 /dev/ttyS0 c 4 64
If you use USB serial port adapters and your system has the Linux
hotplug facility installed, Todo............
Test your GPS input. At user privilege,
linux$ stty -F /dev/ttyXXX ispeed 4800
linux$ cat </dev/ttyXXX
replace ttyXXX with the filename of the port. This will probably be
either /dev/ttyUSB0 or /dev/ttyS0. When you run this command, you
should see text lines beginning with $ come to stdout (possibly after
a short initial burst of binary garbage). If you don't see this, you
may have OS-level problems with your serial support, but more likely
have the wrong device or permissions. Look again.
---------------------------------------------------------------------
7. Cross Compiling for windows using mingw
---------------------------------------------------------------------
It is possible to use mingw to cross compile opencpn for windows,
assuming a debian based linux host system, packages needed:
mingw-w64 - development environment for windows
nsis - to make installer programs
wine - to run and verify the windows binary
sudo apt-get install mingw-w64 nsis wine
Next wxwidgets should be built from source:
tar zxvf wxWidgets-2.8.12.tar.gz
cd wxWidgets-2.8.12.tar.gz
mkdir build
cd build
../configure --prefix=/usr/local/i686-w64-mingw32/ --host=i686-w64-mingw32 --with-opengl --enable-unicode
make
sudo make install
Next build libz from source:
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
cmake -DCMAKE_TOOLCHAIN_FILE=../OpenCPN/Toolchain-mingw32.cmake .
make
sudo cp libzlibstatic.a /usr/local/i686-w64-mingw32/lib/libz.a
Now, edit /usr/share/cmake-2.8/Modules/FindwxWidgets.cmake:
--- OldFindwxWidgets 2014-05-17 15:54:10.804384809 +0800
+++ /usr/share/cmake-2.8/Modules/FindwxWidgets.cmake 2014-05-17 09:32:01.461864587 +0800
@@ -201,10 +201,10 @@
#=====================================================================
#=====================================================================
-if(WIN32 AND NOT CYGWIN AND NOT MSYS)
+if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING)
set(wxWidgets_FIND_STYLE "win32")
else()
- if(UNIX OR MSYS)
+ if(UNIX OR MSYS OR CMAKE_CROSSCOMPILING)
set(wxWidgets_FIND_STYLE "unix")
endif()
endif()
When building opencpn with cmake, use the cross toolchain file:
Be sure the right wx-config is in the PATH, for example:
PATH=~/build/wxWidgets-2.8.12/build_mingw/:$PATH cmake -DCMAKE_TOOLCHAIN_FILE=../buildwin/Toolchain-mingw32.cmake -DCMAKE_BUILD_TYPE=Debug ..
All other steps should work the same as without cross compiling
To set up nsis to build packages (must use nsis-3.0b0, 3.0b2 has a problem)
cd /usr/local/
sudo mkdir nsis
mv <Downloads>/nsis-3.0b0* nsis/
cd nsis
sudo unzip nsis-3.0b0.zip
sudo tar xjvf nsis-3.0b0-src.tar.bz2
cd nsis-3.0b0-src/
sudo scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA=no PREFIX=/usr/local/nsis/nsis-3.0b0 install-compiler
cd ../nsis-3.0b0
sudo mkdir share
sudo ln -s /usr/local/nsis/nsis-3.0b0 nsis
export PATH=/usr/local/nsis/nsis-3.0b0/bin/:$PATH
Now it should be possible to run "make package"
make package
And install and test it using wine:
chmod +x *exe
./opencpn_*