“workspace in use or cannot be created” in eclipse or nvidia nsight

– remove .lock file in workspace’s metadata folder.
rm {YourWorkspaceDir}/.metadata/.lock

– find out the RECENT_WORKSPACES attribute
cd ~/.eclipse
grep -r "RECENT_WORKSPACES" *

– once you got the file where the RECENT_WORKSPACES attribute exists, edit that file by removing the RECENT_WORKSPACES line.

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 ! 🙂

__sync_fetch_and_add

/usr/include/c++/4.4/ext/atomicity.h(46): error: identifier "__sync_fetch_and_add" is undefined
/usr/include/c++/4.4/ext/atomicity.h(50): error: identifier "__sync_fetch_and_add" is undefined

symptoms: #include <iostream> and using gcc 4.4
solution: AFAIK, do upgrade your gcc, or do not use iostream header.. 😀

errors in cuda 4.0

I’m just trying the cuda 4.0 on my macbook. And, as usual, i’m too lazy to read the “what’s new” page or doc. Just go straight to test it until got stuck with the errors.. 😀

Here, I’ll list any kind of errors i experienced with, and hopefully it’ll come along with solution.. 😛

First, i’m trying to compile an old simple code. This code was fine using cuda 3.2, but when I compile it using cuda 4.0, this kind of error comes out..

cudaLK.o:1203:53: warning: null character(s) ignored
cudaLK.o:1203:101: warning: null character(s) ignored
cudaLK.o:1203:112: warning: null character(s) preserved in literal
cudaLK.o:1203:112: warning: missing terminating ' character
cudaLK.o(1): error: unrecognized token

whoaa…… this forced me to read the programming guide, again..

Finally, when my eyes went to nvcc section, I got the clue… It looks like nvidia change the format of nvcc command.. In earlier version, simple nvcc command was

nvcc -c <cudacodefile>.cu -o <cudacodefile>.o

But for cuda 4.0, you don’t need to define the object file. nvcc will automatically define the object file based on the .cu file name. So, it should be simply..

nvcc -c <cudacodefile>.cu

to be continued later..

127.0.0.1 sweet 127.0.0.1

127.0.0.1 sweet 127.0.0.1
There's no place like 127.0.0.1
---------------------------------------
$> cd /pub
$> more beer
---------------------------------------
Declare Variables, Not war.
---------------------------------------
/* No Comment */
---------------------------------------
There are only 10 types of people in the world:
Those who understand binary and those who don't.
---------------------------------------
while(!(succeed = try()));
---------------------------------------
> SELECT * FROM users WHERE clue > 0
0 rows returned
---------------------------------------
i > u
---------------------------------------
i never finish anyth
---------------------------------------
Looks like you've got an ID-10T error!
it must be user error.

error Visual Studio 2005 dan gl.h

Pesan error yang mungkin muncul ketika menggunakan OpenGL pada Visual Studio 2005 :

1>C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKincludeGL/gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
1>C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKincludeGL/gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKincludeGL/gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
1>C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKincludeGL/gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
1>C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKincludeGL/gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKincludeGL/gl.h(1153) : error C2144: syntax error : 'void' should be preceded by ';'

Untuk mengatasinya tambahkan

#include 

sebelum memanggil #include <GL/gl.h>