# OpenEXR 2.1.0 to OpenEXR 2.2.0 Fails?



## Calderon (Aug 19, 2014)

Updating from 2.1.0 to 2.2.0

```
libtool: compile:  g++47 -DHAVE_CONFIG_H -I. -I../config -I.. -I../config -pthread -I/usr/local/include/OpenEXR -I. -I../IlmImf -pipe -O2 -pipe -march=prescott -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -MT ImfSystemSpecific.lo -MD -MP -MF .deps/ImfSystemSpecific.Tpo -c ImfSystemSpecific.cpp  -fPIC -DPIC -o .libs/ImfSystemSpecific.o
ImfSystemSpecific.cpp: In constructor 'Imf_2_2::CpuId::CpuId()':
ImfSystemSpecific.cpp:51:29: error: inconsistent operand constraints in an 'asm'
ImfSystemSpecific.cpp:51:29: error: inconsistent operand constraints in an 'asm'
gmake[2]: *** [ImfSystemSpecific.lo] Error 1
gmake[2]: Leaving directory `/usr/ports/graphics/OpenEXR/work/openexr-2.2.0/IlmImf'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/ports/graphics/OpenEXR/work/openexr-2.2.0/IlmImf'
gmake: *** [all-recursive] Error 1
*** [do-build] Error code 1

Stop in /usr/ports/graphics/OpenEXR.
*** [install] Error code 1

Stop in /usr/ports/graphics/OpenEXR.
```

With this error, happens when *I* try to upgrade KDE 4. im I'm on FBSD FreeBSD 9.3.

Dunno Don't know if this has something to do with it: https://github.com/openexr/openexr/issues/128


----------



## HenkeZan (Aug 19, 2014)

Having the exact same problem. I can not present any solution, but tagging along if someone finds anything.


----------



## Calderon (Aug 19, 2014)

Well this patch (suggested fix from Richard PALO) works for me but *I* don*'*t think this is a final solution..


```
--- IlmImf/ImfSystemSpecific.cpp.orig   2014-08-10 04:23:57.000000000 +0000
+++ IlmImf/ImfSystemSpecific.cpp
@@ -40,21 +40,19 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EN

 namespace {
 #if defined(IMF_HAVE_SSE2) &&  defined(__GNUC__)
-
+#include <cpuid.h>
     // Helper functions for gcc + SSE enabled
-    void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
+    void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
+                   unsigned int &ecx, unsigned int &edx)
     {
-        __asm__ __volatile__ (
-            "cpuid"
-            : /* Output  */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) 
-            : /* Input   */ "a"(n)
-            : /* Clobber */);
+       __get_cpuid(n, &eax, &ebx, &ecx, &edx);
     }

 #else // IMF_HAVE_SSE2 && __GNUC__

     // Helper functions for generic compiler - all disabled
-    void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
+    void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
+                   unsigned int &ecx, unsigned int &edx)
     {
         eax = ebx = ecx = edx = 0;
     }
@@ -64,7 +62,7 @@ namespace {

 #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX

-    void xgetbv(int n, int &eax, int &edx)
+    void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
     {
         __asm__ __volatile__ (
             "xgetbv"
@@ -75,7 +73,7 @@ namespace {

 #else //  OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX

-    void xgetbv(int n, int &eax, int &edx)
+    void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
     {
         eax = edx = 0;
     }
@@ -94,8 +92,8 @@ CpuId::CpuId():
     f16c(false)
 {
     bool osxsave = false;
-    int  max     = 0;
-    int  eax, ebx, ecx, edx;
+    unsigned int  max     = 0;
+    unsigned int  eax, ebx, ecx, edx;

     cpuid(0, max, ebx, ecx, edx);
     if (max > 0)
```


----------



## HenkeZan (Aug 19, 2014)

Yes, patch worked for me aswell (had to apply part 1 of patch manually). But now it compiles. Thanks!


----------



## talsamon (Aug 19, 2014)

--> /usr/ports/UPDATING


```
20140815:
  AFFECTS: users of graphics/ilmbase and graphics/OpenEXR
  AUTHOR: mandree@FreeBSD.org

  The OpenEXR and ilmbase (Industrial Light and Magic) shared object
  names have changed.  You must rebuild all packages that require either
  of these libraries, by using one of these commands:

  # portmaster -r ilmbase -r OpenEXR
    or
  # portupgrade -fr graphics/ilmbase graphics/OpenEXR

  The PORTREVISIONS of all 500+ ports that require ilmbase/OpenEXR
  have been bumped.
```


----------



## Calderon (Aug 20, 2014)

talsamon said:
			
		

> --> /usr/ports/UPDATING
> 
> 
> ```
> ...



Yes and that is when the OpenEXR fails to build


----------

