# Conditional for release and snapshot builds. Uncomment for release-builds. #%%global rel_build 1 # Settings used for build from snapshots. %{!?rel_build:%global commit e380071f5a8a5d35c0b33ea0ab55810ef9845354} %{!?rel_build:%global commit_date 20140313} %{!?rel_build:%global shortcommit %(c=%{commit};echo ${c:0:7})} %{!?rel_build:%global gitver git%{commit_date}-%{shortcommit}} %{!?rel_build:%global gitrel .git%{commit_date}.%{shortcommit}} %{!?rel_build:%global gittar %{name}-%{version}-%{gitver}.tar.gz} # This is needed, because src-url contains branched part of versioning-scheme. %global branch 3.2 # Filter all provides from bindings and private libs. %global __provides_exclude_from ^(%{_libdir}/.*/.*%{name}\\.so|%{_libdir}/libmod%{name}.so) # There's no Python3 on older distributions. %if (0%{?fedora} && 0%{?fedora} <= 12) || (0%{?rhel} && 0%{?rhel} <= 6) %global without_python3 1 %endif # Some bindings are globally disabled by default, because they either FTBFS # or testsuite fails for them. We disable them here until they will build. %global without_perl 1 # not fully implemented by upstream,yet. %global without_r 1 # Testsuite chokes, build broken for R >= 3.0.0. # Mono-bindings are currently segfaulting during testsuite on arm. # See rhbz# 1043941: https://bugzilla.redhat.com/show_bug.cgi?id=1043941 # # Temporarily disabling the build of mono-shogun for all arm-arches. %ifarch %{arm} %global without_mono 1 %endif # Some switches to control build of SWIGed-bindings and testsuite. You still # can pass overriding defines `-D 'with_XXX 1'` or `-D 'without_XXX 1'` to # rpmbuild. %{!?without_cli: %global with_cli 1} %{!?without_java: %global with_java 1} %{!?without_lua: %global with_lua 1} %{!?without_mono: %global with_mono 1} %{!?without_octave: %global with_octave 1} %{!?without_perl: %global with_perl 1} %{!?without_python: %global with_python 1} %{!?without_python3: %global with_python3 1} %{!?without_r: %global with_r 1} %{!?without_ruby: %global with_ruby 1} %{!?without_tests: %global with_tests 1} # The description commonly used by all (sub-)packages. %global common_description \ The SHOGUN machine learning toolbox's focus is on large scale kernel methods \ 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 LibSVM. Each of the SVMs can be combined with a variety of \ kernels. The toolbox not only provides efficient implementations of the most \ common kernels, like the Linear, Polynomial, Gaussian and Sigmoid Kernel but \ also comes with a number of recent string kernels as e.g. the Locality \ Improved, Fischer, TOP, Spectrum, Weighted Degree Kernel (with shifts). For \ the latter the efficient LINADD optimizations are implemented. Also SHOGUN \ offers the freedom of working with custom pre-computed kernels. One of its \ key features is the "combined kernel" which can be constructed by a weighted \ linear combination of a number of sub-kernels, each of which not necessarily \ working on the same domain. An optimal sub-kernel weighting can be learned \ using Multiple Kernel Learning. Currently SVM 2-class classification and \ regression problems can be dealt with. However SHOGUN also implements a \ number of linear methods like Linear Discriminant Analysis (LDA), Linear \ Programming Machine (LPM), (Kernel) Perceptrons and features algorithms to \ train hidden Markov-models. The input feature-objects can be dense, sparse \ or strings and of type int/short/double/char and can be converted into \ different feature types. Chains of "pre-processors" (e.g. subtracting the \ mean) can be attached to each feature object allowing for on-the-fly \ pre-processing. \ \ This build comes WITHOUT support for Thorsten Joachim's `SVM^light`, because \ of it's 'no-redistribute', 'no-commercial-use' license. ############################################################################### Name: shogun Version: %{branch}.0.1 Release: 0.9%{?gitrel}%{?dist} Summary: Large Scale Machine Learning Toolbox # ===== License-breakdown ===== # # # GPLv3+ # ------ # * except the files explicitly named below # # # BSD (2 clause) # -------------- # src/shogun/lib/external/shogun_libsvm.cpp # src/shogun/lib/external/shogun_libsvm.h # src/shogun/optimization/liblinear/shogun_liblinear.cpp # src/shogun/optimization/liblinear/shogun_liblinear.h # src/shogun/optimization/liblinear/tron.cpp # src/shogun/optimization/liblinear/tron.h # # # BSD (3 clause) # -------------- # src/shogun/lib/external/SFMT/* src/shogun/lib/external/dSFMT/* # # # GPLv2+ # ------ # src/shogun/lib/external/ssl.cpp src/shogun/lib/external/ssl.h # src/shogun/mathematics/munkres.cpp src/shogun/mathematics/munkres.h # src/shogun/structure/DynProg.cpp # src/shogun/transfer/multitask/MultitaskKernelMaskNormalizer.h # src/shogun/transfer/multitask/MultitaskKernelMaskPairNormalizer.h # src/shogun/transfer/multitask/MultitaskKernelPlifNormalizer.h # src/shogun/transfer/multitask/MultitaskKernelTreeNormalizer.h # # # GPLv2+ or LGPLv2+ # ----------------- # src/shogun/multiclass/LaRank.cpp src/shogun/multiclass/LaRank.h # # # LGPLv2+ # ------- # src/shogun/classifier/svm/OnlineSVMSGD.cpp # src/shogun/classifier/svm/OnlineSVMSGD.h # src/shogun/classifier/svm/SGDQN.cpp src/shogun/classifier/svm/SGDQN.h # src/shogun/classifier/svm/SVMSGD.cpp src/shogun/classifier/svm/SVMSGD.h # src/shogun/lib/external/brent.cpp src/shogun/lib/external/brent.h # # # MIT/X11 (BSD like) # ------------------ # src/shogun/optimization/lbfgs/lbfgs.cpp # src/shogun/optimization/lbfgs/lbfgs.h # # License: GPLv3+ and BSD and GPLv2+ and (GPLv2+ or LGPLv2+) and GPLv3 and LGPLv2+ and MIT and (Public Domain or GPLv3+) URL: http://%{name}-toolbox.org # Sources for release-builds. %{?rel_build:Source0: %{url}/archives/%{name}/releases/%{branch}/sources/%{name}-%{version}.tar.bz2} # Sources for snapshot-builds. %{!?rel_build:Source0: https://github.com/%{name}-toolbox/%{name}/archive/%{commit}.tar.gz#/%{gittar}} Source98: light-scrubber.sh Source99: http://googlemock.googlecode.com/files/gmock-1.7.0.zip BuildRequires: arpack-devel BuildRequires: arprec-devel BuildRequires: atlas-devel BuildRequires: blas-devel BuildRequires: bzip2-devel BuildRequires: chrpath BuildRequires: ColPack-devel BuildRequires: glpk-devel BuildRequires: hdf5-devel BuildRequires: iputils BuildRequires: json-c-devel %if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 BuildRequires: lapack-devel %endif BuildRequires: libcurl-devel BuildRequires: libxml2-devel BuildRequires: lpsolve-devel BuildRequires: lzo-devel BuildRequires: NLopt-devel BuildRequires: protobuf-devel BuildRequires: qd-devel BuildRequires: %{name}-data BuildRequires: snappy-devel BuildRequires: tapkee-devel BuildRequires: xz-devel BuildRequires: zlib-devel %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: cmake BuildRequires: eigen3-devel BuildRequires: swig %else BuildRequires: cmake28 BuildRequires: eigen32-devel BuildRequires: swig2 %endif # testsuite BuildRequires: gdb BuildRequires: valgrind # copylib - Wildcard-exception granted by FPC. # See: https://fedorahosted.org/fpc/ticket/174 Provides: bundled(dSFMT) Provides: bundled(gnulib) Provides: bundled(liblinear) Provides: bundled(libsvm) Provides: bundled(SFMT) Provides: bundled(SVMlin) %description %{?common_description} SHOGUN is implemented in C++ and offers interfaces for: %{?with_cli: * CLI} %{?with_java: * Java} %{?with_lua: * Lua} %{?with_mono: * Mono (C#)} %{?with_octave: * Octave} %{?with_perl: * Perl} %{?with_python: * Python} %{?with_python3: * Python3} %{?with_r: * R} %{?with_ruby: * Ruby} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %doc README.md doc/md/LICENSE* %{_libdir}/lib%{name}.so.* ############################################################################### %if 0%{?with_cli} %package cli Summary: CLI-interface for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description cli %{?common_description} This package contains the CLI-interface for %{name}. %files cli %{_bindir}/%{name} %endif #0%{?with_cli} ############################################################################### %package devel Summary: Development files for %{name} Requires: arpack-devel%{?_isa} Requires: arprec-devel%{?_isa} Requires: atlas-devel%{?_isa} Requires: blas-devel%{?_isa} Requires: bzip2-devel%{?_isa} Requires: ColPack-devel%{?_isa} Requires: eigen3-devel Requires: glpk-devel%{?_isa} Requires: hdf5-devel%{?_isa} Requires: json-c-devel%{?_isa} %if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 BuildRequires: lapack-devel%{?_isa} %endif Requires: libcurl-devel%{?_isa} Requires: libxml2-devel%{?_isa} Requires: lpsolve-devel%{?_isa} Requires: lzo-devel%{?_isa} Requires: NLopt-devel%{?_isa} Requires: qd-devel%{?_isa} Requires: snappy-devel%{?_isa} Requires: tapkee-devel Requires: xz-devel%{?_isa} Requires: zlib-devel%{?_isa} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{?common_description} This package contains files needed for development with %{name}. %files devel %doc doc/md/README_developer.md doc/md/README_soname.md %{_includedir}/%{name} %{_libdir}/lib%{name}.so ############################################################################### %package doc # Do not check any files in docdir for Requires. %global __requires_exclude_from ^%{_docdir}/.*$ Summary: Documentation files for %{name} %{!?el5:BuildArch: noarch} %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: doxygen-latex BuildRequires: fdupes %else BuildRequires: doxygen BuildRequires: ghostscript BuildRequires: tex(latex) %endif BuildRequires: graphviz BuildRequires: texlive-appendix BuildRequires: texlive-lastpage BuildRequires: texlive-todonotes Requires: %{name}-data = %{_shogun_data_version} %description doc %{?common_description} This package contains the ChangeLog, a very detailed documentation, and some great examples for %{name}. %files doc %doc ChangeLog NEWS README* applications build/unittest*.log build/doc/html* %doc doc/examples doc/images doc/ipython-notebooks doc/md ############################################################################### %if 0%{?with_java} %package -n java-%{name} Summary: Java-plugin for %{name} BuildRequires: java-devel BuildRequires: jblas %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 Requires: java-headless %else Requires: java %endif #0%{?fedora} >= 20 || 0%{?rhel} >= 7 Requires: jblas%{?_isa} Requires: jpackage-utils Requires: %{name}%{?_isa} = %{version}-%{release} %description -n java-%{name} %{?common_description} This package contains the Java-plugin for %{name}. %files -n java-%{name} %{_jnidir}/* %{_libdir}/%{name}.java %endif #0%{?with_java} ############################################################################### %if 0%{?with_lua} %package -n lua-%{name} # http://fedoraproject.org/wiki/PackagingDrafts/Lua %{!?lua_ver: %global lua_ver %(lua -e 'print(string.sub(_VERSION, 5))' || echo 0)} %global lualibdir %{_libdir}/lua/%{lua_ver} %global luanext 5.2 Summary: LUA-plugin for %{name} BuildRequires: lua-devel Requires: lua%{?_isa} %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: lua(abi) = %{lua_ver} %else Requires: lua >= %{lua_ver} Requires: lua < %{luanext} %endif Requires: %{name}%{?_isa} = %{version}-%{release} %description -n lua-%{name} %{?common_description} This package contains the LUA-plugin for %{name}. %files -n lua-%{name} %{lualibdir}/libmod%{name}.so %endif #0%{?with_lua} ############################################################################### %if 0%{?with_mono} %ifarch %{mono_arches} %package -n mono-%{name} Summary: Mono(C#)-plugin for %{name} BuildRequires: mono-devel Requires: %{name}%{?_isa} = %{version}-%{release} %description -n mono-%{name} %{?common_description} This package contains the Mono(C#)-plugin for %{name}. %files -n mono-%{name} %{_libdir}/%{name}.mono %endif #ifarch %%{mono_arches} %endif #0%{?with_mono} ############################################################################### %if 0%{?with_octave} %package -n octave-%{name} # https://fedoraproject.org/wiki/Packaging:Octave %{!?octave_api: %global octave_api %(octave-config -p API_VERSION || echo 0)} %global octave_octdir %(octave-config -p LOCALAPIOCTFILEDIR || echo '') Summary: Octave-plugin for %{name} BuildRequires: octave-devel Requires: octave%{?_isa} >= 3.6 Requires: octave(api) = %{octave_api} Requires: %{name}%{?_isa} = %{version}-%{release} %description -n octave-%{name} %{?common_description} This package contains the Octave-plugin for %{name}. %files -n octave-%{name} %{octave_octdir}/%{name} %endif #0%{?with_octave} ############################################################################### %if 0%{?with_perl} %package -n perl-%{name} Summary: Perl-plugin for %{name} BuildRequires: perl-devel Requires: perl%{?_isa} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: %{name}%{?_isa} = %{version}-%{release} %description -n perl-%{name} %{?common_description} This package contains the Perl-plugin for %{name}. %files -n perl-%{name} %{perl_vendorarch}/* %exclude %dir %{perl_vendorarch}/auto %endif #0%{?with_perl} ############################################################################### %if 0%{?with_python} %package -n python-%{name} %{!?__python2: %global __python2 %{__python27}} %{!?python2_sitearch: %global python2_sitearch %{python27_sitearch}} %{!?python2_ver: %global python2_ver %(%{__python2} -c 'import platform; print platform.python_version();' || echo 0)} Summary: Python-plugin for %{name} %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: numpy BuildRequires: python-docutils BuildRequires: python-jinja2 BuildRequires: python2-devel BuildRequires: scipy Requires: numpy%{?_isa} Requires: python%{?_isa} Requires: scipy%{?_isa} %else BuildRequires: python27-numpy BuildRequires: python27-docutils BuildRequires: python27-jinja2 BuildRequires: python27-devel Requires: python27%{?_isa} Requires: python27-numpy%{?_isa} Requires: python27-scipy%{?_isa} %endif Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python-%{name} %{?common_description} This package contains the Python-plugin for %{name}. %files -n python-%{name} %{python2_sitearch}/* %endif #0%{?with_python} ############################################################################### %if 0%{?with_python3} %package -n python3-%{name} Summary: Python-plugin for %{name} BuildRequires: python3-devel BuildRequires: python3-docutils BuildRequires: python3-jinja2 BuildRequires: python3-numpy BuildRequires: python3-scipy Requires: python3%{?_isa} Requires: python3-numpy%{?_isa} Requires: python3-scipy%{?_isa} Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python3-%{name} %{?common_description} This package contains the Python3-plugin for %{name}. %files -n python3-%{name} %{python3_sitearch}/* %endif #0%{?with_python3} ############################################################################### %if 0%{?with_r} %package -n R-%{name} Summary: R-plugin for %{name} BuildRequires: R-core-devel Requires: R-core%{?_isa} Requires: %{name}%{?_isa} = %{version}-%{release} %description -n R-%{name} %{?common_description} This package contains the R-plugin for %{name}. %files -n R-%{name} %dir %{_libdir}/R/library/%{name} %doc %{_libdir}/R/library/%{name}/DESCRIPTION %doc %{_libdir}/R/library/%{name}/demo %{_libdir}/R/library/%{name}/libs %{_libdir}/R/library/%{name}/Meta %{_libdir}/R/library/%{name}/NAMESPACE %{_libdir}/R/library/%{name}/R %endif #0%{?with_r} ############################################################################### %if 0%{?with_ruby} %package -n ruby-%{name} # For compatibility with RHEL <= 6. %{!?ruby_vendorlibdir: %global ruby_vendorlibdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")} %{!?ruby_vendorarchdir: %global ruby_vendorarchdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitearchdir']")} # We need to pass the path for rubygem(narray) to CMake, so it can find it. %global narray_gem %(gem list narray | grep narray | sed -e's! .!-!' -e 's!.$!!') %global narray_include %{_datadir}/gems/gems/%{narray_gem} %if 0%{?fedora} || 0%{?rhel} >= 7 %global narray_lib %{_libdir}/gems/ruby/%{narray_gem}/narray.so %else %global narray_lib %{ruby_vendorarchdir}/narray.so %endif Summary: Ruby-plugin for %{name} BuildRequires: ruby-devel BuildRequires: rubygem-narray-devel %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 Requires: ruby(release) %else Requires: ruby(abi) = %{?rhel:1.8}%{!?rhel:1.9.1} %endif Requires: rubygem(narray)%{?_isa} Requires: %{name}%{?_isa} = %{version}-%{release} %description -n ruby-%{name} %{?common_description} This package contains the Ruby-plugin for %{name}. %files -n ruby-%{name} %{ruby_vendorarchdir}/mod%{name}.so %endif #0%{?with_ruby} ############################################################################### %prep %setup -q%{!?rel_build:n %{name}-%{commit}} # Scrub SVMlight. install -pm0755 %{SOURCE98} ./scripts/ ./scripts/light-scrubber.sh # Remove cluttering stuff and create some needed dirs. rm -rf %{py3dir} build data doc/tutorial third_party mkdir -p build third_party/GoogleMock # Unbundle Tapkee. This is pretty the same as we have in our repos. rm -rf doc/md/LICENSE_tapkee.md pushd src/shogun/lib/tapkee for _needed_sources in tapkee_shogun.* do sed -e 's!$!shogun/lib/&!g' \ < ${_needed_sources} > ${_needed_sources}.mod && \ touch -r ${_needed_sources} ${_needed_sources}.mod done rm -rf */ *.{cpp,h,hpp} for _needed_sources in tapkee_shogun.* do mv ${_needed_sources} `echo ${_needed_sources} | sed -e 's!\.mod$!!g'` done popd # Disable unwanted / overriding compiler-flags in release-mode, which would # set such stuff like "-march=native" or "-O3 -g0". sed -i -e 's!^[ \t]*[sS][eE][tT].*.*_FLAGS_RELEASE!#&!g' \ -e 's!^[ \t]*[sS][eE][tT].*-march=native!#&!g' \ CMakeLists.txt # Fix testsuite invocation for C#/Mono plugin. sed -i -e 's!\${CSHARP_INTERPRETER}!%(which mono)!g' \ examples/undocumented/csharp_modular/CMakeLists.txt # Fix finding PerlLibs and linking against HDF5. sed -i -e 's!FindPerlLibs REQUIRED!PerlLibs REQUIRED!' \ -e '/SET.HDF5_LIBRARIES/d' \ CMakeLists.txt # Fix install path for R-plugins. sed -i -e "s~\${R_COMPONENT_LIB_PATH}/shogun/Meta~`pwd`/test_install/&~g" \ -e "s~\.r-install.sh ~&`pwd`/test_install/~g" \ src/interfaces/r_modular/CMakeLists.txt # Fix testsuite environment for R. sed -i -e "s~^ENDFOREACH~\tset_property\\(TEST r_modular-\${EXAMPLE_NAME} PROPERTY\n\t\t\t\tENVIRONMENT \\\"R_LIBS_USER=\\\\\\\"`pwd`/test_install%{_libdir}/R/library\\\\\\\"\\\"\\)\n&~" \ examples/undocumented/r_modular/CMakeLists.txt # Ruby-plugins go to %%{ruby_vendorarchdir}, but on <= el6. %if 0%{?fedora} || 0%{?rhel} >= 7 sed -i -e 's!\${RUBY_SITE_ARCH_DIR}!\${RUBY_VENDORARCH_DIR}!g' \ src/interfaces/ruby_modular/CMakeLists.txt %endif # Fix testsuite environment for Ruby. sed -i -e "s!\${NARRAY_PATH}!%{narray_include}:&!" \ examples/undocumented/ruby_modular/CMakeLists.txt # Patch the Ruby-files to `require 'rubygems'` asap. for _file in `find . -depth -type f -name '*.rb'` do sed -i.orig -e "0,/^require/s//require \'rubygems\'\n&/" ${_file} && \ touch -r ${_file}.orig ${_file} && \ rm -rf ${_file}.orig done # This is needed for testsuite not to fail on some tests. echo "# noop" > examples/undocumented/python_modular/tools/__init__.py # Copy the other sources into tree. install -pm 0644 %{SOURCE99} third_party/GoogleMock # Copy data into proper location. cp -a %{_shogun_data_dir} data # Copy all stuff into %%{py3dir} for the Python3-build. cp -a . %{py3dir} # Patch doxy2swig to open files with utf-8 encoding on Python3. sed -i -e's!return open.source.!return open\(source, encoding="utf-8"\)!' \ %{py3dir}/src/.doxy2swig.py ############################################################################### %build # We need some UTF-8 encoding during build. export LANG="us_US.UTF-8" # These will be used for creation of CTest-files, only. There's no impact on # the built binaries caused by them. They are needed to be defined on %%build, # because CMake hardcodes them when creating the Makefiles and it's cache. # We need to export a customized PYTHONPATH. export PYTHONPATH="`pwd`/test_install/%{python2_sitearch}/%{name}" export PYTHONPATH="${PYTHONPATH}:`pwd`/test_install/%{python2_sitearch}" export PYTHONPATH="${PYTHONPATH}:$(pwd)/examples/undocumented/python_modular" export PYTHONPATH="${PYTHONPATH}:%{python2_sitearch}:%{python2_sitelib}" # We need to export some custom LD_LIBRARY_PATH for the tests, too. export LD_LIBRARY_PATH="`pwd`/test_install/%{_libdir}" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:%{_libdir}/atlas" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:%{_libdir}" pushd build %cmake \ -DCMAKE_BUILD_TYPE=Release \ %if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 -DATLAS_LIBRARIES=%{_libdir}/atlas/libtatlas.so \ %endif %{?with_tests: -DBUILD_DASHBOARD_REPORTS=ON } \ -DBUNDLE_EIGEN=OFF \ -DBUNDLE_NLOPT=OFF \ -DBUNDLE_JSON=OFF \ -DENABLE_CCACHE=OFF \ %{?with_tests: -DENABLE_TESTING=ON } \ -DUSE_SVMLIGHT=OFF \ %{?with_cli: -DCmdLineStatic=ON } \ %{?with_mono: -DCSharpModular=ON } \ %{?with_java: -DJavaModular=ON } \ %{?with_lua: -DLuaModular=ON } \ %{?with_ruby: -DRUBY_NARRAY_INCLUDE_DIR="%{narray_include}" } \ %{?with_ruby: -DRUBY_NARRAY_LIBRARY="%{narray_lib}" } \ %{?with_octave: -DOctaveModular=ON } \ %{?with_perl: -DPerlModular=ON } \ %{?with_python: -DPythonModular=ON } \ %{?with_python: -DPYTHON_EXECUTABLE="%{__python2}" } \ %{?with_r: -DRModular=ON } \ %{?with_ruby: -DRubyModular=ON } \ .. # Because of memory-limits (4 GBytes RAM / 4 GBytes swap) on Koji-workers we # cannot use `make %%{?_smp_mflags}`. A single make-thread needs to have # ~1.5 GBytes of RAM or swap avail. 5 * 1.5 = 7.5 is hard on the limit, so # we limit parallel-make to 3 threads = 4.5 GBytes. The actual thing consuming # these amounts of memory is not the build itself, but SWIG, which eats RAM # like chocolate, when creating cpp-src from those *.i ping -c1 mldata.org && \ make %{?_smp_mflags} || make -j3 popd # Build the Python3-version. %if 0%{?with_python3} export PYTHONPATH="`pwd`/test_install/%{python3_sitearch}/%{name}" export PYTHONPATH="${PYTHONPATH}:`pwd`/test_install/%{python3_sitearch}" export PYTHONPATH="${PYTHONPATH}:$(pwd)/examples/undocumented/python_modular" export PYTHONPATH="${PYTHONPATH}:%{python3_sitearch}:%{python3_sitelib}" pushd %{py3dir}/build %cmake \ -DCMAKE_BUILD_TYPE=Release \ %if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 -DATLAS_LIBRARIES=%{_libdir}/atlas/libtatlas.so \ %endif %{?with_tests: -DBUILD_DASHBOARD_REPORTS=ON } \ -DBUNDLE_EIGEN=OFF \ -DBUNDLE_NLOPT=OFF \ -DBUNDLE_JSON=OFF \ -DENABLE_CCACHE=OFF \ %{?with_tests: -DENABLE_TESTING=ON } \ -DUSE_SVMLIGHT=OFF \ -DPythonModular=ON \ -DPYTHON_EXECUTABLE=%{__python3} \ .. # Because of memory-limits (4 GBytes RAM / 4 GBytes swap) on Koji-workers we # cannot use `make %%{?_smp_mflags}`. A single make-thread needs to have # ~1.5 GBytes of RAM or swap avail. 5 * 1.5 = 7.5 is hard on the limit, so # we limit parallel-make to 3 threads = 4.5 GBytes. The actual thing consuming # these amounts of memory is not the build itself, but SWIG, which eats RAM # like chocolate, when creating cpp-src from those *.i ping -c1 mldata.org && \ make %{?_smp_mflags} || make -j3 popd %endif #0%{?with_python3} # Building the autodocs. pushd build make doc %{?_smp_mflags} %if 0%{?fedora} || 0%{?rhel} >= 7 pushd doc %fdupes . popd %endif popd ############################################################################### %install %{?el5:rm -rf %{buildroot}} # We install to custom location first. This will be needed by testsuite, too. export CUSTOM_INSTALL_DIR="`pwd`/test_install/" # Install the Python3-version first. %if 0%{?with_python3} pushd %{py3dir}/build make install DESTDIR=${CUSTOM_INSTALL_DIR} popd # Remove the installed headers and libshogun.so rm -rf ${CUSTOM_INSTALL_DIR}%{_includedir} \ ${CUSTOM_INSTALL_DIR}%{_libdir}/lib%{name}.so* %endif #0%{?with_python3} pushd build make install DESTDIR=${CUSTOM_INSTALL_DIR} popd %if 0%{?with_java} # Move Java-bindings to proper location. mkdir -p ${CUSTOM_INSTALL_DIR}%{_libdir}/%{name}.java \ ${CUSTOM_INSTALL_DIR}%{_jnidir} mv ${CUSTOM_INSTALL_DIR}%{_prefix}/lib/jni/libmod%{name}.so \ ${CUSTOM_INSTALL_DIR}%{_libdir}/%{name}.java mv ${CUSTOM_INSTALL_DIR}%{_javadir}/*.jar ${CUSTOM_INSTALL_DIR}%{_jnidir} %endif #0%{?with_java} %if 0%{?with_mono} # Move Mono(C#)-bindings to the proper location. mkdir -p ${CUSTOM_INSTALL_DIR}%{_libdir}/%{name}.mono mv ${CUSTOM_INSTALL_DIR}%{_prefix}/lib/cli/%{name}/*mod%{name}* \ ${CUSTOM_INSTALL_DIR}%{_libdir}/%{name}.mono %endif #0%{?with_mono} # Fix-up the permissions for some plugins. find ${CUSTOM_INSTALL_DIR} -depth -type f -name '*.so' -print0 | \ xargs -0 chmod -f 0755 # Copy the custom installation to %%{buildroot} for having an installed # version with rpaths preserved for the testsuite. cp -a ${CUSTOM_INSTALL_DIR}/. %{buildroot} # Kill rpath from binaries. find %{buildroot}%{_libdir} -depth -type f -perm 0755 -print0 | \ xargs -0 chrpath -d -k find %{buildroot}%{_bindir} -depth -type f -perm 0755 -print0 | \ xargs -0 chrpath -d -k # Copy examples to keep them prestine. Testsuite will clutter them. cp -a examples doc # Remove unneeded stuff, e.g. compiled examples in %%{buildroot}%%{_datadir}, # build-system files in examples and 0-size files in %%{buildroot}. rm -rf %{buildroot}%{_datadir}/%{name}/examples for _dir in '%{buildroot}' 'doc/examples' do find "${_dir}" -depth -type f -size 0 -print0 | xargs -0 rm -rf for _del in 'CMake*' 'Makefile*' '*.log' '*.sh' do find "${_dir}" -depth -type f -name "${_del}" -print0 | xargs -0 rm -rf done done for _del in '*.map' '*.md5' do find doc -depth -type f -name "${_del}" -print0 | xargs -0 rm -rf done # Add data to clean examples, because they need it to be run. for _dir in 'documented' 'undocumented' do unlink doc/examples/${_dir}/data ln -fs %{_datadir}/%{name}/data/toy doc/examples/${_dir}/data done # Make sure all files in examples have mode 0644. find doc/examples -depth -type f -print0 | xargs -0 chmod 0644 ############################################################################### %check %if 0%{?with_tests} # Disabled tests: # # * everything based on SVMlight EXCLUDE_FROM_TESTS=".*sv[mr]light.*|.*SV[MR]Light.*" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|.*-classifier_domainadaptationsvm_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|.*-mkl_binclass_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|python_modular-serialization_string_kernels_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-TDistributedStochasticNeighborEmbeddingTest" %if 0%{?__isa_bits} == 32 # * tests failing on 32-Bit arches because of misallignments EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-classifier_averaged_perceptron_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-classifier_multiclasslibsvm_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-classifier_svmocas_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-distance_cosine_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-distance_geodesic_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-distance_jensen_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-distance_sparseeuclidean_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_combined_custom_poly_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_histogram_word_string_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_poly_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_salzberg_word_string_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_sparse_poly_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_spline_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_wavelet_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-kernel_wave_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-preprocessor_normone_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-preprocessor_prunevarsubmean_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-regression_gaussian_process_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-regression_libsvr_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-serialization_complex_example" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-structure_multiclass_bmrm" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|libshogun-converter_multidimensionalscaling" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|python_modular-structure_multiclass_bmrm" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-CGMShiftedFamilySolver" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-CMath" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-IsomapTest" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-LinearTimeMMD" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-MMDKernelSelectionCombOpt" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-MMDKernelSelectionCombMaxL2" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-MMDKernelSelectionOpt" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|unit-SparseMatrixOperator" %endif #0%{?__isa_bits} == 32 %ifarch %{arm} # * tests failing on %%{arm} arches because of misallignments or timeouts EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-library_time" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-transfer_multitask_leastsquares_regression" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-library_fisher2x3_modular" EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|java_modular-kernel_auc_modular" %endif #ifarch %{arm} # * tests needing internet-connectivity ping -c1 mldata.org || \ EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|.*mldata.*" export EXCLUDE_FROM_TESTS pushd build # Unit && integration tests -- usual testsuite. ctest \ --exclude-regex "${EXCLUDE_FROM_TESTS}" \ --output-log unittest.log \ --output-on-failure popd %if 0%{?with_python3} %if 0%{?__isa_bits} == 32 # * tests failing on 32-Bit arches because of misallignments EXCLUDE_FROM_TESTS="${EXCLUDE_FROM_TESTS}|integration-python_modular-tester-mathematics_linsolver_cg" %endif #0%{?__isa_bits} == 32 pushd %{py3dir}/build # Unit && integration tests -- usual testsuite. ctest \ --exclude-regex "${EXCLUDE_FROM_TESTS}" \ --output-log unittest.py3.log \ --output-on-failure popd %endif #0%{?with_python3} %endif #0%{?with_tests} ############################################################################### %{?el5:%clean} %{?el5:rm -rf %{buildroot}} ############################################################################### %changelog * Thu Mar 13 2014 Björn Esser - 3.2.0.1-0.9.git20140313.e380071 - updated to new snapshot git20140313.e380071f5a8a5d35c0b33ea0ab55810ef9845354 * Thu Mar 13 2014 Björn Esser - 3.2.0.1-0.8.git20140312.d9c535e - updated to new snapshot git20140312.d9c535e85ed8dc61d537052a9abce200782b87b2 * Fri Mar 07 2014 Björn Esser - 3.2.0.1-0.7.git20140307.c281eaa - updated to new snapshot git20140307.c281eaaf51f44c16c9a7ded0678cbbac265714f6 * Wed Mar 05 2014 Björn Esser - 3.2.0.1-0.6.git20140305.9c67564 - updated to new snapshot git20140305.9c67564278abd5a13efe9ae016f8b3e01bf209f9 * Wed Mar 05 2014 Björn Esser - 3.2.0.1-0.5.git20140305.9b37dc1 - use new macros provided by shogun-data-pkg * Wed Mar 05 2014 Björn Esser - 3.2.0.1-0.4.git20140305.9b37dc1 - use `CMAKE_BUILD_TYPE=Release` for the Python3-version, too * Wed Mar 05 2014 Björn Esser - 3.2.0.1-0.3.git20140305.9b37dc1 - fixed year in git-snapshot-date * Wed Mar 05 2014 Björn Esser - 3.2.0.1-0.2.git20130305.9b37dc1 - updated to new snapshot git20130305.9b37dc1e630d54a9c16f2d19b6a10c34d8aef73a * Tue Mar 04 2014 Björn Esser - 3.2.0.1-0.1.git20130303.df06a0e - updated to new snapshot git20130303.df06a0e1a7e3551b0bee218246cfc4bf1a4696d8 * Tue Mar 04 2014 Björn Esser - 3.2.0-2 - require java-headless on Fedora >= 20 or RHEL >= 7 - exclude some tests on %%{arm} arches only * Sun Feb 23 2014 Björn Esser - 3.2.0-1 - new upstream release: v3.2.0 (#1066944) - enabled build of Java-bindings (#1043882) - enabled build of Python3-bindings (#1043884) - dropped Patch0 for Octave 3.8.0 (#1047053) - bumped required data-version to 0.8 (#1068941) - split-off scrubber-script to seperate script - exclude some tests on 32-Bit arches only * Wed Jan 08 2014 Orion Poplawski - 3.1.1-2 - Add patch for octave 3.8.0 support * Mon Jan 06 2014 Björn Esser - 3.1.1-1 - new upstream release: v3.1.1 - data-files are now moved into a separate package - added example-applications to doc-pkg * Sat Dec 28 2013 Björn Esser - 3.1.0-0.13.git20131226.1c7fbaa - rebuild for octave-3.8.0-rc2 * Thu Dec 26 2013 Björn Esser - 3.1.0-0.12.git20131226.1c7fbaa - updated to new snapshot git20131226.1c7fbaa732c8476b2df26bca2ae93de666959092 - updated to new testsuite-data git20131222.0bbb04f354a29ed3ab43ce002388b79bb274e886 * Fri Dec 20 2013 Björn Esser - 3.1.0-0.11.git20131219.207a709 - rebuild for NLopt-2.4.1 * Fri Dec 20 2013 Björn Esser - 3.1.0-0.10.git20131219.207a709 - rebuild for arprec-2.2.17 - added a line about `no-SVM^light-support` in %%description - minor indention improvements for the list of bindings in %%description - fixed `macro-in-comment %%{mono_arches}` - added %%ifarch %%{mono_arches} for mono-shogun-pkg for building it on those arches, only * Thu Dec 19 2013 Björn Esser - 3.1.0-0.9.git20131219.207a709 - updated to new snapshot git20131219.207a70972e794df28f0fc67309f217f7fbf3b4e7 * Tue Dec 17 2013 Björn Esser - 3.1.0-0.8.git20131217.70f2657 - copying and packaging the prestine examples to another location is better and less error-prone then removing the clutter left by testsuite afterwards * Tue Dec 17 2013 Björn Esser - 3.1.0-0.7.git20131217.70f2657 - remove more possible clutter from testsuite - re-enable mldata-based tests when there is internet connectivity * Tue Dec 17 2013 Björn Esser - 3.1.0-0.6.git20131217.70f2657 - updated to new snapshot git20131217.70f26573a501791e11097615296127c1c36904d7 * Tue Dec 17 2013 Björn Esser - 3.1.0-0.5.git20131216.7230f07 - temporarily disabled mono-shogun on all arm-arches * Tue Dec 17 2013 Björn Esser - 3.1.0-0.4.git20131216.7230f07 - enable build of mono-shogun, since it should be fixed in current checkout (#1043859) * Tue Dec 17 2013 Björn Esser - 3.1.0-0.3.git20131216.7230f07 - updated to new snapshot git20131216.7230f074751a97842170b8a5f9c69fbd9b8287ca * Tue Dec 17 2013 Björn Esser - 3.1.0-0.2.git20131212.70e774d - remove cluttering *.map *.md5 in autodocs (#1043856) - remove possible clutter from testsuite * Mon Dec 16 2013 Björn Esser - 3.1.0-0.1.git20131212.70e774d - updated to latest git-snapshot (#1043283) - disabled shogun-mono, because it segfaults currently and has some severe problems on ARMv7hl * Sun Dec 15 2013 Björn Esser - 3.0.0-1 - Initial rpm release (#1043283)