opencv / opencv/opencv-python

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

オープン
#492 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug
主要言語
Python
スター
5.4k
フォーク
1k
平均マージ
22時間 17分
マージ済み PR(30日)
3

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リポジトリのルートから、記載されている環境変数を使って Windows wheel のビルドを再現し、その後、opencv_contrib/modules/freetype/CMakeLists.txt に示されている freetype チェックと OpenCVUtils.cmake の警告を調査します。FreeType のインストールがない場合でも freetype.lib のリンクエラーが発生せず、BUILD_opencv_freetype=OFF を手動で設定しなくてもビルドが完了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cmake, python
領域
build-system
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。