mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Decouple coordgen and maeparser integrations (#3286)
* decouple the maeparser and coordgen support * further untangling of coordgen and maeparser * more tweaks * be explicit in the azure devops builds * forgot one file * get win64_dll builds working
This commit is contained in:
@@ -25,6 +25,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
|
||||
-DRDK_USE_BOOST_REGEX=ON \
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
|
||||
-DRDK_OPTIMIZE_POPCNT=ON \
|
||||
-DRDK_BUILD_TEST_GZIP=ON \
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=ON \
|
||||
|
||||
@@ -15,6 +15,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
|
||||
-DRDK_USE_BOOST_REGEX=OFF \
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
|
||||
-DRDK_OPTIMIZE_POPCNT=ON \
|
||||
-DRDK_BUILD_TEST_GZIP=ON \
|
||||
-DRDK_BUILD_AVALON_SUPPORT=ON \
|
||||
|
||||
@@ -23,6 +23,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
|
||||
-DRDK_USE_BOOST_REGEX=OFF \
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
|
||||
-DRDK_OPTIMIZE_POPCNT=ON \
|
||||
-DRDK_BUILD_TEST_GZIP=OFF \
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=ON \
|
||||
|
||||
@@ -25,6 +25,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
|
||||
-DRDK_USE_BOOST_REGEX=ON \
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
|
||||
-DRDK_OPTIMIZE_POPCNT=ON \
|
||||
-DRDK_BUILD_TEST_GZIP=ON \
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=ON \
|
||||
|
||||
@@ -37,6 +37,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
|
||||
-DRDK_USE_BOOST_REGEX=ON \
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
|
||||
-DRDK_OPTIMIZE_POPCNT=ON \
|
||||
-DRDK_BUILD_TEST_GZIP=ON \
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=ON \
|
||||
|
||||
@@ -36,6 +36,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
|
||||
-DRDK_USE_BOOST_REGEX=OFF \
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
|
||||
-DRDK_OPTIMIZE_POPCNT=ON \
|
||||
-DRDK_BUILD_TEST_GZIP=OFF \
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=ON \
|
||||
|
||||
@@ -23,6 +23,7 @@ steps:
|
||||
-DRDK_BUILD_PYTHON_WRAPPERS=ON ^
|
||||
-DRDK_USE_BOOST_REGEX=ON ^
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON ^
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON ^
|
||||
-DRDK_OPTIMIZE_POPCNT=ON ^
|
||||
-DRDK_BUILD_TEST_GZIP=ON ^
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=OFF ^
|
||||
|
||||
@@ -22,6 +22,7 @@ steps:
|
||||
-DRDK_BUILD_CPP_TESTS=ON ^
|
||||
-DRDK_USE_BOOST_REGEX=ON ^
|
||||
-DRDK_BUILD_COORDGEN_SUPPORT=ON ^
|
||||
-DRDK_BUILD_MAEPARSER_SUPPORT=ON ^
|
||||
-DRDK_OPTIMIZE_POPCNT=ON ^
|
||||
-DRDK_BUILD_TEST_GZIP=ON ^
|
||||
-DRDK_BUILD_FREESASA_SUPPORT=OFF ^
|
||||
|
||||
@@ -51,6 +51,7 @@ option(RDK_USE_STRICT_ROTOR_DEFINITION "Use the most strict rotatable bond defin
|
||||
option(RDK_BUILD_DESCRIPTORS3D "Build the 3D descriptors calculators, requires Eigen3 to be installed" ON)
|
||||
option(RDK_BUILD_FREESASA_SUPPORT "build the rdkit freesasa wrapper" OFF )
|
||||
option(RDK_BUILD_COORDGEN_SUPPORT "build the rdkit coordgen wrapper" ON )
|
||||
option(RDK_BUILD_MAEPARSER_SUPPORT "build the rdkit MAE parser wrapper" ON )
|
||||
option(RDK_BUILD_MOLINTERCHANGE_SUPPORT "build in support for CommonChem molecule interchange" ON )
|
||||
option(RDK_BUILD_YAEHMOP_SUPPORT "build support for the YAeHMOP wrapper" OFF)
|
||||
option(RDK_BUILD_STRUCTCHECKER_SUPPORT "build in support for the StructChecker alpha (not recommended, use the MolVS integration instead)" OFF )
|
||||
@@ -178,6 +179,11 @@ if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
include_directories(${RDKit_ExternalDir})
|
||||
endif()
|
||||
|
||||
if(RDK_BUILD_MAEPARSER_SUPPORT)
|
||||
add_definitions(-DRDK_BUILD_MAEPARSER_SUPPORT)
|
||||
include_directories(${RDKit_ExternalDir})
|
||||
endif()
|
||||
|
||||
if(RDK_USE_URF)
|
||||
ADD_DEFINITIONS("-DRDK_USE_URF")
|
||||
include_directories(${RDKit_ExternalDir}/RingFamilies/RingDecomposerLib/src/RingDecomposerLib)
|
||||
|
||||
@@ -20,7 +20,7 @@ endif()
|
||||
ADD_DEFINITIONS("-DRDK_USE_BOOST_IOSTREAMS")
|
||||
endif(RDK_USE_BOOST_IOSTREAMS)
|
||||
|
||||
if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
if(RDK_BUILD_MAEPARSER_SUPPORT)
|
||||
include_directories(${maeparser_INCLUDE_DIRS})
|
||||
set (maesupplier MaeMolSupplier.cpp)
|
||||
endif()
|
||||
@@ -45,7 +45,7 @@ rdkit_library(FileParsers
|
||||
ProximityBonds.cpp
|
||||
SequenceParsers.cpp SequenceWriters.cpp
|
||||
SVGParser.cpp
|
||||
LINK_LIBRARIES Depictor SmilesParse GraphMol ${RDK_COORDGEN_LIBS} ${regex_lib} ${link_iostreams})
|
||||
LINK_LIBRARIES Depictor SmilesParse GraphMol ${RDK_MAEPARSER_LIBS} ${regex_lib} ${link_iostreams})
|
||||
|
||||
rdkit_headers(FileParsers.h
|
||||
FileParserUtils.h
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
#include <GraphMol/ROMol.h>
|
||||
#include <RDGeneral/BadFileException.h>
|
||||
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
namespace schrodinger {
|
||||
namespace mae {
|
||||
class Reader;
|
||||
class Block;
|
||||
} // namespace mae
|
||||
} // namespace schrodinger
|
||||
#endif // RDK_BUILD_COORDGEN_SUPPORT
|
||||
#endif // RDK_BUILD_MAEPARSER_SUPPORT
|
||||
|
||||
namespace RDKit {
|
||||
RDKIT_FILEPARSERS_EXPORT std::string strip(const std::string &orig);
|
||||
@@ -398,7 +398,7 @@ class RDKIT_FILEPARSERS_EXPORT PDBMolSupplier : public MolSupplier {
|
||||
bool df_sanitize, df_removeHs, df_proximityBonding;
|
||||
unsigned int d_flavor;
|
||||
};
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
//! lazy file parser for MAE files
|
||||
class RDKIT_FILEPARSERS_EXPORT MaeMolSupplier : public MolSupplier {
|
||||
/**
|
||||
@@ -435,7 +435,7 @@ class RDKIT_FILEPARSERS_EXPORT MaeMolSupplier : public MolSupplier {
|
||||
std::shared_ptr<std::istream> dp_sInStream;
|
||||
std::string d_stored_exc;
|
||||
};
|
||||
#endif // RDK_BUILD_COORDGEN_SUPPORT
|
||||
#endif // RDK_BUILD_MAEPARSER_SUPPORT
|
||||
} // namespace RDKit
|
||||
|
||||
#endif
|
||||
|
||||
@@ -103,7 +103,7 @@ int testMolSup() {
|
||||
}
|
||||
TEST_ASSERT(i == 16);
|
||||
}
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
{ // Test reading properties
|
||||
fname = rdbase + "/Code/GraphMol/FileParsers/test_data/props_test.mae";
|
||||
|
||||
@@ -283,7 +283,7 @@ int testMolSup() {
|
||||
TEST_ASSERT(info->getChainId() == "A");
|
||||
TEST_ASSERT(info->getResidueNumber() == 5);
|
||||
}
|
||||
#endif // RDK_BUILD_COORDGEN_SUPPORT
|
||||
#endif // RDK_BUILD_MAEPARSER_SUPPORT
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2281,7 +2281,7 @@ int testForwardSDSupplier() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
// Now test that Maestro parsing of gz files works
|
||||
std::string maefname =
|
||||
rdbase + "/Code/GraphMol/FileParsers/test_data/NCI_aids_few.mae";
|
||||
@@ -2335,7 +2335,7 @@ int testForwardSDSupplier() {
|
||||
}
|
||||
TEST_ASSERT(i == 16);
|
||||
}
|
||||
#endif // RDK_BUILD_COORDGEN_SUPPORT
|
||||
#endif // RDK_BUILD_MAEPARSER_SUPPORT
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -2685,7 +2685,7 @@ M END
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
void testGitHub2881() {
|
||||
std::string data = R"DATA(f_m_ct {
|
||||
s_m_title
|
||||
|
||||
@@ -21,7 +21,7 @@ rdkit_python_extension(rdqueries
|
||||
LINK_LIBRARIES
|
||||
GraphMol )
|
||||
|
||||
if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
if(RDK_BUILD_MAEPARSER_SUPPORT)
|
||||
set (maesupplier MaeMolSupplier.cpp)
|
||||
include_directories(${maeparser_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
@@ -402,7 +402,7 @@ void wrap_sdsupplier();
|
||||
void wrap_forwardsdsupplier();
|
||||
void wrap_tdtsupplier();
|
||||
void wrap_smisupplier();
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
void wrap_maesupplier();
|
||||
#endif
|
||||
|
||||
@@ -1456,7 +1456,7 @@ BOOST_PYTHON_MODULE(rdmolfiles) {
|
||||
wrap_forwardsdsupplier();
|
||||
wrap_tdtsupplier();
|
||||
wrap_smisupplier();
|
||||
#ifdef RDK_BUILD_COORDGEN_SUPPORT
|
||||
#ifdef RDK_BUILD_MAEPARSER_SUPPORT
|
||||
wrap_maesupplier();
|
||||
#endif
|
||||
// wrap_pdbsupplier();
|
||||
|
||||
@@ -5923,12 +5923,13 @@ M END
|
||||
Chem.SDMolSupplier,
|
||||
Chem.TDTMolSupplier,
|
||||
#Chem.CompressedSDMolSupplier,
|
||||
Chem.MaeMolSupplier
|
||||
]:
|
||||
print("supplier:", supplier)
|
||||
with self.assertRaises(OSError):
|
||||
suppl = supplier(d)
|
||||
|
||||
if hasattr(Chem, 'MaeMolSupplier'):
|
||||
with self.assertRaises(OSError):
|
||||
suppl = Chem.MaeMolSupplier(d)
|
||||
os.rmdir(d)
|
||||
|
||||
def testRandomSmilesVect(self):
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#cmakedefine RDK_BUILD_COORDGEN_SUPPORT
|
||||
|
||||
#cmakedefine RDK_BUILD_MAEPARSER_SUPPORT
|
||||
|
||||
#cmakedefine RDK_BUILD_AVALON_SUPPORT
|
||||
|
||||
#cmakedefine RDK_BUILD_INCHI_SUPPORT
|
||||
|
||||
39
External/CoordGen/CMakeLists.txt
vendored
39
External/CoordGen/CMakeLists.txt
vendored
@@ -1,14 +1,10 @@
|
||||
add_custom_target(coordgen_support ALL)
|
||||
include(RDKitUtils)
|
||||
|
||||
if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
include(RDKitUtils)
|
||||
|
||||
if(MSVC AND (NOT RDK_INSTALL_DLLS_MSVC))
|
||||
add_definitions(-DSTATIC_COORDGEN)
|
||||
else(MSVC AND (NOT RDK_INSTALL_DLLS_MSVC))
|
||||
if(RDK_BUILD_MAEPARSER_SUPPORT)
|
||||
if((NOT MSVC) OR RDK_INSTALL_DLLS_MSVC)
|
||||
add_definitions(-DIN_MAEPARSER)
|
||||
add_definitions(-DIN_COORDGEN)
|
||||
endif(MSVC AND (NOT RDK_INSTALL_DLLS_MSVC))
|
||||
endif()
|
||||
|
||||
find_package(Boost ${RDK_BOOST_VERSION} COMPONENTS system iostreams REQUIRED)
|
||||
set (link_iostreams ${Boost_LIBRARIES})
|
||||
@@ -61,9 +57,26 @@ if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
|
||||
endif(MAEPARSER_FORCE_BUILD OR (NOT maeparser_FOUND))
|
||||
|
||||
include_directories(${maeparser_INCLUDE_DIRS})
|
||||
|
||||
set(RDK_MAEPARSER_LIBS ${maeparser_LIBRARIES} ${Boost_LIBRARIES}
|
||||
CACHE STRING "the external libraries" FORCE)
|
||||
|
||||
else (RDK_BUILD_MAEPARSER_SUPPORT)
|
||||
|
||||
set(RDK_MAEPARSER_LIBS CACHE STRING "the external libraries" FORCE)
|
||||
|
||||
endif(RDK_BUILD_MAEPARSER_SUPPORT)
|
||||
|
||||
if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
if(MSVC AND (NOT RDK_INSTALL_DLLS_MSVC))
|
||||
add_definitions(-DSTATIC_COORDGEN)
|
||||
else(MSVC AND (NOT RDK_INSTALL_DLLS_MSVC))
|
||||
add_definitions(-DIN_COORDGEN)
|
||||
endif(MSVC AND (NOT RDK_INSTALL_DLLS_MSVC))
|
||||
|
||||
find_package(coordgen MODULE)
|
||||
if(COORDGEN_FORCE_BUILD OR (NOT coordgen_FOUND))
|
||||
|
||||
if(NOT DEFINED COORDGEN_DIR)
|
||||
set(COORDGEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/coordgen")
|
||||
endif()
|
||||
@@ -85,19 +98,15 @@ if(RDK_BUILD_COORDGEN_SUPPORT)
|
||||
set(coordgen_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
CACHE STRING "CoordGen Include File" FORCE)
|
||||
file(GLOB CGSOURCES "${COORDGEN_DIR}/*.cpp")
|
||||
rdkit_library(coordgen ${CGSOURCES} SHARED LINK_LIBRARIES ${maeparser_LIBRARIES})
|
||||
rdkit_library(coordgen ${CGSOURCES} SHARED )
|
||||
install(TARGETS coordgen DESTINATION ${RDKit_LibDir})
|
||||
set(coordgen_LIBRARIES coordgen)
|
||||
|
||||
endif(COORDGEN_FORCE_BUILD OR (NOT coordgen_FOUND))
|
||||
|
||||
include_directories(${maeparser_INCLUDE_DIRS})
|
||||
include_directories(${coordgen_INCLUDE_DIRS})
|
||||
|
||||
install(FILES DESTINATION ${RDKit_ShareDir}/Data
|
||||
COMPONENT data)
|
||||
|
||||
set(RDK_COORDGEN_LIBS MolAlign ${coordgen_LIBRARIES} ${maeparser_LIBRARIES} ${Boost_LIBRARIES}
|
||||
set(RDK_COORDGEN_LIBS MolAlign ${coordgen_LIBRARIES} ${RDK_MAEPARSER_LIBS} ${Boost_LIBRARIES}
|
||||
CACHE STRING "the external libraries" FORCE)
|
||||
rdkit_headers(CoordGen.h DEST GraphMol)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user