# $Id: Portfile 55126 2009-08-07 01:30:35Z jameskyle@macports.org $ PortSystem 1.0 categories math science name shogun version 0.7.3 maintainers jameskyle platforms darwin description The machine learning toolbox's focus is on large scale \ kernel methods long_description ${description} and especially on Support Vector Machines \ (SVM). It provides a generic SVM object interfacing to \ several different SVM implementations, among them the \ state of the art OCAS, LibSVM, SVMLight, SVMLin and GPDT. homepage http://www.shogun-toolbox.org/ master_sites http://shogun-toolbox.org/archives/shogun/releases/0.7/sources/ use_bzip2 yes distfiles shogun-${version}${extract.suffix} checksums md5 e3cb08aa05c1da78cd96d71ef97669b0 \ sha1 edad946b8ecbdf8e14f7de2ad54a95c4e2e72140 \ rmd160 bfe7e456505e5306dcf8818ee1c1074d8b8b05e9 worksrcdir ${name}-${version}/src depends_build port:bzip2 \ port:gsed \ port:gcc43 depends_lib port:swig \ port:atlas \ port:readline \ port:glpk configure.args --disable-svm-light \ --libs=${prefix}/lib \ --install-path=${prefix} \ --includes=${prefix}/include \ --destdir=${destroot} \ --cc=${prefix}/bin/gcc-mp-4.3 \ --cxx=${prefix}/bin/g++-mp-4.3 configure.cc ${prefix}/bin/gcc-mp-4.3 configure.compiler macports-gcc-4.3 patchfiles patch-src-configure.diff default_variants +python +glpk # Interfaces are added by a comma delimited argument list to --interfaces. # We check for variants and then build this list accordingly set interfaces "libshogun libshogunui cmdline" if {[variant_isset python]} {lappend interfaces "python,python_modular"} if {[variant_isset r]} {lappend interfaces "r"} if {[variant_isset octave]} {lappend interfaces "octave,octave_modular"} if {[variant_isset elwms] && !([variant_isset python] && [variant_isset octave] && [variant_isset r])} { return -code error "Must set python and both r and octave variants to build elwms interface" } elseif {[variant_isset elwms]} { lappend interfaces "elwms" } # disable glpk if variant is not set if {![variant_isset glpk]} { configure.args-append --disable-glpk depends_lib-delete port:glpk } #if {[variant_isset matlab]} {lappend interfaces "matlab"} set interfaces [join $interfaces ","] configure.args-append --interfaces=$interfaces variant elwms description {Build elwms interface. requires python plus one other interface} {} variant python description {Build Python API} { configure.args-append \ --includes=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 \ --python=${prefix}/bin/python2.5 depends_lib-append port:python25 \ port:py25-numpy } variant r description {Build the R API} { depends_lib-append port:R } variant octave description {Build the Octave API} { depends_lib-append port:octave } variant glpk description {Add support for the Gnu Linear Programming Kit} {} #variant matlab description {Build the Matlab API} {} variant doc description {Install the documentation for shogun} { depends_build-append port:texlive \ path:bin/dot:graphviz \ port:doxygen } pre-extract { # Before doing anything, verify the correct swig bindings are present for # our variants if {[variant_isset python]} { if {![file exists ${prefix}/share/swig/1.3.39/python/python.swg]} { ui_error "To install shogun with the python variant, swig must be installed with the python variant as well." return -code error "incompatible swig installation" } } if {[variant_isset r]} { if {![file exists ${prefix}/share/swig/1.3.39/r/r.swg]} { ui_error "To install shogun with the r variant, swig must be installed with the r variant as well." return -code error "incompatible swig installation" } } if {[variant_isset octave]} { if {![file exists ${prefix}/share/swig/1.3.39/octave/octave.swg]} { ui_error "To install shogun with the octave variant, swig must be installed with the octave variant as well." return -code error "incompatible swig installation" } } } post-patch { reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure } post-destroot { if {[variant_isset doc]} { system "cd ${worksrcpath}/../doc && make" file mkdir ${destroot}${prefix}/share/doc/${name} file copy ${worksrcpath}/../doc ${destroot}${prefix}/share/doc/${name}/doc } }