openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Compile *only* static libs for OS X Uni?


From: Paul Schneider
Subject: Re: [Openexr-devel] Compile *only* static libs for OS X Uni?
Date: Wed, 10 Dec 2008 07:21:03 -0600


Hi Russ,

--enable-osx-universal-binaries sets up the CXXFLAGS and LDFLAGS in much the same way that I did manually, except for two architectures instead of four. I skipped that flag because I manually set them up the way I wanted them.

I believe bootstrap is only necessary if you are building completely from scratch. bootstrap creates the configure script, so if you had a ./configure, you probably didn't need to ./bootstrap. If you're not building from scratch, you can "make distclean" to reset everything to a pristine state.

I'm not sure about the visibility warnings. Are you getting these trying to link the EXR code, or trying to link your code to the EXR libraries?

If you are having trouble linking your own code to the EXR libraries, and your code was built with different visibility settings than the EXR libraries, you may run into trouble. See http://gcc.gnu.org/wiki/Visibility for more information. I think the solution is to either change the visibility settings of your code, or change EXR's visibility settings, probably by adding some form of -fvisibility to your CXXFLAGS. I'm not an expert on this area of gcc, so maybe somebody else can provide more insight.

If you are having trouble just trying to link the EXR libraries themselves, then there may be a problem with your configuration. I would "make distclean" and start again. Also, make sure that you "make install" each package before building the next one. For example, OpenEXR depends on IlmBase, so make sure that you "make install" IlmBase before attempting to build OpenEXR.

Good luck!
- Paul



On Dec 10, 2008, at 12:19 AM, Russ wrote:


Thanks Paul. I am able to get the libraries to compile when I run your commands below as a script, but not when running them against the posted download. So perhaps the CVS is more up-to-date than the posted build. Not sure why you don't have the listed --enable-osx- universal-binaries. Note that from the distributed directions, you'd never know about bootstrap, because it is only in the CVS directions.

I'm currently encountering "different visibility" warnings, followed by undefined symbol errors on
Imf::Channel::Channel(Imf::PixelType, int, int)
Imf::Slice::Slice(...
Imf::OutputFile::OutputFile(...
Imf::RgbaInputFile::RgbaInputFile(...

Any hints to resolve this would be appreciated, I'm kinda fried. This was previously set up to compile against 1.2.2, though I think I had to build my own OpenEXR project to get it to work (helps with debugging anyway)

Thanks,

Russ



----- Original Message ----

Sent: Monday, December 8, 2008 8:23:36 PM
Subject: Re: [Openexr-devel] Compile *only* static libs for OS X Uni?


Hi Russ,

This seems to be working for me with a fresh download of the source from CVS:

%cvs -z3 -d:pserver:address@hidden:/sources/ openexr co IlmBase %cvs -z3 -d:pserver:address@hidden:/sources/ openexr co OpenEXR

%export CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -arch ppc64 -arch x86_64' %export LDFLAGS='-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk - arch ppc -arch i386 -arch ppc64 -arch x86_64'

%cd IlmBase
%./bootstrap
%./configure --disable-dependency-tracking
%make
%sudo make install

%cd ../OpenEXR
%./bootstrap
%./configure --disable-dependency-tracking
%make
%sudo make install

%file /usr/local/lib/libIlmImf.a
/usr/local/lib/libIlmImf.a: Mach-O universal binary with 4 architectures /usr/local/lib/libIlmImf.a (for architecture ppc): current ar archive /usr/local/lib/libIlmImf.a (for architecture i386): current ar archive /usr/local/lib/libIlmImf.a (for architecture ppc64): current ar archive /usr/local/lib/libIlmImf.a (for architecture x86_64): current ar archive

%file /usr/local/lib/libIlmImf.dylib
/usr/local/lib/libIlmImf.dylib: Mach-O universal binary with 4 architectures /usr/local/lib/libIlmImf.dylib (for architecture ppc7400): Mach-O dynamically linked shared library ppc /usr/local/lib/libIlmImf.dylib (for architecture i386): Mach-O dynamically linked shared library i386 /usr/local/lib/libIlmImf.dylib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64 /usr/local/lib/libIlmImf.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64


This is all definitely harder than it needs to be; I'll see about submitting a patch that enables 4-way universal builds in a more user-friendly manner. In the meantime, please try the above and let me know if it's not working for you.

- Paul



On Dec 5, 2008, at 6:05 PM, Russ wrote:


I'm trying to create static libraries for OSX that are 4-way universal from openexr-1.6.1. I've added the architectures to the config and changed from 10.4u to 10.5 SDKs and run it with the two osx options per README.OSX

The ilmbase compile & install seemed to go reasonably well. I have the 4-way static libraries in /usr/local/lib --- libHalf.a etc. The dylibs are i386 only, though.

Now I'm trying the same thing on openexr itself, but it seems intent on building .lo and .la versions and using the dylibs --- but since the dylibs are i386 only, the whole thing is rolling over and failing with spectacular numbers of intermingled missing- architecture messages.

From what I saw in ilmbase, I need the openexr make to be trying to create .o and .a versions, and using the 4-way universal .a versions in /usr/local/lib

Suggestions appreciated, thanks.






_______________________________________________
Openexr-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/openexr-devel





_______________________________________________
Openexr-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/openexr-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]