%define with_mpich 1 # Not yet functional %define with_openmpi 0 # 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.22.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 Patch1: imp-no-cnmultifit.patch BuildRequires: python3-devel BuildRequires: gcc-c++, hdf5-devel >= 1.8 BuildRequires: swig >= 3.0 BuildRequires: gsl-devel, fftw-devel BuildRequires: zlib-devel, sed, eigen3-devel, cereal-devel %if 0%{?fedora} || 0%{?rhel} <= 7 BuildRequires: ann-devel %endif # Need for npctransport module BuildRequires: protobuf-devel BuildRequires: python3-protobuf Requires: python3-protobuf BuildRequires: cmake >= 3.14 BuildRequires: boost-devel >= 1.53 BuildRequires: RMF-devel >= 1.6 BuildRequires: python3-ihm Requires: python3-ihm # Use CGAL and OpenCV if provided by the OS # (RHEL doesn't have a CGAL package; RHEL 7 and 8 have OpenCV, but it was # dropped in RHEL 9). %if 0%{?fedora} BuildRequires: CGAL-devel %endif %if 0%{?fedora} || (0%{?rhel} >= 7 && 0%{?rhel} <= 8) BuildRequires: opencv-devel %endif # On other systems, use our custom CGAL and OpenCV packages instead # from https://integrativemodeling.org/build-extras/ or Fedora COPR %if 0%{?rhel} %if 0%{?rhel} == 9 BuildRequires: opencv-nogui-devel %endif BuildRequires: CGAL-nogui-devel %endif # The IMP kernel links with numpy, so pull that in if available. Many modules # also use Python's scipy module, so pull that in (at build time for tests; # at install time for using the modules). BuildRequires: python3-numpy, python3-scipy Requires: python3-numpy, python3-scipy # Use user-visible (not "platform") Python on RHEL8 %if 0%{?rhel} >= 8 %define __python3 /usr/bin/python3 %endif %define mpiprefix mpi/ # Don't build debug source packages; they cause the build to fail with # error: Empty %files file [...]/debugsourcefiles.list %if 0%{?fedora} > 26 || 0%{?rhel} >= 8 %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, eigen3-devel, cereal-devel Requires: boost-devel, hdf5-devel, protobuf-devel, RMF-devel %if 0%{?fedora} || 0%{?rhel} <= 7 Requires: ann-devel %endif Requires: python3-devel, python3-ihm %if 0%{?fedora} Requires: CGAL-devel %endif %if 0%{?fedora} || (0%{?rhel} >= 7 && 0%{?rhel} <= 8) Requires: opencv-devel %endif %description devel This package contains the include files for building applications that link against IMP. %define MPI_MODULES mpi spb nestor %define MPI_CPP_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} || 0%{?rhel} >= 8 Requires: python3-mpich BuildRequires: python3-mpi4py-mpich %endif BuildRequires: mpich-devel # Need for nestor module BuildRequires: python3-pyyaml Requires: python3-pyyaml %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, IMP.nestor). %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 %if 0%{?with_openmpi} %package openmpi Group: Applications/Engineering Summary: MPI module and dependents, for openmpi Requires: %{name} = %{version}-%{release} Requires: openmpi %if 0%{?fedora} || 0%{?rhel} >= 8 Requires: python3-openmpi BuildRequires: python3-mpi4py-openmpi %endif BuildRequires: openmpi-devel # Need for nestor module BuildRequires: python3-pyyaml Requires: python3-pyyaml %description openmpi This package contains an IMP.mpi module to add MPI support, using the openmpi library. It also includes all IMP modules that depend on IMP.mpi (IMP.spb, IMP.nestor). %package openmpi-devel Group: Applications/Engineering Summary: MPI module and dependents development files, for openmpi Requires: %{name}-openmpi = %{version}-%{release} Requires: openmpi %description openmpi-devel Development files for IMP.mpi module (and dependents) with openmpi. %endif %prep %setup -n imp-%{version} # We don't build IMP.cnmultifit, so don't run the tests that require it %patch -P 1 -p1 %build mkdir imp && mv * imp || : mkdir build && cd build %if 0%{?with_mpich} module load %{mpiprefix}mpich-%{_arch} %endif %if 0%{?fedora} >= 29 && 0%{?fedora} < 32 # Help cmake to find CGAL export CGAL_DIR=%{_libdir}/cmake/CGAL %endif %if 0%{?fedora} == 32 export CGAL_DIR=/usr/share/CGAL/cmake %endif %if 0%{?fedora} >= 33 export CGAL_DIR=/usr/share/cmake/CGAL %endif # Workaround gcc -frounding-math bug; see # https://bugzilla.redhat.com/show_bug.cgi?id=2085189 %if 0%{?fedora} >= 36 CXXFLAGS="$CXXFLAGS -std=c++20" %endif cmake ../imp -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_DOCDIR=%{_prefix}/share/doc/%{name}-%{version} \ -DIMP_TIMEOUT_FACTOR=4 \ -DIMP_USE_SYSTEM_RMF=on -DIMP_USE_SYSTEM_IHM=on \ -DIMP_DISABLED_MODULES=scratch:cnmultifit # 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 python3 ../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 %{?_smp_mflags} %endif %if 0%{?with_mpich} module purge %endif %install cd build make %{?_smp_mflags} DESTDIR=%{buildroot} install # Put MPI-dependent libraries and binaries in mpich directories %if 0%{?with_mpich} (cd %{buildroot}%{_libdir}/python3*/site-packages/ && mkdir mpich) (cd %{buildroot}%{_libdir} && mkdir -p mpich/bin mpich/lib) (cd %{buildroot}%{_bindir} && mv spb* %{buildroot}%{_libdir}/mpich/bin) for mod in %{MPI_CPP_MODULES}; do (cd %{buildroot}%{_libdir}/python3*/site-packages/ \ && mv _IMP_${mod}.so mpich/) (cd %{buildroot}%{_libdir} && mv libimp_${mod}.so.* mpich/lib/) (cd %{buildroot}%{_libdir} && rm libimp_${mod}.so \ && ln -sf mpich/lib/libimp_${mod}.so.* libimp_${mod}.so) done %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=%{buildroot}%{_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 "https://integrativemodeling.org/nightly/doc/manual/" >> ${README} else echo "https://integrativemodeling.org/%{version}/doc/manual/" >> ${README} fi # Don't distribute example application or dependency rm -rf %{buildroot}%{_prefix}/bin/imp_example_app \ %{buildroot}%{_libdir}/libexample* \ %{buildroot}%{_prefix}/include/example* # Make sure all Python applications and build tools use the same Python # we built with sed -i -e 's@^#!.*python.*$@#!/usr/bin/python3@' %{buildroot}%{_prefix}/bin/* find %{buildroot}%{_prefix}/share/IMP/tools -name '*.py' -exec sed -i -e 's#/usr/bin/env python\b#/usr/bin/env python3#' \{\} \; %check defver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"` export IMP_DATA=%{buildroot}%{_prefix}/share/IMP export IMP_EXAMPLE_DATA=%{buildroot}%{_prefix}/share/doc/%{name}-%{version}/examples export LD_LIBRARY_PATH=%{buildroot}%{_libdir} export PATH=%{buildroot}%{_prefix}/bin:${PATH} # Don't use %{_arch} for MOCK_CONFIG because test_mock.py only checks for x86_64 # architecture (but the same check should work for, e.g., aarch64) %if 0%{?fedora} export MOCK_CONFIG=fedora-%{fedora}-x86_64 %else export MOCK_CONFIG=epel-%{rhel}-x86_64 %endif cd imp/tools/nightly-tests/test-install export PYTHONPATH=%{buildroot}%{_libdir}/python${defver}/site-packages python3 test.py -v python3 test_mock.py -v %files %defattr(-,root,root) %doc %{_prefix}/share/doc/%{name}-%{version} %{_prefix}/share/IMP %exclude %{_prefix}/share/IMP/tools %exclude %{_prefix}/share/IMP/swig %exclude %{_prefix}/share/IMP/build_info %{_prefix}/bin/* %{_libdir}/libimp*.so.* %{_libdir}/python3*/site-packages/IMP %{_libdir}/python3*/site-packages/_IMP*so %if 0%{?with_mpich} %exclude %{_prefix}/share/doc/%{name}-%{version}/examples/mpi %exclude %{_libdir}/python3*/site-packages/IMP/mpi %exclude %{_libdir}/python3*/site-packages/IMP/spb %exclude %{_libdir}/python3*/site-packages/IMP/nestor %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 %{_prefix}/share/IMP/build_info/IMP.nestor %{_prefix}/share/IMP/build_info/IMP_nestor.pck %{_libdir}/python3*/site-packages/IMP/mpi %{_libdir}/python3*/site-packages/IMP/spb %{_libdir}/python3*/site-packages/IMP/nestor %{_libdir}/python3*/site-packages/mpich/_IMP_mpi.so %{_libdir}/python3*/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}/share/IMP/tools %{_prefix}/share/IMP/swig %{_prefix}/share/IMP/build_info %if 0%{?with_mpich} %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 %{_prefix}/share/IMP/build_info/IMP.nestor %exclude %{_prefix}/share/IMP/build_info/IMP_nestor.pck %endif %{_prefix}/include/IMP %{_prefix}/include/IMP.h %{_libdir}/libimp*.so %{_libdir}/cmake/IMP %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 * Thu Dec 12 2024 Ben Webb 2.22.0-1 - 2.22.0 release. * Thu Jun 13 2024 Ben Webb 2.21.0-1 - 2.21.0 release. * Thu Apr 04 2024 Ben Webb 2.20.2-1 - 2.20.2 release. * Tue Jan 16 2024 Ben Webb 2.20.1-1 - 2.20.1 release. * Thu Dec 21 2023 Ben Webb 2.20.0-1 - 2.20.0 release. * Thu Jun 22 2023 Ben Webb 2.19.0-1 - 2.19.0 release. * Thu Dec 15 2022 Ben Webb 2.18.0-1 - 2.18.0 release. * Thu Jun 23 2022 Ben Webb 2.17.0-1 - 2.17.0 release. * Thu Dec 16 2021 Ben Webb 2.16.0-1 - 2.16.0 release. * Wed Jun 02 2021 Ben Webb 2.15.0-1 - 2.15.0 release. * Wed Dec 02 2020 Ben Webb 2.14.0-1 - 2.14.0 release. * Thu May 14 2020 Ben Webb 2.13.0-1 - 2.13.0 release. * Fri Dec 06 2019 Ben Webb 2.12.0-1 - 2.12.0 release. * Thu Jul 18 2019 Ben Webb 2.11.1-1 - 2.11.1 release. * Tue Jun 25 2019 Ben Webb 2.11.0-1 - 2.11.0 release. * Tue Feb 26 2019 Ben Webb 2.10.1-1 - 2.10.1 release. * 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.