\page INSTALL INSTALL
- Introduction
- Dependencies
- UNIX-like Environment: Automated Build and Install
- UNIX-like Environment: Manual Build and Install
- Windows and Microsoft Visual Studio: Building with CMake
- Linking Against the GNSSTk Library
The most up-to-date project information can be found at the project website, including build and install instructions, the latest project news, a support forum, IRC, and contact information:
http://www.gnsstk.org/
The easiest way to build an install GNSSTk is to use the shell script provided with the source distribution. See below for more details on use of the script, details on building on POSIX platforms, and where to get instructions for building with CMake, both with Xcode on OSX and Visual Studio on Windows.
This project uses CMake for all of its configuration, build, install & testing tasks.
http://www.cmake.org/
This project (optionally) uses doxygen to dynamically generate API documentation.
http://www.doxygen.org/
This section describes build and installation under the following environments:
- Linux, OSX, Solaris
The following procedure will build and install the GNSSTk.
-
Ensure that prerequisites such as cmake and swig have been installed.
-
Obtain the GNSSTk source distribution.
-
If needed, extract the GNSSTk compressed archive. For example, using GNU tar and gunzip:
$ tar -xvzf gnsstk.tgz
-
Navigate to the root directory of the extract GNSSTk file tree, herein called $gnsstk_root:
$ cd $gnsstk_root
5. Execute the build script to build and install to the user's ~/.local dir
$ ./build.sh -eu
If you instead prefer or need to run commands one at a time, run the following commands instead of build.sh:
-
If you want documentation of the C++ classes:
$ cd $gnsstk_root
$ doxygen
-
Create a directory for your build:
$ cd $gnsstk_root
$ mkdir $gnsstk_root/build
-
Change into the $gnsstk_root/build directory, this will be where all of the build files will reside.
-
If you prefer to build and install GNSSTk as a system library in /usr/local, execute the following commands:
$ cd $gnsstk_root/build
$ cmake $gnsstk_root
$ make
$ make install
-
If you prefer to build and install GNSSTk as a user library in $HOME/.local, skip the previous step, and instead execute the following commands:
$ cd $gnsstk_root/build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local/gnsstk -DBUILD_EXT=1 $gnsstk_root
$ export LD_LIBRARY_PATH=$HOME/.local/gnsstk/lib:$LD_LIBRARY_PATH
$ make
$ make install
$ export PATH=$HOME/.local/gnsstk/bin:$PATH
-
If you want to package the binaries into a tarball, execute the following commands:
$ cd $gnsstk_root/build
$ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local/gnsstk $gnsstk_root
$ export LD_LIBRARY_PATH=$HOME/.local/gnsstk/lib:$LD_LIBRARY_PATH
$ make
$ make package
Step-by-step procedure with pictures on building, installing, and testing the GNSSTk under Visual Studio 2012 can be found at gnsstk.org:
http://www.gnsstk.org/bin/view/Documentation/BuildingGNSSTkUnderWindows
If you are developing against your install of GNSSTk, and have added the relevant GNSSTk library #include statements in you implementation file, then the simplest example of building your application in a Bash script would look like this:
INPUT=Your_App.cpp
OUTPUT=Your_App.exe
GNSSTK_INSTALL=$HOME/.local/gnsstk
COMPILER="gcc -Wall"
COMMAND_STRING="$COMPILER -I$GNSSTK_INSTALL/include -L$GNSSTK_INSTALL/lib -lgnsstk -o $OUTPUT $INPUT"
echo "$COMMAND_STRING"
eval $COMMAND_STRING