Fixes RDK_BUILD_THREADSAFE_SSS=OFF build (#4349)

* - fix non-threaded *nix builds that currently fail because
  boost flyweight introduces a dependency on pthreads
- make sure that mutexes and futures are only used when
  RDK_BUILD_THREADSAFE_SSS is ON
- fix SubstructMatch failing test when RDK_BUILD_THREADSAFE_SSS is OFF
  due to misplaced #ifdef's
- rename RDK_TEST_MULTITHREADED to RDK_THREADSAFE_SSS in inchi.cpp
  (which is not a test)

* - the limitexternal Linux build is now single-threaded so we make
  sure single-threaded builds do not break in the future
  (suggestion from Greg)

* reverted unnecessary change to Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
This commit is contained in:
Paolo Tosco
2021-07-23 14:25:25 +02:00
committed by GitHub
parent 85078f12c4
commit 3904b6958d
9 changed files with 52 additions and 30 deletions

View File

@@ -4,7 +4,9 @@
#include "EHTTools.h"
#include <GraphMol/RDKitBase.h>
#include <GraphMol/MolOps.h>
#ifdef RDK_THREADSAFE_SSS
#include <mutex>
#endif
#include <fstream>
extern "C" {
@@ -19,11 +21,15 @@ const std::string _EHTChargeMatrix = "_EHTChargeMatrix";
// we should only call into the C code, which uses tons of globals, from one
// thread at a time. This mutex enforces that.
#ifdef RDK_THREADSAFE_SSS
std::mutex yaehmop_mutex;
#endif
bool runMol(const ROMol &mol, EHTResults &results, int confId,
bool preserveHamiltonianAndOverlapMatrices) {
#ifdef RDK_THREADSAFE_SSS
std::lock_guard<std::mutex> lock(yaehmop_mutex);
#endif
// -----------------------------
// ----- BOILERPLATE -----------