Russ | 6 Dec 01:05
Picon
Favicon

Compile *only* static libs for OS X Uni?


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.
Paul Schneider | 9 Dec 02:23
Picon

Re: 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:anonymous <at> cvs.savannah.nongnu.org:/sources/openexr  
co IlmBase
%cvs -z3 -d:pserver:anonymous <at> cvs.savannah.nongnu.org:/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
(Continue reading)

Russ | 10 Dec 07:19
Picon
Favicon

Re: Compile *only* static libs for OS X Uni?


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:anonymous <at> cvs.savannah.nongnu.org:/sources/openexr co IlmBase
%cvs -z3 -d:pserver:anonymous <at> cvs.savannah.nongnu.org:/sources/openexr co OpenEXR
(Continue reading)

Paul Schneider | 10 Dec 14:21
Picon

Re: Compile *only* static libs for OS X Uni?


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  
(Continue reading)


Gmane