Monday, January 18, 2010

Ok, I'm not sure if I built fink in 32 or 64 bit version, or how to check.

Now rebuilding fink in 64-bit only mode.

Will probably take a while to redownload all packages. Sigh.

Sunday, January 17, 2010

Continuing with insight3d...

...Seems like my opencv was built for i386 architecture (despite being on a 64 bit architecture).
Manually changed CMakeCache.txt to read:

CMAKE_OSX_ARCHITECTURES:STRING=x86_64

did make clean and make, we'll see how it goes (takes a long time to compile, IIRC).

Didn't work right away.

Deleted contents of build dir, and rebuilding, using instructions at http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port, but also changing architecture to x86_64.

Getting trouble with carbon, because it is not 64 bits. Trying to disable carbon.
Uncommented #undef HAVE_CARBON something in cvconfig.h
That didn't work.

Modified the CMakefile for highgui to use gtk+ highgui code also under APPLE.
rebuilding (in src/highgui/CMakeLists.txt). This time it actually built.

Argh. Now I get the following when building insight3d:
Erland-Lewins-Mac-mini:src erl$ make
ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o
ranlib ../lib/libfeat.a
gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` siftfeat.c -o ../bin/siftfeat -L../lib -lfeat `pkg-config --libs opencv` `pkg-config --libs gtk+-2.0` `pkg-config --libs gsl`
ld: warning: in /sw/lib/libgtk-x11-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgdk-x11-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libatk-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgio-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpangoft2-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgdk_pixbuf-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpangocairo-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libcairo.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpango-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libfreetype.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgobject-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgmodule-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libglib-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libintl.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgsl.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgslcblas.dylib, file is not of required architecture
Undefined symbols:
"_gdk_screen_get_default", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_screen_get_height", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_init", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_screen_get_width", referenced from:
_display_big_img in libfeat.a(utils.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [siftfeat] Error 1
This mix of 64 bit and 32 bit libraries is really frustrating. I imagine some will be 32 bit, others 64 bit. What is the best strategy? Force everything to be 32 bits? 64 bits?

The night ends in frustration.
Continuing trying to get insight3d to work.

History: Didn't work well under Ubuntu. Got it to run under Bootcamp Windows XP, but got some crash there too.

Plan: Will try to build on mac, which is my main machine.

Compiled opencv on the mac. Copied the opencv.pc (pkg-config file) manually to /sw/share/pkgconfig.

Compilation on insight3d started.

Stopped in:
g++ -O3 -c `pkg-config --cflags opencv libxml-2.0 sdl gtk+-2.0` -I./ann_1.1.1/include/ cv_extensions.cpp
cv_extensions.cpp: In function ‘void cvComputeRQDecomposition(CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvPoint3D64f*)’:
cv_extensions.cpp:18: error: ‘__BEGIN__’ was not declared in this scope
cv_extensions.cpp:197: error: ‘__END__’ was not declared in this scope
cv_extensions.cpp:22: error: label ‘exit’ used but not defined
#include in cv_extensions.cpp.
Changed __BEGIN__ to __CV_BEGIN__ and __END__ to __CV_END__
Lots of warnings about printf formats being wrong, ignoring those.

Next stopped on missing gsl lib.
Trying "sudo fink install gsl"
Added ,0 parameter last in call to cvSaveImage in sift/src/siftfeat.c

Getting errors like this:

Erland-Lewins-Mac-mini:sift erl$ make
make -C ./src siftfeat
ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o
ranlib ../lib/libfeat.a
ranlib: warning for library: ../lib/libfeat.a the table of contents is empty (no object file members in the library define global symbols)
gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` siftfeat.c -o ../bin/siftfeat -L../lib -lfeat `pkg-config --libs opencv` `pkg-config --libs gtk+-2.0` `pkg-config --libs gsl`
ld: warning: in ../lib/libfeat.a, file is not of required architecture
ld: warning: in /usr/local/lib/libcxcore.dylib, file is not of required architecture
ld: warning: in /usr/local/lib/libcv.dylib, file is not of required architecture
ld: warning: in /usr/local/lib/libhighgui.dylib, file is not of required architecture
sift/src/imgfeatures.c: 298, change format for line number from %s to %d
sift/src/imgfeatures.c: 369, added -1, -1 to parameters to cvEigenVV

Now getting the "file is not of required architecture problems". Will continue to investigate later



Friday, January 15, 2010

Found insight3D, a cool program to make 3D models out of photos of objects from different angles.

Will try to compile for Ubuntu Linux 9.10, doesn't seem to be immediately available for MacOS X.

Downloaded OpenCV from:

http://dfn.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.0/OpenCV-2.0.0.tar.bz2

Did: apt-get install libgtk2.0-0
Did: sudo apt-get install libgtk2.0-dev
Did: sudo apt-get install gsl-bin
Did: sudo apt-get install libgsl0-dev

Trying to configure with:

./configure --prefix=/usr/local

Compiling insight3D with make.

Failed to run insight3d over X11 on my mac.

Will try to compile on my mac.

Managed to compile opencv with instructions here (after installing cmake with fink).

Managed to compile and run isight3D under Ubuntu on my laptop, but it crashes with an assertion on the example photos. Will try running it under Windows XP on bootcamp on the Mac.