installing OpenCV with GPU modul in Mac

I was trying to install OpenCV 2.4.5 with GPU modul in Mac OSX Mountain Lion (10.8.4) but got some errors. Trying to find solution through Google, but didn’t get much information. Finally, after couple hours, I got the idea, it’s coming from several sources, so I just collect them here to help others who may need this.

Follow instructions in OpenCV_GPU

  1. Download and extract the source.
  2. Use Terminal, and create Build folder
  3. Use CMAKE GUI to configure
  4. Use Terminal and go to Build folder, then type make to compile
  5. Type sudo make install to install

And then, you may get this error :

[ 16%] Building NVCC (Device) object modules/ ... /cuda_compile_generated_matrix_
operations.cu.o
cc1plus: error: unrecognized command line option "-Wno-narrowing"
cc1plus: error: unrecognized command line option "-Wno-delete-non-virtual-dtor"
cc1plus: error: unrecognized command line option "-Wno-unnamed-type-template-args"

Solution : Actually, it’s because in Mac use llvm-gcc compiler. So, you have to download the “TRUE” gcc compiler via MacPort. If you don’t have MacPort yet, don’t be lazy, just Google-ing how to install it. 😀 I use gcc 4.6.4, but you can try the latest one if you already have.

sudo port install gcc46

By default, anything you’ve installed via MacPort will go to /opt/local/bin/. So, you have to make a symbolic link to gcc in /usr/bin

#> sudo unlink /usr/bin/gcc
#> sudo ln -s /opt/local/bin/x86_64-apple-darwin12-gcc-4.6.4 /usr/bin/gcc

and try to compile again.


If you get error like this.

Undefined symbols for architecture x86_64:
"std::ctype<char>::_M_widen_init() const", referenced from:
stdDebugOutput(cv::String const&) in cuda_compile_generated_NCV.cu.o
ld: symbol(s) not found for architecture x86_64

Keep calm, and follow solution below. 😀

Solution : You need to set “-fno-inline” flag in CMAKE_CXX_FLAGS. Open your CMAKE GUI, put a checklist in “Advanced“, you’ll see CMAKE_CXX_FLAGS attribute name.

It should be okay, now ! 🙂

ubuntu 12.04 di macbook pro 7.1

kantor saya yang sekarang ini agak berbeda..

dulu sejak kuliah di Taiwan, untuk urusan Linux, saya lebih condong ke distro turunan RedHat (RHEL, Fedora, atau CentOS).. bahkan sempat memoderatori Fedora Indonesia bersama beberapa kawan dari Bandung.. kemudian ketika lulus dan bekerja, walo sempet jadi Mac user karna kerjaan, sesekali masih bisa kontak dengan RHEL, karna kebetulan server kantor menggunakan RHEL..

tapi sekarang, Continue reading

MATLAB OpenCL Toolbox – Update

I made a little update on Matlab OpenCL Toolbox so now it can support the binary file of opencl program, and also a little update to avoid the compilation error in Mac or Linux..

ocl = opencl();
ocl.initialize(1,2);
ocl.addbinary('binaryprogram.clbin');
ocl.build();

the update is available here.
credit should go to the original author: Radford Juang

shiva3d causes memory leaks on iphone

if you are working with shiva3d game engine on iphone, you may notice two memory leaks once you convert the runtime package (.stk file) to xcode project using shiva authoring tools.

the memory leaks are
1. related to AudioToolbox framework
2. related to NSString

for the first one, i have no idea how to resolve it, since it was related to one of ios frameworks, and even google didn’t know :D.

and for the second, it seems the authoring tools forgot to release a dynamic NSString variable. see the image below. red rectangle is the suspect variable that you could find in initWithCoder method of S3DEngine_EAGLView class (blue rectangles). to resolve this, simply release the variable as shown in green rectangle.

click for bigger image