Bug 179165 - graphics/openimageio fail to compile
Summary: graphics/openimageio fail to compile
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-01 08:00 UTC by Anderson Guzman
Modified: 2013-06-19 23:10 UTC (History)
0 users

See Also:


Attachments
patch-ptex.imageio_ptex_PtexWriter.cpp (285 bytes, text/plain; charset=UTF-8)
2013-06-04 13:35 UTC, Shane
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anderson Guzman 2013-06-01 08:00:00 UTC
******
a) 
The port fail to compile because can't get openimageio-1.1.10.tar.gz:



=> Attempting to fetch https://nodeload.github.com/OpenImageIO/oiio/legacy.tar.gz/Release-1.1.10?dummy=/openimageio-1.1.10.tar.gz
fetch: https://nodeload.github.com/OpenImageIO/oiio/legacy.tar.gz/Release-1.1.10?dummy=/openimageio-1.1.10.tar.gz: size mismatch: expected 9501836, actual 9501822
=> Attempting to fetch http://nodeload.github.com/OpenImageIO/oiio/legacy.tar.gz/Release-1.1.10?dummy=/openimageio-1.1.10.tar.gz
fetch: http://nodeload.github.com/OpenImageIO/oiio/legacy.tar.gz/Release-1.1.10?dummy=/openimageio-1.1.10.tar.gz: size mismatch: expected 9501836, actual 9501822
=> Attempting to fetch http://cloud.github.com/downloads/OpenImageIO/oiio/openimageio-1.1.10.tar.gz
fetch: http://cloud.github.com/downloads/OpenImageIO/oiio/openimageio-1.1.10.tar.gz: Forbidden
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/openimageio-1.1.10.tar.gz
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/openimageio-1.1.10.tar.gz: File unavailable (e.g., file not found, no access)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles// and try again.

****** 

b) if you try download the file and put manually into /usr/ports/distfiles/ not compile too, because GH_COMMIT value in Makefile located in /usr/ports/graphics/openimageio is different from that you download from  nodeload.github.com/OpenImageIO/oiio/legacy.tar.gz/Release-1.1.10?dummy=/openimageio-1.1.10.tar.gz:

GH_COMMIT value in Makefile currently is: f28f5c4 
GH_COMMIT value in Makefile should be: d7aa9f2

and the SHA256 and SIZE in distinfo are different too:

Original distinfo file:

SHA256 (openimageio-1.1.10.tar.gz) = 1510287790113f0c64421623be7bf5b9317a1c9cfd6e85125bae81bc6c07a275
SIZE (openimageio-1.1.10.tar.gz) = 9501836

Should be:

SHA256 (openimageio-1.1.10.tar.gz) = 171b19d98f3b8d95d600a1bdc71447d6a8675ca18bed70ebc576a68e71f73dc7
SIZE (openimageio-1.1.10.tar.gz) = 9501822


*************

c) If you use the correct openimageio-1.1.10.tar.gz (sha256 : 171b19d98f3b8d95d600a1bdc71447d6a8675ca18bed70ebc576a68e71f73dc7) and try to compile it with default GCC installation : gcc (GCC) 4.2.1 20070831 patched [FreeBSD]  you get: 

[ 84%] Building CXX object libOpenImageIO/CMakeFiles/hash_test.dir/hash_test.cpp.o
Linking CXX executable fmath_test
/usr/local/lib/libOpenColorIO.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
*** [libOpenImageIO/fmath_test] Error code 1
1 error
*** [libOpenImageIO/CMakeFiles/fmath_test.dir/all] Error code 2
Linking CXX executable filesystem_test
/usr/local/lib/libOpenColorIO.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
*** [libOpenImageIO/filesystem_test] Error code 1
1 error
*** [libOpenImageIO/CMakeFiles/filesystem_test.dir/all] Error code 2
Linking CXX executable imagespec_test
/usr/local/lib/libOpenColorIO.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
*** [libOpenImageIO/imagespec_test] Error code 1
1 error

If you run  strings /usr/lib/libstdc++.so.6 | grep GLIBC to check GLIBCXX version you get :

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_FORCE_NEW

Of course, with gcc (GCC) 4.2.1 20070831 isn't possible compile openimageio 1.1.10 

But if you try to compile with gcc48 (FreeBSD Ports Collection) 4.8.1 20130418 (prerelease) you get:

usr/ports/graphics/openimageio/work/OpenImageIO-oiio-d7aa9f2/src/ptex.imageio/ptex/PtexWriter.cpp: In member function 'virtual bool PtexWriterBase::close(Ptex::String&)':
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-d7aa9f2/src/ptex.imageio/ptex/PtexWriter.cpp:326:26: error: 'unlink' was not declared in this scope
  unlink(_tilepath.c_str());
                          ^
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-d7aa9f2/src/ptex.imageio/ptex/PtexWriter.cpp: In member function 'virtual bool PtexMainWriter::close(Ptex::String&)':
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-d7aa9f2/src/ptex.imageio/ptex/PtexWriter.cpp:796:25: error: 'unlink' was not declared in this scope
  unlink(_tmppath.c_str());
                         ^
/usr/ports/graphics/openimageio/work/OpenImageIO-oiio-d7aa9f2/src/ptex.imageio/ptex/PtexWriter.cpp:801:22: error: 'unlink' was not declared in this scope
  unlink(_path.c_str());
                        ^
*** [libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/ptex.imageio/ptex/PtexWriter.cpp.o] Error code 1
1 error
*** [libOpenImageIO/CMakeFiles/OpenImageIO.dir/all] Error code 2
1 error
*** [all] Error code 2
1 error
*** [do-build] Error code 1

If you run strings /usr/local/lib/gcc48/libstdc++.so.6 | grep GLIBC to check GLIBXX you get :


GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_DEBUG_MESSAGE_LENGTH

GCC 4.8 have the support to compile openimageio 1.10, but don't compile too ...

How-To-Repeat: portmaster graphics/openimageio
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-01 17:12:49 UTC
Maintainer of graphics/openimageio,

Please note that PR ports/179165 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179165

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-01 17:12:50 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Shane 2013-06-02 09:07:15 UTC
a+b) are the same issue. The GH_COMMIT changing I believe is due to a 
change at github - another I setup a few days ago had a similar change.

If I download openimageio-1.1.10.tar.gz now and compare it to the file I 
downloaded originally, the filesize is different (which I can only guess 
is a variation in compression) and the commit id is different but diff 
shows no change to the de-compressed file contents.

I have just submitted an update to v1.1.11 that should fix this part.


c) The first build error would indicate that OpenColorIO was compiled 
with gcc46 leading to a mismatch in GLIBCXX libs during link time.

Try adding -rpath ${LOCALBASE}/lib/gcc46 to your LDFLAGS or using the 
same gcc version for both.

I haven't tried using gcc48 yet so I need to look into that.
Comment 4 Anderson Guzman 2013-06-03 23:06:41 UTC
Hi Shane, nice to meet you and thanks for fast response ... I'll response to you between lines
 
>c) The first build error would indicate that OpenColorIO was >compiled
>with gcc46 leading to a mismatch in GLIBCXX libs during link >time.

Yes, but I dont have in my system gcc46 installed, only gcc48 and gcc from base/installation : 

 - gcc (GCC) 4.2.1 20070831 patched [FreeBSD])
 - gcc48 (FreeBSD Ports Collection) 4.8.1 20130418 (prerelease)


>Try adding -rpath ${LOCALBASE}/lib/gcc46 to your LDFLAGS or >using the same gcc version for both.

I tryed use the same gcc version to compile openimageio : gcc421, and gcc48 both fail to compile it.

>I have just submitted an update to v1.1.11 that should fix this part.

I'll test your recent update when it's is available on ports tree and later I'll report port's status about this compile bug...

Thanks for your time Shane and have a nice day ...
-- 
Anderson Guzman <aguzman@pendulosoftware.com>
Comment 5 Shane 2013-06-04 13:35:24 UTC
On 04/06/2013 07:36, Anderson Guzman wrote:
>
> Hi Shane, nice to meet you and thanks for fast response ... I'll response to you between lines
>
>> c) The first build error would indicate that OpenColorIO was >compiled
>> with gcc46 leading to a mismatch in GLIBCXX libs during link >time.
>
> Yes, but I dont have in my system gcc46 installed, only gcc48 and gcc from base/installation :
>
>   - gcc (GCC) 4.2.1 20070831 patched [FreeBSD])
>   - gcc48 (FreeBSD Ports Collection) 4.8.1 20130418 (prerelease)
>
>> Try adding -rpath ${LOCALBASE}/lib/gcc46 to your LDFLAGS or
>> using the same gcc version for both.

I thought the GLIBCXX_3.4.11 came from gcc46 but the same appears to be 
generated when building with gcc48. The rpath should end with gcc48 if 
you have gcc48 and not gcc46.

Are you building with gcc48 by adding USE_GCC=4.8 or are you doing 
CC=gcc48? Using USE_GCC should add the rpath setting for you.

> I tryed use the same gcc version to compile openimageio : gcc421, and gcc48 both fail to compile it.

If opencolorio and openimageio are both built with gcc from the base 
system you might still get the GLIBCXX linking issue through boost-libs.

I'll attach a patch here to fix the gcc48 compilation which I will add 
to the 1.1.11 update. You can either save it to 
/usr/ports/graphics/openimageio/files/patch-ptex.imageio_ptex_PtexWriter.cpp 
or wait for the update to be applied.
Comment 6 Anderson Guzman 2013-06-04 18:26:49 UTC
Hi Shane, nice to write you again... I'll response to you between lines

> I thought the GLIBCXX_3.4.11 came from gcc46 but the same appears to be 
> generated when building with gcc48. The rpath should end with gcc48 if 
> you have gcc48 and not gcc46.

Yes, the rpath should be gcc48 and not gcc46... 
 
> Are you building with gcc48 by adding USE_GCC=4.8 or are you doing 
> CC=gcc48? Using USE_GCC should add the rpath setting for you.

The 2nd try to compile ports/openimageio only I edit  GH_COMMIT in MakeFile and /etc/make.conf  is untouched... I never try adding USE_GCC=4.8 

> 
> If opencolorio and openimageio are both built with gcc from the base 
> system you might still get the GLIBCXX linking issue through boost-libs.

I checked GLIBCXX strings from libboost 1.52.0:

Boost:

# strings /usr/local/lib/libboost_filesystem.so | grep GLIBCXX
GLIBCXX_3.4

Your comment invite me to check opencolorio GLIBCXX strings and I see that is linking to gcc48 (GLIBCXX_3.4.11), later I uninstalled opencolorio and try to compile it again but with gcc from base.

Opencolorio was installed perfectly and later I try to compile openimageio and it compile perfect too...

> I'll attach a patch here to fix the gcc48 compilation which I will add 
> to the 1.1.11 update. You can either save it to 
> /usr/ports/graphics/openimageio/files/patch-ptex.imageio_ptex_PtexWriter.cpp 
> or wait for the update to be applied.
> 

When 1.1.11 update is available in ports tree I'll test it with gcc48...

Thanks for your time Shane, efforts and fast response, 


-- 
Anderson Guzman <aguzman@pendulosoftware.com>
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2013-06-19 23:00:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->madpilot

I'll take it.
Comment 8 dfilter service freebsd_committer freebsd_triage 2013-06-19 23:04:41 UTC
Author: madpilot
Date: Wed Jun 19 22:04:32 2013
New Revision: 321340
URL: http://svnweb.freebsd.org/changeset/ports/321340

Log:
  - Update to 1.1.11
  - Fix build with gcc 4.8
  - While I'm here, remove check for unsupported FreeBSD version
  
  PR:		ports/179165 [1], ports/179192 [2]
  Submitted by:	Anderson Guzman <aguzman@pendulosoftware.com> [1]
  Submitted by:	Shane Ambler <FreeBSD@Shaneware.biz> (maintainer) [2]

Added:
  head/graphics/openimageio/files/patch-ptex.imageio_ptex_PtexWriter.cpp   (contents, props changed)
Modified:
  head/graphics/openimageio/Makefile
  head/graphics/openimageio/distinfo
  head/graphics/openimageio/pkg-plist

Modified: head/graphics/openimageio/Makefile
==============================================================================
--- head/graphics/openimageio/Makefile	Wed Jun 19 21:57:33 2013	(r321339)
+++ head/graphics/openimageio/Makefile	Wed Jun 19 22:04:32 2013	(r321340)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME?=	openimageio
-PORTVERSION=	1.1.10
+PORTVERSION=	1.1.11
 PORTREVISION?=	0
 CATEGORIES?=	graphics multimedia
 
@@ -22,7 +22,7 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	OpenImageIO
 GH_PROJECT=	oiio
 GH_TAGNAME=	Release-${PORTVERSION}
-GH_COMMIT=	f28f5c4
+GH_COMMIT=	c092151
 WRKSRC=		${WRKDIR}/OpenImageIO-oiio-${GH_COMMIT}/src
 
 # fbm also installs bin/idiff
@@ -80,15 +80,9 @@ LIB_DEPENDS+=	OpenColorIO:${PORTSDIR}/gr
 CMAKE_ARGS+=	-DUSE_OCIO:BOOL=OFF
 .endif
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 800000
-IGNORE=	requires FreeBSD 8.0 or higher
-.endif
-
 post-install:
 .if !defined(OIIO_PYBIND)
 	cd ${PREFIX}/lib && ${LN} -sf libOpenImageIO.so.1.1 libOpenImageIO.so.1
 .endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Modified: head/graphics/openimageio/distinfo
==============================================================================
--- head/graphics/openimageio/distinfo	Wed Jun 19 21:57:33 2013	(r321339)
+++ head/graphics/openimageio/distinfo	Wed Jun 19 22:04:32 2013	(r321340)
@@ -1,2 +1,2 @@
-SHA256 (openimageio-1.1.10.tar.gz) = 1510287790113f0c64421623be7bf5b9317a1c9cfd6e85125bae81bc6c07a275
-SIZE (openimageio-1.1.10.tar.gz) = 9501836
+SHA256 (openimageio-1.1.11.tar.gz) = 489be1c57f10543412b42ae2aa67eb0ecb9634045b698b29ec06b5d120722308
+SIZE (openimageio-1.1.11.tar.gz) = 9502233

Added: head/graphics/openimageio/files/patch-ptex.imageio_ptex_PtexWriter.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/openimageio/files/patch-ptex.imageio_ptex_PtexWriter.cpp	Wed Jun 19 22:04:32 2013	(r321340)
@@ -0,0 +1,10 @@
+--- ./ptex.imageio/ptex/PtexWriter.cpp.orig	2013-06-04 19:49:43.476382085 +0930
++++ ./ptex.imageio/ptex/PtexWriter.cpp	2013-06-04 19:49:48.134381870 +0930
+@@ -66,6 +66,7 @@
+ #include <algorithm>
+ #include <iostream>
+ #include <sstream>
++#include <unistd.h>
+ 
+ #include "filesystem.h"
+ 

Modified: head/graphics/openimageio/pkg-plist
==============================================================================
--- head/graphics/openimageio/pkg-plist	Wed Jun 19 21:57:33 2013	(r321339)
+++ head/graphics/openimageio/pkg-plist	Wed Jun 19 22:04:32 2013	(r321340)
@@ -38,7 +38,7 @@ include/OpenImageIO/version.h
 lib/libOpenImageIO.so
 lib/libOpenImageIO.so.1
 lib/libOpenImageIO.so.1.1
-lib/libOpenImageIO.so.1.1.10
+lib/libOpenImageIO.so.1.1.11
 %%PORTDOCS%%%%DOCSDIR%%/CHANGES
 %%PORTDOCS%%%%DOCSDIR%%/LICENSE
 %%PORTDOCS%%%%DOCSDIR%%/openimageio.pdf
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 9 Guido Falsi freebsd_committer freebsd_triage 2013-06-19 23:05:10 UTC
State Changed
From-To: feedback->closed

Fixed by patch in ports/179192.