27 February 1999, Produced by lobsterman <lobsterman@caspar.bgsu.edu>
This document describes the MacGSL CodeWarrior Port Package which allows compilation of the Genetic Simulation Library (developed by John Conery and Michael Lynch) and projects based on it with the Metrowerks CodeWarrior PowerPC compiler. The source code for GSL can be freely copied <http://www.csi.uoregon.edu/projects/genetics/GSL> and distributed subject to the constraints spelled out in the included copyright notice. Refer to the "*Readme_GSL" file for more information concerning the GSL. The source code of the Genetic Simulation Library itself was converted and updated. This has allowed us to compile the GSL source code into a library which you can include with your projects. Look for updates and support files to the MacGSL on lobsterman's webserver <http://caspar.bgsu.edu/~software/>.
Several changes to the GSL were necessary to get successfull compilation under Codewarrior:
- the Unix compiler allows the following construct in header files:
class foo; // tells the compiler "foo" is the name of a class
class bar {
...
foo x; // member x is of type foo
...
};
The UNIX compiler doesn't care that it doesn't yet know what a foo is -- it assumes that you will elaborate when you actually implement the class bar (i.e. it assumes "foo.h" will be included in bar.C). The Mac compiler doesn't like this. To fix this problem, we deleted the line
class ostream;
from near the top of six header files: genome.h, individual.h, infgenome.h, population.h, sparsegenome.h, and virtualgenome.h. This fix works because every C++ file in the library has a list of system include files before it includes any GSL header files. Thus by the time the compiler gets to a GSL include it has already read in <iostream.h> and knows what an ostream is.
- Unix-specific calls were replaced in rng.C, the random number generator module for getting the first random seed using the current clock setting, using the definition of pi from <fp.h>, and replaced "erand48()" with "erand()" calls.
To use the MacGSL CodeWarrior Port Package, you need the following items:
To port your own GSL-based projects to Codewarrior you may need to convert your source code to a form usable by the Metrowerks compilers.
Enclosed is the project file "GSL.mcp" for creating the library "libgen.a". All preferences are set properly for use with the GSL. Compile the GSL library by chosing "Make" from the "Project" menu.
Create a new empty Project File using the "Empty Project" stationary. Include the GSL library "libgen.a" and your project source files. Compile the application by chosing "Make" from the "Project" menu.
This port of the GSL is made available to you an an "as is" basis. No warranty is made, either express or implied, by statute or otherwise, regarding this package, its quality, its performance, its merchantability, or its fitness for any particular purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of this package or any of its contents.
Robert Huber (lobsterman@caspar.bgsu.edu), December, 1999