Note that there are some explanatory texts on larger screens.

plurals
  1. PONVCC linking error in C and CUDA-C code
    primarykey
    data
    text
    <p>I'm working on an DNA Fragment Assembly program. The CPU-only version is built in C language using GCC and I'm trying to build a GPU version using NVCC.</p> <p>Here is the makefile</p> <pre><code>all : clean FragmentAssembly.exe FragmentAssembly.exe : Common.o Fragment.o ILS.o Consensus.o main.o nvcc -pg -o FragmentAssembly.exe Common.o Fragment.o ILS.o Consensus.o main.o Common.o : Common.cu nvcc -pg -o Common.o -c Common.cu Fragment.o : Fragment.cu nvcc -pg -o Fragment.o -c Fragment.cu ILS.o : ILS.cu nvcc -pg -o ILS.o -c ILS.cu Consensus.o : Consensus.cu nvcc -pg -o Consensus.o -c Consensus.cu main.o : main.cu nvcc -pg -o main.o -c main.cu clean : rm -f *.exe *.o </code></pre> <p>As seen, the original <code>.c</code> files became .cu files for <code>nvcc</code> to compile them correctly. All of the cu files contain includes of their corresponding files (Common.h for Common.cu, etc..) except for <code>main.cu</code>.</p> <p>ILS.h contians definition of global variables <code>p_instanceFragments</code> and <code>p_instanceLength</code></p> <p>The problem is when compiling NVCC, for an unknown reason, I get the following errors :</p> <pre><code>Consensus.o:(.bss+0x0): multiple definition of `p_instanceFragments' ILS.o:(.bss+0x0): first defined here Consensus.o:(.bss+0x8): multiple definition of `p_instanceLength' ILS.o:(.bss+0x8): first defined here </code></pre> <p>There is no real multiple definitions since the same code is built correctly using GCC. It looks as if <code>ILS.h</code> is getting included twice in nvcc, by <code>ILS.cu</code> and <code>Consensus.cu</code>. This is also not possible since I've wrapped all my header files with an <code>#ifndef .. #define .. #endif</code> statements to avoid multiple includes and infinite include loops.</p> <p>Maybe something with the makefile commands ? or should I use gcc for linking ? Can you tell me how to deal with it ?</p> <p>Regards,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload