%if 0%{?fedora} > 12 %define with_python3 1 %else %define with_python3 0 %endif %if 0%{?rhel} == 5 %define with_mpich 0 %else %define with_mpich 1 %endif # 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.6.0 Release: 1%{?dist} License: LGPLv2+ and GPLv3 Summary: The Integrative Modeling Platform Group: Applications/Engineering Packager: Ben Webb URL: http://www.integrativemodeling.org/ Source0: imp-%{version}.tar.gz %if 0%{?rhel} == 5 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %endif %if 0%{?with_python3} BuildRequires: python3-devel, symlinks %endif # RHEL 5 ships with Python 2.4. We need Python 2.6 or later, so pull in that # from EPEL (note we need to tell the build later on where to find this python) # The HDF5 package in EPEL is too old though - we need a newer version # (which can be obtained from # http://integrativemodeling.org/build-extras/RHEL5/) %if 0%{?rhel} == 5 BuildRequires: python26-devel BuildRequires: hdf518-devel Requires: python26 %define apppython /usr/bin/python26 %else %define apppython /usr/bin/python BuildRequires: python-devel >= 2.6 BuildRequires: hdf5-devel >= 1.8 %endif # Note that RHEL 5 doesn't have a new enough swig to build IMP. If you must # use RHEL 5 (we recommend RHEL 6) you will need to build a newer SWIG package # before building IMP (or use ours, available at # http://integrativemodeling.org/build-extras/RHEL5/) BuildRequires: swig >= 1.3.40 BuildRequires: gsl-devel, fftw-devel BuildRequires: zlib-devel, perl BuildRequires: ann-devel # Needed to build the cnmultifit module; obtain # from https://salilab.org/imp/libTAU.html # (Or, if you don't need cnmultifit, you can comment out this line) BuildRequires: libTAU-devel # The cmake included with RHEL 5 is too old; use a newer cmake28 instead. # You will need to build this package yourself (or use ours, available at # http://integrativemodeling.org/build-extras/RHEL5/) %if 0%{?rhel} == 5 BuildRequires: cmake28 %define cmake cmake28 %define ctest ctest28 %else BuildRequires: cmake >= 2.8 %define cmake cmake %define ctest ctest %endif # RHEL 5 ships with an ancient version of boost. Require the newer version # that is in EPEL instead %if 0%{?rhel} == 5 BuildRequires: boost141-devel %define boost -DCMAKE_INCLUDE_PATH="/usr/include/boost141;/usr/include/hdf518/" -DCMAKE_LIBRARY_PATH="%{_libdir}/boost141;%{_libdir}/hdf518" %else BuildRequires: boost-devel >= 1.41 %define boost %{nil} %endif # 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 RHEL5/6) and CGAL packages # and bundle the libraries with IMP. # If building outside of the lab and you still want these packages, get them # from http://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} == 5 %ifarch x86_64 # Also bundle mpfr on 64-bit RHEL5 %define extralib \\|libmpfr\\.so %else # On 32-bit RHEL5, sometimes 'file' misidentifies libimp_domino.so or # other DSOs as a core file (not as a shared object) and doesn't add # it to the Provides - this results in a broken dependency. Work around # this by excluding it from the Requires too. %define extralib \\|libimp_domino\\.so\\|libimp_isd\\.so\\|libimp_integrative_docking\\.so %endif %else %define extralib %{nil} %endif %if 0%{?rhel} < 7 %define bundled 'libcv\\.so\\|libcxcore\\.so\\|libhighgui.so\\|libTAU\\.so\\|libCGAL\\.so%{extralib}' %else %define bundled 'libTAU\\.so\\|libCGAL\\.so%{extralib}' %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). # Note that the python26-numpy package in EPEL5 has been retired. %if 0%{?rhel} != 5 BuildRequires: numpy, scipy Requires: numpy, scipy %endif %define cmake_opts %{boost} -DCMAKE_INSTALL_RPATH=%{_libdir}/IMP %if 0%{?rhel} == 6 %define mpiprefix %{nil} %else %define mpiprefix mpi/ %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 %if 0%{?rhel} == 5 Requires: boost141-devel, python26-devel, hdf518-devel %else Requires: boost-devel, python-devel, hdf5-devel %endif %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 %description python3 This package contains wrappers for Python 3 (the base package already includes Python 2 wrappers). %endif %if 0%{?with_mpich} %package mpich Group: Applications/Engineering Summary: MPI module, for mpich Requires: %{name} = %{version}-%{release} Requires: mpich BuildRequires: mpich-devel %description mpich This package contains an IMP.mpi module to add MPI support, using the mpich library. %package mpich-devel Group: Applications/Engineering Summary: MPI module development files, for mpich Requires: %{name}-mpich = %{version}-%{release} Requires: mpich %description mpich-devel Development files for IMP.mpi module 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.*$ %global __requires_exclude ^libTAU\\.so.*|libimp_mpi\\.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 || : # On RHEL5, we need 'python' to be Python 2.6 %if 0%{?rhel} == 5 mkdir python-bin ln -sf /usr/bin/python26 python-bin/python PATH="`pwd`/python-bin:$PATH" %endif mkdir build && cd build %if 0%{?with_mpich} module load %{mpiprefix}mpich-%{_arch} %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 %if 0%{?rhel} == 5 PATH="`pwd`/python-bin:$PATH" %endif 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 rm -rf ${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/site-packages/IMP/mpi rm -f ${RPM_BUILD_ROOT}%{_libdir}/python${py3_ver}/site-packages/_IMP_mpi.so # 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 in mpich directories %if 0%{?with_mpich} (cd ${RPM_BUILD_ROOT}%{_libdir}/python2*/site-packages/ && mkdir mpich \ && mv _IMP_mpi.so mpich/) (cd ${RPM_BUILD_ROOT}%{_libdir} && mkdir mpich && mv libimp_mpi.so.* mpich) (cd ${RPM_BUILD_ROOT}%{_libdir} && rm libimp_mpi.so \ && ln -sf mpich/libimp_mpi.so.* libimp_mpi.so) %endif # Note that we currently don't include the documentation in the RPM, since # a) it takes a long time to run doxygen # b) doxygen isn't installed on all of our build systems # c) it is really big # and d) only certain versions of doxygen work correctly # You can build the documentation by running "make IMP-doc" # on the IMP source code. README=${RPM_BUILD_ROOT}%{_prefix}/share/doc/%{name}-%{version}/README echo "For full IMP documentation, please go to" > ${README} # Direct nightly build users to most recent nightly build docs if echo ${version} | grep -q git; then echo "http://integrativemodeling.org/nightly/doc/manual/" >> ${README} else echo "http://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/ # Also bundle mpfr on 64-bit RHEL5 %if 0%{?rhel} == 5 %ifarch x86_64 cp /usr/%{_lib}/libmpfr.so.1 ${RPM_BUILD_ROOT}%{_libdir}/IMP/ %endif %endif %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.*^#!%{apppython}^' ${RPM_BUILD_ROOT}%{_prefix}/bin/* %if 0%{?rhel} == 5 %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %endif %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 %if 0%{?with_mpich} %exclude %{_prefix}/share/doc/%{name}-%{version}/examples/mpi %exclude %{_prefix}/share/IMP/swig/IMP_mpi.* %exclude %{_prefix}/share/IMP/build_info/IMP.mpi %exclude %{_prefix}/share/IMP/build_info/IMP_mpi.pck %exclude %{_libdir}/python2*/site-packages/IMP/mpi %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/__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/build_info/IMP.mpi %{_prefix}/share/IMP/build_info/IMP_mpi.pck %{_libdir}/python2*/site-packages/IMP/mpi %{_libdir}/python2*/site-packages/mpich/_IMP_mpi.so %{_libdir}/mpich/libimp_mpi.so.* %files mpich-devel %defattr(-,root,root) %{_libdir}/libimp_mpi.so %{_prefix}/include/IMP/mpi %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 %{_libdir}/libimp_mpi.so %endif %changelog * 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.