diff --git a/CMakeLists.txt b/CMakeLists.txt index 6240398ed..e2a074c2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,6 @@ option(RDK_BUILD_YAEHMOP_SUPPORT "build support for the YAeHMOP wrapper" OFF) option(RDK_BUILD_XYZ2MOL_SUPPORT "build in support for the RDKit's implementation of xyz2mol (in the DetermineBonds library)" OFF ) option(RDK_BUILD_STRUCTCHECKER_SUPPORT "build in support for the StructChecker alpha (not recommended, use the MolVS integration instead)" OFF ) option(RDK_BUILD_PUBCHEMSHAPE_SUPPORT "build the rdkit wrapper around pubchem-align3d" ON ) -option(RDK_USE_URF "Build support for Florian Flachsenberg's URF library" ON) option(RDK_INSTALL_DEV_COMPONENT "install libraries and headers" ON) option(RDK_USE_BOOST_IOSTREAMS "use boost::iostreams" ON) option(RDK_BUILD_MINIMAL_LIB "build the minimal RDKit wrapper (for the JS bindings)" OFF) @@ -240,13 +239,10 @@ if(RDK_BUILD_MAEPARSER_SUPPORT) include_directories(${RDKit_ExternalDir}) endif() -if(RDK_USE_URF) - add_definitions(-DRDK_USE_URF) - if((MSVC AND (NOT RDK_INSTALL_DLLS_MSVC)) OR ((NOT MSVC) AND WIN32 AND RDK_INSTALL_STATIC_LIBS)) +if((MSVC AND (NOT RDK_INSTALL_DLLS_MSVC)) OR ((NOT MSVC) AND WIN32 AND RDK_INSTALL_STATIC_LIBS)) add_definitions(-DRDL_WIN_STATIC) - endif() - include_directories(${RDKit_ExternalDir}/RingFamilies/RingDecomposerLib/src/RingDecomposerLib) endif() +include_directories(${RDKit_ExternalDir}/RingFamilies/RingDecomposerLib/src/RingDecomposerLib) if(RDK_BUILD_XYZ2MOL_SUPPORT) add_definitions(-DRDK_BUILD_XYZ2MOL_SUPPORT) diff --git a/Code/GraphMol/CMakeLists.txt b/Code/GraphMol/CMakeLists.txt index f7ff05f2b..29342c89c 100644 --- a/Code/GraphMol/CMakeLists.txt +++ b/Code/GraphMol/CMakeLists.txt @@ -12,11 +12,10 @@ rdkit_library(GraphMol SHARED LINK_LIBRARIES RDGeometryLib RDGeneral) target_compile_definitions(GraphMol PRIVATE RDKIT_GRAPHMOL_BUILD) -if (RDK_USE_URF) - target_link_libraries(GraphMol PUBLIC ${RDK_URF_LIBS}) - if (RDK_INSTALL_STATIC_LIBS AND NOT RDK_BUILD_STATIC_LIBS_ONLY) + +target_link_libraries(GraphMol PUBLIC ${RDK_URF_LIBS}) +if (RDK_INSTALL_STATIC_LIBS AND NOT RDK_BUILD_STATIC_LIBS_ONLY) target_link_libraries(GraphMol_static PUBLIC ${RDK_URF_LIBS}_static) - endif () endif () rdkit_headers(Atom.h diff --git a/Code/GraphMol/FindRings.cpp b/Code/GraphMol/FindRings.cpp index 3622c134c..bd2fbef2c 100644 --- a/Code/GraphMol/FindRings.cpp +++ b/Code/GraphMol/FindRings.cpp @@ -1157,7 +1157,6 @@ void fastFindRings(const ROMol &mol) { FindRings::storeRingsInfo(mol, res); } -#ifdef RDK_USE_URF void findRingFamilies(const ROMol &mol, bool includeDativeBonds, bool includeHydrogenBonds) { if (mol.getRingInfo()->isInitialized()) { @@ -1214,13 +1213,6 @@ void findRingFamilies(const ROMol &mol, bool includeDativeBonds, free(edges); } } -#else -void findRingFamilies(const ROMol &mol, bool includeDativeBonds, - bool includeHydrogenBonds) { - BOOST_LOG(rdErrorLog) - << "This version of the RDKit was built without URF support" << std::endl; -} -#endif } // namespace MolOps } // namespace RDKit diff --git a/Code/GraphMol/RingInfo.cpp b/Code/GraphMol/RingInfo.cpp index ea22ba17f..06a0aeac6 100644 --- a/Code/GraphMol/RingInfo.cpp +++ b/Code/GraphMol/RingInfo.cpp @@ -267,7 +267,6 @@ void RingInfo::initFusedRings() { } } -#ifdef RDK_USE_URF unsigned int RingInfo::numRingFamilies() const { PRECONDITION(df_init, "RingInfo not initialized"); return d_atomRingFamilies.size(); @@ -288,7 +287,6 @@ unsigned int RingInfo::addRingFamily(const INT_VECT &atomIndices, return rdcast(d_atomRingFamilies.size()); } -#endif void RingInfo::initialize(RDKit::FIND_RING_TYPE ringType) { df_init = true; @@ -304,10 +302,9 @@ void RingInfo::reset() { d_bondMembers.clear(); d_atomRings.clear(); d_bondRings.clear(); -#ifdef RDK_USE_URF + d_atomRingFamilies.clear(); d_bondRingFamilies.clear(); -#endif } void RingInfo::preallocate(unsigned int numAtoms, unsigned int numBonds) { d_atomMembers.resize(numAtoms); diff --git a/Code/GraphMol/RingInfo.h b/Code/GraphMol/RingInfo.h index d8bd33c6f..33764ff1a 100644 --- a/Code/GraphMol/RingInfo.h +++ b/Code/GraphMol/RingInfo.h @@ -15,13 +15,9 @@ #include #include #include -#ifdef RDK_USE_URF #include -#endif #include -#ifdef RDK_USE_URF #include -#endif namespace RDKit { //! A class to store information about a molecule's rings @@ -270,7 +266,6 @@ class RDKIT_GRAPHMOL_EXPORT RingInfo { */ std::vector fusedRingNeighbors(unsigned int ringIdx); -#ifdef RDK_USE_URF //! adds a ring family to our data /*! \param atomIndices the integer indices of the atoms involved in the @@ -317,7 +312,6 @@ class RDKIT_GRAPHMOL_EXPORT RingInfo { //! check if the ring families have been initialized bool areRingFamiliesInitialized() const { return dp_urfData != nullptr; } -#endif //! @} @@ -333,10 +327,8 @@ class RDKIT_GRAPHMOL_EXPORT RingInfo { std::vector> d_fusedRings; std::vector d_numFusedBonds; -#ifdef RDK_USE_URF public: boost::shared_ptr dp_urfData; -#endif }; } // namespace RDKit diff --git a/Code/GraphMol/Wrap/MolOps.cpp b/Code/GraphMol/Wrap/MolOps.cpp index 339168db4..d60bbc589 100644 --- a/Code/GraphMol/Wrap/MolOps.cpp +++ b/Code/GraphMol/Wrap/MolOps.cpp @@ -1322,7 +1322,6 @@ struct molops_wrapper { python::def("FastFindRings", MolOps::fastFindRings, docString.c_str(), python::args("mol")); -#ifdef RDK_USE_URF docString = "Generate Unique Ring Families.\n\ \n\ @@ -1338,7 +1337,6 @@ struct molops_wrapper { (python::args("mol"), python::arg("includeDativeBonds") = false, python::arg("includeHydrogenBonds") = false), docString.c_str()); -#endif // ------------------------------------------------------------------------ docString = R"DOC(Parameters controlling H addition.)DOC"; diff --git a/Code/GraphMol/Wrap/RingInfo.cpp b/Code/GraphMol/Wrap/RingInfo.cpp index 6df70e992..77d16106d 100644 --- a/Code/GraphMol/Wrap/RingInfo.cpp +++ b/Code/GraphMol/Wrap/RingInfo.cpp @@ -46,7 +46,6 @@ python::object bondRingSizes(const RingInfo *self, unsigned int idx) { return python::tuple(self->bondRingSizes(idx)); } -#ifdef RDK_USE_URF python::object atomRingFamilies(const RingInfo *self) { python::list res; for (const auto &ring : self->atomRingFamilies()) { @@ -61,7 +60,6 @@ python::object bondRingFamilies(const RingInfo *self) { } return python::tuple(res); } -#endif void addRing(RingInfo *self, python::object atomRing, python::object bondRing) { unsigned int nAts = boost::python::len(atomRing); @@ -121,7 +119,6 @@ struct ringinfo_wrapper { .def("BondMembers", bondMembers, python::args("self", "idx")) .def("AtomRingSizes", atomRingSizes, python::args("self", "idx")) .def("BondRingSizes", bondRingSizes, python::args("self", "idx")) -#ifdef RDK_USE_URF .def("NumRingFamilies", &RingInfo::numRingFamilies, python::args("self")) .def("NumRelevantCycles", &RingInfo::numRelevantCycles, @@ -130,7 +127,6 @@ struct ringinfo_wrapper { .def("BondRingFamilies", bondRingFamilies, python::args("self")) .def("AreRingFamiliesInitialized", &RingInfo::areRingFamiliesInitialized, python::args("self")) -#endif .def("AddRing", addRing, (python::arg("self"), python::arg("atomIds"), python::arg("bondIds")), diff --git a/Code/GraphMol/catch_molops.cpp b/Code/GraphMol/catch_molops.cpp index 605097620..c999479cb 100644 --- a/Code/GraphMol/catch_molops.cpp +++ b/Code/GraphMol/catch_molops.cpp @@ -681,7 +681,6 @@ TEST_CASE("Github #8945") { } } -#ifdef RDK_USE_URF TEST_CASE("Test findRingFamilies") { SECTION("basic check") { auto m = R"SMI(c1ccc2c(c1)C3CC3C4CC5CC4CC25)SMI"_smiles; @@ -770,4 +769,3 @@ TEST_CASE("Test findRingFamilies") { CHECK(r->bondRingFamilies().size() == numRings); } } -#endif diff --git a/Code/GraphMol/molopstest.cpp b/Code/GraphMol/molopstest.cpp index 9194059ec..c5107d219 100644 --- a/Code/GraphMol/molopstest.cpp +++ b/Code/GraphMol/molopstest.cpp @@ -7754,7 +7754,6 @@ M END)CTAB"; REQUIRE(v86.dotProduct(v16) < -1e-4); } -#ifdef RDK_USE_URF TEST_CASE("Testing ring family calculation") { { constexpr const char *smiles = "C(C1C2C3C41)(C2C35)C45"; // cubane @@ -7799,7 +7798,6 @@ TEST_CASE("Testing ring family calculation") { delete m; } } -#endif TEST_CASE("Testing adding coordinates to a terminal atom") { auto mol = R"CTAB( diff --git a/Code/JavaWrappers/CMakeLists.txt b/Code/JavaWrappers/CMakeLists.txt index 0e52142e2..50a9ddccc 100644 --- a/Code/JavaWrappers/CMakeLists.txt +++ b/Code/JavaWrappers/CMakeLists.txt @@ -37,9 +37,7 @@ set(swigRDKitLibList "${swigRDKitLibList}" "ForceFieldHelpers;ForceField;EigenSolvers;Optimizer;MolAlign;O3AAlign;" "Alignment;SimDivPickers;RDGeometryLib;RDStreams;RDGeneral;" ) -if(RDK_USE_URF) - set(swigRDKitLibList "${swigRDKitLibList};${RDK_URF_LIBS};") -endif(RDK_USE_URF) +set(swigRDKitLibList "${swigRDKitLibList};${RDK_URF_LIBS};") set(swigRDKitLibs "") foreach(swigRDKitLib ${swigRDKitLibList}) set(swigRDKitLibs "${swigRDKitLibs}${swigRDKitLib}${swigRDKitLibSuffix};") diff --git a/Code/MinimalLib/CMakeLists.txt b/Code/MinimalLib/CMakeLists.txt index e44bc67b3..785c55cde 100644 --- a/Code/MinimalLib/CMakeLists.txt +++ b/Code/MinimalLib/CMakeLists.txt @@ -61,9 +61,7 @@ if(RDK_BUILD_CFFI_LIB) add_definitions(-DRDK_BUILD_INCHI_SUPPORT) list(APPEND LIBS_TO_USE RDInchiLib) endif() - if(RDK_URF_LIBS) - list(APPEND LIBS_TO_USE RingDecomposerLib) - endif() + list(APPEND LIBS_TO_USE RingDecomposerLib) if(RDK_CFFI_STATIC AND ((NOT WIN32) OR (WIN32 AND RDK_INSTALL_DLLS_MSVC))) set(staticLibSuffix "_static") diff --git a/Code/PgSQL/rdkit/CMakeLists.txt b/Code/PgSQL/rdkit/CMakeLists.txt index 1e517dff2..d7524cd23 100644 --- a/Code/PgSQL/rdkit/CMakeLists.txt +++ b/Code/PgSQL/rdkit/CMakeLists.txt @@ -143,9 +143,7 @@ set(pgRDKitLibList "${pgRDKitLibList}" "FileParsers;SmilesParse;Fingerprints;Subgraphs;Descriptors;" "PartialCharges;SubstructMatch;GraphMol;EigenSolvers;DataStructs;Depictor;" "RDGeometryLib;RDGeneral") -if(RDK_USE_URF) - set(pgRDKitLibList "${pgRDKitLibList};${RDK_URF_LIBS}") -endif(RDK_USE_URF) +set(pgRDKitLibList "${pgRDKitLibList};${RDK_URF_LIBS}") set (pgRDKitLibs "") foreach(pgRDKitLib ${pgRDKitLibList}) if (NOT pgRDKitLibs STREQUAL "") diff --git a/Code/RDGeneral/RDConfig.h.cmake b/Code/RDGeneral/RDConfig.h.cmake index 741468fef..b8825fe8c 100644 --- a/Code/RDGeneral/RDConfig.h.cmake +++ b/Code/RDGeneral/RDConfig.h.cmake @@ -40,8 +40,6 @@ #cmakedefine RDK_BUILD_FREETYPE_SUPPORT -#cmakedefine RDK_USE_URF - #cmakedefine RDK_BUILD_YAEHMOP_SUPPORT #cmakedefine RDK_BUILD_XYZ2MOL_SUPPORT diff --git a/External/RingFamilies/CMakeLists.txt b/External/RingFamilies/CMakeLists.txt index 08dd1fe04..d12bf3b92 100644 --- a/External/RingFamilies/CMakeLists.txt +++ b/External/RingFamilies/CMakeLists.txt @@ -1,9 +1,5 @@ add_custom_target(ringdecomposerlib_support ALL) -if(NOT RDK_USE_URF) - return() -endif(NOT RDK_USE_URF) - if(NOT DEFINED URFLIB_DIR) set(URFLIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/RingDecomposerLib/src/RingDecomposerLib") endif() @@ -25,7 +21,6 @@ set(urflib_INCLUDE_DIRS ${URFLIB_DIR} CACHE STRING "RingDecomposerLib Include Dir" FORCE) file(GLOB URFSOURCES "${URFLIB_DIR}/*.c") -#if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32 AND (NOT RDK_INSTALL_STATIC_LIBS))) if(WIN32) set (ringdecomposerlib_h ${URFLIB_DIR}/RingDecomposerLib.h) file(READ ${ringdecomposerlib_h} ringdecomposerlib_h_data) @@ -35,6 +30,7 @@ if(WIN32) file(WRITE ${ringdecomposerlib_h} "${ringdecomposerlib_h_data}") endif() endif() + rdkit_library(RingDecomposerLib ${URFSOURCES} SHARED) if((MSVC AND RDK_INSTALL_DLLS_MSVC) OR ((NOT MSVC) AND WIN32 AND (NOT RDK_INSTALL_STATIC_LIBS))) target_compile_definitions(RingDecomposerLib PRIVATE RDKIT_URFLIB_BUILD) diff --git a/Scripts/patch_rdkit_docstrings/__init__.py b/Scripts/patch_rdkit_docstrings/__init__.py index 43f0f1384..73d0951e5 100644 --- a/Scripts/patch_rdkit_docstrings/__init__.py +++ b/Scripts/patch_rdkit_docstrings/__init__.py @@ -1295,7 +1295,6 @@ class FixSignatures: DEFINE_RDK_REGEX = re.compile(r"^\s*#define\s+(RDK_\S+)\s*$") INCLUDE_PATH_BY_DEFINITION = { "RDK_BUILD_COORDGEN_SUPPORT": ["External", "CoordGen"], - "RDK_USE_URF": ["External", "RingFamilies", "RingDecomposerLib", "src", "RingDecomposerLib"], "RDK_HAS_EIGEN3": os.environ.get("EIGEN3_INCLUDE_DIR", include_path), "RDK_BUILD_CAIRO_SUPPORT": [include_path, "cairo"], } @@ -1435,6 +1434,7 @@ class FixSignatures: python_include_path = f"-I{self.python_include_path}" if self.python_include_path else "" rdkit_code = os.path.join(self.cpp_source_path, "Code") rdkit_external = os.path.join(self.cpp_source_path, "External") + ringdecomposerlib_include_path = os.path.join(rdkit_external, "RingFamilies/RingDecomposerLib/src/RingDecomposerLib") user_clang_flags = " " + self.user_clang_flags if self.user_clang_flags else "" rdk_build_defs = self.get_rdk_build_flags() qt_include_dirs = self.get_include_flags_from_include_path(os.environ.get("QT_INCLUDE_DIRS", None)) @@ -1442,8 +1442,9 @@ class FixSignatures: avalon_include_dir = os.path.abspath(str(max(rdkit_external_path.rglob("AvalonTools/ava-formake-AvalonToolkit_*/src/main/C/include")))) clang_flags = ( - f"-I{self.include_path} {python_include_path} -I{rdkit_code} " - f"-I{rdkit_external} -I{avalon_include_dir} -I. -I..{qt_include_dirs}" + f"-I{ringdecomposerlib_include_path} -I{self.include_path} " + f"{python_include_path} -I{rdkit_code} -I{rdkit_external} " + f"-I{avalon_include_dir} -I. -I..{qt_include_dirs}" f" {rdk_build_defs} {self.clang_flags}{user_clang_flags}" ).strip().split() self.clang_worker_data = ClangWorkerData(clang_flags) diff --git a/rdkit-config.cmake.in b/rdkit-config.cmake.in index ad0a3fe28..3b18f8f4b 100644 --- a/rdkit-config.cmake.in +++ b/rdkit-config.cmake.in @@ -19,7 +19,6 @@ set(RDKit_HAS_MAEPARSER_SUPPORT @RDK_BUILD_MAEPARSER_SUPPORT@) set(RDKit_HAS_MOLINTERCHANGE_SUPPORT @RDK_BUILD_MOLINTERCHANGE_SUPPORT@) set(RDKit_HAS_YAEHMOP_SUPPORT @RDK_BUILD_YAEHMOP_SUPPORT@) set(RDKit_HAS_STRUCTCHECKER_SUPPORT @RDK_BUILD_STRUCTCHECKER_SUPPORT@) -set(RDKit_HAS_URF_SUPPORT @RDK_USE_URF@) set(RDKit_USE_OPTIMIZED_POPCNT @RDK_OPTIMIZE_POPCNT@) set(RDKit_USE_STRICT_ROTOR_DEFINITION @RDK_USE_STRICT_ROTOR_DEFINITION@)