BUS runtime error due to wrong compiler options?


I am currently trying to turn a linear cpu code into a parallel code with cuda for C, I figured a good place to start would be to get nvcc to work properly on my code that does not parallelize anything. I am using an IDL script to give input and call my c code. So if I compile the code with gcc with the options

[codebox]gcc -fPIC -c filename.c -std=c99

gcc -shared -o filename.so filename.o[/codebox]

I get that there is no runtime error. Where as if I compile the code with nvcc with the command:

[codebox]nvcc -o fdtd1d_yee_mult_lnx.so --compiler-options ‘-fPIC’ -shared fdtd1d_yee_mult_lnx.c


I get an error from the IDL script:

[codebox]ntw OK …

Output filename: nstxae_42.0GHz_017out.sav

Start: Tue Jul 7 11:52:28 2009

Bus error


Also I have a version of the code that implements cuda in what seems a rather trivial and simple matter (so it should be hard to screw up). When I compile this code and try to run it on IDL I get the runtime error:

[codebox]Output filename: nstxae_42.0GHz_017out.sav

Start: Tue Jul 7 11:27:43 2009

% CALL_EXTERNAL: Error loading sharable executable.

             Symbol: fdtd1d_yee_mult_lnx, File = fdtd1d_yee_mult_lnx.so

             ./fdtd1d_yee_mult_lnx.so: undefined symbol:


% Execution halted at: FDTD1D_YEE_MULT_LNX 103


fdtd1d_yee_mult_lnx.so being the shared object file that is the result of the compilation with nvcc. I was wondering if you guys had any advice as to why it would be doing this!?

Bus error is usually just a segfault.

It seems that the problem is that when I compile my .cu into a shared object file with nvcc it is stored in a different format as when the file is compiled into a .so with gcc. I say this because the error I am getting is in the IDL function CALL_EXTERNAL It seems that IDL is capable of locating and opening the shared object file but it is incapable of evoking the function within the file. this is why it gives “undefined symbol”. I guess my question would be why would the format be different when compiling with nvcc and also how is it different? Essentially it all comes down to (i believe) how should I look for my function within the shared object file?