Skip to content

Commit

Permalink
Update CI, remove some warnings (#6882)
Browse files Browse the repository at this point in the history
* ci updates

* forgotten update

* inch by inch

* remove unused variable

* try a gcc bump

* get rid of a bunch of unused-but-set errors in clang16

* be more selective

* disable a test in an obsolete module which is mysteriously failing
  • Loading branch information
greglandrum committed Nov 9, 2023
1 parent 55ab3c8 commit a411b87
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 87 deletions.
17 changes: 6 additions & 11 deletions .azure-pipelines/linux_build_limitexternal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ steps:
sudo chown -R ${USER} ${CONDA}
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda config --set channel_priority strict
conda config --add channels conda-forge
conda config --set solver libmamba
conda info -a
conda create --name rdkit_build $(python) cmake \
boost-cpp=$(boost_version) \
py-boost=$(boost_version) \
libboost=$(boost_version) libboost-devel=$(boost_version) \
libboost-python=$(boost_version) libboost-python-devel=$(boost_version) \
numpy pillow eigen pandas \
qt
conda activate rdkit_build
conda install -c rdkit nox cairo=1.14.6
displayName: Setup build environment
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
Expand All @@ -35,17 +37,10 @@ steps:
-DRDK_BUILD_INCHI_SUPPORT=OFF \
-DRDK_BUILD_CAIRO_SUPPORT=OFF \
-DRDK_BUILD_QT_SUPPORT=OFF \
-DQt5_DIR=/usr/lib/x86_64-linux-gnu/cmake/Qt5 \
-DRDK_BUILD_SWIG_WRAPPERS=OFF \
-DRDK_SWIG_STATIC=OFF \
-DRDK_BUILD_THREADSAFE_SSS=OFF \
-DRDK_TEST_MULTITHREADED=OFF \
-DBoost_NO_SYSTEM_PATHS=ON \
-DBoost_NO_BOOST_CMAKE=TRUE \
-DRDK_BOOST_PYTHON3_NAME=$(python_name) \
-DPYTHON_EXECUTABLE=${CONDA_PREFIX}/bin/python3 \
-DCMAKE_INCLUDE_PATH="${CONDA_PREFIX}/include" \
-DCMAKE_LIBRARY_PATH="${CONDA_PREFIX}/lib"
-DRDK_TEST_MULTITHREADED=OFF
displayName: Configure build (Run CMake)
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
Expand Down
21 changes: 8 additions & 13 deletions .azure-pipelines/mac_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ steps:
echo -e "backend: TkAgg\n" > $HOME/.matplotlib/matplotlibrc
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda create --name rdkit_build $(compiler)=$(compiler_version) libcxx=$(compiler_version) cmake=3.19.6 \
boost-cpp=$(boost_version) boost=$(boost_version) \
py-boost=$(boost_version) libboost=$(boost_version) \
conda config --set solver libmamba
conda config --set channel_priority strict
conda config --add channels conda-forge
conda create --name rdkit_build $(python) $(compiler) libcxx cmake \
libboost=$(boost_version) libboost-devel=$(boost_version) \
libboost-python=$(boost_version) libboost-python-devel=$(boost_version) \
qt \
numpy matplotlib cairo pillow eigen pandas \
jupyter
conda activate rdkit_build
conda install -c conda-forge sphinx myst-parser
conda install -c conda-forge nbval
jupyter sphinx myst-parser pytest nbval
displayName: Setup build environment
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
Expand Down Expand Up @@ -57,13 +57,8 @@ steps:
-DRDK_BUILD_THREADSAFE_SSS=ON \
-DRDK_TEST_MULTITHREADED=ON \
-DRDK_BUILD_CFFI_LIB=ON \
-DBoost_NO_SYSTEM_PATHS=ON \
-DCMAKE_OSX_SYSROOT=${SDKROOT} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(target_platform) \
-DRDK_BOOST_PYTHON3_NAME=$(python_name) \
-DPYTHON_EXECUTABLE=${CONDA_PREFIX}/bin/python3 \
-DCMAKE_INCLUDE_PATH="${CONDA_PREFIX}/include" \
-DCMAKE_LIBRARY_PATH="${CONDA_PREFIX}/lib"
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(target_platform)
displayName: Configure build (Run CMake)
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/Descriptors/GETAWAY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ std::vector<double> clusterArray(std::vector<double> data, double precision) {
// std::transform(diffs.begin(), diffs.end(), data.begin(), diffs.begin(),
// std::divides<double>());

int j = 0;
int count = 0;
for (unsigned int i = 0; i < data.size(); i++) {
// std::cout << diffs[i] << ",";
Expand All @@ -203,7 +202,6 @@ std::vector<double> clusterArray(std::vector<double> data, double precision) {
if (diffs[i] > pow(0.1, precision)) {
Store.push_back(count);
count = 0;
j++;
}
}

Expand Down
4 changes: 0 additions & 4 deletions Code/GraphMol/Descriptors/test3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ void testPMI1() {
std::string fName =
pathName + "/Code/GraphMol/Descriptors/test_data/PMI_egfr.out";
std::ifstream instrm(fName.c_str());
int nDone = 0;
while (!reader.atEnd()) {
RDKit::ROMol *m = reader.next();
TEST_ASSERT(m);
Expand Down Expand Up @@ -108,7 +107,6 @@ void testPMI1() {
TEST_ASSERT(compare(inm, pmi3_m, val));

delete m;
++nDone;
}
BOOST_LOG(rdErrorLog) << " done" << std::endl;
}
Expand Down Expand Up @@ -252,7 +250,6 @@ void testNPR1() {
pathName + "/Code/GraphMol/Descriptors/test_data/PBF_egfr.sdf";
RDKit::SDMolSupplier reader(sdfName, true, false);

int nDone = 0;
while (!reader.atEnd()) {
RDKit::ROMol *m = reader.next();
TEST_ASSERT(m);
Expand Down Expand Up @@ -280,7 +277,6 @@ void testNPR1() {
compare(nm, pmi2_nom / pmi3_nom, val);

delete m;
++nDone;
}
BOOST_LOG(rdErrorLog) << " done" << std::endl;
}
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/Descriptors/testPBF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ void test1() {
std::string fName =
pathName + "/Code/GraphMol/Descriptors/test_data/PBF_egfr.out";
std::ifstream instrm(fName.c_str());
int nDone = 0;
while (!reader.atEnd()) {
RDKit::ROMol *m = reader.next();
TEST_ASSERT(m);
Expand All @@ -50,7 +49,6 @@ void test1() {
}
TEST_ASSERT(fabs(ref - dpbf) < 0.001);
delete m;
++nDone;
}
BOOST_LOG(rdErrorLog) << " done" << std::endl;
}
Expand Down
6 changes: 0 additions & 6 deletions Code/GraphMol/Descriptors/testWHIM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ void testWHIM2() {

RDKit::SDMolSupplier reader(sdfName, true, false);

int nDone = 0;
while (!reader.atEnd()) {
++nDone;

RDKit::ROMol *m = reader.next();
TEST_ASSERT(m);
std::string nm;
Expand Down Expand Up @@ -62,10 +59,7 @@ void testWHIM3() {

RDKit::SDMolSupplier reader(sdfName, true, false);

int nDone = 0;
while (!reader.atEnd()) {
++nDone;

RDKit::ROMol *m = reader.next();
TEST_ASSERT(m);
std::string nm;
Expand Down
6 changes: 0 additions & 6 deletions Code/GraphMol/DistGeomHelpers/Embedder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,11 @@ bool firstMinimization(RDGeom::PointPtrVect *positions,
field->fixedPoints().push_back(v.first);
}
}
unsigned int nPasses = 0;
field->initialize();
if (field->calcEnergy() > ERROR_TOL) {
int needMore = 1;
while (needMore) {
needMore = field->minimize(400, embedParams.optimizerForceTol);
++nPasses;
}
}
std::vector<double> e_contribs;
Expand Down Expand Up @@ -577,13 +575,9 @@ bool minimizeFourthDimension(RDGeom::PointPtrVect *positions,
// std::cerr<<"FIELD2 E: "<<field2->calcEnergy()<<std::endl;
if (field2->calcEnergy() > ERROR_TOL) {
int needMore = 1;
int nPasses2 = 0;
while (needMore) {
needMore = field2->minimize(200, embedParams.optimizerForceTol);
++nPasses2;
}
// std::cerr<<" "<<field2->calcEnergy()<<" after npasses2:
// "<<nPasses2<<std::endl;
}
return true;
}
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/DistGeomHelpers/testDgeomHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,9 @@ void test5() {
rdbase + "/Code/GraphMol/DistGeomHelpers/test_data/cis_trans_cases.csv";
SmilesMolSupplier smiSup(smifile, ",", 0, 1);

int i = 0;
int cid;
while (1) {
try {
i++;
std::unique_ptr<RWMol> mol{static_cast<RWMol *>(smiSup.next())};
MolOps::addHs(*mol);
cid = DGeomHelpers::EmbedMolecule(*mol, 10, 1); // getCoords(*mol, iter);
Expand Down
2 changes: 1 addition & 1 deletion Code/GraphMol/FMCS/Test/testFMCS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ void testFileSDF_RandomSet(const char* test = "chembl13-10000-random-pairs.sdf",
std::cout << "\n****** RANDOM SET test *********\n\n";
const unsigned int N_RandomTests = all_mols.size() * 7;
srand(1); // make stable pseudorandom sequence
for (unsigned int jn = 0; n <= N_RandomTests; jn++, n++) {
for (; n <= N_RandomTests; n++) {
char smiName[256];
sprintf(smiName, "%s/smilesRAND/%s.%u.smi", path, test, n);
FILE* fsmi = fopen(smiName, "wt");
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ ROMol *MultithreadedSmilesMolSupplier::processMoleculeRecord(
// -----------
// read in the properties
// -----------
unsigned int iprop = 0;
for (unsigned int col = 0; col < recs.size(); col++) {
if (static_cast<int>(col) == d_smi || static_cast<int>(col) == d_name) {
continue;
Expand All @@ -211,7 +210,6 @@ ROMol *MultithreadedSmilesMolSupplier::processMoleculeRecord(

pval = recs[col];
res->setProp(pname, pval);
iprop++;
}
return res;
}
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/FileParsers/SmilesMolSupplier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ ROMol *SmilesMolSupplier::processLine(std::string inLine) {
// -----------
// read in the properties
// -----------
unsigned int iprop = 0;
for (unsigned int col = 0; col < recs.size(); col++) {
if (static_cast<int>(col) == d_smi || static_cast<int>(col) == d_name) {
continue;
Expand All @@ -203,7 +202,6 @@ ROMol *SmilesMolSupplier::processLine(std::string inLine) {

pval = recs[col];
res->setProp(pname, pval);
iprop++;
}

} catch (const SmilesParseException &pe) {
Expand Down
6 changes: 0 additions & 6 deletions Code/GraphMol/MolDraw2D/DrawText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void DrawText::drawStringRects(const std::string &label, OrientType orient,
std::vector<TextDrawType> draw_modes;
std::vector<char> draw_chars;

size_t i = 0;
getStringRects(label, orient, rects, draw_modes, draw_chars, false, talign);
for (auto r : rects) {
r->trans_.x += cds.x;
Expand All @@ -176,7 +175,6 @@ void DrawText::drawStringRects(const std::string &label, OrientType orient,
mol_draw.drawLine(br, bl);
mol_draw.setColour(DrawColour(0.0, 0.95, 0.95));
mol_draw.drawLine(bl, tl);
++i;
}
}

Expand Down Expand Up @@ -310,7 +308,6 @@ void DrawText::getStringExtremes(const std::string &label, OrientType orient,
std::vector<char> to_draw;
getStringRects(label, orient, rects, draw_modes, to_draw, dontSplit);

int i = 0;
for (auto r : rects) {
Point2D tl, tr, br, bl;
r->calcCorners(tl, tr, br, bl, 0.0);
Expand All @@ -326,7 +323,6 @@ void DrawText::getStringExtremes(const std::string &label, OrientType orient,
x_max = std::max(tr.x, x_max);
y_max = std::max(bl.y, y_max);
y_max = std::max(tr.y, y_max);
++i;
}
}

Expand Down Expand Up @@ -362,7 +358,6 @@ void DrawText::alignString(
double x_max = std::numeric_limits<double>::lowest();
double y_min = std::numeric_limits<double>::max();
double y_max = std::numeric_limits<double>::lowest();
int num_norm = 0;
int align_char = -1;
for (size_t i = 0; i < rects.size(); ++i) {
if (draw_modes[i] == TextDrawType::TextDrawNormal) {
Expand All @@ -381,7 +376,6 @@ void DrawText::alignString(
x_max = std::max(tr.x, x_max);
y_max = std::max(bl.y, y_max);
y_max = std::max(tr.y, y_max);
++num_norm;
}
}
align_char = align_char == -1 ? 0 : align_char;
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/MolHash/hashfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,8 @@ std::string AnonymousGraph(RWMol *mol, bool elem, bool useCXSmiles,
unsigned cxFlagsToSkip = 0) {
PRECONDITION(mol, "bad molecule");
std::string result;
int charge = 0;

for (auto aptr : mol->atoms()) {
charge += aptr->getFormalCharge();
aptr->setIsAromatic(false);
aptr->setFormalCharge(0);
if (!elem) {
Expand Down
2 changes: 0 additions & 2 deletions Code/GraphMol/RGroupDecomposition/RGroupDecompParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ bool RGroupDecompositionParameters::prepareCore(RWMol &core,
}
std::set<int> foundLabels;

int nextOffset = 0;
std::map<int, int> atomToLabel;

for (auto atom : core.atoms()) {
Expand Down Expand Up @@ -273,7 +272,6 @@ bool RGroupDecompositionParameters::prepareCore(RWMol &core,
// insufficient dummy groups are added to the core
if (setLabel(atom, indexOffset - atom->getIdx(), foundLabels, maxLabel,
relabel, Labelling::INDEX_LABELS)) {
nextOffset++;
}
found = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Code/GraphMol/RGroupDecomposition/RGroupGa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ vector<GaResult> RGroupGa::runBatch() {
tasks.reserve(numberRuns);
for (int n = 0; n < numberRuns; n++) {
auto future = async(launch::async, &RDKit::RGroupGa::run, this, n + 1);
tasks.push_back(move(future));
tasks.push_back(std::move(future));
}

std::transform(tasks.begin(), tasks.end(), back_inserter(results),
Expand Down
4 changes: 0 additions & 4 deletions Code/GraphMol/RGroupDecomposition/testRGroupDecomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,13 +935,11 @@ M END
SDMolSupplier sdsup;
sdsup.setData(sdmols);

int idx = 0;
while (!sdsup.atEnd()) {
ROMol *mol = sdsup.next();
TEST_ASSERT(mol);
int addedIndex = decomp.add(*mol);
TEST_ASSERT(addedIndex == -1); // none should match
++idx;
delete mol;
}
}
Expand All @@ -966,12 +964,10 @@ M END
SDMolSupplier sdsup;
sdsup.setData(sdmols);

int idx = 0;
while (!sdsup.atEnd()) {
ROMol *mol = sdsup.next();
TEST_ASSERT(mol);
decomp.add(*mol);
++idx;
delete mol;
}
}
Expand Down
5 changes: 5 additions & 0 deletions Code/GraphMol/SmilesParse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ if(MSVC)
ADD_DEFINITIONS("/D YY_NO_UNISTD_H")
endif()

if(CMAKE_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 15)
# the output from bison triggers some warnings we can safely ignore with clang 16+
set_source_files_properties(smarts.tab.cpp smiles.tab.cpp PROPERTIES COMPILE_OPTIONS "-Wno-unused-but-set-variable")
endif()

if(FLEX_EXECUTABLE)
FLEX_TARGET(SmilesL smiles.ll
${CMAKE_CURRENT_SOURCE_DIR}/lex.yysmiles.cpp
Expand Down
6 changes: 0 additions & 6 deletions Code/GraphMol/WedgeBonds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ Bond::BondDir determineBondWedgeState(const Bond *bond,

neighborBondIndices.push_back(bond->getIdx());
neighborBondAngles.push_back(0.0);
unsigned int neighborsWithDirection = 0;
for (const auto nbrBond : mol->atomBonds(atom)) {
const auto otherAtom = nbrBond->getOtherAtom(atom);
if (nbrBond != bond) {
Expand All @@ -169,11 +168,6 @@ Bond::BondDir determineBondWedgeState(const Bond *bond,
}
neighborBondAngles.insert(angleIt, angle);
neighborBondIndices.insert(nbrIt, nbrBond->getIdx());
if (nbrBond->getBeginAtomIdx() == atom->getIdx() &&
(nbrBond->getBondDir() == Bond::BondDir::BEGINDASH ||
nbrBond->getBondDir() == Bond::BondDir::BEGINWEDGE)) {
++neighborsWithDirection;
}
}
}

Expand Down

0 comments on commit a411b87

Please sign in to comment.