| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE chapter SYSTEM "docbook-dtd-45/docbookx.dtd"> |
| 3 |
|
| 4 |
<chapter id="installation"> |
| 5 |
<title>Installation & Updating</title> |
| 6 |
<para> |
| 7 |
These guidelines are primarily for Linux, although I develop on Windows |
| 8 |
using <ulink url="https://www.visualstudio.com/vs/community/">Visual Studio</ulink>. |
| 9 |
</para> |
| 10 |
|
| 11 |
<section id="cmake"> |
| 12 |
<title>CMake Notes</title> |
| 13 |
<para> |
| 14 |
A few have wondered how one installs into a different folder than the default /usr/local when there is no --prefix option to CMake. |
| 15 |
Either pass <code>--prefix=/your/folder/here</code> to <code>./cmake.sh</code> |
| 16 |
or run <code>cmake -DCMAKE_INSTALL_PREFIX=/your/folder/here .</code> if you have already run cmake.sh. |
| 17 |
CMake also supports the common <ulink url="http://www.cmake.org/Wiki/CMake_FAQ#Does_CMake.27s_.22make_install.22_support_DESTDIR.3F">DESTDIR environment variable</ulink>. |
| 18 |
</para> |
| 19 |
<para> |
| 20 |
Also, you do not need to run cmake.sh at every build; make will detect stale files and re-run CMake as needed, |
| 21 |
just like automake. The cmake.sh script is to force a completely clean rebuild. |
| 22 |
</para> |
| 23 |
</section> |
| 24 |
|
| 25 |
<section id="ubuntu-debian"> |
| 26 |
<title>Ubuntu / Debian</title> |
| 27 |
<para> |
| 28 |
For any currently supported version of Debian/Ubuntu or compatible derivatives thereof (such as Linux Mint), |
| 29 |
there is a <ulink url="https://apertium.projectjj.com/apt/">ready-made nightly repository</ulink>, |
| 30 |
easily installable via |
| 31 |
<screen> |
| 32 |
wget https://apertium.projectjj.com/apt/install-nightly.sh -O - | sudo bash |
| 33 |
sudo apt-get install cg3 |
| 34 |
</screen> |
| 35 |
Rest of this page can be skipped. |
| 36 |
</para> |
| 37 |
<para> |
| 38 |
Steps tested on a clean install of Ubuntu 12.10, but should work on any version. |
| 39 |
It is assumed you have a working network connection. |
| 40 |
</para> |
| 41 |
<para> |
| 42 |
Launch a Terminal from Applications -> Accessories, and in that do |
| 43 |
<screen> |
| 44 |
sudo apt-get install g++ libicu-dev subversion cmake libboost-dev build-essential |
| 45 |
cd /tmp/ |
| 46 |
git clone https://github.com/GrammarSoft/cg3 |
| 47 |
cd cg3/ |
| 48 |
./cmake.sh |
| 49 |
make -j3 |
| 50 |
./test/runall.pl |
| 51 |
sudo make install |
| 52 |
sudo ldconfig |
| 53 |
</screen> |
| 54 |
Rest of this page can be skipped. |
| 55 |
</para> |
| 56 |
</section> |
| 57 |
|
| 58 |
<section id="fedora"> |
| 59 |
<title>Fedora / Red Hat / CentOS / OpenSUSE</title> |
| 60 |
<para> |
| 61 |
For any currently supported version of these RPM-based distros or compatible derivatives thereof, there is a |
| 62 |
<ulink url="https://build.opensuse.org/project/show/home:TinoDidriksen:nightly">ready-made nightly repository</ulink>, |
| 63 |
installable via e.g. |
| 64 |
<screen> |
| 65 |
wget https://apertium.projectjj.com/rpm/install-nightly.sh -O - | sudo bash |
| 66 |
yum check-upgrade |
| 67 |
yum install cg3 |
| 68 |
</screen> |
| 69 |
See <ulink url="https://en.opensuse.org/openSUSE:Build_Service_Enduser_Info">openSUSE:Build_Service_Enduser_Info</ulink> |
| 70 |
for how to use on other distros. |
| 71 |
Rest of this page can be skipped. |
| 72 |
</para> |
| 73 |
<para> |
| 74 |
Steps tested on a clean install of CentOS 6.3, but should work on any version. |
| 75 |
It is assumed you have a working network connection. |
| 76 |
</para> |
| 77 |
<para> |
| 78 |
Launch a Terminal from Applications -> System Tools, and in that do |
| 79 |
<screen> |
| 80 |
su - |
| 81 |
yum install gcc-c++ libicu-devel subversion cmake boost-devel make |
| 82 |
cd /tmp/ |
| 83 |
git clone https://github.com/GrammarSoft/cg3 |
| 84 |
cd cg3/ |
| 85 |
./cmake.sh |
| 86 |
make -j3 |
| 87 |
./test/runall.pl |
| 88 |
make install |
| 89 |
ldconfig |
| 90 |
</screen> |
| 91 |
Rest of this page can be skipped. |
| 92 |
</para> |
| 93 |
</section> |
| 94 |
|
| 95 |
<section id="macosx"> |
| 96 |
<title>Mac OS X</title> |
| 97 |
|
| 98 |
<section id="macosx-brew"> |
| 99 |
<title>Homebrew</title> |
| 100 |
<para> |
| 101 |
Launch a Terminal and in that do |
| 102 |
<screen> |
| 103 |
curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo bash |
| 104 |
</screen> |
| 105 |
Rest of this page can be skipped. |
| 106 |
</para> |
| 107 |
<para> |
| 108 |
Or if you want to install from source, do |
| 109 |
<screen> |
| 110 |
brew install cmake |
| 111 |
brew install boost |
| 112 |
brew install icu4c |
| 113 |
brew link icu4c |
| 114 |
cd /tmp |
| 115 |
git clone https://github.com/GrammarSoft/cg3 |
| 116 |
cd cg3/ |
| 117 |
./cmake.sh |
| 118 |
make -j3 |
| 119 |
./test/runall.pl |
| 120 |
make install |
| 121 |
</screen> |
| 122 |
Rest of this page can be skipped. |
| 123 |
If you get errors that ICU cannot be found, you may have to add |
| 124 |
-DCMAKE_INCLUDE_PATH=/usr/local/opt/icu4c/include -DCMAKE_LIBRARY_PATH=/usr/local/opt/icu4c/lib |
| 125 |
to the cmake.sh line. |
| 126 |
</para> |
| 127 |
</section> |
| 128 |
|
| 129 |
<section id="macosx-ports"> |
| 130 |
<title>MacPorts</title> |
| 131 |
<para> |
| 132 |
Launch a Terminal and in that do |
| 133 |
<screen> |
| 134 |
curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo bash |
| 135 |
</screen> |
| 136 |
Rest of this page can be skipped. |
| 137 |
</para> |
| 138 |
<para> |
| 139 |
Or if you want to install from source, do |
| 140 |
<screen> |
| 141 |
sudo port install cmake |
| 142 |
sudo port install boost |
| 143 |
sudo port install icu |
| 144 |
cd /tmp |
| 145 |
git clone https://github.com/GrammarSoft/cg3 |
| 146 |
cd cg3/ |
| 147 |
./cmake.sh |
| 148 |
make -j3 |
| 149 |
./test/runall.pl |
| 150 |
sudo make install |
| 151 |
</screen> |
| 152 |
Rest of this page can be skipped. |
| 153 |
</para> |
| 154 |
</section> |
| 155 |
|
| 156 |
<section id="macosx-other"> |
| 157 |
<title>Other</title> |
| 158 |
<para> |
| 159 |
Installing from source is very similar to Linux, but since the developer tools for OS X are so large, |
| 160 |
we provide binaries from <ulink url="https://apertium.projectjj.com/osx/nightly/">the download folder</ulink>. |
| 161 |
Look for file named cg3-latest.tar.bz2. The archive contains the vislcg3, cg-comp, cg-proc, and cg-conv tools, |
| 162 |
the ICU library binaries. |
| 163 |
</para> |
| 164 |
</section> |
| 165 |
|
| 166 |
</section> |
| 167 |
|
| 168 |
<section id="windows"> |
| 169 |
<title>Windows</title> |
| 170 |
<para> |
| 171 |
Installing from source is rather complicated due to lack of standard search paths for libraries, so |
| 172 |
we provide binaries from <ulink url="https://apertium.projectjj.com/win32/nightly/">the download folder</ulink>. |
| 173 |
Look for files named cg3-latest.zip and/or cg3ide-latest.zip. The archive contains the vislcg3, cg-comp, cg-proc, and cg-conv tools and |
| 174 |
the ICU library DLLs. May also require installing the |
| 175 |
<ulink url="http://www.microsoft.com/download/en/details.aspx?id=5555">VC++ 2010 redist</ulink> |
| 176 |
or <ulink url="http://www.microsoft.com/download/en/details.aspx?id=5582">VC++ 2008 redist</ulink>. |
| 177 |
</para> |
| 178 |
</section> |
| 179 |
|
| 180 |
<section id="installing_icu"> |
| 181 |
<title>Installing ICU</title> |
| 182 |
<para> |
| 183 |
<ulink url="http://icu-project.org/">International Components for Unicode</ulink> are required to compile and run VISL CG-3. |
| 184 |
Only need to do this once, however it must be done unless you already have a recent |
| 185 |
(newer or equal to <ulink url="http://icu-project.org/">ICU</ulink> 3.6) version installed. <ulink url="http://icu-project.org/">ICU</ulink> 3.4 may also work, but is |
| 186 |
considerably slower. Latest info on <ulink url="http://icu-project.org/">ICU</ulink> can be found at <ulink url="http://icu-project.org/">http://icu-project.org/</ulink>. |
| 187 |
I always develop and test with the latest version available. |
| 188 |
</para> |
| 189 |
<para> |
| 190 |
Newer distributions may have a usable version of ICU available for install via the usual yum or apt managers. |
| 191 |
Just make sure to get the developer package alongside the runtime libraries. |
| 192 |
</para> |
| 193 |
<para> |
| 194 |
If you do not have ICU from your distribution, manual install is as follows. |
| 195 |
These steps have been tested on all Red Hat based distributions from RH8 to Fedora 8. |
| 196 |
Similar steps have been tested on Ubuntu 7.10, and Mac OS X 10.3 to 10.5 both PPC and Intel. |
| 197 |
They may vary for your distribution. |
| 198 |
</para> |
| 199 |
<para> |
| 200 |
As root: |
| 201 |
<screen> |
| 202 |
cd /tmp |
| 203 |
wget -c \ |
| 204 |
'<ulink url="http://icu-project.org/download">http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.tgz</ulink>' |
| 205 |
tar -zxvf icu4c-53_1-src.tgz |
| 206 |
cd icu/source/ |
| 207 |
./runConfigureICU Linux |
| 208 |
make |
| 209 |
make install |
| 210 |
echo "/usr/local/lib" >> /etc/ld.so.conf |
| 211 |
ldconfig |
| 212 |
</screen> |
| 213 |
</para> |
| 214 |
</section> |
| 215 |
|
| 216 |
<section id="compiling_cg3"> |
| 217 |
<title>Getting & Compiling VISL CG-3</title> |
| 218 |
<para> |
| 219 |
This step requires you have <ulink url="http://subversion.tigris.org/">Subversion</ulink> installed. |
| 220 |
Subversion binaries are very likely available for your distribution already; |
| 221 |
try using <command>yum install subversion</command> or <command>apt-get install subversion</command> or whichever |
| 222 |
package manager your distribution uses. |
| 223 |
</para> |
| 224 |
<para> |
| 225 |
As any user in any folder where you can find it again: |
| 226 |
<screen> |
| 227 |
git clone https://github.com/GrammarSoft/cg3 |
| 228 |
cd cg3/ |
| 229 |
./cmake.sh |
| 230 |
make |
| 231 |
./test/runall.pl |
| 232 |
... and if all tests succeed ... |
| 233 |
make install |
| 234 |
</screen> |
| 235 |
</para> |
| 236 |
</section> |
| 237 |
|
| 238 |
<section id="updating_cg3"> |
| 239 |
<title>Updating VISL CG-3</title> |
| 240 |
<para> |
| 241 |
In the same folder you chose above, as the same user: |
| 242 |
<screen> |
| 243 |
$ svn up |
| 244 |
$ make |
| 245 |
$ ./test/runall.pl |
| 246 |
... and if all tests succeed ... |
| 247 |
$ make install |
| 248 |
</screen> |
| 249 |
</para> |
| 250 |
</section> |
| 251 |
|
| 252 |
<section id="regressiontest"> |
| 253 |
<title>Regression Testing</title> |
| 254 |
<para> |
| 255 |
After successfully compiling the binary, you can run the regression test suite |
| 256 |
with the command: |
| 257 |
<screen> |
| 258 |
./test/runall.pl |
| 259 |
</screen> |
| 260 |
</para> |
| 261 |
<para> |
| 262 |
This will run a series of tests that should all exit with "Success Success". |
| 263 |
If a test on your end exits with "Fail", please tar up that tests' folder and |
| 264 |
send it to me alongside any ideas you may have as to why it failed. |
| 265 |
</para> |
| 266 |
</section> |
| 267 |
|
| 268 |
<section id="cygwin"> |
| 269 |
<title>Cygwin</title> |
| 270 |
<para> |
| 271 |
While Cygwin can compile and run VISL CG-3 via the cmake toolchain, it cannot be recommended |
| 272 |
as it is very slow (even when using GCC 4.3). |
| 273 |
Instead, compile with Microsoft Visual C++ or use the latest precompiled binary. |
| 274 |
</para> |
| 275 |
</section> |
| 276 |
</chapter> |