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

Postgres cartridge build fails under Ubuntu #4681

Closed
SPKorhonen opened this issue Nov 9, 2021 · 3 comments · Fixed by #4692
Closed

Postgres cartridge build fails under Ubuntu #4681

SPKorhonen opened this issue Nov 9, 2021 · 3 comments · Fixed by #4692
Labels
Milestone

Comments

@SPKorhonen
Copy link
Contributor

Describe the bug

I have trouble building Postgres cartridge under Linux. All other parts of RDKit compile and pass tests (with -DRDK_BUILD_PGSQL=OFF, Windows compilation of cartridge also works)

The problem is that cartridge build fails due to invalid link command: /BUILD/boost/lib/libboost_iostreams-mt-d-x64.so -loptimized_static /BUILD/boost/lib/libboost_regex-mt-x64.so -ldebug_static /BUILD/boost/lib/libboost_regex-mt-d-x64.so ../../GraphMol/MolAlign/libRDKitMolAlign_static.a

It seems that whatever code automatically adds boost libraries is somehow mangling in configuration information. I also get both debug and release versions of boost libraries in link command ../../Catalogs/libRDKitCatalogs_static.a /BUILD/boost/lib/libboost_serialization-mt-x64.so /BUILD/boost/lib/libboost_serialization-mt-d-x64.so /usr/lib/x86_64-linux-gnu/libfreetype.so though I'm not sure if this is an issue also.

To Reproduce

I'm building RDKit from source using boost 1.76 built locally. Postgres 12 is installed from PostgreSQL Apt Repository. Cmake 3.21.3 is installed from KitWare apt repository.

Run cmake referencing custom boost:

cmake -DBOOST_ROOT:PATHNAME=$BOOST_BASE_PATH -DBoost_LIBRARY_DIRS=$BOOST_LIBRARYDIR -DBoost_NO_SYSTEM_PATHS=ON -DBoost_NO_BOOST_CMAKE=TRUE -DBoost_ARCHITECTURE=-x64 -DRDK_BUILD_PYTHON_WRAPPERS=ON -DPYTHON_EXECUTABLE:FILEPATH=$PYTHONBIN_DIR -DPYTHON_LIBRARY=$PYTHON_LIBRARY -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR -DPYTHON_NUMPY_INCLUDE_PATH=$PYTHON_NUMPY_INCLUDE_PATH -DRDK_BUILD_INCHI_SUPPORT=ON -DRDK_BUILD_AVALON_SUPPORT=ON -DRDK_BUILD_FREESASA_SUPPORT=ON -DRDK_BUILD_YAEHMOP_SUPPORT=ON -DRDK_BUILD_MOLINTERCHANGE_SUPPORT=ON -DRDK_BUILD_PGSQL=ON -DPostgreSQL_CONFIG=$POSTGRES_CONFIG ..

Run make

Expected behavior

Cartridge is built successfully.

Configuration (please complete the following information):

  • RDKit version: 2021.09.2
  • OS: Ubuntu 20.04
  • Python version : Python 3.8
  • Building rdkit from source

Additional context

Link.txt generated by CMake:

/usr/bin/c++ -fPIC -mpopcnt -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wall -Wextra -fPIC -O3 -DNDEBUG -shared -Wl,-soname,librdkit.so -o librdkit.so CMakeFiles/rdkit.dir/adapter.cpp.o CMakeFiles/rdkit.dir/bfp_op.c.o CMakeFiles/rdkit.dir/cache.c.o CMakeFiles/rdkit.dir/guc.c.o CMakeFiles/rdkit.dir/low_gist.c.o CMakeFiles/rdkit.dir/mol_op.c.o CMakeFiles/rdkit.dir/rdkit_gist.c.o CMakeFiles/rdkit.dir/bfp_gist.c.o CMakeFiles/rdkit.dir/bfp_gin.c.o CMakeFiles/rdkit.dir/bitstring.c.o CMakeFiles/rdkit.dir/rdkit_io.c.o CMakeFiles/rdkit.dir/rxn_op.c.o CMakeFiles/rdkit.dir/sfp_op.c.o -L/BUILD/rdkit/lib -Wl,-rpath,/BUILD/rdkit/lib:/BUILD/boost/lib /usr/lib/x86_64-linux-gnu/libpq.so ../../../External/AvalonTools/libRDKitAvalonLib_static.a ../../../External/AvalonTools/libRDKitavalon_clib_static.a ../../../External/INCHI-API/libRDKitRDInchiLib_static.a ../../../External/INCHI-API/libRDKitInchi_static.a ../../GraphMol/MolInterchange/libRDKitMolInterchange_static.a ../../GraphMol/MolDraw2D/libRDKitMolDraw2D_static.a ../../GraphMol/MolTransforms/libRDKitMolTransforms_static.a ../../GraphMol/MolHash/libRDKitMolHash_static.a ../../GraphMol/FMCS/libRDKitFMCS_static.a ../../GraphMol/ChemReactions/libRDKitChemReactions_static.a ../../GraphMol/ChemTransforms/libRDKitChemTransforms_static.a ../../GraphMol/FileParsers/libRDKitFileParsers_static.a ../../GraphMol/SmilesParse/libRDKitSmilesParse_static.a ../../GraphMol/Fingerprints/libRDKitFingerprints_static.a ../../GraphMol/Subgraphs/libRDKitSubgraphs_static.a ../../GraphMol/Descriptors/libRDKitDescriptors_static.a ../../GraphMol/PartialCharges/libRDKitPartialCharges_static.a ../../GraphMol/Substruct/libRDKitSubstructMatch_static.a ../../GraphMol/libRDKitGraphMol_static.a ../../Numerics/EigenSolvers/libRDKitEigenSolvers_static.a ../../DataStructs/libRDKitDataStructs_static.a ../../GraphMol/Depictor/libRDKitDepictor_static.a ../../Geometry/libRDKitRDGeometryLib_static.a ../../RDGeneral/libRDKitRDGeneral_static.a ../../../External/RingFamilies/libRDKitRingDecomposerLib_static.a ../../GraphMol/FilterCatalog/libRDKitFilterCatalog_static.a ../../Catalogs/libRDKitCatalogs_static.a /BUILD/boost/lib/libboost_serialization-mt-x64.so /BUILD/boost/lib/libboost_serialization-mt-d-x64.so /usr/lib/x86_64-linux-gnu/libfreetype.so ../../GraphMol/Subgraphs/libRDKitSubgraphs_static.a ../../GraphMol/FileParsers/libRDKitFileParsers_static.a /usr/lib/x86_64-linux-gnu/libz.so ../../GraphMol/SmilesParse/libRDKitSmilesParse_static.a ../../GraphMol/Depictor/libRDKitDepictor_static.a ../../../External/CoordGen/libRDKitmaeparser_static.a /BUILD/boost/lib/libboost_system-mt-x64.so /BUILD/boost/lib/libboost_system-mt-d-x64.so /BUILD/boost/lib/libboost_iostreams-mt-x64.so /BUILD/boost/lib/libboost_iostreams-mt-d-x64.so -loptimized_static /BUILD/boost/lib/libboost_regex-mt-x64.so -ldebug_static /BUILD/boost/lib/libboost_regex-mt-d-x64.so ../../GraphMol/MolAlign/libRDKitMolAlign_static.a ../../GraphMol/MolTransforms/libRDKitMolTransforms_static.a ../../Numerics/EigenSolvers/libRDKitEigenSolvers_static.a ../../GraphMol/Substruct/libRDKitSubstructMatch_static.a ../../GraphMol/libRDKitGraphMol_static.a ../../Numerics/Alignment/libRDKitAlignment_static.a ../../Geometry/libRDKitRDGeometryLib_static.a ../../DataStructs/libRDKitDataStructs_static.a ../../RDGeneral/libRDKitRDGeneral_static.a ../../../External/CoordGen/libRDKitcoordgen_static.a -lpthread

@SPKorhonen SPKorhonen added the bug label Nov 9, 2021
@ptosco
Copy link
Contributor

ptosco commented Nov 9, 2021

@SPKorhonen Thanks for providing details regarding your installation. I'll try to reproduce this over the next few days. Could you please also share your boost build script (you mentioned that you have built this locally) and any relevant configuration file?

@SPKorhonen
Copy link
Contributor Author

Here is the relevant portion of our build script:

#BOOST
cd boost

tee user-config_gcc93_PY38-64.jam <<EOF
import toolset : using ;  
using gcc : 9.3 ;  
using python  
     : 3.8  
     : "/usr/bin/python3"
     : "/usr/include/python3.8"
     : "/usr/lib/x86_64-linux-gnu"
     ;
EOF

wget https://github.com/unicode-org/icu/releases/download/release-69-1/icu4c-69_1-src.tgz
rm -rf icu
tar xvf icu4c-68_2-src.tgz
cd icu/source
CXXFLAGS=-std=c++11 ./runConfigureICU Linux/gcc
make
make install
cd $NMRS_DEV_BUILDBOOST

wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2
tar -xvf boost_1_76_0.tar.bz2
mv boost_1_76_0 1_76_0_BUILD
cp -Rf ./1_76_0_BUILD/boost .
cp -f user-config_gcc93_PY38-64.jam $HOME/user-config.jam
cd 1_76_0_BUILD
./bootstrap.sh gcc --with-python=/usr/bin/python3 --with-python-version=3.8 --with-python-root=/usr/lib/x86_64-linux-gnu
rm -rf bin.v2
rm -rf stage
./b2 variant=debug,release runtime-link=shared threading=multi address-model=64 architecture=x86 -j12 --without-mpi --build-type=complete --layout=tagged --toolset=gcc
cp -rf ./stage/lib ../lib
cd $NMRS_BUILDBASE

@ptosco
Copy link
Contributor

ptosco commented Nov 9, 2021

@SPKorhonen Thanks!

ptosco pushed a commit to ptosco/rdkit that referenced this issue Nov 12, 2021
greglandrum pushed a commit that referenced this issue Nov 20, 2021
* fixes #4681

* fixes a few Windows build problems

* added comments to adapter.cpp to explain the changes

* get PostgreSQL to build on Windows with both MSVC and MinGW compilers

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
@greglandrum greglandrum added this to the 2022_03_1 milestone Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants