Bug 211805 - graphics/opencv: Missing fortran dependency, causes graphics/py-opencv import cv2 fails
Summary: graphics/opencv: Missing fortran dependency, causes graphics/py-opencv import...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Many People
Assignee: Larry Rosenman
URL:
Keywords: easy, needs-qa
Depends on:
Blocks:
 
Reported: 2016-08-13 07:42 UTC by hassonofer
Modified: 2017-11-04 01:56 UTC (History)
8 users (show)

See Also:
koobs: merge-quarterly+


Attachments
Fix error on import cv2. (512 bytes, patch)
2017-04-18 17:03 UTC, Eric Camachat
koobs: maintainer-approval+
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hassonofer 2016-08-13 07:42:02 UTC
System:
FreeBSD localhost 10.3-RELEASE-p4 FreeBSD 10.3-RELEASE-p4

Description:
After installing py27-opencv and py27-numpy using 'pkg', there is a failure to import cv2 before importing numpy.
Script like this:
---
import numpy as np
import cv2
---
will work, but script like this will fail:
---
import cv2
import numpy as np
---

Output: "ImportError: numpy.core.multiarray failed to import"

If I run a full project, I get a more descriptive error:
ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48/libgfortran.so.3 not found


Steps to reproduce:
1. Install py27-opencv py27-numpy using the binary package manager 'pkg'
2. Run python -c 'exec("import cv2\nimport numpy")' - Error
3. Run python -c 'exec("import numpy\nimport cv2")' - No Error
Comment 1 Jason E. Hale freebsd_committer freebsd_triage 2016-09-19 22:59:33 UTC
Return to pool.
Comment 2 Eric Camachat 2017-04-18 17:03:04 UTC
Created attachment 181871 [details]
Fix error on import cv2.
Comment 3 Randy Westlund 2017-10-19 22:30:50 UTC
This patch works for me. py-opencv must be rebuilt also (not just opencv).
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2017-10-26 01:21:16 UTC
Patch is against graphics/opencv, re-classifying (and updating summary) so noone is confused.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2017-10-26 02:10:06 UTC
Comment on attachment 181871 [details]
Fix error on import cv2.

Port is unmaintained, implicit approval (pending QA)
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2017-10-26 02:11:26 UTC
If the dependent (graphics/py-opencv) does indeed require rebuilding, then its PORTREVISION should also be bumped (not included in attachment 181871 [details])
Comment 7 Larry Rosenman freebsd_committer freebsd_triage 2017-10-26 02:31:58 UTC
jbeich mentioned that it does need a PORTREVISION bump.  Poudriere run in progress.
Comment 8 Larry Rosenman freebsd_committer freebsd_triage 2017-10-26 04:57:17 UTC
I accidentally referenced 211806 in the commit for this one.

It's committed in r452901.
Comment 9 Jan Beich freebsd_committer freebsd_triage 2017-10-26 07:59:16 UTC
Can you MFH to 2017Q4? -RELEASE users reside on /quarterly by default.
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2017-10-26 09:48:51 UTC
Pending MFH
Comment 11 Ryan Steinmetz freebsd_committer freebsd_triage 2017-10-26 14:48:47 UTC
(In reply to Kubilay Kocak from comment #10)

Approved by: ports-secteam (zi)
Comment 12 Larry Rosenman freebsd_committer freebsd_triage 2017-10-26 15:01:25 UTC
The bad news is, this brings in a BIG change (armv7 stuff).

Is that still OK zi?
------------------------------------------------------------------------
r451721 | linimon | 2017-10-10 16:31:30 -0500 (Tue, 10 Oct 2017) | 6 lines

For ports that are explicitly enabled on armv6, also enable them
on armv7.  This has not been tested with an -exp run but should
"do no harm".

PR:             221894 (partial)
Comment 13 Mark Linimon freebsd_committer freebsd_triage 2017-10-27 16:40:20 UTC
(In reply to Larry Rosenman from comment #12)

IIUC the additional line will only be evaluated in an environment where ARCH is 'armv7'.  So if that is not the case, the statement should have no effect.  Or am I missing something?

e.g. you should be able to also have a line 

  OPTIONS_GROUP_SIMD_fabulous_thunderbirds=  NEON VFPV3

which would similarly be a no-op.

But if the line somehow needs to be commented out for the MFC, feel free to go ahead.  I'll keep track of it in my local repo, which has many more uncommitted armv7 changes.
Comment 14 Larry Rosenman freebsd_committer freebsd_triage 2017-10-27 16:41:45 UTC
The issue is getting the Tools/scripts/mfh scropt to DTRT, as it'll want to push that big commit to quarterly.
Comment 15 commit-hook freebsd_committer freebsd_triage 2017-10-27 16:45:38 UTC
A commit references this bug:

Author: linimon
Date: Fri Oct 27 16:45:01 UTC 2017
New revision: 453014
URL: https://svnweb.freebsd.org/changeset/ports/453014

Log:
  Temporarily uncomment the added armv7 line to allow an MFC that does not drag
  in world+dog.

  PR:		211805
  Submitted by:	ler
  Reported by:	ler

Changes:
  head/graphics/opencv/Makefile
Comment 16 Mark Linimon freebsd_committer freebsd_triage 2017-10-27 17:08:54 UTC
(In reply to Larry Rosenman from comment #14)

OK, I was unaware of how that script works.  I have commented the line out, and that should be good enough to allow an MFC of the latest revision by itself.

I think?
Comment 17 Jan Beich freebsd_committer freebsd_triage 2017-10-27 17:22:54 UTC
Why ports r451721 has anything to do with ports r452901? Both touch PORTREVISION, so merge conflict is expected. Subversion presents several options to resolve conflicts. If you didn't know how this was supposed to be a homework...

$ ${PORTSDIR:-/usr/ports}/Tools/scripts/mfh 2017Q4 452901
 U   2017Q4
Checked out revision 453016.
A    2017Q4/graphics
Updating '2017Q4/graphics/opencv':
A    2017Q4/graphics/opencv
A    2017Q4/graphics/opencv/files
A    2017Q4/graphics/opencv/files/FindOpenCVCore.cmake.in
A    2017Q4/graphics/opencv/files/patch-cmake__OpenCVCompilerOptions.cmake
A    2017Q4/graphics/opencv/files/patch-cmake__OpenCVFindLibsGUI.cmake
A    2017Q4/graphics/opencv/files/patch-cmake__OpenCVVersion.cmake
A    2017Q4/graphics/opencv/files/patch-modules__contrib__src__spinimages.cpp
A    2017Q4/graphics/opencv/files/patch-modules__core__src__system.cpp
A    2017Q4/graphics/opencv/files/patch-modules__highgui__src__cap_libv4l.cpp
A    2017Q4/graphics/opencv/files/patch-modules__highgui__src__cap_v4l.cpp
A    2017Q4/graphics/opencv/files/patch-modules__python__src2__cv2.cv.hpp
A    2017Q4/graphics/opencv/files/patch-modules__ts__src__ts.cpp
A    2017Q4/graphics/opencv/files/patch-samples__cpp__tutorial_code__core__how_to_scan_images__how_to_scan_images.cpp
A    2017Q4/graphics/opencv/Makefile
A    2017Q4/graphics/opencv/distinfo
A    2017Q4/graphics/opencv/pkg-descr
A    2017Q4/graphics/opencv/pkg-plist
Updated to revision 453016.
Updating '2017Q4/graphics/py-opencv':
A    2017Q4/graphics/py-opencv
A    2017Q4/graphics/py-opencv/Makefile
A    2017Q4/graphics/py-opencv/pkg-plist
Updated to revision 453016.
Summary of updates:
  Updated '2017Q4/graphics/opencv' to r453016.
  Updated '2017Q4/graphics/py-opencv' to r453016.
--- Merging r452901 into '2017Q4':
C    2017Q4/graphics/opencv/Makefile
U    2017Q4/graphics/py-opencv/Makefile
--- Recording mergeinfo for merge of r452901 into '2017Q4':
 U   2017Q4
--- Recording mergeinfo for merge of r452901 into '2017Q4/graphics':
 G   2017Q4/graphics
--- Eliding mergeinfo from '2017Q4/graphics':
 U   2017Q4/graphics
--- Recording mergeinfo for merge of r452901 into '2017Q4/graphics/opencv':
 G   2017Q4/graphics/opencv
--- Eliding mergeinfo from '2017Q4/graphics/opencv':
 U   2017Q4/graphics/opencv
--- Recording mergeinfo for merge of r452901 into '2017Q4/graphics/py-opencv':
 G   2017Q4/graphics/py-opencv
--- Eliding mergeinfo from '2017Q4/graphics/py-opencv':
 U   2017Q4/graphics/py-opencv
Summary of conflicts:
  Text conflicts: 1
Conflict discovered in file '2017Q4/graphics/opencv/Makefile'.
Select: (p) postpone, (df) show diff, (e) edit file, (m) merge,
        (mc) my side of conflict, (tc) their side of conflict,
        (s) show all options: e
Waiting for Emacs...
Select: (p) postpone, (df) show diff, (e) edit file, (m) merge,
        (r) mark resolved, (mc) my side of conflict,
        (tc) their side of conflict, (s) show all options: r
Resolved conflicted state of '2017Q4/graphics/opencv/Makefile'
Summary of conflicts:
  Text conflicts: 0 remaining (and 1 already resolved)
 M      2017Q4
M       2017Q4/graphics/opencv/Makefile
?       2017Q4/graphics/opencv/Makefile.edited
M       2017Q4/graphics/py-opencv/Makefile
Index: 2017Q4/graphics/opencv/Makefile
===================================================================
--- 2017Q4/graphics/opencv/Makefile     (revision 453016)
+++ 2017Q4/graphics/opencv/Makefile     (working copy)
@@ -3,7 +3,7 @@

 PORTNAME?=     opencv
 PORTVERSION=   2.4.13.1
-PORTREVISION?= 7
+PORTREVISION?= 8
 CATEGORIES=    graphics

 MAINTAINER=    ports@FreeBSD.org
@@ -140,7 +140,7 @@ CMAKE_ARGS+=        -DBUILD_opencv_${module}:BOOL=Off
 LIB_DEPENDS+=  libopencv_legacy.so:graphics/opencv
 BUILD_DEPENDS+=        ${PYNUMPY}
 RUN_DEPENDS+=  ${PYNUMPY}
-USES+=         python:2.7
+USES+=         fortran python:2.7
 CMAKE_ARGS+=   -DBUILD_opencv_python:BOOL=On
 . for module in apps java stitching superres videostab
 CMAKE_ARGS+=   -DBUILD_opencv_${module}:BOOL=Off
Index: 2017Q4/graphics/py-opencv/Makefile
===================================================================
--- 2017Q4/graphics/py-opencv/Makefile  (revision 453016)
+++ 2017Q4/graphics/py-opencv/Makefile  (working copy)
@@ -1,7 +1,7 @@
 # Created by: Martin Matuska <mm@FreeBSD.org>
 # $FreeBSD$

-PORTREVISION=  1
+PORTREVISION=  2
 CATEGORIES=    graphics python
 PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

Index: 2017Q4
===================================================================
--- 2017Q4      (revision 453016)
+++ 2017Q4      (working copy)

Property changes on: 2017Q4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /head:r452901
All the merge work was done in /tmp/merge.PcwlSy/2017Q4.
Do you want to commit? (no = start a shell) [y/n]
Comment 18 Larry Rosenman freebsd_committer freebsd_triage 2017-10-27 17:25:36 UTC
because I was under the impression (perhaps misguided) that you needed to merge ALL revisions of a port since the branch.
Comment 19 Kubilay Kocak freebsd_committer freebsd_triage 2017-10-29 02:01:37 UTC
Comment on attachment 181871 [details]
Fix error on import cv2.

Approved by: ports-secteam (zi)

See comment 11
Comment 20 Kubilay Kocak freebsd_committer freebsd_triage 2017-11-04 01:54:43 UTC
Merged (but not referenced, so no comment automatically added) to 2017Q4 in ports r453133
Comment 21 Kubilay Kocak freebsd_committer freebsd_triage 2017-11-04 01:56:08 UTC
Clarification, commit (inadvertently) referenced bug 211806. See bug 211806 comment  4