Skip to content

Commit

Permalink
Compile reference library
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCBrammer committed Feb 19, 2024
1 parent 13b0931 commit 95b37e6
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ on:
jobs:
test_glibc_gcc:
runs-on: ubuntu-latest
container: gcc:latest
container: gcc:12

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- uses: ./.github/actions/regression_tests
with:
artifact-name: regression-test-results_glibc_gcc
Expand Down
12 changes: 9 additions & 3 deletions INCHI-1-TEST/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM python:3.12

# Python image includes the dependencies we need for building InChI (gcc, make, etc.)
FROM python:3.12-bookworm
# Python image includes the dependencies we need for building InChI (gcc, make, etc.).

RUN pip install --upgrade pip && \
pip install git+https://github.com/TUCAN-nest/SDF-pipeline.git

# On Debian bookworm (12) only GCC versions 11 and 12 are available.
# For GCC versions 9 and 10, use Debian bullseye (11).
ARG GCC_VERSION=12
RUN apt-get update && apt-get install gcc-$GCC_VERSION -y
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 42
RUN update-alternatives --set gcc /usr/bin/gcc-$GCC_VERSION
16 changes: 16 additions & 0 deletions INCHI-1-TEST/compile_reference_inchi_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

reference_version="v1.06"

if ! git diff-index --quiet HEAD --; then
echo "There are uncommitted changes on the current branch."
echo "Please commit or stash them before checking out the reference tag."
exit 1
fi
git checkout tags/$reference_version

(cd INCHI-1-SRC/INCHI_API/libinchi/gcc &&
make -j LIB_DIR=../../../../INCHI-1-TEST VERSION=.$reference_version)

# Switch back to the branch that was checked out prior to checking out the tag.
git switch -
4 changes: 1 addition & 3 deletions INCHI-1-TEST/compute_regression_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
if __name__ == "__main__":
dataset = get_dataset_arg()

subprocess.run(
f"{TEST_PATH}/download_inchi_regression_reference_lib.sh", check=True
)
subprocess.run(f"{TEST_PATH}/compile_reference_inchi_lib.sh", check=True)

exit_code = 0
sdf_paths = DATASETS[dataset]["sdf_paths"]
Expand Down
2 changes: 1 addition & 1 deletion INCHI-1-TEST/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_progress(current: int, total: int) -> str:
INCHI_API_PARAMETERS: Final[str] = ""
TEST_PATH: Final[Path] = Path(__file__).parent.absolute()
INCHI_LIB_PATH: Final[Path] = TEST_PATH.joinpath("libinchi.so.dev")
INCHI_REFERENCE_LIB_PATH: Final[Path] = TEST_PATH.joinpath("libinchi.so.1.06.00")
INCHI_REFERENCE_LIB_PATH: Final[Path] = TEST_PATH.joinpath("libinchi.so.v1.06")
N_PROCESSES: Final[int] = len(
os.sched_getaffinity(0)
) # https://docs.python.org/3/library/multiprocessing.html#multiprocessing.cpu_count
Expand Down
Binary file modified INCHI-1-TEST/data/ci/inchi.sdf.regression_reference.sqlite
Binary file not shown.
Binary file modified INCHI-1-TEST/data/ci/mcule.sdf.regression_reference.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion INCHI-1-TEST/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Note that validation isn't available for `pubchem_compound3d`.
```Shell
python -m INCHI-1-TEST.compute_regression_reference <dataset>
```
downloads `libinchi.so.1.06.00`, the shared library belonging to the current stable InChI release,
compiles `libinchi.so.v1.06`, the shared library belonging to the current stable InChI release,
and generates an `<SDF>.regression_reference.sqlite` file for each SDF under `INCHI-1-TEST/data/<dataset>`.
The `sqlite` file contains a table with the results for each molfile.

Expand Down
5 changes: 0 additions & 5 deletions INCHI-1-TEST/download_inchi_regression_reference_lib.sh

This file was deleted.

0 comments on commit 95b37e6

Please sign in to comment.