%if 0%{?fedora} > 12 %define with_python3 1 %else %define with_python3 0 %endif %define with_mpich 1 # Change '#' to '%' in the line below if you want to build to install # somewhere other than the default /usr #define _prefix /usr/local Name: IMP Version: 2.10.0 Release: 1%{?dist} License: LGPLv2+ and GPLv3 Summary: The Integrative Modeling Platform Group: Applications/Engineering Packager: Ben Webb URL: https://integrativemodeling.org/ Source0: imp-%{version}.tar.gz %if 0%{?with_python3} BuildRequires: python3-devel, symlinks %endif BuildRequires: python-devel >= 2.6 # /usr/bin/python is provided by a separate package in recent Fedora %if 0%{?fedora} >= 29 BuildRequires: python-unversioned-command %endif BuildRequires: hdf5-devel >= 1.8 BuildRequires: swig >= 1.3.40 BuildRequires: gsl-devel, fftw-devel BuildRequires: zlib-devel, perl BuildRequires: ann-devel, eigen3-devel # Needed to build the cnmultifit module; obtain # from https://integrativemodeling.org/libTAU.html # (Or, if you don't need cnmultifit, you can comment out this line) BuildRequires: libTAU-devel # Need for npctransport module BuildRequires: protobuf-devel %if 0%{?fedora} Requires: python2-protobuf %else Requires: protobuf-python %endif BuildRequires: cmake >= 2.8 BuildRequires: boost-devel >= 1.41 # RHEL doesn't have a CGAL package, so build without CGAL on RHEL. It also # doesn't have a new enough OpenCV in the base distribution or in EPEL until # RHEL7, so disable the em2d module. # On Fedora, all of these packages are available; add them as dependencies %if 0%{?fedora} BuildRequires: CGAL-devel, opencv-devel %endif %if 0%{?rhel} >= 7 BuildRequires: opencv-devel %endif # If building in the Sali lab, pass '-D "RHEL_SALI_LAB 1"' to your rpmbuild # invocation. This will pull in our custom OpenCV (on RHEL6) and CGAL packages # and bundle the libraries with IMP. # If building outside of the lab and you still want these packages, get them # from https://integrativemodeling.org/build-extras/ %if 0%{?rhel} && 0%{?RHEL_SALI_LAB} %if 0%{?rhel} < 7 BuildRequires: opencv-nogui-devel %endif BuildRequires: CGAL-nogui-devel %if 0%{?rhel} < 7 %define bundled 'libcv\\.so\\|libcxcore\\.so\\|libhighgui.so\\|libTAU\\.so\\|libCGAL\\.so' %else %define bundled 'libTAU\\.so\\|libCGAL\\.so' %endif %else %define bundled 'libTAU\\.so' %endif # Many modules use Python's numpy and scipy modules, so pull those in # (at build time for tests; at install time for using the modules). BuildRequires: numpy, scipy Requires: numpy, scipy # RHEL 6 ships with Python 2.6, which doesn't have the argparse module, # so pull in the extra package that provides it %if 0%{?rhel} == 6 BuildRequires: python-argparse Requires: python-argparse %endif %define cmake_opts -DCMAKE_INSTALL_RPATH=%{_libdir}/IMP %if 0%{?rhel} == 6 %define mpiprefix %{nil} %else %define mpiprefix mpi/ %endif # Don't build debug source packages; they cause the build to fail with # error: Empty %files file [...]/debugsourcefiles.list %if 0%{?fedora} > 26 %undefine _debugsource_packages %endif %description IMP's broad goal is to contribute to a comprehensive structural characterization of biomolecules ranging in size and complexity from small peptides to large macromolecular assemblies. Detailed structural characterization of assemblies is generally impossible by any single existing experimental or computational method. This barrier can be overcome by hybrid approaches that integrate data from diverse biochemical and biophysical experiments (eg, x-ray crystallography, NMR spectroscopy, electron microscopy, immuno-electron microscopy, footprinting, chemical cross-linking, FRET spectroscopy, small angle X-ray scattering, immunoprecipitation, genetic interactions, etc...). We formulate the hybrid approach to structure determination as an optimization problem, the solution of which requires three main components: * the representation of the assembly, * the scoring function and * the optimization method. The ensemble of solutions to the optimization problem embodies the most accurate structural characterization given the available information. We created IMP, the Integrative Modeling Platform, to make it easier to implement such an integrative approach to structural and dynamics problems. IMP is designed to allow mixing and matching of existing modeling components as well as easy addition of new functionality. %package devel Group: Applications/Engineering Summary: Development package for IMP developers. Requires: %{name} = %{version}-%{release} Requires: gsl-devel, fftw-devel, zlib-devel Requires: ann-devel, eigen3-devel Requires: boost-devel, python-devel, hdf5-devel, protobuf-devel %if 0%{?fedora} Requires: CGAL-devel, opencv-devel %endif %if 0%{?rhel} >= 7 Requires: opencv-devel %endif %description devel This package contains the include files for building applications that link against IMP. %if 0%{?with_python3} %package python3 Group: Applications/Engineering Summary: Python wrappers for Python 3 Requires: %{name} = %{version}-%{release} Requires: python3 %if 0%{?fedora} Requires: python3-protobuf %endif %description python3 This package contains wrappers for Python 3 (the base package already includes Python 2 wrappers). %endif %define MPI_MODULES mpi spb %if 0%{?with_mpich} %package mpich Group: Applications/Engineering Summary: MPI module and dependents, for mpich Requires: %{name} = %{version}-%{release} Requires: mpich %if 0%{?fedora} Requires: python2-mpich %endif BuildRequires: mpich-devel %description mpich This package contains an IMP.mpi module to add MPI support, using the mpich library. It also includes all IMP modules that depend on IMP.mpi (IMP.spb). %package mpich-devel Group: Applications/Engineering Summary: MPI module and dependents development files, for mpich Requires: %{name}-mpich = %{version}-%{release} Requires: mpich %description mpich-devel Development files for IMP.mpi module (and dependents) with mpich. %endif %prep %setup -n imp-%{version} # Exclude bundled libraries from provides and requires %if 0%{?fedora} > 22 # In newer Fedora, the old script-based dependency generation doesn't play # nicely with the new mechanism for adding MPI dependencies # (rpm-mpi-hooks package) %if 0%{?with_mpich} %global __provides_exclude ^libTAU\\.so.*|libimp_mpi\\.so.*|libimp_spb\\.so.*$ %global __requires_exclude ^libTAU\\.so.*|libmpi\\.so.*|libmpicxx\\.so.*|libimp_mpi\\.so.*|libimp_spb\\.so.*$ %else %global __provides_exclude ^libTAU\\.so.*$ %global __requires_exclude ^libTAU\\.so.*$ %endif %else %define reqprog %{_builddir}/find-requires-%{name} %define proprog %{_builddir}/find-provides-%{name} cat < %{reqprog} #!/bin/bash %{__find_requires} $@ | grep -v %{bundled} exit $? EOF cat < %{proprog} #!/bin/bash %{__find_provides} $@ | grep -v %{bundled} exit $? EOF chmod a+x %{reqprog} chmod a+x %{proprog} %define _use_internal_dependency_generator 0 %define __find_requires %{reqprog} %define __find_provides %{proprog} %endif %build # For now, bundle RMF with IMP (long term, may be better to put in a separate # RPM) mkdir imp && mv * imp || : mkdir build && cd build %if 0%{?with_mpich} module load %{mpiprefix}mpich-%{_arch} %endif %if 0%{?fedora} >= 29 # Help cmake to find CGAL export CGAL_DIR=%{_libdir}/cmake/CGAL %endif cmake ../imp -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_DOCDIR=%{_prefix}/share/doc/%{name}-%{version} \ -DIMP_TIMEOUT_FACTOR=4 \ -DIMP_DISABLED_MODULES=scratch %{cmake_opts} # Normally make will stop at the first error. Since an RPM cannot be built # if the build did not complete successfully, this is the default here too. # Pass '-D "keep_going 1"' to your rpmbuild invocation if you want it to # keep going; we use this in nightly builds to see every broken module, # not just the first one. %if 0%{?keep_going} mkdir logs ../imp/tools/nightly-tests/build_all.py --run-tests=fast --ctest="ctest --output-on-failure" --outdir=logs --summary=logs/summary.pck "make -k" %else make %endif %if 0%{?with_mpich} module purge %endif %install cd build make DESTDIR=${RPM_BUILD_ROOT} install %if 0%{?with_python3} # Build Python 3 wrappers py2_ver=`python2 -c "import sys; print('%d.%d' % sys.version_info[:2])"` py3_ver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` py3_lib=`echo %{_libdir}/libpython3.*.so` py3_inc=`echo /usr/include/python3.*` %if 0%{?with_mpich} module load %{mpiprefix}mpich-%{_arch} %endif cmake ../imp \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_PYTHONDIR=%{_libdir}/python${py3_ver}/site-packages \ -DSWIG_PYTHON_LIBRARIES=${py3_lib} \ -DPYTHON_INCLUDE_DIRS=${py3_inc} \ -DPYTHON_INCLUDE_PATH=${py3_inc} \ -DPYTHON_LIBRARIES=${py3_lib} make DESTDIR=${RPM_BUILD_ROOT} install %if 0%{?with_mpich} module purge %endif # Don't build Python 3 MPI for now for mod in %{MPI_MODULES}; do rm -rf ${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/site-packages/IMP/${mod} rm -f ${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/site-packages/_IMP_${mod}.so done # Replace .py files with symlinks to Python 2 files (since they are the same) (cd ${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver} \ && find site-packages -name '*.py' \ -exec ln -sf ${RPM_BUILD_ROOT}%{_libdir}/python${py2_ver}/\{\} \{\} \; \ && symlinks -rc .) %endif # Put MPI-dependent libraries and binaries in mpich directories %if 0%{?with_mpich} (cd ${RPM_BUILD_ROOT}%{_libdir}/python2*/site-packages/ && mkdir mpich) (cd ${RPM_BUILD_ROOT}%{_libdir} && mkdir -p mpich/bin mpich/lib) (cd ${RPM_BUILD_ROOT}%{_bindir} && mv spb* ${RPM_BUILD_ROOT}%{_libdir}/mpich/bin) for mod in %{MPI_MODULES}; do (cd ${RPM_BUILD_ROOT}%{_libdir}/python2*/site-packages/ \ && mv _IMP_${mod}.so mpich/) (cd ${RPM_BUILD_ROOT}%{_libdir} && mv libimp_${mod}.so.* mpich/lib/) (cd ${RPM_BUILD_ROOT}%{_libdir} && rm libimp_${mod}.so \ && ln -sf mpich/lib/libimp_${mod}.so.* libimp_${mod}.so) done # Add MPI-dependent directory to Python search path %if 0%{?rhel} == 6 (cd ${RPM_BUILD_ROOT}%{_libdir}/python2*/site-packages && cat > imp-mpi.pth < ${README} # Direct nightly build users to most recent nightly build docs if echo ${version} | grep -q git; then echo "https://integrativemodeling.org/nightly/doc/manual/" >> ${README} else echo "https://integrativemodeling.org/%{version}/doc/manual/" >> ${README} fi # Bundle libTAU from build machine so users don't have to get it separately # (can't use %_libdir here since that is dependent on whatever we redefined # %_prefix to be, but dependent libraries are always in /usr) mkdir ${RPM_BUILD_ROOT}%{_libdir}/IMP cp /usr/%{_lib}/libTAU.so.1 ${RPM_BUILD_ROOT}%{_libdir}/IMP/ %if 0%{?rhel} && 0%{?RHEL_SALI_LAB} # Bundle OpenCV and CGAL libraries %if 0%{?rhel} < 7 for cvlib in cv cxcore highgui; do cp /usr/%{_lib}/lib${cvlib}.so.2.1 ${RPM_BUILD_ROOT}%{_libdir}/IMP/ done %endif cp /usr/%{_lib}/libCGAL.so.10 ${RPM_BUILD_ROOT}%{_libdir}/IMP/ %endif # Don't distribute example application, dependency, or system pydir=${RPM_BUILD_ROOT}%{_libdir}/python2*/site-packages rm -rf ${RPM_BUILD_ROOT}%{_prefix}/bin/example \ ${RPM_BUILD_ROOT}%{_libdir}/libimp_example_system* \ ${RPM_BUILD_ROOT}%{_libdir}/libexample* \ ${RPM_BUILD_ROOT}%{_prefix}/include/example* \ ${pydir}/IMP/example_system_local \ ${pydir}/_IMP_example_system_local.so # Make sure all Python applications use the same Python we built with perl -pi -e 's^#!.*python.*^#!/usr/bin/python^' ${RPM_BUILD_ROOT}%{_prefix}/bin/* %files %defattr(-,root,root) %doc %{_prefix}/share/doc/%{name}-%{version} %{_prefix}/share/IMP %{_prefix}/bin/* %{_libdir}/libimp*.so.* %{_libdir}/libRMF*.so %{_libdir}/IMP %{_libdir}/python2*/site-packages/IMP %{_libdir}/python2*/site-packages/_IMP*so %{_libdir}/python2*/site-packages/RMF* %{_libdir}/python2*/site-packages/_RMF*so %{_libdir}/python2*/site-packages/ihm %if 0%{?with_mpich} %exclude %{_prefix}/share/doc/%{name}-%{version}/examples/mpi %exclude %{_prefix}/share/IMP/swig/IMP_mpi.* %exclude %{_prefix}/share/IMP/swig/IMP_spb.* %exclude %{_prefix}/share/IMP/build_info/MPI %exclude %{_prefix}/share/IMP/build_info/IMP.mpi %exclude %{_prefix}/share/IMP/build_info/IMP_mpi.pck %exclude %{_prefix}/share/IMP/build_info/IMP.spb %exclude %{_prefix}/share/IMP/build_info/IMP_spb.pck %exclude %{_libdir}/python2*/site-packages/IMP/mpi %exclude %{_libdir}/python2*/site-packages/IMP/spb %endif %if 0%{?with_python3} %files python3 %defattr(-,root,root) %{_libdir}/python3*/site-packages/IMP %{_libdir}/python3*/site-packages/_IMP*so %{_libdir}/python3*/site-packages/RMF* %{_libdir}/python3*/site-packages/_RMF*so %{_libdir}/python3*/site-packages/ihm %{_libdir}/python3*/site-packages/__pycache__ %endif %if 0%{?with_mpich} %files mpich %defattr(-,root,root) %doc %{_prefix}/share/doc/%{name}-%{version}/examples/mpi %{_prefix}/share/IMP/swig/IMP_mpi.* %{_prefix}/share/IMP/swig/IMP_spb.* %{_prefix}/share/IMP/build_info/MPI %{_prefix}/share/IMP/build_info/IMP.mpi %{_prefix}/share/IMP/build_info/IMP_mpi.pck %{_prefix}/share/IMP/build_info/IMP.spb %{_prefix}/share/IMP/build_info/IMP_spb.pck %{_libdir}/python2*/site-packages/IMP/mpi %{_libdir}/python2*/site-packages/IMP/spb %if 0%{?rhel} == 6 %{_libdir}/python2*/site-packages/imp-mpi.pth %endif %{_libdir}/python2*/site-packages/mpich/_IMP_mpi.so %{_libdir}/python2*/site-packages/mpich/_IMP_spb.so %{_libdir}/mpich/lib/libimp_mpi.so.* %{_libdir}/mpich/lib/libimp_spb.so.* %{_libdir}/mpich/bin/spb* %files mpich-devel %defattr(-,root,root) %{_libdir}/libimp_mpi.so %{_libdir}/libimp_spb.so %{_prefix}/include/IMP/mpi %{_prefix}/include/IMP/spb %endif %files devel %defattr(-,root,root) %{_prefix}/include/IMP %{_prefix}/include/IMP.h %{_prefix}/include/RMF %{_libdir}/libimp*.so %if 0%{?with_mpich} %exclude %{_prefix}/include/IMP/mpi %exclude %{_prefix}/include/IMP/spb %exclude %{_libdir}/libimp_mpi.so %exclude %{_libdir}/libimp_spb.so %endif %changelog * Tue Jan 08 2019 Ben Webb 2.10.0-1 - 2.10.0 release. * Mon Jul 02 2018 Ben Webb 2.9.0-1 - 2.9.0 release. * Wed Aug 16 2017 Ben Webb 2.8.0-1 - 2.8.0 release. * Thu Apr 13 2017 Ben Webb 2.7.0-1 - 2.7.0 release. * Wed May 25 2016 Ben Webb 2.6.2-1 - 2.6.2 release. * Thu Apr 14 2016 Ben Webb 2.6.1-1 - 2.6.1 release. * Mon Mar 28 2016 Ben Webb 2.6.0-1 - 2.6.0 release. * Tue Jun 30 2015 Ben Webb 2.5.0-1 - 2.5.0 release. * Fri Feb 27 2015 Ben Webb 2.4.0-1 - 2.4.0 release. * Tue Dec 09 2014 Ben Webb 2.3.1-1 - 2.3.1 release. * Fri Oct 24 2014 Ben Webb 2.3.0-1 - 2.3.0 release. * Mon Aug 11 2014 Ben Webb 2.2.1-1 - 2.2.1 release. * Wed Apr 09 2014 Ben Webb 2.2.0-1 - 2.2.0 release. * Mon Nov 04 2013 Ben Webb 2.1.1-1 - 2.1.1 release. * Thu Oct 24 2013 Ben Webb 2.1.0-1 - 2.1.0 release. * Thu May 02 2013 Ben Webb 2.0.1-1 - 2.0.1 release. * Mon Apr 29 2013 Ben Webb 2.0.0-1 - 2.0.0 release. * Mon Mar 08 2010 Ben Webb 1.0-1 - 1.0 release. * Thu May 07 2009 Ben Webb - Initial build.