Chapter 3. Installation & Updating

Table of Contents

CMake Notes
Ubuntu / Debian
Fedora / Red Hat / CentOS / OpenSUSE
Mac OS X
Homebrew
MacPorts
Other
Windows
Installing ICU
Getting & Compiling VISL CG-3
Updating VISL CG-3
Regression Testing
Cygwin

These guidelines are primarily for Linux, although I develop on Windows using Visual Studio.

CMake Notes

A few have wondered how one installs into a different folder than the default /usr/local when there is no --prefix option to CMake. Either pass --prefix=/your/folder/here to ./cmake.sh or run cmake -DCMAKE_INSTALL_PREFIX=/your/folder/here . if you have already run cmake.sh. CMake also supports the common DESTDIR environment variable.

Also, you do not need to run cmake.sh at every build; make will detect stale files and re-run CMake as needed, just like automake. The cmake.sh script is to force a completely clean rebuild.

Ubuntu / Debian

For any currently supported version of Debian/Ubuntu or compatible derivatives thereof (such as Linux Mint), there is a ready-made nightly repository, easily installable via

        wget https://apertium.projectjj.com/apt/install-nightly.sh -O - | sudo bash
        sudo apt-get install cg3
      

Rest of this page can be skipped.

Steps tested on a clean install of Ubuntu 12.10, but should work on any version. It is assumed you have a working network connection.

Launch a Terminal from Applications -> Accessories, and in that do

        sudo apt-get install g++ libicu-dev subversion cmake libboost-dev build-essential
        cd /tmp/
        git clone https://github.com/GrammarSoft/cg3
        cd cg3/
        ./cmake.sh
        make -j3
        ./test/runall.pl
        sudo make install
        sudo ldconfig
      

Rest of this page can be skipped.

Fedora / Red Hat / CentOS / OpenSUSE

For any currently supported version of these RPM-based distros or compatible derivatives thereof, there is a ready-made nightly repository, installable via e.g.

        wget https://apertium.projectjj.com/rpm/install-nightly.sh -O - | sudo bash
        yum check-upgrade
        yum install cg3
      

See openSUSE:Build_Service_Enduser_Info for how to use on other distros. Rest of this page can be skipped.

Steps tested on a clean install of CentOS 6.3, but should work on any version. It is assumed you have a working network connection.

Launch a Terminal from Applications -> System Tools, and in that do

        su -
        yum install gcc-c++ libicu-devel subversion cmake boost-devel make
        cd /tmp/
        git clone https://github.com/GrammarSoft/cg3
        cd cg3/
        ./cmake.sh
        make -j3
        ./test/runall.pl
        make install
        ldconfig
      

Rest of this page can be skipped.

Mac OS X

Homebrew

Launch a Terminal and in that do

          curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo bash
        

Rest of this page can be skipped.

Or if you want to install from source, do

          brew install cmake
          brew install boost
          brew install icu4c
          brew link icu4c
          cd /tmp
          git clone https://github.com/GrammarSoft/cg3
          cd cg3/
          ./cmake.sh
          make -j3
          ./test/runall.pl
          make install
        

Rest of this page can be skipped. If you get errors that ICU cannot be found, you may have to add -DCMAKE_INCLUDE_PATH=/usr/local/opt/icu4c/include -DCMAKE_LIBRARY_PATH=/usr/local/opt/icu4c/lib to the cmake.sh line.

MacPorts

Launch a Terminal and in that do

          curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo bash
        

Rest of this page can be skipped.

Or if you want to install from source, do

          sudo port install cmake
          sudo port install boost
          sudo port install icu
          cd /tmp
          git clone https://github.com/GrammarSoft/cg3
          cd cg3/
          ./cmake.sh
          make -j3
          ./test/runall.pl
          sudo make install
        

Rest of this page can be skipped.

Other

Installing from source is very similar to Linux, but since the developer tools for OS X are so large, we provide binaries from the download folder. Look for file named cg3-latest.tar.bz2. The archive contains the vislcg3, cg-comp, cg-proc, and cg-conv tools, the ICU library binaries.

Windows

Installing from source is rather complicated due to lack of standard search paths for libraries, so we provide binaries from the download folder. 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 the ICU library DLLs. May also require installing the VC++ 2010 redist or VC++ 2008 redist.

Installing ICU

International Components for Unicode are required to compile and run VISL CG-3. Only need to do this once, however it must be done unless you already have a recent (newer or equal to ICU 3.6) version installed. ICU 3.4 may also work, but is considerably slower. Latest info on ICU can be found at http://icu-project.org/. I always develop and test with the latest version available.

Newer distributions may have a usable version of ICU available for install via the usual yum or apt managers. Just make sure to get the developer package alongside the runtime libraries.

If you do not have ICU from your distribution, manual install is as follows. These steps have been tested on all Red Hat based distributions from RH8 to Fedora 8. Similar steps have been tested on Ubuntu 7.10, and Mac OS X 10.3 to 10.5 both PPC and Intel. They may vary for your distribution.

As root:

        cd /tmp
        wget -c \
          'http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.tgz'
        tar -zxvf icu4c-53_1-src.tgz
        cd icu/source/
        ./runConfigureICU Linux
        make
        make install
        echo "/usr/local/lib" >> /etc/ld.so.conf
        ldconfig
      

Getting & Compiling VISL CG-3

This step requires you have Subversion installed. Subversion binaries are very likely available for your distribution already; try using yum install subversion or apt-get install subversion or whichever package manager your distribution uses.

As any user in any folder where you can find it again:

        git clone https://github.com/GrammarSoft/cg3
        cd cg3/
        ./cmake.sh
        make
        ./test/runall.pl
        ... and if all tests succeed ...
        make install
      

Updating VISL CG-3

In the same folder you chose above, as the same user:

        $ svn up
        $ make
        $ ./test/runall.pl
        ... and if all tests succeed ...
        $ make install
      

Regression Testing

After successfully compiling the binary, you can run the regression test suite with the command:

        ./test/runall.pl
      

This will run a series of tests that should all exit with "Success Success". If a test on your end exits with "Fail", please tar up that tests' folder and send it to me alongside any ideas you may have as to why it failed.

Cygwin

While Cygwin can compile and run VISL CG-3 via the cmake toolchain, it cannot be recommended as it is very slow (even when using GCC 4.3). Instead, compile with Microsoft Visual C++ or use the latest precompiled binary.