#32 How do I compile for mac os x x64?


can anyone tell me how to compile a 64 bit version of glew on mac os x?

I already have the latest xcode, macports, and I have downloaded the source for glew 1.5.1.


  • Nigel Stewart

    Nigel Stewart - 2011-08-02

    Attached patch is under consideration.

    $ make SYSTEM=darwin-x86_64
    mkdir lib
    cc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -fPIC -o src/glew.pic_o -c src/glew.c
    cc -dynamiclib -install_name /usr/lib/libGLEW.1.7.0.dylib -current_version 1.7.0 -compatibility_version 1.7 -o lib/libGLEW.1.7.0.dylib src/glew.pic_o -arch x86_64 -framework AGL -framework OpenGL
    ln -sf libGLEW.1.7.0.dylib lib/libGLEW.1.7.dylib
    ln -sf libGLEW.1.7.0.dylib lib/libGLEW.dylib
    cc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -o src/glew.o -c src/glew.c
    ar cr lib/libGLEW.a src/glew.o
    sed \ -e "s|@prefix@|/usr|g" \ -e "s|@libdir@|/usr/lib|g" \ -e "s|@exec_prefix@|/usr/bin|g" \ -e "s|@includedir@|/usr/include/GL|g" \ -e "s|@version@|1.7.0|g" \ -e "s|@cflags@||g" \ -e "s|@libname@|GLEW|g" \ < glew.pc.in > glew.pc
    cc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -fPIC -o src/glew.mx.pic_o -c src/glew.c
    cc -dynamiclib -install_name /usr/lib/libGLEWmx.1.7.0.dylib -current_version 1.7.0 -compatibility_version 1.7 -o lib/libGLEWmx.1.7.0.dylib src/glew.mx.pic_o -arch x86_64 -framework AGL -framework OpenGL
    ln -sf libGLEWmx.1.7.0.dylib lib/libGLEWmx.1.7.dylib
    ln -sf libGLEWmx.1.7.0.dylib lib/libGLEWmx.dylib
    cc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -o src/glew.mx.o -c src/glew.c
    ar cr lib/libGLEWmx.a src/glew.mx.o
    sed \ -e "s|@prefix@|/usr|g" \ -e "s|@libdir@|/usr/lib|g" \ -e "s|@exec_prefix@|/usr/bin|g" \ -e "s|@includedir@|/usr/include/GL|g" \ -e "s|@version@|1.7.0|g" \ -e "s|@cflags@|-DGLEW_MX|g" \ -e "s|@libname@|GLEWmx|g" \ < glew.pc.in > glewmx.pc
    mkdir bin
    cc -c -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -o src/glewinfo.o src/glewinfo.c
    cc -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -o bin/glewinfo src/glewinfo.o -Llib -lGLEW -arch x86_64 -framework AGL -framework OpenGL
    cc -c -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -o src/visualinfo.o src/visualinfo.c
    src/visualinfo.c: In function ‘VisualInfo’:
    src/visualinfo.c:583: warning: unused parameter ‘ctx’
    cc -O2 -Wall -W -Iinclude -arch x86_64 -no-cpp-precomp -dynamic -fno-common -o bin/visualinfo src/visualinfo.o -Llib -lGLEW -arch x86_64 -framework AGL -framework OpenGL

    $ file lib/libGLEW.
    libGLEW.1.7.0.dylib libGLEW.1.7.dylib libGLEW.a libGLEW.dylib
    nstewart@nstewart-osx ~/Sourceforge/git.master4/glew [rel3.1]
    $ file lib/libGLEW.1.7.0.dylib
    lib/libGLEW.1.7.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64

  • Nigel Stewart

    Nigel Stewart - 2011-08-02

    Moved to feature requests.

  • Nigel Stewart

    Nigel Stewart - 2011-08-25

    SYSTEM=darwin-x86_64 is supported in the upcoming GLEW 1.7.0
    Closing this
    Thanks for the report

  • Nigel Stewart

    Nigel Stewart - 2012-01-11

    Fixed in 1.7.0, closing.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks