Development | Getting Started

Matthew Rupp edited this page Jun 26, 2017 · 5 revisions
Clone this wiki locally

These instructions will guide you through the process of setting up tools, obtaining the source code, building the suite, and provide an overview of the source code structure.

Development Tools

Avida is a cross platform project designed to work on most POSIX-compliant systems, such as Linux, Mac OS X, Unix-variants, and Windows. You will need a development environment for your platform, such as GCC on Linux, Microsoft Visual Studio on Windows, and Apple Xcode on Mac OS X. The cross platform build system uses CMake, version 2.6 or greater, to generate platform specific build files. In order to obtain the source code, you will need a recent copy of Git.

Getting the Source Code

The Avida project uses multiple Git repositories to manage the source code. If you are new to Git, see Using Git for an overview of basic usage. When developing in Avida, you should always work from a working copy of the Git repository to ensure that you may stay up to date with recent changes. To clone the master Avida repository, move to the directory where you want to store the clone and run the following:

$ git clone https://github.com/devosoft/avida.git

Note, however, that the Avida project uses the Apto library linked as a submodule. You must initialize the submodule following the clone command above before you will be able to build the project:

$ cd avida
$ git submodule init
$ git submodule update

At this point you should be able to proceed to compiling.

Compiling

Unix Command Line - CMake

You will need a copy of CMake.

  1. At the top level of the source code run the ./build_avida script.
  • To compile the avida-viewer, use the flag -DAVD_GUI_NCURSES with ./build_avida
  • Change into the directory cbuild/work
  • The compiled executables (avida, avida-viewer), as well as the sample configuration files will be present in the work directory.
  • ### Mac OS X - Xcode
    1. Open the Avida.xcodeworkspace file in the top level of the source code.
    2. Select the avida build scheme in the top left of the workspace window.
    3. Select menu option Product > Archive
    4. "Distribute..." the archive, "Save Built Products"
    5. The archive contents will contain the executable in /usr/local/bin/avida and the example configuration files in /usr/local/share/avida

    Windows - Visual Studio

    1. Open the CMake GUI
    2. Select the top level avida source code directory for the "Where is the source code" option.
    3. Specify a director to build the project files and binaries. It is recommended that you create a new empty directory for this path.
    4. Select your desired development system (Visual Studio version), if prompted or necessary.
    5. Click Configure twice, then click Generate to generate the project files.
    6. Open the generated Visual Studio solution file that should now be in your build folder.
    7. Build the solution (build the install target, don't use build all).
    8. You should find a work directory in your build folder containing the avida.exe and default configuration files.
    Some other notes:
    1. In the options panel only APTO_LIB_SHARED, APTO_LIB_STATIC and AVD_CMDLINE should be 'On'. The viewer does not appear to build on Windows at the moment.
    2. Can't find the executable? Check the bin/DEBUG or bin/RELEASE directories.

    Project Structure

    The Avida project master repository has been organized in the structure described below. This overview should help locate where the sub-projects you are interested in may be found. See specific sub-project pages for further information.

    Applications - /apps
    Mac OS Viewer - /apps/viewer-macos
    Cocoa-based GUI application supporting Avida and Avida-ED
    Avida Core - /avida-core
    The avida-core and avida-viewer libraries. The heart of Avida.
    Libraries - /libs
    Apto - /libs/apto submodule
    Apto C++ tools library. Data structures and cross-platform support layer.

    Contributing to the Repositories

    There are two main ways to contribute code changes to the repositories of the Avida project. The community at large is encouraged to fork the repositories on GitHub and to submit pull requests as appropriate. More details about using GitHub is available on their site.

    Core developers who have been granted direct push access will need to utilize the authenticated remote repository path. The authenticated repository is git@github.com:devosoft/avida.git. If you are working from a standard clone of the source code, you may update your push URLs with the following commands:

    $ git remote set-url --push origin git@github.com:devosoft/avida.git