[galib] Compilation trouble

Liekens, A.M.L. A.M.L.Liekens at tue.nl
Sat Dec 25 20:57:53 EST 2004


I have patched galib-2.4.5 to compile under gcc-3.4. Probably not 100% bullet-proof, please send your further bug reports and requests to make galib compliant for gcc 3.4 to anthony at liekens.net, and please read the notes I have attached below if you're planning on using this patched version of galib.

You can find it here:

http://anthony.liekens.net/galib-2.4.5-al1/

Here are the notes coming with this version:

Notes on version galib-2.4.5-al1
--------------------------------

This adaptation was necessary to compile galib-2.4.5 with GCC 3.4. Since
gcc-3.4 requires more compliance with the standard, tighter use of template
inheritance and scoping in galib-2.4.5 was required.

Note that this patch is not completely checked, and more problems may turn
up upon compilation of specific applications using galib-2.4.5-al1 with
gcc-3.4. Disclaimer: I cannot guarantee anything for this patch. Please send
your bugs and further patch requests for compliance of galib-2.4.5-al1 with
gcc-3.4 to anthony at liekens.net

The following changes were required for getting galib-2.4.5 compiled for
gcc-3.4, resulting in galib-2.4.5-al1

* Random functionality in ga/garandom.h/.C is now in a GARandom namespace,
thus if you use random functions of garandom.h, make sure to use the correct
namespace, e.g.

        #include <ga/garandom.h>
        using namespace GARandom;

or call these functions from within their GARandom namespace, e.g. use

        GARandom::GARandomInt();

to access the functions.

Because of the addition of a namespace, I had to drop all random number
generators, except for the default ran2() and sran2() functions, which have
now been renamed to ran() and sran(). If you need other random functions,
you'll have to go back to an older version of galib and patch the function
you want into ga/garandom.C

* Inheritance of templates is now in compliance with the C++ standard

* Friend operators == and != of GAAlleleSet<T> are now also according to the
standard

* Deprecated inclusions of <iostream.h> and <fstream.h> have been replaced by
the correct <iostream> and <fstream> includes

* Corrected warnings of comparisons of ints with unsigned ints

Hope you like it,

Anthony,-

-----Original Message-----
From:	galib-bounces at MIT.EDU on behalf of Mark Hodgson
Sent:	Thu 12/23/04 21:47
To:	galib at MIT.EDU
Cc:	
Subject:	[galib] Compilation trouble
Hi all,

I have been using GALib 2.4.5 on Fedora Linux Core 2 for some time now. 
However, i recently performed a fresh install of Fedora Core 3 and am 
now unable to make GAlib.

Here is the make output that i am recieving:

[root at localhost galib245]# make
cd ga; make
make[1]: Entering directory `/home/mark/.Trash/galib245/ga'
make[1]: `libga.a' is up to date.
make[1]: Leaving directory `/home/mark/.Trash/galib245/ga'
cd examples; make
make[1]: Entering directory `/home/mark/.Trash/galib245/examples'
g++ -g -Wall -O -fexceptions -O0 -I.. -c ex21.C
In file included from 
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/backward/iostream.h:31,
                 from ex21.C:15:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/backward/backward_warning.h:32:2: 
warning: #warning This file includes at least one deprecated or 
antiquated header. Please consider using one of the 32 headers found in 
section 17.4.1.2 of the C++ standard. Examples include substituting the 
<X> header for the <X.h> header for C++ includes, or <iostream> instead 
of the deprecated header <iostream.h>. To disable this warning use 
-Wno-deprecated.
In file included from ../ga/ga.h:171,
                 from ex21.C:16:
../ga/GA1DArrayGenome.h: In member function `GA1DArrayGenome<T>& 
GA1DArrayGenome<T>::operator=(const T*)':
../ga/GA1DArrayGenome.h:66: error: `sz' undeclared (first use this function)
../ga/GA1DArrayGenome.h:66: error: (Each undeclared identifier is 
reported only once for each function it appears in.)
../ga/GA1DArrayGenome.h: In member function `const T& 
GA1DArrayGenome<T>::gene(unsigned int) const':
../ga/GA1DArrayGenome.h:78: error: `a' undeclared (first use this function)
../ga/GA1DArrayGenome.h: In member function `T& 
GA1DArrayGenome<T>::gene(unsigned int, const T&)':
../ga/GA1DArrayGenome.h:80: error: `a' undeclared (first use this function)
../ga/GA1DArrayGenome.h: At global scope:
../ga/GA1DArrayGenome.h:155: error: `CONTENTS' was not declared in this 
scope
In file included from ../ga/GA1DArrayGenome.h:178,
                 from ../ga/ga.h:171,
                 from ex21.C:16:
../ga/GA1DArrayGenome.C: In member function `virtual int 
GA1DArrayGenome<T>::resize(int)':
../ga/GA1DArrayGenome.C:136: error: `sz' undeclared (first use this 
function)
../ga/GA1DArrayGenome.C: In constructor 
`GA1DArrayAlleleGenome<T>::GA1DArrayAlleleGenome(unsigned int, const 
GAAlleleSet<T>&, float (*)(GAGenome&), void*)':
../ga/GA1DArrayGenome.C:227: error: `ElementComparator' undeclared 
(first use this function)
../ga/GA1DArrayGenome.C:227: error: there are no arguments to 
`comparator' that depend on a template parameter, so a declaration of 
`comparator' must be available
../ga/GA1DArrayGenome.C:227: error: (if you use `-fpermissive', G++ will 
accept your code, but allowing the use of an undeclared name is deprecated)
../ga/GA1DArrayGenome.C:228: error: `OnePointCrossover' undeclared 
(first use this function)
../ga/GA1DArrayGenome.C:228: error: there are no arguments to 
`crossover' that depend on a template parameter, so a declaration of 
`crossover' must be available../ga/GA1DArrayGenome.C: In constructor 
`GA1DArrayAlleleGenome<T>::GA1DArrayAlleleGenome(const 
GAAlleleSetArray<T>&, float (*)(GAGenome&), void*)':
../ga/GA1DArrayGenome.C:243: error: `ElementComparator' undeclared 
(first use this function)
../ga/GA1DArrayGenome.C:243: error: there are no arguments to 
`comparator' that depend on a template parameter, so a declaration of 
`comparator' must be available
../ga/GA1DArrayGenome.C:244: error: `OnePointCrossover' undeclared 
(first use this function)
../ga/GA1DArrayGenome.C:244: error: there are no arguments to 
`crossover' that depend on a template parameter, so a declaration of 
`crossover' must be available../ga/GA1DArrayGenome.C: In member function 
`virtual int GA1DArrayAlleleGenome<T>::resize(int)':
../ga/GA1DArrayGenome.C:298: error: `nx' undeclared (first use this 
function)
../ga/GA1DArrayGenome.C:302: error: `a' undeclared (first use this function)
In file included from ../ga/ga.h:172,
                 from ex21.C:16:
../ga/GA2DArrayGenome.h: In member function `const T& 
GA2DArrayGenome<T>::gene(unsigned int, unsigned int) const':
../ga/GA2DArrayGenome.h:60: error: `a' undeclared (first use this function)
../ga/GA2DArrayGenome.h: In member function `T& 
GA2DArrayGenome<T>::gene(unsigned int, unsigned int, const T&)':
../ga/GA2DArrayGenome.h:62: error: `a' undeclared (first use this function)
../ga/GA2DArrayGenome.h: At global scope:
../ga/GA2DArrayGenome.h:124: error: `CONTENTS' was not declared in this 
scope
In file included from ../ga/GA2DArrayGenome.h:145,
                 from ../ga/ga.h:172,
                 from ex21.C:16:
../ga/GA2DArrayGenome.C: In member function `virtual int 
GA2DArrayGenome<T>::resize(int, int)':
../ga/GA2DArrayGenome.C:89: error: `sz' undeclared (first use this function)
../ga/GA2DArrayGenome.C:116: error: there are no arguments to `move' 
that depend on a template parameter, so a declaration of `move' must be 
available
../ga/GA2DArrayGenome.C: In constructor 
`GA2DArrayAlleleGenome<T>::GA2DArrayAlleleGenome(unsigned int, unsigned 
int, const GAAlleleSet<T>&, float (*)(GAGenome&), void*)':
../ga/GA2DArrayGenome.C:274: error: `ElementComparator' undeclared 
(first use this function)
../ga/GA2DArrayGenome.C:274: error: there are no arguments to 
`comparator' that depend on a template parameter, so a declaration of 
`comparator' must be available
../ga/GA2DArrayGenome.C:275: error: `OnePointCrossover' undeclared 
(first use this function)
../ga/GA2DArrayGenome.C:275: error: there are no arguments to 
`crossover' that depend on a template parameter, so a declaration of 
`crossover' must be available../ga/GA2DArrayGenome.C: In constructor 
`GA2DArrayAlleleGenome<T>::GA2DArrayAlleleGenome(unsigned int, unsigned 
int, const GAAlleleSetArray<T>&, float (*)(GAGenome&), void*)':
../ga/GA2DArrayGenome.C:291: error: `ElementComparator' undeclared 
(first use this function)
../ga/GA2DArrayGenome.C:291: error: there are no arguments to 
`comparator' that depend on a template parameter, so a declaration of 
`comparator' must be available
../ga/GA2DArrayGenome.C:292: error: `OnePointCrossover' undeclared 
(first use this function)
../ga/GA2DArrayGenome.C:292: error: there are no arguments to 
`crossover' that depend on a template parameter, so a declaration of 
`crossover' must be available../ga/GA2DArrayGenome.C: In member function 
`virtual int GA2DArrayAlleleGenome<T>::resize(int, int)':
../ga/GA2DArrayGenome.C:338: error: `nx' undeclared (first use this 
function)
../ga/GA2DArrayGenome.C:339: error: `ny' undeclared (first use this 
function)
../ga/GA2DArrayGenome.C:346: error: `a' undeclared (first use this function)
../ga/GA2DArrayGenome.C:354: error: `sz' undeclared (first use this 
function)
In file included from ../ga/ga.h:173,
                 from ex21.C:16:
../ga/GA3DArrayGenome.h: In member function `const T& 
GA3DArrayGenome<T>::gene(unsigned int, unsigned int, unsigned int) const':
../ga/GA3DArrayGenome.h:63: error: `a' undeclared (first use this function)
../ga/GA3DArrayGenome.h: In member function `T& 
GA3DArrayGenome<T>::gene(unsigned int, unsigned int, unsigned int, const 
T&)':
../ga/GA3DArrayGenome.h:66: error: `a' undeclared (first use this function)
../ga/GA3DArrayGenome.h: At global scope:
../ga/GA3DArrayGenome.h:139: error: `CONTENTS' was not declared in this 
scope
In file included from ../ga/GA3DArrayGenome.h:160,
                 from ../ga/ga.h:173,
                 from ex21.C:16:
../ga/GA3DArrayGenome.C: In member function `virtual int 
GA3DArrayGenome<T>::resize(int, int, int)':
../ga/GA3DArrayGenome.C:92: error: `sz' undeclared (first use this function)
../ga/GA3DArrayGenome.C: In constructor 
`GA3DArrayAlleleGenome<T>::GA3DArrayAlleleGenome(unsigned int, unsigned 
int, unsigned int, const GAAlleleSet<T>&, float (*)(GAGenome&), void*)':
../ga/GA3DArrayGenome.C:327: error: `ElementComparator' undeclared 
(first use this function)
../ga/GA3DArrayGenome.C:327: error: there are no arguments to 
`comparator' that depend on a template parameter, so a declaration of 
`comparator' must be available
../ga/GA3DArrayGenome.C:328: error: `OnePointCrossover' undeclared 
(first use this function)
../ga/GA3DArrayGenome.C:328: error: there are no arguments to 
`crossover' that depend on a template parameter, so a declaration of 
`crossover' must be available../ga/GA3DArrayGenome.C: In constructor 
`GA3DArrayAlleleGenome<T>::GA3DArrayAlleleGenome(unsigned int, unsigned 
int, unsigned int, const GAAlleleSetArray<T>&, float (*)(GAGenome&), 
void*)':
../ga/GA3DArrayGenome.C:344: error: `ElementComparator' undeclared 
(first use this function)
../ga/GA3DArrayGenome.C:344: error: there are no arguments to 
`comparator' that depend on a template parameter, so a declaration of 
`comparator' must be available
../ga/GA3DArrayGenome.C:345: error: `OnePointCrossover' undeclared 
(first use this function)
../ga/GA3DArrayGenome.C:345: error: there are no arguments to 
`crossover' that depend on a template parameter, so a declaration of 
`crossover' must be available../ga/GA3DArrayGenome.C: In member function 
`virtual int GA3DArrayAlleleGenome<T>::resize(int, int, int)':
../ga/GA3DArrayGenome.C:391: error: `nx' undeclared (first use this 
function)
../ga/GA3DArrayGenome.C:392: error: `ny' undeclared (first use this 
function)
../ga/GA3DArrayGenome.C:393: error: `nz' undeclared (first use this 
function)
../ga/GA3DArrayGenome.C:404: error: `a' undeclared (first use this function)
../ga/GA3DArrayGenome.C:429: error: `sz' undeclared (first use this 
function)
In file included from ../ga/GAListGenome.h:68,
                 from ../ga/ga.h:174,
                 from ex21.C:16:
../ga/GAListGenome.C: In member function `virtual int 
GAListGenome<T>::write(std::ostream&) const':
../ga/GAListGenome.C:84: error: `hd' undeclared (first use this function)
../ga/GAListGenome.C: In member function `virtual int 
GAListGenome<T>::equal(const GAGenome&) const':
../ga/GAListGenome.C:112: error: there are no arguments to `size' that 
depend on a template parameter, so a declaration of `size' must be available
In file included from ../ga/GATreeGenome.h:71,
                 from ../ga/ga.h:175,
                 from ex21.C:16:
../ga/GATreeGenome.C: In member function `virtual int 
GATreeGenome<T>::write(std::ostream&) const':
../ga/GATreeGenome.C:107: error: `rt' undeclared (first use this function)
../ga/GATreeGenome.C:107: error: no matching function for call to 
`_tt(std::ostream&, <type error>)'
../ga/GATreeGenome.C: In member function `virtual int 
GATreeGenome<T>::equal(const GAGenome&) const':
../ga/GATreeGenome.C:118: error: `rt' undeclared (first use this function)
In file included from ex21.C:18:
../ga/GAAllele.h: At global scope:
../ga/GAAllele.h: In instantiation of `GAAlleleSet<float>':
../ga/GARealGenome.C:22:   instantiated from here
../ga/GAAllele.h:147: error: template-id `operator==<float>' for `int 
operator==(const GAAlleleSet<float>&, const GAAlleleSet<float>&)' does 
not match any template declaration
../ga/GAAllele.h:148: error: template-id `operator!=<float>' for `int 
operator!=(const GAAlleleSet<float>&, const GAAlleleSet<float>&)' does 
not match any template declaration
ex21.C: In function `int main(int, char**)':
ex21.C:72: warning: comparison between signed and unsigned integer 
expressions
make[1]: *** [ex21.o] Error 1
make[1]: Leaving directory `/home/mark/.Trash/galib245/examples'
make: *** [all] Error 2



Any input would be greatly appriciated.
Many thanks,

Mark Hodgson
_______________________________________________
galib mailing list
galib at mit.edu
http://mailman.mit.edu/mailman/listinfo/galib






More information about the galib mailing list