Skip to content

Commit

Permalink
Remove boost::regex support rdkit#6817 (rdkit#6913)
Browse files Browse the repository at this point in the history
Made the following changes
        * removed RDK_USE_BOOST_REGEX cmake option and its references
        * removed usage of RDKIT_USE_BOOST_REGEX macro
        * removed install instructions related to boost regex
  • Loading branch information
whosayn authored Nov 21, 2023
1 parent 2a68050 commit ab7b8dd
Show file tree
Hide file tree
Showing 17 changed files with 12 additions and 76 deletions.
3 changes: 1 addition & 2 deletions .azure-pipelines/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=OFF \
-DRDK_BUILD_CPP_TESTS=ON \
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
-DRDK_USE_BOOST_REGEX=ON \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down Expand Up @@ -70,7 +69,7 @@ steps:
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
conda activate rdkit_build
conda install ipython matplotlib-base
conda install ipython matplotlib-base
conda install -c conda-forge sphinx myst-parser
export RDBASE=`pwd`
export PYTHONPATH=${RDBASE}:${PYTHONPATH}
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/linux_build_cartridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ steps:
-DRDK_INSTALL_INTREE=ON \
-DRDK_BUILD_CPP_TESTS=OFF \
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
-DRDK_USE_BOOST_REGEX=OFF \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/linux_build_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=ON \
-DRDK_BUILD_CPP_TESTS=OFF \
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
-DRDK_USE_BOOST_REGEX=OFF \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/linux_build_limitexternal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=OFF \
-DRDK_BUILD_CPP_TESTS=ON \
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
-DRDK_USE_BOOST_REGEX=OFF \
-DRDK_BUILD_COORDGEN_SUPPORT=OFF \
-DRDK_BUILD_MAEPARSER_SUPPORT=OFF \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down
3 changes: 1 addition & 2 deletions .azure-pipelines/linux_build_py311.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=OFF \
-DRDK_BUILD_CPP_TESTS=ON \
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
-DRDK_USE_BOOST_REGEX=ON \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down Expand Up @@ -67,7 +66,7 @@ steps:
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
conda activate rdkit_build
conda install ipython matplotlib-base
conda install ipython matplotlib-base
conda install -c conda-forge sphinx myst-parser
export RDBASE=`pwd`
export PYTHONPATH=${RDBASE}:${PYTHONPATH}
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/linux_build_py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=OFF \
-DRDK_BUILD_CPP_TESTS=ON \
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
-DRDK_USE_BOOST_REGEX=ON \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/mac_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=OFF \
-DRDK_BUILD_CPP_TESTS=ON \
-DRDK_BUILD_PYTHON_WRAPPERS=ON \
-DRDK_USE_BOOST_REGEX=ON \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/mac_build_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=ON \
-DRDK_BUILD_CPP_TESTS=OFF \
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
-DRDK_USE_BOOST_REGEX=OFF \
-DRDK_BUILD_COORDGEN_SUPPORT=ON \
-DRDK_BUILD_MAEPARSER_SUPPORT=ON \
-DRDK_OPTIMIZE_POPCNT=ON \
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/vs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ steps:
-DRDK_INSTALL_STATIC_LIBS=OFF ^
-DRDK_BUILD_CPP_TESTS=ON ^
-DRDK_BUILD_PYTHON_WRAPPERS=ON ^
-DRDK_USE_BOOST_REGEX=ON ^
-DRDK_BUILD_COORDGEN_SUPPORT=ON ^
-DRDK_BUILD_MAEPARSER_SUPPORT=ON ^
-DRDK_OPTIMIZE_POPCNT=ON ^
Expand Down
1 change: 0 additions & 1 deletion .azure-pipelines/vs_build_dll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ steps:
-DRDK_INSTALL_DLLS_MSVC=ON ^
-DRDK_BUILD_CPP_TESTS=ON ^
-DRDK_BUILD_PYTHON_WRAPPERS=OFF ^
-DRDK_USE_BOOST_REGEX=ON ^
-DRDK_BUILD_COORDGEN_SUPPORT=ON ^
-DRDK_BUILD_MAEPARSER_SUPPORT=ON ^
-DRDK_OPTIMIZE_POPCNT=ON ^
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ option(RDK_BUILD_XYZ2MOL_SUPPORT "build in support for the RDKit's implementatio
option(RDK_BUILD_STRUCTCHECKER_SUPPORT "build in support for the StructChecker alpha (not recommended, use the MolVS integration instead)" OFF )
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_REGEX "use boost::regex instead of std::regex (needed for systems with g++-4.8)" OFF)
option(RDK_USE_BOOST_IOSTREAMS "use boost::iostreams" ON)
option(RDK_BUILD_MINIMAL_LIB "build the minimal RDKit wrapper (for the JS bindings)" OFF)
option(RDK_MINIMAL_LIB_SUPPORT_LEGACY_BROWSERS "build the minimal RDKit JS wrapper such that it supports legacy browsers" OFF)
Expand Down Expand Up @@ -313,7 +312,7 @@ 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})

Expand Down Expand Up @@ -488,12 +487,6 @@ if(RDK_USE_BOOST_IOSTREAMS)
target_link_libraries(rdkit_base INTERFACE ${zlib_lib})
endif()

if(RDK_USE_BOOST_REGEX)
add_definitions(-DRDKIT_USE_BOOST_REGEX)
find_package(Boost ${RDK_BOOST_VERSION} COMPONENTS regex REQUIRED)
target_link_libraries(rdkit_base INTERFACE ${Boost_LIBRARIES})
endif()


# set the boost include directories and linkage:
target_include_directories(rdkit_base INTERFACE
Expand Down
4 changes: 2 additions & 2 deletions Code/Demos/RDKit/Draw/qtDemo/qtdraw_demo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ CONFIG += qt
INCLUDEPATH += ${RDBASE}/Code

RD_STATIC_LIBS = -lSmilesParse_static -lDepictor_static -lGraphMol_static \
-lRDGeometryLib_static -lRDGeneral_static
-lRDGeometryLib_static -lRDGeneral_static

LIBS += -L${RDBASE}/lib $${RD_STATIC_LIBS}

LIBS += -L${BOOST}/lib -lboost_regex -lboost_system
LIBS += -L${BOOST}/lib -lboost_system
15 changes: 4 additions & 11 deletions Code/GraphMol/FileParsers/MolFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,18 @@
#include <typeinfo>
#include <exception>
#include <charconv>

#ifdef RDKIT_USE_BOOST_REGEX
#include <boost/regex.hpp>
using boost::regex;
using boost::regex_match;
using boost::smatch;
#else
#include <regex>
using std::regex;
using std::regex_match;
using std::smatch;
#endif
#include <sstream>
#include <locale>
#include <cstdlib>
#include <cstdio>
#include <string_view>

using namespace RDKit::SGroupParsing;
using std::regex;
using std::regex_match;
using std::smatch;


namespace RDKit {

Expand Down
1 change: 0 additions & 1 deletion Code/cmake/rdkit_valgrind.suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# -DRDK_BUILD_THREADSAFE_SSS=ON \
# -DRDK_TEST_MULTITHREADED=ON \
# -DRDK_BUILD_FREESASA_SUPPORT=ON \
# -DRDK_USE_BOOST_REGEX=ON \
# -DPYTHON_NUMPY_INCLUDE_PATH="$CONDA_PREFIX/lib/python3.6/site-packages/numpy/core/include"
#
{
Expand Down
26 changes: 3 additions & 23 deletions Docs/Book/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,26 +358,6 @@ In each case I've replaced specific pieces of the path with `...`.

*Problem:* :

```
Linking CXX shared library libSLNParse.so
/usr/bin/ld: .../libboost_regex.a(cpp_regex_traits.o): relocation R_X86_64_32S against `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage' can not be used when making a shared object; recompile with -fPIC
.../libboost_regex.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Code/GraphMol/SLNParse/libSLNParse.so] Error 1
make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/all] Error 2
make: *** [all] Error 2
```

*Solution:*

Add this to the arguments when you call cmake: `-DBoost_USE_STATIC_LIBS=OFF`

More information here: http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01119.html

* * * * *

*Problem:* :

```
.../Code/GraphMol/Wrap/EditableMol.cpp:114: instantiated from here
.../boost/type_traits/detail/cv_traits_impl.hpp:37: internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:5067
Expand Down Expand Up @@ -479,15 +459,15 @@ This section assumes that python is installed in `C:\Python36 that the boost lib
#### Building from the command line (recommended)

- Create a directory `C:\RDKit\build` and cd into it
- Run cmake. Here's an example basic command line for 64bit windows that will download the InChI and Avalon toolkit sources from the InChI Trust and SourceForge repositories, respectively, and build the PostgreSQL cartridge for the installed version of PostgreSQL:
- Run cmake. Here's an example basic command line for 64bit windows that will download the InChI and Avalon toolkit sources from the InChI Trust and SourceForge repositories, respectively, and build the PostgreSQL cartridge for the installed version of PostgreSQL:
`cmake -DRDK_BUILD_PYTHON_WRAPPERS=ON -DBOOST_ROOT=C:/boost -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_AVALON_SUPPORT=ON -DRDK_BUILD_PGSQL=ON -DPostgreSQL_ROOT="C:\Program Files\PostgreSQL\9.5" -G"Visual Studio 14 2015 Win64" ..`
- Build the code. Here's an example command line:
- Build the code. Here's an example command line:
`C:/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe /m:4 /p:Configuration=Release INSTALL.vcxproj`
- If you have built in PostgreSQL support, you will need to open a shell with administrator privileges, stop the PostgreSQL service, run the `pgsql_install.bat` installation script, then restart the PostgreSQL service (please refer to `%RDBASE%\Code\PgSQL\rdkit\README` for further details):
- `"C:\Program Files\PostgreSQL\9.5\bin\pg_ctl.exe" -N "postgresql-9.5" -D "C:\Program Files\PostgreSQL\9.5\data" -w stop`
- `C:\RDKit\build\Code\PgSQL\rdkit\pgsql_install.bat`
- `"C:\Program Files\PostgreSQL\9.5\bin\pg_ctl.exe" -N "postgresql-9.5" -D "C:\Program Files\PostgreSQL\9.5\data" -w start`
- Before restarting the PostgreSQL service, make sure that the Boost libraries the RDKit was built against are in the system PATH, or PostgreSQL will fail to create the `rdkit` extension with a deceptive error message such as:
- Before restarting the PostgreSQL service, make sure that the Boost libraries the RDKit was built against are in the system PATH, or PostgreSQL will fail to create the `rdkit` extension with a deceptive error message such as:
`ERROR: could not load library "C:/Program Files/PostgreSQL/9.5/lib/rdkit.dll": The specified module could not be found.`


Expand Down
18 changes: 0 additions & 18 deletions Docs/Book_jp/Installation_jp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,24 +423,6 @@ JAVAラッパーのビルド

*問題:*

.. code:: console
Linking CXX shared library libSLNParse.so
/usr/bin/ld: .../libboost_regex.a(cpp_regex_traits.o): relocation R_X86_64_32S against `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage' can not be used when making a shared object; recompile with -fPIC
.../libboost_regex.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [Code/GraphMol/SLNParse/libSLNParse.so] Error 1
make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/SLNParse.dir/all] Error 2
make: *** [all] Error 2
*解決方法:*

cmakeを呼び出すときに次を引数に加えてください:\ ``-DBoost_USE_STATIC_LIBS=OFF``\

さらに情報が欲しい場合はこちら:http://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg01119.html

*問題:*

.. code:: console
.../Code/GraphMol/Wrap/EditableMol.cpp:114: instantiated from here
Expand Down
1 change: 0 additions & 1 deletion rdkit-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ set(RDKit_USE_OPTIMIZED_POPCNT @RDK_OPTIMIZE_POPCNT@)
set(RDKit_USE_STRICT_ROTOR_DEFINITION @RDK_USE_STRICT_ROTOR_DEFINITION@)
set(RDKit_USE_BOOST_VERSION @Boost_VERSION_STRING@)
set(RDKit_USE_BOOST_SERIALIZATION @RDK_USE_BOOST_SERIALIZATION@)
set(RDKit_USE_BOOST_REGEX @RDK_USE_BOOST_REGEX@)
set(RDKit_USE_BOOST_IOSTREAMS @RDK_USE_BOOST_IOSTREAMS@)

# Find the RDKit dependencies
Expand Down

0 comments on commit ab7b8dd

Please sign in to comment.