GLew for MAC

Ryan Schmidt ryandesign at macports.org
Mon Apr 6 00:20:12 PDT 2009


On Apr 6, 2009, at 00:21, vinitha ks wrote:

> On Mon, 2/3/09, Ryan Schmidt wrote:
>
>> On Mar 2, 2009, at 00:54, vinitha ks wrote:
>>
>>> How do i create or download universal glew libaries for Leopard?
>>
>> After installing MacPorts, type this in a Terminal:
>>
>> sudo port install glew +universal
>>
>> Note that unless you want to use these compiled binaries on both  
>> an Intel Mac and a PowerPC Mac, you don't need +universal.
>
> When i tried sudo port install glew +universal.got libGLEW.a
> but when i check its architecture it displays
> "/opt/local/var/macports/software/glew/1.5.1_0+universal/opt/local/ 
> lib/libGLEW.a (can't determine architecture for it)" and wouldn't  
> work libGLEW.a file for intel or PPC.

I am able to build a 4-way universal of glew on Mac OS X 10.5.6 with  
Xcode 3.1.2 and MacPorts 1.7.1.

Note that libGLEW.a is a static library. I'm not aware of how to  
determine what architectures a static library is built for. Usually  
you would be using a dynamic library, like libGLEW.dylib, for which  
the "file" command should verify its architectures.


$ port install glew +universal
--->  Fetching glew
--->  Verifying checksum(s) for glew
--->  Extracting glew
--->  Applying patches to glew
--->  Configuring glew
--->  Building glew
--->  Staging glew into destroot
--->  Installing glew @1.5.1_0+universal
--->  Activating glew @1.5.1_0+universal
--->  Cleaning glew
$ port contents glew
Port glew contains:
   /opt/local/bin/glewinfo
   /opt/local/bin/visualinfo
   /opt/local/include/GL/glew.h
   /opt/local/include/GL/glxew.h
   /opt/local/include/GL/wglew.h
   /opt/local/lib/libGLEW.1.5.1.dylib
   /opt/local/lib/libGLEW.1.5.dylib
   /opt/local/lib/libGLEW.a
   /opt/local/lib/libGLEW.dylib
$ port contents glew | sed 1d | xargs file
/opt/local/bin/glewinfo:            Mach-O universal binary with 4  
architectures
/opt/local/bin/glewinfo (for architecture i386):       Mach-O  
executable i386
/opt/local/bin/glewinfo (for architecture ppc7400):    Mach-O  
executable ppc
/opt/local/bin/glewinfo (for architecture x86_64):     Mach-O 64-bit  
executable x86_64
/opt/local/bin/glewinfo (for architecture ppc64):      Mach-O 64-bit  
executable ppc64
/opt/local/bin/visualinfo:          Mach-O universal binary with 4  
architectures
/opt/local/bin/visualinfo (for architecture i386):     Mach-O  
executable i386
/opt/local/bin/visualinfo (for architecture ppc7400):  Mach-O  
executable ppc
/opt/local/bin/visualinfo (for architecture x86_64):   Mach-O 64-bit  
executable x86_64
/opt/local/bin/visualinfo (for architecture ppc64):    Mach-O 64-bit  
executable ppc64
/opt/local/include/GL/glew.h:       ASCII c program text, with CRLF  
line terminators
/opt/local/include/GL/glxew.h:      ASCII c program text, with CRLF  
line terminators
/opt/local/include/GL/wglew.h:      ASCII c program text, with CRLF  
line terminators
/opt/local/lib/libGLEW.1.5.1.dylib: Mach-O universal binary with 4  
architectures
/opt/local/lib/libGLEW.1.5.1.dylib (for architecture i386):    Mach-O  
dynamically linked shared library i386
/opt/local/lib/libGLEW.1.5.1.dylib (for architecture ppc7400): Mach-O  
dynamically linked shared library ppc
/opt/local/lib/libGLEW.1.5.1.dylib (for architecture x86_64):  Mach-O  
64-bit dynamically linked shared library x86_64
/opt/local/lib/libGLEW.1.5.1.dylib (for architecture ppc64):   Mach-O  
64-bit dynamically linked shared library ppc64
/opt/local/lib/libGLEW.1.5.dylib:   Mach-O universal binary with 4  
architectures
/opt/local/lib/libGLEW.1.5.dylib (for architecture i386):      Mach-O  
dynamically linked shared library i386
/opt/local/lib/libGLEW.1.5.dylib (for architecture ppc7400):   Mach-O  
dynamically linked shared library ppc
/opt/local/lib/libGLEW.1.5.dylib (for architecture x86_64):    Mach-O  
64-bit dynamically linked shared library x86_64
/opt/local/lib/libGLEW.1.5.dylib (for architecture ppc64):     Mach-O  
64-bit dynamically linked shared library ppc64
/opt/local/lib/libGLEW.a:           current ar archive
/opt/local/lib/libGLEW.dylib:       Mach-O universal binary with 4  
architectures
/opt/local/lib/libGLEW.dylib (for architecture i386):  Mach-O  
dynamically linked shared library i386
/opt/local/lib/libGLEW.dylib (for architecture ppc7400):       Mach-O  
dynamically linked shared library ppc
/opt/local/lib/libGLEW.dylib (for architecture x86_64):        Mach-O  
64-bit dynamically linked shared library x86_64
/opt/local/lib/libGLEW.dylib (for architecture ppc64): Mach-O 64-bit  
dynamically linked shared library ppc64
$





More information about the macports-users mailing list