bertsky / ocrd_detectron2

OCR-D wrapper for detectron2 based segmentation models
16 stars 5 forks source link

install fails with pycocotools #13

Closed witobejmak closed 1 year ago

witobejmak commented 2 years ago

if test -n "$CUDA_VERSION"; then :; \
elif test -s /usr/local/cuda/version.txt; then \
    CUDA_VERSION=$(sed 's/^.* //;s/\([0-9]\+[.][0-9]\).*/\1/' /usr/local/cuda/version.txt); \
elif command -v nvcc &>/dev/null; then \
    CUDA_VERSION=$(nvcc --version | sed -n '/^Cuda/{s/.* release //;s/,.*//;p;}'); \
elif command -v nvidia-smi &>/dev/null; then \
    CUDA_VERSION=$(nvidia-smi | sed -n '/CUDA Version/{s/.*CUDA Version: //;s/ .*//;p;}'); \
elif command -v pkg-config &>/dev/null; then \
    CUDA_VERSION=$(pkg-config --list-all | sed -n '/^cudart/{s/cudart-//;s/ .*//;p;q;}'); \
fi && \
if test "$CUDA_VERSION" = 10.0 -o "$CUDA_VERSION" = 11.0 -o "$CUDA_VERSION" = 11.2; then \
    echo "Detected CUDA version $CUDA_VERSION, which is not supported by Detectron2 - falling back to CPU-only"; CUDA_VERSION=CPU; \
elif test -z "$CUDA_VERSION"; then \
    echo "Cannot find CUDA runtime library, assuming CPU-only"; CUDA_VERSION=CPU; \
fi && echo "Detected CUDA version: $CUDA_VERSION" && \
if test "$CUDA_VERSION" = CPU; then CUDA=cpu; \
else IFS=. CUDA=($CUDA_VERSION) && CUDA=cu${CUDA[0]}${CUDA[1]}; \
fi && pip3 install -r requirements.txt \
-f "https://dl.fbaipublicfiles.com/detectron2/wheels/$CUDA/torch1.10/index.html" \
-f "https://download.pytorch.org/whl/$CUDA/torch_stable.html"
Cannot find CUDA runtime library, assuming CPU-only
Detected CUDA version: CPU
Looking in links: https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/index.html, https://download.pytorch.org/whl/cpu/torch_stable.html
Requirement already satisfied: ocrd>=2.30 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (2.35.0)
Requirement already satisfied: click>=7.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (8.0.4)
Requirement already satisfied: scipy in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (1.5.4)
Requirement already satisfied: numpy>=1.17.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from -r requirements.txt (line 4)) (1.18.5)
Requirement already satisfied: pillow>=7.1.2 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from -r requirements.txt (line 5)) (8.4.0)
Requirement already satisfied: shapely in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from -r requirements.txt (line 6)) (1.8.2)
Collecting scikit-image>=0.17.2
  Using cached scikit_image-0.17.2-cp36-cp36m-manylinux1_x86_64.whl (12.4 MB)
Collecting torch<1.11,>=1.10.1
  Downloading https://download.pytorch.org/whl/cpu/torch-1.10.2%2Bcpu-cp36-cp36m-linux_x86_64.whl (199.3 MB)
     |████████████████████████████████| 199.3 MB 12.2 MB/s            
Collecting torchvision>=0.11.2
  Downloading https://download.pytorch.org/whl/cpu/torchvision-0.11.3%2Bcpu-cp36-cp36m-linux_x86_64.whl (16.2 MB)
     |████████████████████████████████| 16.2 MB 12.4 MB/s            
Collecting detectron2>=0.6
  Downloading https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/detectron2-0.6%2Bcpu-cp36-cp36m-linux_x86_64.whl (5.4 MB)
     |████████████████████████████████| 5.4 MB 10.3 MB/s            
Requirement already satisfied: ocrd-models==2.35.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (2.35.0)
Requirement already satisfied: bagit-profile>=1.3.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (1.3.1)
Requirement already satisfied: lxml in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (4.9.1)
Requirement already satisfied: ocrd-modelfactory==2.35.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (2.35.0)
Requirement already satisfied: ocrd-utils==2.35.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (2.35.0)
Requirement already satisfied: opencv-python-headless in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (4.6.0.66)
Requirement already satisfied: Flask in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (2.0.3)
Requirement already satisfied: pyyaml in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (6.0)
Requirement already satisfied: bagit>=1.7.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (1.8.1)
Requirement already satisfied: requests in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (2.27.1)
Requirement already satisfied: ocrd-validators==2.35.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (2.35.0)
Requirement already satisfied: jsonschema in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (3.2.0)
Requirement already satisfied: Deprecated==1.2.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd>=2.30->-r requirements.txt (line 1)) (1.2.0)
Requirement already satisfied: wrapt<2,>=1 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from Deprecated==1.2.0->ocrd>=2.30->-r requirements.txt (line 1)) (1.14.1)
Requirement already satisfied: atomicwrites>=1.3.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from ocrd-utils==2.35.0->ocrd>=2.30->-r requirements.txt (line 1)) (1.4.1)
Requirement already satisfied: importlib-metadata in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from click>=7.0->-r requirements.txt (line 2)) (4.8.3)
Requirement already satisfied: tifffile>=2019.7.26 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from scikit-image>=0.17.2->-r requirements.txt (line 7)) (2020.9.3)
Requirement already satisfied: imageio>=2.3.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from scikit-image>=0.17.2->-r requirements.txt (line 7)) (2.14.1)
Collecting networkx>=2.0
  Using cached networkx-2.5.1-py3-none-any.whl (1.6 MB)
Collecting PyWavelets>=1.1.1
  Using cached PyWavelets-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (4.4 MB)
Requirement already satisfied: matplotlib!=3.0.0,>=2.0.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from scikit-image>=0.17.2->-r requirements.txt (line 7)) (3.3.4)
Requirement already satisfied: typing-extensions in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from torch<1.11,>=1.10.1->-r requirements.txt (line 8)) (4.1.1)
Requirement already satisfied: dataclasses in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from torch<1.11,>=1.10.1->-r requirements.txt (line 8)) (0.8)
Collecting iopath<0.1.10,>=0.1.7
  Downloading iopath-0.1.9-py3-none-any.whl (27 kB)
Collecting hydra-core>=1.1
  Downloading hydra_core-1.2.0-py3-none-any.whl (151 kB)
     |████████████████████████████████| 151 kB 5.3 MB/s            
Collecting cloudpickle
  Downloading cloudpickle-2.1.0-py3-none-any.whl (25 kB)
Requirement already satisfied: termcolor>=1.1 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from detectron2>=0.6->-r requirements.txt (line 10)) (1.1.0)
Collecting omegaconf>=2.1
  Downloading omegaconf-2.2.2-py3-none-any.whl (79 kB)
     |████████████████████████████████| 79 kB 9.4 MB/s             
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 10.7 MB/s            
  Preparing metadata (setup.py) ... done
Collecting fvcore<0.1.6,>=0.1.5
  Downloading fvcore-0.1.5.post20220512.tar.gz (50 kB)
     |████████████████████████████████| 50 kB 8.4 MB/s             
  Preparing metadata (setup.py) ... done
Collecting pycocotools>=2.0.2
  Downloading pycocotools-2.0.4.tar.gz (106 kB)
     |████████████████████████████████| 106 kB 12.7 MB/s            
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting yacs>=0.1.8
  Downloading yacs-0.1.8-py3-none-any.whl (14 kB)
Collecting tqdm>4.29.0
  Using cached tqdm-4.64.0-py2.py3-none-any.whl (78 kB)
Collecting pydot
  Downloading pydot-1.4.2-py2.py3-none-any.whl (21 kB)
Collecting tabulate
  Downloading tabulate-0.8.10-py3-none-any.whl (29 kB)
Collecting black==21.4b2
  Downloading black-21.4b2-py3-none-any.whl (130 kB)
     |████████████████████████████████| 130 kB 10.9 MB/s            
Requirement already satisfied: tensorboard in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from detectron2>=0.6->-r requirements.txt (line 10)) (1.15.0)
Collecting regex>=2020.1.8
  Using cached regex-2022.7.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (749 kB)
Collecting appdirs
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting mypy-extensions>=0.4.3
  Downloading mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting pathspec<1,>=0.8.1
  Downloading pathspec-0.9.0-py2.py3-none-any.whl (31 kB)
Collecting toml>=0.10.1
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting typed-ast>=1.4.2
  Downloading typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (831 kB)
     |████████████████████████████████| 831 kB 9.1 MB/s            
Collecting antlr4-python3-runtime==4.9.*
  Downloading antlr4-python3-runtime-4.9.3.tar.gz (117 kB)
     |████████████████████████████████| 117 kB 10.6 MB/s            
  Preparing metadata (setup.py) ... done
Collecting importlib-resources
  Using cached importlib_resources-5.4.0-py3-none-any.whl (28 kB)
Collecting packaging
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting portalocker
  Downloading portalocker-2.5.1-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: cycler>=0.10 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image>=0.17.2->-r requirements.txt (line 7)) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image>=0.17.2->-r requirements.txt (line 7)) (1.3.1)
Requirement already satisfied: python-dateutil>=2.1 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image>=0.17.2->-r requirements.txt (line 7)) (2.8.2)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image>=0.17.2->-r requirements.txt (line 7)) (3.0.9)
Collecting decorator<5,>=4.3
  Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Requirement already satisfied: Werkzeug>=2.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from Flask->ocrd>=2.30->-r requirements.txt (line 1)) (2.0.3)
Requirement already satisfied: itsdangerous>=2.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from Flask->ocrd>=2.30->-r requirements.txt (line 1)) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from Flask->ocrd>=2.30->-r requirements.txt (line 1)) (3.0.3)
Requirement already satisfied: zipp>=0.5 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from importlib-metadata->click>=7.0->-r requirements.txt (line 2)) (3.6.0)
Requirement already satisfied: setuptools in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from jsonschema->ocrd>=2.30->-r requirements.txt (line 1)) (59.6.0)
Requirement already satisfied: six>=1.11.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from jsonschema->ocrd>=2.30->-r requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: attrs>=17.4.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from jsonschema->ocrd>=2.30->-r requirements.txt (line 1)) (21.4.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from jsonschema->ocrd>=2.30->-r requirements.txt (line 1)) (0.18.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from requests->ocrd>=2.30->-r requirements.txt (line 1)) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from requests->ocrd>=2.30->-r requirements.txt (line 1)) (2022.6.15)
Requirement already satisfied: idna<4,>=2.5 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from requests->ocrd>=2.30->-r requirements.txt (line 1)) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from requests->ocrd>=2.30->-r requirements.txt (line 1)) (1.26.10)
Requirement already satisfied: absl-py>=0.4 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from tensorboard->detectron2>=0.6->-r requirements.txt (line 10)) (1.1.0)
Requirement already satisfied: wheel>=0.26 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from tensorboard->detectron2>=0.6->-r requirements.txt (line 10)) (0.37.1)
Requirement already satisfied: grpcio>=1.6.3 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from tensorboard->detectron2>=0.6->-r requirements.txt (line 10)) (1.47.0)
Requirement already satisfied: protobuf>=3.6.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from tensorboard->detectron2>=0.6->-r requirements.txt (line 10)) (3.19.4)
Requirement already satisfied: markdown>=2.6.8 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from tensorboard->detectron2>=0.6->-r requirements.txt (line 10)) (3.3.7)
Requirement already satisfied: MarkupSafe>=2.0 in /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages (from Jinja2>=3.0->Flask->ocrd>=2.30->-r requirements.txt (line 1)) (2.0.1)
Building wheels for collected packages: fvcore, antlr4-python3-runtime, pycocotools, future
  Building wheel for fvcore (setup.py) ... done
  Created wheel for fvcore: filename=fvcore-0.1.5.post20220512-py3-none-any.whl size=61288 sha256=247fb1bbcbc0a92e9ab8eed2979ee743e5b8873491c8c3eb06cedb7ddf63b300
  Stored in directory: /home/bejmak/.cache/pip/wheels/d8/a6/d7/45355843f401575fd6c60baa10f23a035f2b8d89866894870e
  Building wheel for antlr4-python3-runtime (setup.py) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144575 sha256=b9f4ceb363e3d93cb62b9653163314a74a2c2478c71a9eeeda5554cb6ee07bac
  Stored in directory: /home/bejmak/.cache/pip/wheels/db/fb/79/75c19314f02d8da5400c2b2794f5f368ab39ba7f644c98dcee
  Building wheel for pycocotools (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/bin/python3 /home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpistj7n8_
       cwd: /tmp/pip-install-uxaes31u/pycocotools_e9223dcd7e0a4d03aa8041adb8b64fce
  Complete output (67 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/pycocotools
  copying pycocotools/mask.py -> build/lib.linux-x86_64-3.6/pycocotools
  copying pycocotools/coco.py -> build/lib.linux-x86_64-3.6/pycocotools
  copying pycocotools/__init__.py -> build/lib.linux-x86_64-3.6/pycocotools
  copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-3.6/pycocotools
  running build_ext
  skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
  building 'pycocotools._mask' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/common
  creating build/temp.linux-x86_64-3.6/pycocotools
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-build-env-ncck29pn/overlay/lib/python3.6/site-packages/numpy/core/include -I./common -I/home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/include -I/usr/include/python3.6m -c ./common/maskApi.c -o build/temp.linux-x86_64-3.6/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
  ./common/maskApi.c: In function ‘rleDecode’:
  ./common/maskApi.c:46:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
         for( k=0; k<R[i].cnts[j]; k++ ) *(M++)=v; v=!v; }}
         ^~~
  ./common/maskApi.c:46:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
         for( k=0; k<R[i].cnts[j]; k++ ) *(M++)=v; v=!v; }}
                                                   ^
  ./common/maskApi.c: In function ‘rleToBbox’:
  ./common/maskApi.c:135:32: warning: unused variable ‘xp’ [-Wunused-variable]
       uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
                                  ^~
  ./common/maskApi.c: In function ‘rleFrPoly’:
  ./common/maskApi.c:181:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(j=0; j<k; j++) x[j]=(int)(scale*xy[j*2+0]+.5); x[k]=x[0];
     ^~~
  ./common/maskApi.c:181:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
     for(j=0; j<k; j++) x[j]=(int)(scale*xy[j*2+0]+.5); x[k]=x[0];
                                                        ^
  ./common/maskApi.c:182:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(j=0; j<k; j++) y[j]=(int)(scale*xy[j*2+1]+.5); y[k]=y[0];
     ^~~
  ./common/maskApi.c:182:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
     for(j=0; j<k; j++) y[j]=(int)(scale*xy[j*2+1]+.5); y[k]=y[0];
                                                        ^
  ./common/maskApi.c: In function ‘rleToString’:
  ./common/maskApi.c:227:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
         if(more) c |= 0x20; c+=48; s[p++]=c;
         ^~
  ./common/maskApi.c:227:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
         if(more) c |= 0x20; c+=48; s[p++]=c;
                             ^
  ./common/maskApi.c: In function ‘rleFrString’:
  ./common/maskApi.c:235:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
     while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
     ^~~~~
  ./common/maskApi.c:235:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
     while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
                        ^~~~
  ./common/maskApi.c:243:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
       if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
       ^~
  ./common/maskApi.c:243:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
       if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
                                    ^~~~
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-build-env-ncck29pn/overlay/lib/python3.6/site-packages/numpy/core/include -I./common -I/home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/include -I/usr/include/python3.6m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.6/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
  pycocotools/_mask.c:4:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=3352ae92170f60019fd463f6c08771f17434db4a63e197410b8ecf6c89d93f57
  Stored in directory: /home/bejmak/.cache/pip/wheels/6e/9c/ed/4499c9865ac1002697793e0ae05ba6be33553d098f3347fb94
Successfully built fvcore antlr4-python3-runtime future
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects
Makefile:26: recipe for target 'deps' failed
make[2]: *** [deps] Error 1
make[2]: Leaving directory '/home/bejmak/ocrd_all/ocrd_detectron2'
Makefile:283: recipe for target '/home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/bin/ocrd-detectron2-segment' failed
make[1]: *** [/home/bejmak/ocrd_all/venv/sub-venv/headless-tf1/bin/ocrd-detectron2-segment] Error 2
make[1]: Leaving directory '/home/bejmak/ocrd_all'
Makefile:278: recipe for target '/home/bejmak/ocrd_all/venv/bin/ocrd-detectron2-segment' failed
make: *** [/home/bejmak/ocrd_all/venv/bin/ocrd-detectron2-segment] Error 2
make: *** Deleting file '/home/bejmak/ocrd_all/venv/bin/ocrd-detectron2-segment'
bejmak@ubuntu:~/ocrd_all$ ```
bertsky commented 2 years ago

I believe the reason for this is simply that a system package python3-dev is missing. I could add a deps-ubuntu rule here, but since this is already required for most other OCR-D packages, and is therefore included in ocrd_all's deps-ubuntu, I'd rather not.

@witobejmak can you confirm the installation runs through afer you apt-get install that?