Skip to content

Commit

Permalink
Skip HDF5 code if RMF doesn't support it
Browse files Browse the repository at this point in the history
If RMF was built without deprecated backends,
we cannot use its HDF5 headers.
  • Loading branch information
benmwebb committed Jun 22, 2024
1 parent 374319d commit 8b7eb21
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
11 changes: 7 additions & 4 deletions modules/domino/include/assignment_containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
#include <cstdio>
#include <queue>

#if IMP_DOMINO_HAS_RMF
#include <RMF/HDF5/Group.h>
#include <RMF/HDF5/File.h>
#ifdef IMP_DOMINO_USE_IMP_RMF
# include <RMF/config.h>
# if RMF_HAS_DEPRECATED_BACKENDS
# include <RMF/HDF5/Group.h>
# include <RMF/HDF5/File.h>
# endif
#endif

#ifdef _MSC_VER
Expand Down Expand Up @@ -175,7 +178,7 @@ inline Assignment SampleAssignmentContainer::get_assignment(unsigned int i)
}
#endif

#if IMP_DOMINO_HAS_RMF || defined(IMP_DOXYGEN)
#if RMF_HAS_DEPRECATED_BACKENDS || defined(IMP_DOXYGEN)
//! Store the assignments in an HDF5DataSet.
/** Make sure to delete this container before trying to read from the
same data set (unless you pass the data set explicitly, in which
Expand Down
5 changes: 4 additions & 1 deletion modules/domino/include/interactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#include <IMP/statistics/metric_clustering.h>

#ifdef IMP_DOMINO_USE_IMP_RMF
#include <RMF/HDF5/Group.h>
# include <RMF/config.h>
# if RMF_HAS_DEPRECATED_BACKENDS
# include <RMF/HDF5/Group.h>
# endif
#endif

IMPDOMINO_BEGIN_NAMESPACE
Expand Down
10 changes: 7 additions & 3 deletions modules/domino/include/subset_scores.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
#include <IMP/log.h>
#include <boost/unordered_map.hpp>

#if IMP_DOMINO_HAS_RMF
#include <RMF/HDF5/Group.h>
#ifdef IMP_DOMINO_USE_IMP_RMF
# include <RMF/config.h>
# if RMF_HAS_DEPRECATED_BACKENDS
# include <RMF/HDF5/Group.h>
# endif
#endif


IMPDOMINO_BEGIN_NAMESPACE

/** Implement a cache for restraint scores as well as management of restraints
Expand Down Expand Up @@ -197,7 +201,7 @@ class IMPDOMINOEXPORT RestraintCache : public Object {

RestraintsTemp get_restraints() const;

#if IMP_DOMINO_HAS_RMF || defined(IMP_DOXYGEN)
#if RMF_HAS_DEPRECATED_BACKENDS || defined(IMP_DOXYGEN)
/** This assumes that restraints are always added to the cache
in the same order.
\param[in] particle_ordering An ordering for the particles.
Expand Down
5 changes: 4 additions & 1 deletion modules/domino/include/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
#include <IMP/statistics/metric_clustering.h>

#ifdef IMP_DOMINO_USE_IMP_RMF
#include <RMF/HDF5/Group.h>
# include <RMF/config.h>
# if RMF_HAS_DEPRECATED_BACKENDS
# include <RMF/HDF5/Group.h>
# endif
#endif

IMPKERNEL_BEGIN_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion modules/domino/src/assignment_containers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void SampleAssignmentContainer::add_assignment(const Assignment &a) {
}
}

#if IMP_DOMINO_HAS_RMF
#if RMF_HAS_DEPRECATED_BACKENDS
WriteHDF5AssignmentContainer::WriteHDF5AssignmentContainer(
RMF::HDF5::Group parent, const Subset &s,
const ParticlesTemp &all_particles, std::string name)
Expand Down
7 changes: 5 additions & 2 deletions modules/domino/src/subset_scores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
#include <IMP/domino/Order.h>
#include <IMP/input_output.h>
#ifdef IMP_DOMINO_USE_IMP_RMF
#include <RMF/HDF5/DataSetD.h>
# include <RMF/config.h>
# if RMF_HAS_DEPRECATED_BACKENDS
# include <RMF/HDF5/DataSetD.h>
# endif
#endif

IMPDOMINO_BEGIN_NAMESPACE
Expand Down Expand Up @@ -230,7 +233,7 @@ void RestraintCache::validate() const {
one for all the scores and one for the assignments.
*/
#if IMP_DOMINO_HAS_RMF
#if RMF_HAS_DEPRECATED_BACKENDS
namespace {
Ints get_ids(const boost::unordered_map<Particle *, int> &map,
const Subset &s) {
Expand Down

0 comments on commit 8b7eb21

Please sign in to comment.