Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IexMathFpu build error #3

Closed
nickrasmussen opened this issue Apr 15, 2012 · 14 comments
Closed

IexMathFpu build error #3

nickrasmussen opened this issue Apr 15, 2012 · 14 comments
Milestone

Comments

@nickrasmussen
Copy link
Contributor

libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../config -I.. -I../Iex
-I../config -pipe -g -O2 -pthread -c IexMathFpu.cpp -fPIC -DPIC -o
.libs/IexMathFpu.o
IexMathFpu.cpp: In function 'void
Iex::FpuControl::restoreControlRegs(const ucontext_t&, bool)':
IexMathFpu.cpp:231:38: error: 'struct _libc_fpstate' has no member named
'cwd'
IexMathFpu.cpp:232:40: error: 'struct _libc_fpstate' has no member named
'mxcsr'

I'll add the missing stdint include. What version of kernel and glibc do
you have? Looks like we'll have to put together an additional
implementation of the fpu routines.

Good morning,

libc6 2.11.3-3
linux-image-2.6.32-5-amd64 2.6.32-41squeeze2

I am running AMD64-kernel with 32bit userland, ilmbase has been
configured with --build=i486-linux-gnu.

thanks, cu andreas

@ametzler
Copy link

This issue also applies to i686 kernel with ix86 userland, not just to the abovementioned AMD64-kernel with 32bit userland mixture. (Tested with today's Debian sid: libc6-dev 2.13-35 linux-image-3.2.0-3-686-pae).

@ametzler
Copy link

Also present in v2.0.0.beta.2.zip

@ametzler
Copy link

ametzler commented Aug 1, 2012

Still present in ilmbase 1.0.3.

@kwizart
Copy link
Contributor

kwizart commented Aug 2, 2012

Same for me on 32bit linux.
Might be related to the glibc not having mxcsr in 32bit _libc_fpstate

I've used the hack described, but make check fails at this step:
lt-ImathTest: testBox.cpp:286: void {anonymous}::testExtendByPoint(const char*) [with T = Imath::Vec2]: Assertion `b.min == min && b.max == max' failed.
/bin/sh: line 5: 7761 Aborted (core dumped) ${dir}$tst
FAIL: ImathTest

@ametzler
Copy link

RedHat uses the following patch to fix the build-error:

diff -up ilmbase-1.0.3/IexMath/IexMathFpu.cpp.ucontext ilmbase-1.0.3/IexMath/IexMathFpu.cpp
--- ilmbase-1.0.3/IexMath/IexMathFpu.cpp.ucontext 2012-07-26 20:51:55.000000000 +0200
+++ ilmbase-1.0.3/IexMath/IexMathFpu.cpp 2012-08-02 23:33:14.815036891 +0200
@@ -228,6 +228,7 @@ clearExceptions ()
const uint16_t cwRestoreMask = ~((3 << 10) | (3 << 8));
const uint16_t cwRestoreVal = (0 << 10) | (3 << 8);

+#if 0
inline void
restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
{
@@ -235,7 +236,7 @@ restoreControlRegs (const ucontext_t & u
setMxcsr (ucon.uc_mcontext.fpregs->mxcsr, clearExceptions);
}

-#if 0
+#endif

//
// Ugly, the mxcsr isn't defined in GNU libc ucontext_t, but
@@ -255,7 +256,6 @@ restoreControlRegs (const ucontext_t & u
setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
}

-#endif

} // namespace FpuControl

The testsuite still fails with

lt-ImathTest: testBox.cpp:253: void {anonymous}::testExtendByPoint(const char*) [with T = Imath::Vec2]: Assertion `b.min == p && b.max == p' failed.
/bin/bash: line 4: 1727 Aborted ${dir}$tst

FAIL: ImathTest


1 of 1 tests failed

@yuyuyak
Copy link

yuyuyak commented Mar 13, 2013

I must chime in too. This is on Funtoo ~x86 (32bit current). The same occurs whether I use the version from http://dev.gentoo.org/~ssuominen/openexr-${PV}.tar.gz
or directly from git in a directory, running bootstrap, configure, make check. Of course from portage package manager as well. Wish I knew of the hack spoken of by kwizart.
Glib 2.15.-r3 (AKA libc6)
automake 1.11.16
Latest 2.0.0
IexMathFpu.cpp: In function 'void Iex::FpuControl::restoreControlRegs(const ucontext_t&, bool)':
IexMathFpu.cpp:262:38: error: 'struct _libc_fpstate' has no member named 'cwd'
IexMathFpu.cpp:263:40: error: 'struct _libc_fpstate' has no member named 'mxcsr'

@pstanczyk
Copy link
Contributor

Hey - are you pulling from the develop branch from here?
(Master should reflect the snapshot of that last released/tagged version)

@yuyuyak
Copy link

yuyuyak commented Mar 15, 2013

cloned exactly like this: git clone https://github.com/openexr/openexr.git. Is this what you wanted to know: master 5c820c8?

@peterhillman
Copy link
Contributor

Could you try 
git checkout develop
git pull
and see if there are still issues? This is the OpenEXR-2.0
development code, which should have a fix for this issue.On 03/15/2013 05:59 PM, Mike Johnson
  wrote:

  cloned exactly like this: git clone https://github.com/openexr/openexr.git.
    Is this what you wanted to know: master 5c820c8?
  —
    Reply to this email directly or view
      it on GitHub.

@yuyuyak
Copy link

yuyuyak commented Mar 15, 2013

Thank you. The development version indeed got it way past that error. However, I now have the same symptom mentioned by ametzler above:
ImathTest: testBox.cpp:286: void {anonymous}::testExtendByPoint(const char*) [with T = Imath::Vec2]: Assertion `b.min == min && b.max == max' failed.
/bin/sh: line 5: 25491 Aborted ${dir}$tst
FAIL: ImathTest

@ametzler
Copy link

ilmbase 2.0.0 builds on i386, however the testsuite still fails with:
extendBy() point for type V2f
extendBy() point for type V2d
lt-ImathTest: testBox.cpp:253: void {anonymous}::testExtendByPoint(const char*) [with T = Imath_2_0::Vec2]: Assertion `b.min == p && b.max == p' failed.
/bin/bash: line 4: 7000 Aborted ${dir}$tst
FAIL: ImathTest

@tonytheodore
Copy link

Does 20061ef fix this?

@ametzler
Copy link

ametzler commented Aug 6, 2013

2.0.1 compiles, but the testsuite still errs out, probably due to a opt-error.

Pasting in the respective comment from #67:
The ilmbase testsuite (not the openexr one) succeeds if only the two files testBoxAlgo.cpp and testBox.cpp are built with -fno-inline or -ffloat-store (either of theses gcc options does the trick).

@nickrasmussen
Copy link
Contributor Author

opened the testBox failure as a separate issue: #100.

@qflb qflb mentioned this issue Sep 1, 2017
peterhillman pushed a commit to peterhillman/openexr that referenced this issue Feb 6, 2024
Co-authored-by: Philippe Leprince <github.pleprince@gmail.com>
Signed-off-by: Vlad Lazar <vladal@unity3d.com>

* better multy-type compression

* Version the Stream

---------

Signed-off-by: Vlad Lazar <vladal@unity3d.com>
Co-authored-by: Philippe Leprince <github.pleprince@gmail.com>
cary-ilm referenced this issue in cary-ilm/openexr Jul 16, 2024
Signed-off-by: Philippe Leprince <github.pleprince@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants