Bug 197907 - graphics/openimageio fails to build when USE_GCC=yes implies GCC 4.9
Summary: graphics/openimageio fails to build when USE_GCC=yes implies GCC 4.9
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-22 01:56 UTC by Gerald Pfeifer
Modified: 2015-06-29 21:38 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (FreeBSD)


Attachments
update for gcc4.9 as default version (2.72 KB, patch)
2015-02-27 02:04 UTC, Shane
no flags Details | Diff
update for gcc4.9 as default version (2.59 KB, patch)
2015-02-27 03:08 UTC, Shane
no flags Details | Diff
update for gcc4.9 as default version (438 bytes, patch)
2015-03-05 05:06 UTC, Shane
no flags Details | Diff
Patch (879 bytes, patch)
2015-04-09 11:58 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer freebsd_committer freebsd_triage 2015-02-22 01:56:26 UTC
This is related to PR 196712 and blocks updating the default version of
GCC from 4.8 to 4.9.

I believe what is happening here is that OpenEXR uses GCC on older 
versions of FreeBSD and when linking with the OpenEXR libraries we
then fail to pull in the proper NEWER GCC run-time libraries.

This can be fixed by building (or at least linking) with the same
compiler that OpenEXR is built with.  See OpenEXR/Makefile for how
this is done there.

http://package18.nyi.freebsd.org/data/93i386-default-PR196712/2015-01-18_16h49m19s/logs/errors/openimageio-1.4.14_2.log

/usr/bin/c++   -O2 -pipe -fno-strict-aliasing -march=i586 -O2 -pipe -fno-strict-aliasing   CMakeFiles/iconvert.dir/iconvert.cpp.o  -o iconvert  -L/usr/local/lib  ../libOpenImageIO/libOpenImageIO.so.1.4.14 /usr/local/lib/libboost_filesystem.so /usr/local/lib/libboost_regex.so /usr/local/lib/libboost_system.so /usr/local/lib/libboost_thread.so /usr/local/lib/libHalf.so /usr/local/lib/libIex.so /usr/local/lib/libImath.so /usr/local/lib/libIlmThread.so -pthread -lopencv_core -lopencv_highgui -lssl -lcrypto /usr/local/lib/libHalf.so /usr/local/lib/libIex.so /usr/local/lib/libImath.so /usr/local/lib/libIlmThread.so /usr/local/lib/libpng.so -lz /usr/local/lib/libtiff.so /usr/local/lib/libjpeg.so -lz /usr/local/lib/libtiff.so /usr/local/lib/libjpeg.so /usr/local/lib/libopenjpeg.so /usr/local/lib/libwebp.so /usr/local/lib/libIlmImf.so /usr/local/lib/libgif.so -Wl,-rpath,/usr/local/lib:/wrkdirs/usr/ports/graphics/openimageio/work/.build/src/libOpenImageIO: 
/usr/local/lib/libIlmImf.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
*** [src/iconvert/iconvert] Error code 1
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-22 01:56:26 UTC
Maintainer CC'd
Comment 2 Shane 2015-02-27 02:04:08 UTC
Created attachment 153568 [details]
update for gcc4.9 as default version

I see no problem adding USE_GCC=yes when gcc is being used. This also cascades into graphics/opencolorio (as master port for opencolorio-tools) and graphics/openshadinglanguage which also link with openimageio.

graphics/blender also uses these ports but already has the USE_GCC in place.

One consolidated patch for all three ports - similar change to each.
Comment 3 Shane 2015-02-27 03:08:31 UTC
Created attachment 153569 [details]
update for gcc4.9 as default version

small adjustment to opencolorio patch. Need to use both options.mk and pre.mk to pickup cmake and pkgconf as dependencies.
Comment 4 Gerald Pfeifer freebsd_committer freebsd_triage 2015-02-28 12:01:05 UTC
Cool, thanks for this patch! I applied the one to graphics/openimageio.

Did you observe the other two ports -- graphics/opencolorio and
graphics/openshadinglanguage -- fail?  They did not show up in the
full ports rebuild report in PR 196712, hence this question.  

If you want these two change as well, I will be happy to commit them
for you.  I just wanted to double check.
Comment 5 Shane 2015-03-01 04:06:06 UTC
Yes I did, only reason I updated them as well - as openimageio is a dependency graphics/opencolorio-tools and graphics/openshadinglanguage won't start to build until openimageio completes, which is why they haven't shown up yet.
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2015-03-03 18:47:16 UTC
This duplicates needless conditional compiler selection logic from OpenEXR. As I suggested in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196712, it'd be better to use compiler:c++11-lib everywhere instead, which essentially does the same thing (noop on 10.x, recent gcc on pre-10), but is shorter, more flexible and future-proof.
Comment 7 Shane 2015-03-05 05:06:51 UTC
Created attachment 153817 [details]
update for gcc4.9 as default version

USES=compiler:c++11-lib works fine in my tests. Update patch to use that instead of USES_GCC
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2015-04-09 11:58:16 UTC
Now that OpenEXR was fixed, there's no longer need for any hacks, so I suggest to just rollback original change. Patch follows.
Comment 9 Dmitry Marakasov freebsd_committer freebsd_triage 2015-04-09 11:58:47 UTC
Created attachment 155360 [details]
Patch
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-06-27 13:27:12 UTC
A commit references this bug:

Author: amdmi3
Date: Sat Jun 27 13:27:10 UTC 2015
New revision: 390701
URL: https://svnweb.freebsd.org/changeset/ports/390701

Log:
  - Remove compiler tampering

  This is no longer needed after the same thing was removed from OpenEXR, and moreover it breaks opencolorio-tools on 9.x

  PR:		197907
  Approved by:	portmgr blanket, maitainer timeout

Changes:
  head/graphics/openimageio/Makefile