1. Compile PTAM
1). Install TooN lib.
Download Toon.
-> cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/toon co TooN
Make and install.
-> make
-> make install
2). Install libcvd(32bit).
a) Download libcvd.
-> cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co libcvd
b) Edit cvd/gl_helpers.h. Use OpenGL/gl.h and OpenGL/glu.h.
c) Edit progs/calibrate.cxx. Replace GL_TEXTURE_RECTANGLE_NV with GL_TEXTURE_RECTANGLE_ARB.
d) Edit cvd_src/OSX/qtbuffer.cpp. Add #include <vector>
e) Create a new configure script configure_mac.sh:
#!/bin/bash
SDK="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
SDKLIB="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk"
export MACOSX_DEPLOYMENT_TARGET="10.5"
ARCH="-arch i386"
export CFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export CXXFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export CPPFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export LDFLAGS="$ARCH $SDKLIB -mmacosx-version-min=10.5 -I /usr/local/include"
CC="/usr/bin/gcc-4.2"
CXX="/usr/bin/g++-4.2"
OBJC="/usr/bin/gcc-4.2"
./configure $1 $2 $3 $4 $5 $6 $7 $8 $9
f) Configure.
-> ./configure_mac.sh --without-ffmpeg --x-libraries=/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/ --x-includes=/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include
g) Edit makefile.
Move all -L/opt/local/lib to the end of the argument list, giving priority to OSX10.5.sdk version of X11
h) Make and Install
-> make
-> install
3). Install gvars3
a) Download gvars3
-> cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co gvars3
b) Copy the previous configure_mac.sh.
-> sh configure_mac.sh --disable-widgets
-> make
-> make install
4). Compile PTAM
a) Copy /Build/OSX/Makefile and VideoSource_OSX.cc to source root directory.
b) Edit makefile. Compile 32bit.
-> CC = g++ -g -O3 -arch i386
-> make
-> make install
2. Compile PTAMM
a. Install lib3ds. Download the source. Copy configure_mac.sh. Do the same as above.
b. Copy PTAM/VideoSource_OSX.cc to PTAMM.
c. Copy PTAMM/Build/Linux/Makefile to PTAMM.
d. Edit VideoSource_OSX.cc. Add “namespace PTAMM{” after the includes and “}” at the end.
e. Edit makefile.
Change “LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd $(3DSLIB)” => “LINKFLAGS = -framework OpenGL -framework VecLib -lGVars3 -lcvd $(3DSLIB)”.
Change “VIDEOSOURCE = VideoSource_Linux_DV.o” => “VIDEOSOURCE = VideoSource_OSX.o”
f. make and install.
Have fun:)
