OpenNI on Mac!

1,029 views
Skip to first unread message

roxlu

unread,
Dec 13, 2010, 2:18:01 PM12/13/10
to OpenNI
Dear reader,

Since OpenNI was released we're extremely excited about it and can't
wait to
start using it. It's great to have a open source standardized
frameworks for this!
We've (already) seen some great projects done with it, together with
NITE.

As lots of people in this field use are working on a Mac we started
porting OpenNI so
it compiles on Mac OSX.

Our first step has been changing the build system to CMake which
seems to be
the best start. After four days of hacking we got OpenNI compiled on
Mac. Still ofcourse
we did not test this completely but it's a good start! There are still
some
minor things we should do with the CMake files but we would like to
have some
discussion from you at PrimeSense. We've got some thought on using the
TinyXML,
LibJPEG, LibUSB.

We're wondering what you (OpenNI developers) think of this and we
really hope
you're interested in having a look at this and make OpenNI+NITE work
on Mac so even
more people can start enjoying this fantastic ride!

I wrote a small post of the current status on my blog: http://roxlu.com/

Best regards
Diederick

Sassy Natan

unread,
Dec 13, 2010, 4:29:30 PM12/13/10
to openn...@googlegroups.com
this is super coooooool


--
You received this message because you are subscribed to the Google Groups "OpenNI" group.
To post to this group, send email to openn...@googlegroups.com.
To unsubscribe from this group, send email to openni-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.


Ziv Hendel

unread,
Dec 13, 2010, 4:39:54 PM12/13/10
to OpenNI
Hi Roxlu!

My name is Ziv and I'm the Realtime & Embedded team leader at
PrimeSense.

We really appreciate all your work and would love to help of course!

I'm going to go visit your IRC channel as this will probably make
discussion easier..

See you there in a sec :-)

Ziv.

roxlu

unread,
Dec 18, 2010, 4:35:11 PM12/18/10
to openn...@googlegroups.com
Together with Ziv we just got OpenNI working on a Mac together with the Kinect driver (SensorKinect). 
Note: it's still a work in progress version, but you can start playing around!  Read here how to compile
and run openni with your kinect here. Ziv is working on a binary of NITE! So the fun can start!

Roxlu

Matteo Bonini

unread,
Dec 18, 2010, 5:02:14 PM12/18/10
to openn...@googlegroups.com
I Compile the code

But when i try to start sample NiViewer application start but i see only one red point and the rest of the screen is black.

Matteo

mcpll

unread,
Dec 18, 2010, 6:28:10 PM12/18/10
to OpenNI
Ok,
I tryed on a Mac Mini Work Perfect.

On MacBookPro continue to have a problem.

Good Work

Matteo

subblue

unread,
Dec 19, 2010, 6:44:50 AM12/19/10
to openn...@googlegroups.com
Hi Roxlu

I've just followed your instructions for building OpenNI and SensorKinect on OS X. OpenNI built fine but after running make install for the SensorKinect I get the following error:

make[2]: *** No rule to make target `../../../../../OpenNI_TEST/libJPEG.dylib', needed by `Source/XnFormats/libXnFormats.dylib'.  Stop.
make[1]: *** [Source/XnFormats/CMakeFiles/XnFormats.dir/all] Error 2
make: *** [all] Error 2

Any suggestions?

Thanks
Tom.

Matthew Hare

unread,
Dec 21, 2010, 6:07:56 AM12/21/10
to openn...@googlegroups.com
worked perfectly. Looking forward to the NITE kit :)

--
You received this message because you are subscribed to the Google Groups "OpenNI" group.
To post to this group, send email to openn...@googlegroups.com.
To unsubscribe from this group, send email to openni-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.



--
Matthew Hare
Director
MBH Software LTD

takahashi

unread,
Dec 21, 2010, 8:03:13 AM12/21/10
to OpenNI
Hi Roxlu!

Thank you for your great works!

I got several error messages when I compile your codes.
After some modifications, I finally compiled successfully.

my modifications are below:
-------------------------------------------------------
*OpenNI

(1) Source/Modules/nimCodecs/CMakeFiles/nimCodecs.dir/link.txt

-lJPEG => /opt/local/lib/libjpeg.dylib

(2) OpenNI/Source/Modules/nimCodecs/XnStreamCompression.h

before:
#include <jpeglib.h>

after:
extern "C" {
#include <jpeglib.h>
}

*SensorKinect

I executed below command before executing make command.

cp /opt/local/lib/libjpeg.dylib libJPEG.dylib
-------------------------------------------------------

I'm looking forward to the NITE too.

roxlu

unread,
Dec 21, 2010, 12:02:18 PM12/21/10
to OpenNI
Hi subblue and takahashi,

I've to figure out why openni did not compile on your macs. Could you
tell
me a bit more about your system?
- what cmake version
- what mac osx version
- what were the errors exactly?
- and can you paste the specific link.txt?

It would great if I could reproduce the errors here and fix those!

Best roxlu

subblue

unread,
Dec 21, 2010, 4:25:33 PM12/21/10
to openn...@googlegroups.com
Thanks to takahashi's tip I copied my own copy of libjpeg.dylib I had previously installed via brew. 

From the openni_test/SensorKinect/Platform/Mac/Bin/Test directory I ran:
cp /usr/local/lib/libjpeg.dylib ../../../../../OpenNI_TEST/libJPEG.dylib

then make install worked properly.

Just for reference I'm using cmake 2.8.3 on OS X 10.6.5. cmake and libjpeg were installed via brew.

Thanks! :)

gabor papp

unread,
Dec 21, 2010, 5:32:08 PM12/21/10
to openn...@googlegroups.com
hi roxlu,

great work! congratulations.

i have some problems compiling the code, though. osx 10.5.8, macbook pro. cmake version 2.8.3, dependencies and cmake installed from macports.

$ ./build_test.sh 
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found JPEG: /opt/local/lib/libjpeg.dylib 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/gabor/.../roxlu_openni/Platform/Mac/Bin/Test
$ make install
Scanning dependencies of target TinyXml
[  1%] Building CXX object Source/External/TinyXml/CMakeFiles/TinyXml.dir/tinyxml.cpp.o
[  2%] Building CXX object Source/External/TinyXml/CMakeFiles/TinyXml.dir/tinystr.cpp.o
[  3%] Building CXX object Source/External/TinyXml/CMakeFiles/TinyXml.dir/tinyxmlerror.cpp.o
[  4%] Building CXX object Source/External/TinyXml/CMakeFiles/TinyXml.dir/tinyxmlparser.cpp.o
Linking CXX shared library libTinyXml.dylib
[  4%] Built target TinyXml
Scanning dependencies of target OpenNI
[  5%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/openNI.cpp.o
...
[ 37%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/Linux-x86Memory.cpp.o
/Users/gabor/.../roxlu_openni/Source/OpenNI/Mac/Linux-x86Memory.cpp: In function ‘void* xnOSMallocAligned(XnSizeT, XnSizeT)’:
/Users/gabor/.../roxlu_openni/Source/OpenNI/Mac/Linux-x86Memory.cpp:47: error: ‘posix_memalign’ was not declared in this scope
make[2]: *** [Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/Linux-x86Memory.cpp.o] Error 1
make[1]: *** [Source/OpenNI/CMakeFiles/OpenNI.dir/all] Error 2
make: *** [all] Error 2

any help would be appreciated.

best,
gabor

takahashi

unread,
Dec 21, 2010, 10:47:10 PM12/21/10
to OpenNI
Hi Roxlu,

> - what cmake version

2.8.3

> - what mac osx version

Mac OS X 10.6.5 (10H574)

> - what were the errors exactly?

---------------------------------------
./build_test.sh
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag -
yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag -
yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found JPEG: /opt/local/lib/libjpeg.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ktakahas/OpenNI/Platform/
Mac/Bin/Test
pro:Test ktakahas$ make
Scanning dependencies of target TinyXml
[ 1%] Building CXX object Source/External/TinyXml/CMakeFiles/
TinyXml.dir/tinyxml.cpp.o
[ 2%] Building CXX object Source/External/TinyXml/CMakeFiles/
TinyXml.dir/tinystr.cpp.o
[ 3%] Building CXX object Source/External/TinyXml/CMakeFiles/
TinyXml.dir/tinyxmlerror.cpp.o
[ 4%] Building CXX object Source/External/TinyXml/CMakeFiles/
TinyXml.dir/tinyxmlparser.cpp.o
Linking CXX shared library libTinyXml.dylib
[ 4%] Built target TinyXml
Scanning dependencies of target OpenNI
[ 5%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
openNI.cpp.o
[ 6%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnBaseNode.cpp.o
[ 7%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnEnumerationErrors.cpp.o
[ 8%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnFPSCalculator.cpp.o
[ 9%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnLicensing.cpp.o
[ 10%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnLog.cpp.o
[ 12%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnMockNotifier.cpp.o
[ 13%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnModuleLoader.cpp.o
[ 14%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnNodeManager.cpp.o
[ 15%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnNodeWatcher.cpp.o
[ 16%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnOpenNI.cpp.o
[ 17%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnOS.cpp.o
[ 18%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnOSMemoryProfiling.cpp.o
[ 19%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnPlayerImpl.cpp.o
[ 20%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnProfiling.cpp.o
[ 21%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnQueries.cpp.o
[ 23%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnRecorderImpl.cpp.o
[ 24%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnScheduler.cpp.o
[ 25%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnStatusRegister.cpp.o
[ 26%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnUSB.cpp.o
[ 27%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnUtils.cpp.o
[ 28%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnXml.cpp.o
[ 29%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/
XnXmlConfig.cpp.o
[ 30%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86CriticalSections.cpp.o
[ 31%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Debug.cpp.o
[ 32%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Events.cpp.o
[ 34%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Files.cpp.o
[ 35%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86INI.cpp.o
[ 36%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Keyboard.cpp.o
[ 37%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Memory.cpp.o
[ 38%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Mutex.cpp.o
[ 39%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Network.cpp.o
[ 40%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Processes.cpp.o
[ 41%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86SharedLibs.cpp.o
[ 42%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86SharedMemory.cpp.o
[ 43%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Strings.cpp.o
[ 45%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Threads.cpp.o
[ 46%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
Linux-x86Time.cpp.o
[ 47%] Building CXX object Source/OpenNI/CMakeFiles/OpenNI.dir/Mac/
XnUSBLinux-x86.cpp.o
Linking CXX shared library libOpenNI.dylib
[ 47%] Built target OpenNI
Scanning dependencies of target nimCommon
[ 48%] Building CXX object Source/Modules/Common/CMakeFiles/
nimCommon.dir/DataRecords.cpp.o
Linking CXX shared library libnimCommon.dylib
[ 48%] Built target nimCommon
Scanning dependencies of target nimCodecs
[ 49%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/ExportedCodec.cpp.o
[ 50%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/Xn16zCodec.cpp.o
[ 51%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/Xn16zEmbTablesCodec.cpp.o
[ 52%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/Xn8zCodec.cpp.o
[ 53%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/XnCodec.cpp.o
[ 54%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/XnCodecs.cpp.o
[ 56%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/XnJpegCodec.cpp.o
[ 57%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/XnStreamCompression.cpp.o
[ 58%] Building CXX object Source/Modules/nimCodecs/CMakeFiles/
nimCodecs.dir/XnUncompressedCodec.cpp.o
Linking CXX shared library libnimCodecs.dylib
ld: library not found for -lJPEG
collect2: ld returned 1 exit status
make[2]: *** [Source/Modules/nimCodecs/libnimCodecs.dylib] Error 1
make[1]: *** [Source/Modules/nimCodecs/CMakeFiles/nimCodecs.dir/all]
Error 2
make: *** [all] Error 2
---------------------------------------

And after modifying Source/Modules/nimCodecs/CMakeFiles/nimCodecs.dir/
link.txt
---------------------------------------
pro:Test ktakahas$ make
[ 4%] Built target TinyXml
[ 47%] Built target OpenNI
[ 48%] Built target nimCommon
Linking CXX shared library libnimCodecs.dylib
Undefined symbols:
"jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned
long)", referenced from:
XnStreamInitUncompressImageJ(XnStreamUncompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_read_header(jpeg_decompress_struct*, int)", referenced from:
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**,
unsigned int)", referenced from:
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_resync_to_restart(jpeg_decompress_struct*, int)", referenced
from:
XnStreamInitUncompressImageJ(XnStreamUncompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_write_scanlines(jpeg_compress_struct*, unsigned char**,
unsigned int)", referenced from:
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_set_defaults(jpeg_compress_struct*)", referenced from:
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_start_decompress(jpeg_decompress_struct*)", referenced from:
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_set_quality(jpeg_compress_struct*, int, int)", referenced
from:
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_destroy_compress(jpeg_compress_struct*)", referenced from:
XnStreamFreeCompressImageJ(XnStreamCompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_finish_decompress(jpeg_decompress_struct*)", referenced from:
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_std_error(jpeg_error_mgr*)", referenced from:
XnStreamInitUncompressImageJ(XnStreamUncompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamInitCompressImageJ(XnStreamCompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
"jpeg_CreateCompress(jpeg_compress_struct*, int, unsigned long)",
referenced from:
XnStreamInitCompressImageJ(XnStreamCompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_start_compress(jpeg_compress_struct*, int)", referenced from:
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_finish_compress(jpeg_compress_struct*)", referenced from:
XnStreamCompressImage24J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
XnStreamCompressImage8J(XnStreamCompJPEGContext*, unsigned char
const*, unsigned char*, unsigned int*, unsigned int, unsigned int,
unsigned int)in XnStreamCompression.cpp.o
"jpeg_destroy_decompress(jpeg_decompress_struct*)", referenced from:
XnStreamFreeUncompressImageJ(XnStreamUncompJPEGContext*) in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
XnStreamUncompressImageJ(XnStreamUncompJPEGContext*, unsigned
char const*, unsigned int, unsigned char*, unsigned int*)in
XnStreamCompression.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [Source/Modules/nimCodecs/libnimCodecs.dylib] Error 1
make[1]: *** [Source/Modules/nimCodecs/CMakeFiles/nimCodecs.dir/all]
Error 2
make: *** [all] Error 2

---------------------------------------

> - and can you paste the specific link.txt?

Source/Modules/nimCodecs/CMakeFiles/nimCodecs.dir/link.txt
---------------------------------------
/usr/bin/c++ -O3 -DNDEBUG -dynamiclib -headerpad_max_install_names -
o libnimCodecs .dylib -install_name /Users/ktakahas/OpenNI/Platform/
Mac/Bin/Test/Source/Modules/nim Codecs/libnimCodecs.dylib
CMakeFiles/nimCodecs.dir/ExportedCodec.cpp.o CMakeFiles/ni
mCodecs.dir/Xn16zCodec.cpp.o CMakeFiles/nimCodecs.dir/
Xn16zEmbTablesCodec.cpp.o CMak eFiles/nimCodecs.dir/Xn8zCodec.cpp.o
CMakeFiles/nimCodecs.dir/XnCodec.cpp.o CMakeFil es/nimCodecs.dir/
XnCodecs.cpp.o CMakeFiles/nimCodecs.dir/XnJpegCodec.cpp.o CMakeFile
s/nimCodecs.dir/XnStreamCompression.cpp.o CMakeFiles/nimCodecs.dir/
XnUncompressedCod ec.cpp.o -lJPEG ../../OpenNI/
libOpenNI.dylib ../../../../../../../Source/External/Li bUSB/Mac/
libusb-1.0.a /usr/lib/libdl.dylib ../../External/TinyXml/
libTinyXml.dylib - framework CoreFoundation -framework IOKit
---------------------------------------

takahashi

Kamen Dimitrov

unread,
Dec 22, 2010, 10:34:07 AM12/22/10
to openn...@googlegroups.com
Hi,
I got the same error, but libjpeg was installed with "fink". After I
removed it and installed it with "brew", everything works fine. It
seems the version that "fink" installed was only compiled for i386 and
not x86_64.

Cheerz,
KD

Matteo Bonini

unread,
Dec 22, 2010, 10:42:13 AM12/22/10
to openn...@googlegroups.com
Have you install Xcode?

2010/12/22 Kamen Dimitrov <kam...@gmail.com>

Radamés Ajna

unread,
Dec 24, 2010, 12:07:53 AM12/24/10
to openn...@googlegroups.com
Hi!

I've gotten the drivers working on my mac, the Sample-NiViewer and Sample-NiSimpleViewer, however it takes some seconds to open and keep sending this error message

libusb:info [darwin_check_configuration] active config: 1, first config: 1
libusb:info [process_new_device] found device with address 1 at 001-05ac-8005-09-00
libusb:info [process_new_device] allocating new device for location 0x06300000
libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device

it repeats until the Viewer open...

 
I'm interested in the skeleton tracking, at this point can I use the methods inside my apps?

thanks


Radamés

gabor papp

unread,
Dec 24, 2010, 2:56:59 PM12/24/10
to OpenNI
there was no posix_memalign before snow leopard. patch to make it
compile:

diff --git a/Include/Mac/XnPlatformMac.h b/Include/Mac/XnPlatformMac.h
index bb25017..b96b543 100755
--- a/Include/Mac/XnPlatformMac.h
+++ b/Include/Mac/XnPlatformMac.h
@@ -39,6 +39,9 @@
#include <string.h>^M
#include <assert.h>^M
^M
+#include <AvailabilityMacros.h>^M
+#include <sys/errno.h>^M
+^M
//---------------------------------------------------------------------------
^M
// Platform Basic Definition^M
//---------------------------------------------------------------------------
^M
@@ -132,6 +135,20 @@ typedef size_t XnSizeT;
//---------------------------------------------------------------------------
^M
// Memory^M
//---------------------------------------------------------------------------
^M
+/** posix_memalign for OS X version < 10.6 */^M
+#if (defined __APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED <= 1060)^M
+inline int posix_memalign(void **memptr, size_t alignment, size_t
size)^M
+{^M
+ if ((alignment && !(alignment & (alignment - 1))) ||^M
+ (alignment > 16)) // OS X has 16 bytes alignment by default^M
+ return EINVAL;^M
+ *memptr = malloc(size);^M
+ if (*memptr == NULL)^M
+ return ENOMEM;^M
+ return 0;^M
+}^M
+#endif^M
+^M
/** The default memory alignment. */ ^M
#define XN_DEFAULT_MEM_ALIGN 16^M
^M
diff --git a/Source/OpenNI/Mac/Linux-x86Memory.cpp b/Source/OpenNI/Mac/
Linux-x86Memory.cpp
index 11ddcc9..fedbced 100755
--- a/Source/OpenNI/Mac/Linux-x86Memory.cpp
+++ b/Source/OpenNI/Mac/Linux-x86Memory.cpp
@@ -29,6 +29,7 @@
// NOTE: you must define XN_OS_IMPL before including xnOS.h,
otherwise, when mem profiling this file will not compile.^M
#define XN_OS_IMPL^M
#include <XnOS.h>^M
+#include <XnPlatform.h>^M
#include <malloc/malloc.h> // @todo Porting to Mac^M
#include <XnLog.h>^M
^M

gabor papp

unread,
Dec 24, 2010, 4:57:37 PM12/24/10
to OpenNI
sorry, the previous patch although compiles does not work. the
following fixes it.
i also had to patch the cmake file to make it work with the macports
libjpeg, i hope it also works with fink and homebrew.

copying libjpeg.dylib to OpenNI_TEST/libJPEG.dylib is still required
unfortunately.

best,
gabor


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80b3d7e..699e530 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,6 @@ set(TINYXML_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/
Source/External/TinyXml/")
set(OPENNI_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include/")
set(OPENNI_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules")
set(TINYXML_LIB_NAME TinyXml)
-set(JPEG_LIB_NAME JPEG)
set(OPENNI_LIB_NAME OpenNI)
set(NIMCOMMON_LIB_NAME nimCommon)
set(NIMCODECS_LIB_NAME nimCodecs)
@@ -42,11 +41,15 @@ set(NIMRECORDER_LIB_NAME nimRecorder)
# Find JPEG system lib
# ---------------------
find_package(JPEG)
+
if(NOT JPEG_FOUND)
# when not found use the one in the externals folder, so we can
compile!
set(JPEG_FOUND true)
set(JPEG_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Source/External/
LibJPEG/")
add_subdirectory("./Source/External/LibJPEG/")
+else (JPEG_FOUND)
+ include_directories(${JPEG_INCLUDE_DIRS})
+ set(JPEG_LIB_NAME ${JPEG_LIBRARIES})
endif()

# Find USB lib
diff --git a/Include/Mac/XnPlatformMac.h b/Include/Mac/XnPlatformMac.h
index bb25017..3cdd954 100755
+ if (!alignment || (alignment & (alignment - 1)) ||^M

Amir Hirsch

unread,
Dec 24, 2010, 7:45:39 PM12/24/10
to openn...@googlegroups.com
Hi Everyone!

I have OpenNI Compiling on Mac

i changed the link.txt file from -lJPEG to /opt/local/lib/libjpeg.dylib


I cannot get SensorKinect to compile from Roxlu's github.


make install dumps this:



[  0%] Building CXX object Source/XnCore/CMakeFiles/XnCore.dir/XnBuffer.cpp.o

In file included from /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:31:

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.h:33:18: error: XnOS.h: No such file or directory

In file included from /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.h:34,

                 from /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:31:

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:34:24: error: XnPlatform.h: No such file or directory

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:35:22: error: XnStatus.h: No such file or directory

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:36:23: error: XnVersion.h: No such file or directory

In file included from /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.h:34,

                 from /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:31:

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:63: error: ‘XN_API_IMPORT’ does not name a type

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:72: error: ‘XN_API_IMPORT’ does not name a type

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:78: error: ‘XN_API_IMPORT’ does not name a type

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:86: error: ‘XN_API_IMPORT’ does not name a type

/Users/amir/Hacking/kinect/SensorKinect/Include/XnCore.h:95: error: expected constructor, destructor, or type conversion before ‘const’

In file included from /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:31:

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.h:42: error: function definition does not declare parameters

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:36: error: ‘XnStatus’ does not name a type

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:46: error: ‘XnBuffer’ has not been declared

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:46: error: variable or field ‘SetExternalBuffer’ declared void

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:46: error: ‘XnUChar’ was not declared in this scope

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:46: error: ‘pBuffer’ was not declared in this scope

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:46: error: ‘XnUInt32’ was not declared in this scope

/Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.cpp:55: error: ‘XnStatus’ does not name a type

make[2]: *** [Source/XnCore/CMakeFiles/XnCore.dir/XnBuffer.cpp.o] Error 1

make[1]: *** [Source/XnCore/CMakeFiles/XnCore.dir/all] Error 2

make: *** [all] Error 2
















gabor papp

unread,
Dec 25, 2010, 2:42:27 AM12/25/10
to OpenNI
hi Amir,

> /Users/amir/Hacking/kinect/SensorKinect/Source/XnCore/XnBuffer.h:33:18:
> error: XnOS.h: No such file or directory
it seems you don't have the directory structure described in
http://roxlu.com/blog/entry/116/openni-and-sensorkinect-driver-for-mac-/
so sensorkinect does not find the include files from openni. openni
and sensorkinect should be in the same parent directory called OpenNI
and SensorKinect.

best,
gabor


Amir Hirsch

unread,
Dec 25, 2010, 4:38:18 PM12/25/10
to openn...@googlegroups.com
Thank you Gabor. This gets the Simple Viewer example working on OS X!

I don't think any of the other OpenNI are working correctly on Mac though. It seems to freeze the stream whenever I use the mouse to make a selection. 


Going to try everything in Linux and Windows now. 




Amir



--

Radamés Ajna

unread,
Dec 25, 2010, 7:00:58 PM12/25/10
to openn...@googlegroups.com
yes, the same here, the only app that is working on Mac for while.
My doubt is whether or not I can use the functions of skeleton extraction of the compiled apps. I know I need the wrapper functions to use in OpenFrameworks for example.
I notice roxlu is going to work in something like that.
https://github.com/roxlu/ofxOpenNI
ps. still empty!!




Radamés

blkcatman

unread,
Dec 26, 2010, 12:54:27 AM12/26/10
to OpenNI
Hi.

I tried to compile OpenNI and SensorKinect on Leopard.
Compiling was done thanks to valuable information.

And I tried to run Sample-NiViewer,
glut window was open,but nothing is working.
Captured raw image is filled with zero(00).

Error log is(repeating couple of times):
------------

5462560 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 1:
Failed to submit asynch I/O transfer (err=-99)!
5463057 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 2:
Failed to submit asynch I/O transfer (err=-99)!
5463447 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 3:
Failed to submit asynch I/O transfer (err=-99)!
5464566 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 4:
Failed to submit asynch I/O transfer (err=-99)!
5464797 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 5:
Failed to submit asynch I/O transfer (err=-99)!
5465213 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 7:
Failed to submit asynch I/O transfer (err=-99)!
5465445 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 8:
Failed to submit asynch I/O transfer (err=-99)!
5465663 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 9:
Failed to submit asynch I/O transfer (err=-99)!
5465857 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 10:
Failed to submit asynch I/O transfer (err=-99)!
5465971 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 11:
Failed to submit asynch I/O transfer (err=-99)!
5466060 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 12:
Failed to submit asynch I/O transfer (err=-99)!
5466196 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 13:
Failed to submit asynch I/O transfer (err=-99)!
5466373 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 14:
Failed to submit asynch I/O transfer (err=-99)!
5466602 [ERROR] XnUSBLinux-x86.cpp 835 Endpoint 0x82, Buffer 15:
Failed to submit asynch I/O transfer (err=-99)!
5466648 [WARNING] XnUSBLinux-x86.cpp 929 Endpoint 0x82, Buffer 0:
Asynch transfer failed (status: 1)
5466831 [ERROR] XnUSBLinux-x86.cpp 939 Endpoint 0x82, Buffer 0:
Failed to re-submit asynch I/O transfer (err=-99)!

------------
FYI,
blkcatman

gabor papp

unread,
Dec 26, 2010, 6:42:26 AM12/26/10
to OpenNI
> And I tried to run Sample-NiViewer,
> glut window was open,but nothing is working.
just an idea, but did you patch libusb? it might not work if you
didn't.

gabor

blkcatman

unread,
Dec 26, 2010, 9:13:35 AM12/26/10
to OpenNI
Thank you gabor.
I forgot patch libusb.
Sample-NiViewer is working after pathing and recompiling.
Thanks to you for your support.

blkcatman

Nicholas Butko

unread,
Dec 26, 2010, 2:36:36 PM12/26/10
to openn...@googlegroups.com
Hey Roxlu,

I've been traveling for the holidays, so I've been out of the loop unfortunately.

Just got OpenNI/SensorKinect compiled. Good work!

I'm attaching a new CMakeLists with a small modification. It simply looks for an installed version of libjpeg (e.g. from macports). If installed, it won't try to use the custom version.

Sounds like it will help several people on the mailing list out. Give it a look to make sure it doesn't break anything for you.

--Nick

CMakeLists.txt

Nicholas Butko

unread,
Dec 26, 2010, 2:37:46 PM12/26/10
to openn...@googlegroups.com
Are there instructions somewhere for patching libusb? I can't seem to find them on the instructions at http://www.roxlu.com/

Sorry if they're in plain view somewhere.

--Nick

gabor papp

unread,
Dec 26, 2010, 2:59:54 PM12/26/10
to OpenNI
> I'm attaching a new CMakeLists with a small modification.
works perfectly for me. thanks.

> Are there instructions somewhere for patching libusb?
there are instructions on the openkinect site:
http://openkinect.org/wiki/Getting_Started#Manual_Build_under_OSX

the patch is here:
https://github.com/OpenKinect/libfreenect/raw/master/platform/osx/libusb-osx-kinect.diff

although i think you won't need it if you install libusb-devel from
macports or homebrew.

gabor

Nicholas Butko

unread,
Dec 26, 2010, 3:59:00 PM12/26/10
to openn...@googlegroups.com
Thanks for the heads-up about libusb-devel. This works well.

Good job, Roxlu & everyone else.

Now we just need NITE =). Anyone have any idea what's the progress on OSX NITE?

--Nick

Nicholas Butko

unread,
Dec 28, 2010, 1:12:18 PM12/28/10
to openn...@googlegroups.com, Ziv Hendel
Ziv,

As you know, we've basically gotten OpenNI+SensorKinect working on OSX. I say "we", but my involvement is very small, and there are many others to thank for it. Here's a link to the effort: 

http://www.roxlu.com/blog/entry/116/openni-and-sensorkinect-driver-for-mac-/page/

I would very much like to use kinect with ROS, and would like to see our efforts re-integrated with the ros OpenNI+ps_engine repositories. 

I talked to Willow Garage, and it seems like the best approach is to integrate the OSX Platform and cmake build system directly into the OpenNI & SensorKinect frameworks, to minimize the amount of patching that needs to be done downstream.

Having the CMake build system is also helpful for those using Ubuntu, because until now they have been patching makefiles downstream, which is kindof tedious and brittle. 

So, can we get these fixes ported to the OpenNI repositories soon? 

--Nick


On Dec 13, 2010, at 1:39 PM, Ziv Hendel wrote:

Hi Roxlu!

My name is Ziv and I'm the Realtime & Embedded team leader at
PrimeSense.

We really appreciate all your work and would love to help of course!

I'm going to go visit your IRC channel as this will probably make
discussion easier..

See you there in a sec :-)

Ziv.
Reply all
Reply to author
Forward
0 new messages