GNE Tutorials

GNE website

Tutorials Home

Tutorials

  1. Creating exhello
  2. Techniques using PacketFeeder

Figures

  1. GNE Mid-Level API Connection Process

Installation Tutorials

  1. MSVC.NET
  2. MinGW32
  3. Linux/UNIX

Installing GNE for Linux/UNIX

Follow these steps to build GNE with the GCC compiler on Linux.

Contents

  1. Install UNIX Libraries
  2. Install HawkNL
  3. Install Boost
  4. Provide Library Paths
  5. Compile GNE
  6. Use GNE

Step 1: Install UNIX Libraries

GNE should compile on any UNIX-like system. GNE does not use anything system specific except for ncurses and pthreads. HawkNL also requires pthreads. If HawkNL compiles and you have pthreads and ncurses then GNE SHOULD compile and run. Boost should be able to run on just about everything under the sun since its libraries are candidates to be included into the next C++ standard.

Someone recently mentioned they were compiling GNE under Mac OS X. No news was heard on that before the latest GNE release. If more information arrives I will make note of it.

Back To Top

Step 2: Install HawkNL

The first dependency required for GNE is HawkNL. HawkNL can be found at http://www.hawksoft.com/hawknl/. GNE 0.70 was developed using HawkNL 1.66. I believe any HawkNL 1.6 version will work, but 1.66 is suggested. HawkNL 2.0 has not been released yet, so nothing can be said about GNE compatibilty with HawkNL 2.0.

Once you have HawkNL compiled, you will have the HawkNL.a file, the nl.h header, and the HawkNL.so file.

Back To Top

Step 3: Install Boost

The second dependency for GNE is the Boost library. Boost can be found at http://www.boost.org/. Most parts of Boost are implemented as templates, which means that NO compiling is needed. None of the parts of Boost that GNE uses require compiling. So you need NOT to compile the Boost library -- I make a special note because the first time I got Boost I tried forever to try to compile it only to discover it doesn't need to be compiled. All that is needed is for you to unpack the Boost library.

GNE was developed using Boost 1.30. There is a bugfix version 1.30.2. I have no reason to believe that GNE will not compile with that Boost version.

Once you have unpacked Boost, you will have a directory strucuture. Keep note of where the Boost_1_30_0 or Boost_1_30_2 library is located, so you can locate it later.

The Boost library download is 10 megs. If you do not already have boost I have provided a minimal version of Boost that includes only the files required for GNE that is around 100k. You can find this file from the same place you downloaded GNE.

If you download this "mini Boost" version, you can unpack it into the include directory of the GNE structure for easiest use, or you can unpack it into a new directory of your choosing. If you unpack it into the GNE\include directory, you should end with a directory structure that looks like this:

  • GNE Root
    • include
      • directory boost
      • directory gnelib
      • gnelib.h

This will add the "boost" directory into the gne\include directory.

Back To Top

Step 4: Provide Library Paths

In the MinGW build, the method to provide the paths to HawkNL's .a and header and Boost's headers is through the LibPaths.mak file. In the GCC compiler the -I option and -L option.

If you have not installed HawkNL or Boost into your compiler's paths where it can find it, you need to specify the paths in the LibPaths.mak file.

Back To Top

Step 5: Compile GNE

To compile GNE for MinGW, perform the following steps:

First run "fixlinux.sh" to configure GNE for mingw32.

Second decide your options:

  • If you want the debug compile of GNE, append DEBUGMODE=1
  • If you have GCC 2.95, append OLD_CPP=1

So if you want to compile in release mode: run "make". If you want to compile in debugmode with MinGW1.0, run "make DEBUGMODE=1 OLD_CPP=1".

If you only want to compile the lib, use "make lib"

Back To Top

Step 6: Use GNE

Once you have compiled GNE you have two options for using it.

The first way is to add the -I lines for HawkNL, Boost, and GNE to your project's makefile. This is probably the best way.

Some people prefer to install GNE and other libraries right into their compiler's paths. If you prefer this method, you can run "make install" to copy GNE into your /usr/local/lib and /usr/local/include.

If you do it this way, you don't need to add any -I lines to your GCC line. You do still have to add the -l lines. For example:

gcc -o mygneprog.exe -lgnelib -lNL mygneprog.cpp

If you prefer to not copy the files into your compiler's directory, you have to use -I and -L. It looks like a long line, but it's not bad if you are using makefiles so you only have to type it once:

gcc -o mygneprog.exe -I"C:\My Projects\boost_1_30_0" -I"C:\My Projects\HawkNL\include" -I"C:\My Projects\gnelib\include" -L"C:\My Projects\HawkNL\lib" -lgnelib -lNL mygneprog.cpp

I apologize for allowing word wrap there but without it it will make a really huge horizontal scroll bar ;). All of that above should be on a single line.

Back To Top