Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conan build 97% success #6850

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 37 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(CMAKE_MODULE_PATH
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_PYTHON_WRAPPERS "build the standard python wrappers" OFF)
option(RDK_BUILD_COMPRESSED_SUPPLIERS "build in support for compressed MolSuppliers" OFF )
option(RDK_BUILD_INCHI_SUPPORT "build the rdkit inchi wrapper" OFF )
option(RDK_BUILD_AVALON_SUPPORT "install support for the avalon toolkit. Use the variable AVALONTOOLS_DIR to set the location of the source." OFF )
Expand All @@ -31,26 +31,26 @@ option(RDK_PGSQL_BFP_GIST_SORTSUPPORT "enable the sortsupport method in the Post
option(RDK_PGSQL_MOL_GIST_SORTSUPPORT "enable the sortsupport method in the PostgreSQL mol gist index" ON )
option(RDK_PGSQL_QMOL_GIST_SORTSUPPORT "enable the sortsupport method in the PostgreSQL qmol gist index" ON )
option(RDK_BUILD_CONTRIB "build the Contrib directory" OFF )
option(RDK_INSTALL_INTREE "install the rdkit in the source tree (former behavior)" ON )
option(RDK_INSTALL_INTREE "install the rdkit in the source tree (former behavior)" OFF)
option(RDK_INSTALL_DLLS_MSVC "install the rdkit DLLs when using MSVC" OFF)
option(RDK_INSTALL_STATIC_LIBS "install the rdkit static libraries" ON )
option(RDK_INSTALL_STATIC_LIBS "install the rdkit static libraries" OFF )
option(RDK_INSTALL_PYTHON_TESTS "install the rdkit Python tests with the wrappers" OFF )
option(RDK_BUILD_THREADSAFE_SSS "enable thread-safe substructure searching" ON )
option(RDK_BUILD_SLN_SUPPORT "include support for the SLN format" ON )
option(RDK_TEST_MULTITHREADED "run some tests of multithreading" ON )
option(RDK_TEST_MULTITHREADED "run some tests of multithreading" OFF )
option(RDK_BUILD_SWIG_JAVA_WRAPPER "build the SWIG JAVA wrappers (does nothing if RDK_BUILD_SWIG_WRAPPERS is not set)" ON )
option(RDK_BUILD_SWIG_CSHARP_WRAPPER "build the experimental SWIG C# wrappers (does nothing if RDK_BUILD_SWIG_WRAPPERS is not set)" OFF )
option(RDK_SWIG_STATIC "statically link rdkit libraries into the SWIG wrappers" ON )
option(RDK_TEST_MMFF_COMPLIANCE "run MMFF compliance tests (requires tar/gzip)" ON )
option(RDK_BUILD_CPP_TESTS "build the c++ tests (disabing can speed up builds" ON)
option(RDK_TEST_MMFF_COMPLIANCE "run MMFF compliance tests (requires tar/gzip)" OFF )
option(RDK_BUILD_CPP_TESTS "build the c++ tests (disabing can speed up builds" OFF)
option(RDK_USE_FLEXBISON "use flex/bison, if available, to build the SMILES/SMARTS/SLN parsers" OFF)
option(RDK_TEST_COVERAGE "Use G(L)COV to compute test coverage" OFF)
option(RDK_USE_BOOST_SERIALIZATION "Use the boost serialization library if available" ON)
option(RDK_USE_BOOST_SERIALIZATION "Use the boost serialization library if available" OFF)
option(RDK_USE_BOOST_STACKTRACE "use boost::stacktrace to do more verbose invariant output (linux only)" ON)
option(RDK_BUILD_TEST_GZIP "Build the gzip'd stream test" OFF)
option(RDK_OPTIMIZE_POPCNT "Use SSE4.2 popcount instruction while compiling." ON)
option(RDK_USE_STRICT_ROTOR_DEFINITION "Use the most strict rotatable bond definition" ON)
option(RDK_BUILD_DESCRIPTORS3D "Build the 3D descriptors calculators, requires Eigen3 to be installed" ON)
option(RDK_BUILD_DESCRIPTORS3D "Build the 3D descriptors calculators, requires Eigen3 to be installed" OFF)
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 )
Expand All @@ -70,7 +70,9 @@ option(RDK_BUILD_MINIMAL_LIB_RXN "build support for reactions into MinimalLib" O
option(RDK_BUILD_MINIMAL_LIB_SUBSTRUCTLIBRARY "build support for SubstructLibrary into MinimalLib" ON )
option(RDK_BUILD_MINIMAL_LIB_MCS "build support for MCS into MinimalLib" OFF )

set(RDK_BOOST_VERSION "1.58.0")
set(RDK_BOOST_VERSION "1.83.0")

include_directories(/usr/include/freetype2)

if(NOT MSVC)
if(RDK_OPTIMIZE_POPCNT)
Expand Down Expand Up @@ -160,7 +162,7 @@ if(RDK_INSTALL_INTREE)
else(RDK_INSTALL_INTREE)
set(RDKit_BinDir "bin")
set(RDKit_LibDir "lib${LIB_SUFFIX}")
set(RDKit_HdrDir "include/rdkit")
set(RDKit_HdrDir "include")
set(RDKit_ShareDir "share/RDKit")
endif(RDK_INSTALL_INTREE)

Expand Down Expand Up @@ -250,6 +252,7 @@ include(RDKitUtils)
install(TARGETS rdkit_base EXPORT ${RDKit_EXPORTED_TARGETS}
COMPONENT dev )


# disable some warnings that we don't care about
if(MSVC)
# These should occasionally be enabled to check what's going on
Expand Down Expand Up @@ -302,18 +305,22 @@ if(RDK_BUILD_PYTHON_WRAPPERS)
if(WIN32 OR "${Py_ENABLE_SHARED}" STREQUAL "1")
target_link_libraries(rdkit_py_base INTERFACE ${PYTHON_LIBRARIES} )
endif()

find_package(NumPy REQUIRED)
target_include_directories(rdkit_base INTERFACE ${PYTHON_NUMPY_INCLUDE_PATH})

include(CMakePrintHelpers)

cmake_print_variables(PYTHON_LIBRARIES)

if(PYTHON_VERSION_MAJOR EQUAL 3)
# Find boost-python3 using name specified as command line option then fall back to commonly used names
set(RDK_BOOST_PYTHON3_NAME "python3" CACHE STRING "Name of the boost python3 library. If installed as libboost_python-xxx.so, use python-xxx.")
list(APPEND Boost_Python_Names "${RDK_BOOST_PYTHON3_NAME}" "python-py3${PYTHON_VERSION_MINOR}" "python3")
endif(PYTHON_VERSION_MAJOR EQUAL 3)

# Boost 1.67+ uses a version suffix like "python36" or "python27"
list(APPEND Boost_Python_Names "python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
#list(APPEND Boost_Python_Names "python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")

# Try each potential boost-python name until one works
foreach(Boost_Python_LibN ${Boost_Python_Names})
Expand All @@ -329,7 +336,8 @@ if(RDK_BUILD_PYTHON_WRAPPERS)
set(Boost_Python_Lib "python")
endif()

target_link_libraries(rdkit_py_base INTERFACE Boost::${Boost_Python_Lib})

target_link_libraries(rdkit_py_base INTERFACE Boost::python)#${Boost_Python_Lib})

if(RDK_INSTALL_INTREE)
set(RDKit_PythonDir "${CMAKE_SOURCE_DIR}/rdkit")
Expand Down Expand Up @@ -405,19 +413,19 @@ else(RDK_BUILD_PYTHON_WRAPPERS)
find_package(Boost ${RDK_BOOST_VERSION} REQUIRED)
endif(RDK_BUILD_PYTHON_WRAPPERS)

find_package(Eigen3)
if(RDK_BUILD_DESCRIPTORS3D)
if(NOT EIGEN3_FOUND)
add_subdirectory(External/Eigen)
endif()
target_compile_definitions(rdkit_base INTERFACE "-DRDK_BUILD_DESCRIPTORS3D")
endif()

if(TARGET Eigen3::Eigen)
target_compile_definitions(rdkit_base INTERFACE "-DRDK_HAS_EIGEN3")
target_link_libraries(rdkit_base INTERFACE Eigen3::Eigen)
set(RDK_HAS_EIGEN ON)
endif()
#find_package(Eigen3)
#if(RDK_BUILD_DESCRIPTORS3D)
# if(NOT EIGEN3_FOUND)
# add_subdirectory(External/Eigen)
# endif()
# target_compile_definitions(rdkit_base INTERFACE "-DRDK_BUILD_DESCRIPTORS3D")
#endif()
#
#if(TARGET Eigen3::Eigen)
# target_compile_definitions(rdkit_base INTERFACE "-DRDK_HAS_EIGEN3")
# target_link_libraries(rdkit_base INTERFACE Eigen3::Eigen)
# set(RDK_HAS_EIGEN ON)
#endif()

if(RDK_BUILD_THREADSAFE_SSS)
find_package (Threads)
Expand All @@ -437,6 +445,8 @@ else()
endif()
endif()

find_package(Boost ${RDK_BOOST_VERSION} COMPONENTS archive system filesystem serialization REQUIRED)

if(RDK_USE_BOOST_SERIALIZATION)
set(T_LIBS ${Boost_LIBRARIES})
find_package(Boost ${RDK_BOOST_VERSION} COMPONENTS system serialization iostreams)
Expand All @@ -451,6 +461,7 @@ if(RDK_USE_BOOST_SERIALIZATION)
endif()
endif()

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lfreetype")

# set the boost include directories and linkage:
target_include_directories(rdkit_base INTERFACE
Expand Down Expand Up @@ -660,7 +671,6 @@ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSIO
#ENDIF(WIN32 AND NOT UNIX)
#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")


SET(CPACK_SET_DESTDIR ON)

INCLUDE(CPack)
10 changes: 10 additions & 0 deletions CMakeUserPresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"configurePresets": [],
"include": [
"/home/niklas/projects/uni/rdkit/build/Debug/generators/CMakePresets.json"
]
}
2 changes: 2 additions & 0 deletions Code/GraphMol/ChemReactions/Enumerate/Enumerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "../ReactionPickler.h"
#include <GraphMol/MolPickler.h>
#include <GraphMol/SmilesParse/SmilesWrite.h>
#include <GraphMol/SmilesParse/SmilesParse.h>


#include <RDGeneral/BoostStartInclude.h>
#include <boost/multiprecision/cpp_int.hpp>
Expand Down
3 changes: 3 additions & 0 deletions Code/GraphMol/ChemReactions/Enumerate/EvenSamplePairs.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ class RDKIT_CHEMREACTIONS_EXPORT EvenSamplePairsStrategy
};
} // namespace RDKit


#ifdef RDK_USE_BOOST_SERIALIZATION
BOOST_CLASS_VERSION(RDKit::EvenSamplePairsStrategy, 1)
#endif

#endif
2 changes: 1 addition & 1 deletion Code/GraphMol/MolDraw2D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ option(RDK_BUILD_QT_SUPPORT "build support for QT drawing" OFF)
option(RDK_USE_QT6 "Use Qt6 instead of Qt5" OFF)
option(RDK_BUILD_QT_DEMO "build the QT drawing demo" OFF)
option(RDK_BUILD_CAIRO_SUPPORT "build support for Cairo drawing" OFF)
option(RDK_BUILD_FREETYPE_SUPPORT "build support for FreeType font handling" ON)
option(RDK_BUILD_FREETYPE_SUPPORT "build support for FreeType font handling" OFF)
option(RDK_INSTALL_COMIC_FONTS "download and install comic-neue to maximize the \"utility\" of the comic mode in MolDraw2D" ON)

if (RDK_BUILD_MINIMAL_LIB AND RDK_MINIMAL_LIB_SUPPORT_LEGACY_BROWSERS)
Expand Down
119 changes: 119 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps

class RDKitRecipe(ConanFile):
name = "rdkit"
version = "0.0.1"
package_type = "library"

# Optional metadata
license = "<Put the package license here>"
author = "<Put your name here> <And your email here>"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Description of RDKit package here>"
topics = ("<Put some tag here>", "<here>", "<and here>")

# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": True, "fPIC": True}

requires = "freetype/2.10.4", "boost/1.83.0"# "eigen/3.3.9"# "boost/1.83.0"

# Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "*"

def config_options(self):
if self.settings.os == "Windows":
self.options.rm_safe("fPIC")

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self)

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.sourcedirs = ["Code"]
self.cpp_info.components["RDKitAbbreviations"].libs = ["RDKitAbbreviations"]
self.cpp_info.components["RDKitAlignment"].libs = ["RDKitAlignment"]
self.cpp_info.components["RDKitCatalogs"].libs = ["RDKitCatalogs"]
self.cpp_info.components["RDKitChemicalFeatures"].libs = ["RDKitChemicalFeatures"]
self.cpp_info.components["RDKitChemReactions"].libs = ["RDKitChemReactions"]
self.cpp_info.components["RDKitChemTransforms"].libs = ["RDKitChemTransforms"]
self.cpp_info.components["RDKitCIPLabeler"].libs = ["RDKitCIPLabeler"]
self.cpp_info.components["RDKitcoordgen"].libs = ["RDKitcoordgen"]
self.cpp_info.components["RDKitDataStructs"].libs = ["RDKitDataStructs"]
self.cpp_info.components["RDKitDepictor"].libs = ["RDKitDepictor"]
self.cpp_info.components["RDKitDeprotect"].libs = ["RDKitDeprotect"]
self.cpp_info.components["RDKitDescriptors"].libs = ["RDKitDescriptors"]
self.cpp_info.components["RDKitDistGeometry"].libs = ["RDKitDistGeometry"]
self.cpp_info.components["RDKitDistGeomHelpers"].libs = ["RDKitDistGeomHelpers"]
self.cpp_info.components["RDKitEigenSolvers"].libs = ["RDKitEigenSolvers"]
self.cpp_info.components["RDKitFileParsers"].libs = ["RDKitFileParsers"]
self.cpp_info.components["RDKitFilterCatalog"].libs = ["RDKitFilterCatalog"]
self.cpp_info.components["RDKitFingerprints"].libs = ["RDKitFingerprints"]
self.cpp_info.components["RDKitFMCS"].libs = ["RDKitFMCS"]
self.cpp_info.components["RDKitForceFieldHelpers"].libs = ["RDKitForceFieldHelpers"]
self.cpp_info.components["RDKitForceField"].libs = ["RDKitForceField"]
self.cpp_info.components["RDKitFragCatalog"].libs = ["RDKitFragCatalog"]
self.cpp_info.components["RDKitga"].libs = ["RDKitga"]
self.cpp_info.components["RDKitGeneralizedSubstruct"].libs = ["RDKitGeneralizedSubstruct"]
self.cpp_info.components["RDKitGenericGroups"].libs = ["RDKitGenericGroups"]
self.cpp_info.components["RDKitGraphMol"].libs = ["RDKitGraphMol"]
self.cpp_info.components["RDKithc"].libs = ["RDKithc"]
self.cpp_info.components["RDKitInfoTheory"].libs = ["RDKitInfoTheory"]
self.cpp_info.components["RDKitmaeparser"].libs = ["RDKitmaeparser"]
self.cpp_info.components["RDKitMarvinParser"].libs = ["RDKitMarvinParser"]
self.cpp_info.components["RDKitMMPA"].libs = ["RDKitMMPA"]
self.cpp_info.components["RDKitMolAlign"].libs = ["RDKitMolAlign"]
self.cpp_info.components["RDKitMolCatalog"].libs = ["RDKitMolCatalog"]
self.cpp_info.components["RDKitMolChemicalFeatures"].libs = ["RDKitMolChemicalFeatures"]
self.cpp_info.components["RDKitMolDraw2D"].libs = ["RDKitMolDraw2D"]
self.cpp_info.components["RDKitMolEnumerator"].libs = ["RDKitMolEnumerator"]
self.cpp_info.components["RDKitMolHash"].libs = ["RDKitMolHash"]
self.cpp_info.components["RDKitMolInterchange"].libs = ["RDKitMolInterchange"]
self.cpp_info.components["RDKitMolStandardize"].libs = ["RDKitMolStandardize"]
self.cpp_info.components["RDKitMolTransforms"].libs = ["RDKitMolTransforms"]
self.cpp_info.components["RDKitO3AAlign"].libs = ["RDKitO3AAlign"]
self.cpp_info.components["RDKitOptimizer"].libs = ["RDKitOptimizer"]
self.cpp_info.components["RDKitPartialCharges"].libs = ["RDKitPartialCharges"]
self.cpp_info.components["RDKitRascalMCES"].libs = ["RDKitRascalMCES"]
self.cpp_info.components["RDKitRDGeneral"].libs = ["RDKitRDGeneral"]
self.cpp_info.components["RDKitRDGeometryLib"].libs = ["RDKitRDGeometryLib"]
self.cpp_info.components["RDKitRDStreams"].libs = ["RDKitRDStreams"]
self.cpp_info.components["RDKitReducedGraphs"].libs = ["RDKitReducedGraphs"]
self.cpp_info.components["RDKitRGroupDecomposition"].libs = ["RDKitRGroupDecomposition"]
self.cpp_info.components["RDKitRingDecomposerLib"].libs = ["RDKitRingDecomposerLib"]
self.cpp_info.components["RDKitScaffoldNetwork"].libs = ["RDKitScaffoldNetwork"]
self.cpp_info.components["RDKitShapeHelpers"].libs = ["RDKitShapeHelpers"]
self.cpp_info.components["RDKitSimDivPickers"].libs = ["RDKitSimDivPickers"]
self.cpp_info.components["RDKitSLNParse"].libs = ["RDKitSLNParse"]
self.cpp_info.components["RDKitSmilesParse"].libs = ["RDKitSmilesParse"]
self.cpp_info.components["RDKitSubgraphs"].libs = ["RDKitSubgraphs"]
self.cpp_info.components["RDKitSubstructLibrary"].libs = ["RDKitSubstructLibrary"]
self.cpp_info.components["RDKitSubstructMatch"].libs = ["RDKitSubstructMatch"]
self.cpp_info.components["RDKitTautomerQuery"].libs = ["RDKitTautomerQuery"]
self.cpp_info.components["RDKitTrajectory"].libs = ["RDKitTrajectory"]