Warning: This is no longer the latest available version of this module. Please see the releases page for the most recent version. The Webnucleo group strongly recommends the use of the latest version of any of its online modules.
This tutorial demonstrates how to compile the example codes of wn_simple_gce. It assumes you are in a Linux or Unix environment. If you are using a different operating system, please adjust the following instructions as appropriate.
Check for Dependencies
The wn_simple_gce codes depend on libxml2, the XML C parser and toolkit of Gnome, and gsl, the GNU Scientific Library.
To find out if you have libxml2 properly installed on your system, type at the command line:
xml2–config
If libxml2 is properly installed, the command will return a Usage description and a list of Options. Note that you can check which version of libxml2 is installed by typing xml2-config --version. If libxml2 is not properly installed, the result of running xml2-config will be the line xml2-config: command not found. In this case, you will need to install libxml2 from the libxml2 downloads page before compiling wn_simple_gce codes.
To find out if you have gsl properly installed on your system, type at the command line:
gsl–config
If gsl is properly installed, the command will return a Usage description and a list of Options. As with libxml, you can check which version of gsl is installed by typing gsl-config --version. If gsl is not properly installed, the result of running gsl-config will be the line gsl-config: command not found. In this case, you will need to install gsl from the gsl ftp site before compiling wn_simple_gce codes.
Create a Temporary Directory
After downloading wn_simple_gce, go to the directory src/examples of the distribution. For example, if your current installation of wn_simple_gce is in the directory ~/modules/wn_simple_gce/0.1/src/, type
cd ~/modules/wn_simple_gce/0.1/src/examples
Create a temporary directory by typing
mkdir tmp
This command makes a temporary directory named "tmp" where the object files will be created during compilation.
Compile the Examples
Now compile the examples by typing:
make all
This will generate all the executable files. You can also make them separately. For example, type
make example1
to generate the executable file example1*. Please note that we have the compiler flags set for gcc and for memory checking with Valgrind. You may wish to edit the Makefile. Look for this part of the Makefile:
#/////////////////////////////////////////////////////////////////////////////// # The following lines may be edited to choose a different compiler to # to use Valgrind or not, or to profile: #/////////////////////////////////////////////////////////////////////////////// GC=gcc GCEDIR = ../ VALGRIND= yes PROFILE= no #/////////////////////////////////////////////////////////////////////////////// # End of lines to be edited. #///////////////////////////////////////////////////////////////////////////////
You should only need to change the lines in this section. For example, you might want to change the compiler from gcc to g++ by setting GC=g++, to optimize by setting VALGRIND=no, or to profile. (Note that Valgrind works better without optimization.)
Clean the Examples
To remove the object files created during compilation, type
make clean
To remove all the object and executable files, type
make cleanall