Ubuntu 11.10 Eclipse and CUDA 4.1

I cant quite figure out why this happens but I am running Ubuntu with CUDA 4.1 in Eclipse and am running an example file and it builds fine but when I run it in Eclipse I get the following error

clBuildProgram(-11)

however when I go to my workspace and run the compiled program using

./example

it works perfectly. Does anyone know why it would give me a build program error in Eclipse but not when I run it from the terminal?

I know its not a crucial error since I can run it but it still is annoying to not have the run ability from eclipse.

Figured out its an optirun problem.

Does anyone know how to force Eclipse to run builds with optirun?