opencv / opencv/opencv-python

Freetype has been found when there are no freetype in environment (Windows)

Abierto
#492 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1k
Merge medio
22 h 17 min
PR fusionados (30 d)
3

Descripción

Actual behaviour

I have faced the issue when I do not have pre-installed freetype in my environment, but during a build cmake finds it and try to build the project with it.
The log during the configuration:

  -- Checking for module 'freetype2'
  --   Found freetype2, version 23.0.17
  CMake Warning at C:/Users/runneradmin/AppData/Local/Temp/pip-req-build-egif0lkt/opencv/cmake/OpenCVUtils.cmake:882 (message):
    ocv_check_modules(FREETYPE): can't find library 'freetype'.  Specify
    'pkgcfg_lib_FREETYPE_freetype' manually
  Call Stack (most recent call first):
    C:/Users/runneradmin/AppData/Local/Temp/pip-req-build-egif0lkt/opencv_contrib/modules/freetype/CMakeLists.txt:6 (ocv_check_modules)

And the log during the build:

  LINK : fatal error LNK1181: cannot open input file 'freetype.lib' [C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-egif0lkt\_skbuild\win32-3.6\cmake-build\modules\python3\opencv_python3.vcxproj]
Steps to reproduce
  • example code:

Run building a wheel command in the root directory of opencv-python repository with the following environment variables:
SDIST=0
ENABLE_HEADLESS=0
ENABLE_CONTRIB=1

python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose
  • operating system: Windows x86 / x64
  • architecture (e.g. x86)
  • opencv-python version: 4.5.2
  • branch: master
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
How to temporary fix it

I have added the flag -DBUILD_opencv_freetype=OFF to suppress freetype and to build without it.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce la compilación del wheel de Windows desde la raíz del repositorio con las variables de entorno indicadas y, después, inspecciona la comprobación de freetype mostrada en opencv_contrib/modules/freetype/CMakeLists.txt y la advertencia de OpenCVUtils.cmake. Se considera terminado cuando la ausencia de una instalación de FreeType no produce un error de enlazado de freetype.lib y la compilación sigue completándose sin establecer manualmente BUILD_opencv_freetype=OFF.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cmake, python
Área
build-system
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.