# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup               cmake 1.0
PortGroup               compilers 1.0

name                    eo
categories              science
license                 LGPL-2.1+
version                 1.3.1
revision                0
categories              science math
maintainers             openmaintainer {jochen @jokuha}
description             an evolutionary computation library
long_description        Evolving Objects (EO) is a templates-based, \
                        ANSI-C++ compliant evolutionary computation \
                        library. It contains classes for almost any \
                        kind of evolutionary computation you might \
                        come up with -- at least for the ones we could \
                        think of. It is component-based, so that if \
                        you don't find the class you need in it, it is \
                        very easy to subclass existing abstract or \
                        concrete classes.

homepage                http://eodev.sourceforge.net/
master_sites            sourceforge:eodev
distname                EO-${version}
use_zip                 yes
worksrcdir              eo
checksums               rmd160  d0882988b4e6debbe059bfd4183ced54bf0f2d1d \
                        sha256  230886e0c857a8497b2e1c892ff2bfa1d9d4115199d9267b3bdb89ff0f846850 \
                        size    4860892

depends_lib             port:gnuplot
#TODO: Add support for mpi, openmp, boost

post-extract {
    # Avoid conflict with standard string.h header on case-insensitive filesystems.
    # See https://github.com/torognes/vsearch/issues/91
    file rename ${worksrcpath}/src/serial/String.h ${worksrcpath}/src/serial/serial_String.h

    # DOS to UNIX line endings so we can patch.
    reinplace "s|\r||g" ${worksrcpath}/ConfigureChecks.cmake
}

patchfiles              ConfigureChecks.cmake.patch \
                        patch-src-utils-eoGnuplot1DSnapshot.h.diff \
                        rename-String.h.patch

configure.args-append   -DENABLE_CMAKE_TESTING:BOOL=ON

test.run                yes

compilers.choose        cc cxx
compilers.setup         -gcc44 -gcc45 -gcc46

#gcc44 gcc45 gcc46 dragonegg: cc1: error: unrecognized command line option "-arch"

# gcc, clang:  fails test 40 - t-eoIQRStat (Failed)

# caused by gcc use of -ftree-vectorize -march=native -O3
# if /opt/local/bin/g++-mp-4.4 -DHAVE_CONFIG_H -I. -I. -I../..   -I/opt/local/include -I../../src -pipe -Os -fpermissive -ftree-vectorize -march=native -O3 -MT make_genotype_real.o -MD -MP -MF ".deps/make_genotype_real.Tpo" -c -o make_genotype_real.o make_genotype_real.cpp; \
#         then mv -f ".deps/make_genotype_real.Tpo" ".deps/make_genotype_real.Po"; else rm -f ".deps/make_genotype_real.Tpo"; exit 1; fi
# {standard input}:807:no such instruction: `vmovsd (%r9), %xmm1'
# {standard input}:808:no such instruction: `vmovd %rbx, %xmm0'
# {standard input}:809:no such instruction: `vucomisd %xmm0, %xmm1'
# {standard input}:810:no such instruction: `vcmpnltsd %xmm1, %xmm0,%xmm2'
# {standard input}:813:no such instruction: `vandpd %xmm2, %xmm0,%xmm0'
# {standard input}:814:no such instruction: `vandnpd %xmm1, %xmm2,%xmm1'

# There is no longer an option (as there was in 1.0.1) to install applications
#variant applications {
#        license-append  GPL-2+
#        configure.args-append   --enable-applications
#        configure.args-delete   --disable-applications
#}
#

livecheck.distname   eo
