mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
merge to master
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -6,6 +6,9 @@
|
||||
/.project
|
||||
/.pydevproject
|
||||
|
||||
#- CLion files
|
||||
/cmake-build-*
|
||||
|
||||
#- IDEA files
|
||||
/.idea
|
||||
|
||||
@@ -77,4 +80,4 @@ __pycache__/
|
||||
External/INCHI-API/*
|
||||
/rdkit/ML/Data/test_data/testgeneral.dat.pkl
|
||||
/rdkit/ML/Data/test_data/testquant.qdat.pkl
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
if(CMAKE_MAJOR_VERSION EQUAL 2 AND ((CMAKE_MINOR_VERSION EQUAL 8 AND CMAKE_PATCH_VERSION GREATER 1) OR CMAKE_MINOR_VERSION GREATER 8))
|
||||
cmake_policy(SET CMP0015 OLD)
|
||||
endif()
|
||||
@@ -16,6 +16,8 @@ enable_testing()
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/Code/cmake/Modules/")
|
||||
|
||||
add_library(rdkit_base INTERFACE)
|
||||
|
||||
option(RDK_BUILD_SWIG_WRAPPERS "build the SWIG wrappers" OFF )
|
||||
option(RDK_BUILD_PYTHON_WRAPPERS "build the standard python wrappers" ON )
|
||||
option(RDK_BUILD_COMPRESSED_SUPPLIERS "build in support for compressed MolSuppliers" OFF )
|
||||
@@ -103,18 +105,20 @@ if(RDK_BUILD_SWIG_WRAPPERS)
|
||||
endif(RDK_BUILD_SWIG_WRAPPERS)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||
ADD_DEFINITIONS("-DRDK_32BIT_BUILD")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DRDK_32BIT_BUILD")
|
||||
else()
|
||||
ADD_DEFINITIONS("-DRDK_64BIT_BUILD")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DRDK_64BIT_BUILD")
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
ADD_DEFINITIONS("-DBOOST_SYSTEM_NO_DEPRECATED")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DBOOST_SYSTEM_NO_DEPRECATED")
|
||||
endif(MINGW)
|
||||
|
||||
# defines macros: rdkit_python_extension, rdkit_test
|
||||
include(RDKitUtils)
|
||||
install(EXPORT ${RDKit_EXPORTED_TARGETS} DESTINATION ${RDKit_LibDir})
|
||||
install(TARGETS rdkit_base EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
COMPONENT dev )
|
||||
|
||||
# create and install package configuration and version files
|
||||
configure_file (
|
||||
@@ -133,7 +137,7 @@ install(FILES
|
||||
# extra boost versions
|
||||
if(MSVC)
|
||||
SET(Boost_ADDITIONAL_VERSIONS "1.48" "1.48.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.43" "1.43.0" "1.42" "1.42.0" "1.41" "1.41.0" "1.40" "1.40.0")
|
||||
ADD_DEFINITIONS("-DBOOST_ALL_NO_LIB")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DBOOST_ALL_NO_LIB")
|
||||
endif(MSVC)
|
||||
|
||||
if(RDK_BUILD_INCHI_SUPPORT)
|
||||
@@ -149,12 +153,12 @@ if(RDK_BUILD_PYTHON_WRAPPERS)
|
||||
endif (PYTHONINTERP_FOUND AND NOT Python_ADDITIONAL_VERSIONS)
|
||||
find_package(PythonLibs)
|
||||
if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
|
||||
include_directories(${PYTHON_INCLUDE_PATH})
|
||||
target_include_directories(rdkit_base INTERFACE ${PYTHON_INCLUDE_PATH})
|
||||
else(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
|
||||
include_directories(${PYTHON_INCLUDE_DIR})
|
||||
target_include_directories(rdkit_base INTERFACE ${PYTHON_INCLUDE_DIR})
|
||||
endif(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
|
||||
find_package(NumPy REQUIRED)
|
||||
include_directories(${PYTHON_NUMPY_INCLUDE_PATH})
|
||||
target_include_directories(rdkit_base INTERFACE ${PYTHON_NUMPY_INCLUDE_PATH})
|
||||
|
||||
if(PYTHON_VERSION_MAJOR EQUAL 3)
|
||||
# Find boost-python3 using name specified as command line option then fall back to commonly used names
|
||||
@@ -231,10 +235,13 @@ if(APPLE)
|
||||
endif()
|
||||
endif(APPLE)
|
||||
|
||||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
|
||||
target_include_directories(rdkit_base SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
|
||||
include_directories(${RDKit_CodeDir})
|
||||
target_include_directories(rdkit_base INTERFACE
|
||||
$<BUILD_INTERFACE:${RDKit_CodeDir}>
|
||||
$<INSTALL_INTERFACE:${RDKit_HdrDir}>
|
||||
)
|
||||
|
||||
|
||||
# Detect clang, which masquerades as gcc. CMake 2.6 doesn't know how to
|
||||
@@ -244,8 +251,8 @@ string(REGEX MATCH "clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER}")
|
||||
if(RDK_BUILD_DESCRIPTORS3D)
|
||||
find_package(Eigen3)
|
||||
if(EIGEN3_FOUND)
|
||||
ADD_DEFINITIONS("-DRDK_HAS_EIGEN3" "-DRDK_BUILD_DESCRIPTORS3D")
|
||||
include_directories(${EIGEN3_INCLUDE_DIR})
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DRDK_HAS_EIGEN3" "-DRDK_BUILD_DESCRIPTORS3D")
|
||||
target_include_directories(rdkit_base INTERFACE ${EIGEN3_INCLUDE_DIR})
|
||||
else(EIGEN3_FOUND)
|
||||
message("Eigen3 not found, disabling the Descriptors3D build.")
|
||||
set(RDK_BUILD_DESCRIPTORS3D OFF)
|
||||
@@ -259,10 +266,10 @@ if(RDK_BUILD_THREADSAFE_SSS)
|
||||
find_package(Boost 1.39.0 COMPONENTS thread system)
|
||||
if(Boost_THREAD_FOUND AND Boost_SYSTEM_FOUND)
|
||||
set(Boost_LIBRARIES ${T_LIBS} ${Boost_LIBRARIES})
|
||||
ADD_DEFINITIONS("-DRDK_THREADSAFE_SSS -DBOOST_ALL_NO_LIB")
|
||||
target_compile_definitions(rdkit_base INTERFACE -DRDK_THREADSAFE_SSS -DBOOST_ALL_NO_LIB)
|
||||
set(RDKit_THREAD_LIBS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
||||
if(RDK_TEST_MULTITHREADED)
|
||||
ADD_DEFINITIONS("-DRDK_TEST_MULTITHREADED")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DRDK_TEST_MULTITHREADED")
|
||||
endif()
|
||||
else()
|
||||
message("Boost thread or system not found. Disabling RDK_BUILD_THREADSAFE_SSS.")
|
||||
@@ -360,13 +367,13 @@ endif(NOT RDK_INSTALL_INTREE)
|
||||
|
||||
if (RDK_SQUASH_MVC_SECURE_WARNINGS)
|
||||
MESSAGE("== Squashing MSVC Security warnings (do not use during development)")
|
||||
ADD_DEFINITIONS("-D_SCL_SECURE_NO_WARNINGS")
|
||||
ADD_DEFINITIONS("/wd4996")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-D_SCL_SECURE_NO_WARNINGS")
|
||||
target_compile_definitions(rdkit_base INTERFACE "/wd4996")
|
||||
endif(RDK_SQUASH_MVC_SECURE_WARNINGS)
|
||||
|
||||
if(RDK_USE_STRICT_ROTOR_DEFINITION)
|
||||
MESSAGE("== Using strict rotor definition")
|
||||
ADD_DEFINITIONS("-DRDK_USE_STRICT_ROTOR_DEFINITION")
|
||||
target_compile_definitions(rdkit_base INTERFACE "-DRDK_USE_STRICT_ROTOR_DEFINITION")
|
||||
endif()
|
||||
|
||||
add_subdirectory(External)
|
||||
|
||||
@@ -11,7 +11,7 @@ rdkit_library(GraphMol
|
||||
LINK_LIBRARIES RDGeometryLib RDGeneral
|
||||
${RDKit_THREAD_LIBS})
|
||||
|
||||
target_link_libraries(GraphMol ${RDKit_THREAD_LIBS})
|
||||
target_link_libraries(GraphMol PUBLIC ${RDKit_THREAD_LIBS})
|
||||
|
||||
rdkit_headers(Atom.h
|
||||
atomic_data.h
|
||||
|
||||
@@ -1606,5 +1606,5 @@ BOOST_PYTHON_MODULE(rdMolDescriptors) {
|
||||
python::def("CalcAUTOCORR2D", calcAUTOCORR2Ds, (python::arg("mol")),
|
||||
docString.c_str());
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -12,45 +12,41 @@ rdkit_headers(MolDraw2D.h
|
||||
DEST GraphMol/MolDraw2D
|
||||
)
|
||||
|
||||
if(RDK_BUILD_QT_SUPPORT)
|
||||
#find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5OpenGL REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${Qt5Widgets_INCLUDE_DIRS}
|
||||
${Qt5OpenGL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(QTDRAW2D_SRC MolDraw2DQt.cpp)
|
||||
set(EXTRA_LOCAL_LIBS ${EXTRA_LOCAL_LIBS} ${Qt5Widgets_LIBRARIES} ${Qt5OpenGL_LIBRARIES} )
|
||||
rdkit_headers(MolDraw2DQt.h DEST GraphMol/MolDraw2D)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif(RDK_BUILD_QT_SUPPORT)
|
||||
|
||||
if(RDK_BUILD_CAIRO_SUPPORT)
|
||||
find_package(Cairo REQUIRED)
|
||||
include_directories( ${CAIRO_INCLUDE_DIRS} )
|
||||
set(EXTRA_LOCAL_LIBS ${EXTRA_LOCAL_LIBS} ${CAIRO_LIBRARIES} )
|
||||
ADD_DEFINITIONS("-DRDK_CAIRO_BUILD")
|
||||
set(CAIRODRAW2D_SRC MolDraw2DCairo.cpp)
|
||||
rdkit_headers(MolDraw2DCairo.h DEST GraphMol/MolDraw2D)
|
||||
endif(RDK_BUILD_CAIRO_SUPPORT)
|
||||
|
||||
rdkit_library(MolDraw2D MolDraw2D.cpp MolDraw2DSVG.cpp
|
||||
${CAIRODRAW2D_SRC} ${QTDRAW2D_SRC}
|
||||
MolDraw2DDetails.cpp MolDraw2DUtils.cpp
|
||||
LINK_LIBRARIES
|
||||
ChemReactions FileParsers SmilesParse Depictor MolTransforms RDGeometryLib
|
||||
RDGeneral SubstructMatch Subgraphs GraphMol EigenSolvers
|
||||
RDGeometryLib
|
||||
${RDKit_THREAD_LIBS} ${EXTRA_LOCAL_LIBS} )
|
||||
${RDKit_THREAD_LIBS} )
|
||||
|
||||
if(RDK_BUILD_QT_SUPPORT)
|
||||
#find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5OpenGL REQUIRED)
|
||||
|
||||
target_sources(MolDraw2D PRIVATE MolDraw2DQt.cpp)
|
||||
target_include_directories(MolDraw2D PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS})
|
||||
target_compile_options(MolDraw2D PRIVATE "-std=c++11")
|
||||
target_link_libraries(MolDraw2D PUBLIC ${Qt5Widgets_LIBRARIES} ${Qt5OpenGL_LIBRARIES})
|
||||
rdkit_headers(MolDraw2DQt.h DEST GraphMol/MolDraw2D)
|
||||
endif(RDK_BUILD_QT_SUPPORT)
|
||||
|
||||
if(RDK_BUILD_CAIRO_SUPPORT)
|
||||
find_package(Cairo REQUIRED)
|
||||
target_include_directories(MolDraw2D PUBLIC ${CAIRO_INCLUDE_DIRS})
|
||||
target_compile_definitions(MolDraw2D PUBLIC "-DRDK_CAIRO_BUILD")
|
||||
target_link_libraries(MolDraw2D PUBLIC ${CAIRO_LIBRARIES})
|
||||
target_sources(MolDraw2D PRIVATE MolDraw2DCairo.cpp)
|
||||
rdkit_headers(MolDraw2DCairo.h DEST GraphMol/MolDraw2D)
|
||||
endif(RDK_BUILD_CAIRO_SUPPORT)
|
||||
|
||||
|
||||
rdkit_test(moldraw2DTest1 test1.cpp LINK_LIBRARIES
|
||||
ChemReactions FileParsers SmilesParse Depictor RDGeometryLib
|
||||
RDGeneral SubstructMatch Subgraphs GraphMol MolTransforms EigenSolvers
|
||||
RDGeometryLib
|
||||
MolDraw2D ${RDKit_THREAD_LIBS} ${EXTRA_LOCAL_LIBS} )
|
||||
MolDraw2D ${RDKit_THREAD_LIBS} )
|
||||
|
||||
rdkit_test(moldraw2DRxnTest1 rxn_test1.cpp LINK_LIBRARIES
|
||||
ChemReactions FileParsers SmilesParse Depictor RDGeometryLib
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
include_directories(${CMAKE_SOURCE_DIR}/External/boost-numeric-bindings)
|
||||
|
||||
rdkit_library(Subgraphs Subgraphs.cpp SubgraphUtils.cpp
|
||||
LINK_LIBRARIES GraphMol )
|
||||
|
||||
rdkit_headers(Subgraphs.h
|
||||
SubgraphUtils.h DEST GraphMol/Subgraphs)
|
||||
|
||||
target_include_directories(Subgraphs PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/External/boost-numeric-bindings>)
|
||||
|
||||
rdkit_test(testSubgraphs1 test1.cpp LINK_LIBRARIES Subgraphs SmilesParse GraphMol RDGeometryLib RDGeneral )
|
||||
rdkit_test(testSubgraphs2 test2.cpp LINK_LIBRARIES SmilesParse Subgraphs GraphMol RDGeometryLib RDGeneral )
|
||||
|
||||
@@ -2,6 +2,8 @@ find_package(SWIG REQUIRED)
|
||||
include(${SWIG_USE_FILE})
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${RDKit_CodeDir})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
|
||||
SET(CMAKE_SWIG_FLAGS "")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ rdkit_library(EigenSolvers PowerEigenSolver.cpp LINK_LIBRARIES RDGeneral)
|
||||
rdkit_headers(PowerEigenSolver.h DEST Numerics/EigenSolvers)
|
||||
|
||||
IF (LAPACK_FOUND)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/External/boost-numeric-bindings)
|
||||
rdkit_test(tesEigensolvers testEigenSolvers.cpp
|
||||
LINK_LIBRARIES EigenSolvers RDGeneral )
|
||||
target_include_directories(tesEigenSolvers PUBLIC ${CMAKE_SOURCE_DIR}/External/boost-numeric-bindings)
|
||||
ENDIF (LAPACK_FOUND)
|
||||
|
||||
@@ -28,7 +28,7 @@ if(MINGW)
|
||||
endif()
|
||||
endif(MINGW)
|
||||
|
||||
target_link_libraries(RDGeneral ${RDKit_THREAD_LIBS} ${MSVC_RUNTIME_DLL})
|
||||
target_link_libraries(RDGeneral PUBLIC ${RDKit_THREAD_LIBS} ${MSVC_RUNTIME_DLL})
|
||||
|
||||
rdkit_headers(Exceptions.h
|
||||
BadFileException.h
|
||||
|
||||
@@ -38,7 +38,8 @@ macro(rdkit_library)
|
||||
CDR(RDKLIB_SOURCES ${RDKLIB_DEFAULT_ARGS})
|
||||
if(MSVC)
|
||||
add_library(${RDKLIB_NAME} ${RDKLIB_SOURCES})
|
||||
target_link_libraries(${RDKLIB_NAME} ${Boost_SYSTEM_LIBRARY} )
|
||||
target_link_libraries(${RDKLIB_NAME} PUBLIC rdkit_base)
|
||||
target_link_libraries(${RDKLIB_NAME} PUBLIC ${Boost_SYSTEM_LIBRARY} )
|
||||
INSTALL(TARGETS ${RDKLIB_NAME} EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
|
||||
COMPONENT dev )
|
||||
@@ -48,11 +49,22 @@ macro(rdkit_library)
|
||||
# boundaries. As of now (June 2010), this doesn't work
|
||||
# with g++ unless libraries are shared.
|
||||
add_library(${RDKLIB_NAME} SHARED ${RDKLIB_SOURCES})
|
||||
target_link_libraries(${RDKLIB_NAME} PUBLIC rdkit_base)
|
||||
INSTALL(TARGETS ${RDKLIB_NAME} EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
|
||||
COMPONENT runtime )
|
||||
if(RDK_INSTALL_STATIC_LIBS)
|
||||
add_library(${RDKLIB_NAME}_static ${RDKLIB_SOURCES})
|
||||
target_link_libraries(${RDKLIB_NAME}_static PUBLIC rdkit_base)
|
||||
foreach(RDKLIB_LINK_LIBRARY ${RDKLIB_LINK_LIBRARIES})
|
||||
set(STATIC_LIB ${RDKLIB_LINK_LIBRARY}_static)
|
||||
# if the static variant exist, link against it, otherwise link against the unmodified name (-> boost, etc)
|
||||
if (TARGET ${STATIC_LIB})
|
||||
target_link_libraries(${RDKLIB_NAME}_static PUBLIC ${STATIC_LIB})
|
||||
else()
|
||||
target_link_libraries(${RDKLIB_NAME}_static PUBLIC ${RDKLIB_LINK_LIBRARY})
|
||||
endif()
|
||||
endforeach()
|
||||
INSTALL(TARGETS ${RDKLIB_NAME}_static EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
|
||||
COMPONENT dev )
|
||||
@@ -61,7 +73,7 @@ macro(rdkit_library)
|
||||
|
||||
endif(RDK_INSTALL_STATIC_LIBS)
|
||||
IF(RDKLIB_LINK_LIBRARIES)
|
||||
target_link_libraries(${RDKLIB_NAME} ${RDKLIB_LINK_LIBRARIES})
|
||||
target_link_libraries(${RDKLIB_NAME} PUBLIC ${RDKLIB_LINK_LIBRARIES})
|
||||
ENDIF(RDKLIB_LINK_LIBRARIES)
|
||||
endif(MSVC)
|
||||
if(WIN32)
|
||||
|
||||
@@ -154,11 +154,7 @@ Here things are more difficult. Check this wiki page for information: https://co
|
||||
##### Installing prerequisites from source
|
||||
|
||||
- Required packages:
|
||||
- cmake. You need version 2.6 (or more recent). http://www.cmake.org if your linux distribution doesn't have an appropriate package.
|
||||
|
||||
> **note**
|
||||
>
|
||||
> It seems that v2.8 is a better bet than v2.6. It might be worth compiling your own copy of v2.8 even if v2.6 is already installed.
|
||||
- cmake. You need version 3.1 (or more recent). http://www.cmake.org if your linux distribution doesn't have an appropriate package.
|
||||
|
||||
- The following are required if you are planning on using the Python wrappers
|
||||
- The python headers. This probably means that you need to install the python-dev package (or whatever it's called) for your linux distribution.
|
||||
|
||||
Reference in New Issue
Block a user