byzhang / cudpp

Automatically exported from code.google.com/p/cudpp
Other
0 stars 0 forks source link

error creating shared libraries #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. edit common.mk add -fPIC to gcc g++ and link
2. make
3. g++ -shared -Wl,-soname,libcudpp.so.1 -o libcudpp.so.1.0 *.cpp_o *.cu_o

What is the expected output? What do you see instead?

g++ -shared -Wl,-soname,libcudpp.so.1 -o libcudpp.so.1.0 *.cpp_o *.cu_o
radixsort_app.cu_o: In function `OperatorMin<double>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x150a0):
 multiple definition of `OperatorMin<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x17f0): first defined here
radixsort_app.cu_o: In function `OperatorMin<float>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x150c0):
 multiple definition of `OperatorMin<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1810): first defined here
radixsort_app.cu_o: In function `OperatorMin<unsigned int>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x150e0):
 multiple definition of `OperatorMin<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1830): first defined here
radixsort_app.cu_o: In function `OperatorMin<int>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x15100):
 multiple definition of `OperatorMin<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1850): first defined here
radixsort_app.cu_o: In function `OperatorMax<double>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x15120):
 multiple definition of `OperatorMax<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1870): first defined here
radixsort_app.cu_o: In function `OperatorMax<float>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x15140):
 multiple definition of `OperatorMax<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1890): first defined here
radixsort_app.cu_o: In function `OperatorMax<unsigned int>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x15160):
 multiple definition of `OperatorMax<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18b0): first defined here
radixsort_app.cu_o: In function `OperatorMax<int>::identity() const':
tmpxft_00005020_00000000-4_radixsort_app.compute_10.cudafe1.cpp:(.text+0x15180):
 multiple definition of `OperatorMax<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18d0): first defined here
rand_app.cu_o: In function `OperatorMin<double>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xe30): 
multiple definition of `OperatorMin<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x17f0): first defined here
rand_app.cu_o: In function `OperatorMin<float>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xe50): 
multiple definition of `OperatorMin<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1810): first defined here
rand_app.cu_o: In function `OperatorMin<unsigned int>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xe70): 
multiple definition of `OperatorMin<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1830): first defined here
rand_app.cu_o: In function `OperatorMin<int>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xe90): 
multiple definition of `OperatorMin<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1850): first defined here
rand_app.cu_o: In function `OperatorMax<double>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xeb0): 
multiple definition of `OperatorMax<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1870): first defined here
rand_app.cu_o: In function `OperatorMax<float>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xed0): 
multiple definition of `OperatorMax<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1890): first defined here
rand_app.cu_o: In function `OperatorMax<unsigned int>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xef0): 
multiple definition of `OperatorMax<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18b0): first defined here
rand_app.cu_o: In function `OperatorMax<int>::identity() const':
tmpxft_00005110_00000000-4_rand_app.compute_10.cudafe1.cpp:(.text+0xf10): 
multiple definition of `OperatorMax<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18d0): first defined here
reduce_app.cu_o: In function `OperatorMin<double>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6ef0): 
multiple definition of `OperatorMin<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x17f0): first defined here
reduce_app.cu_o: In function `OperatorMin<float>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6f10): 
multiple definition of `OperatorMin<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1810): first defined here
reduce_app.cu_o: In function `OperatorMin<unsigned int>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6f30): 
multiple definition of `OperatorMin<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1830): first defined here
reduce_app.cu_o: In function `OperatorMin<int>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6f50): 
multiple definition of `OperatorMin<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1850): first defined here
reduce_app.cu_o: In function `OperatorMax<double>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6f70): 
multiple definition of `OperatorMax<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1870): first defined here
reduce_app.cu_o: In function `OperatorMax<float>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6f90): 
multiple definition of `OperatorMax<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1890): first defined here
reduce_app.cu_o: In function `OperatorMax<unsigned int>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6fb0): 
multiple definition of `OperatorMax<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18b0): first defined here
reduce_app.cu_o: In function `OperatorMax<int>::identity() const':
tmpxft_00005028_00000000-4_reduce_app.compute_10.cudafe1.cpp:(.text+0x6fd0): 
multiple definition of `OperatorMax<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18d0): first defined here
scan_app.cu_o: In function `OperatorMin<double>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x202b0): 
multiple definition of `OperatorMin<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x17f0): first defined here
scan_app.cu_o: In function `OperatorMin<float>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x202d0): 
multiple definition of `OperatorMin<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1810): first defined here
scan_app.cu_o: In function `OperatorMin<unsigned int>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x202f0): 
multiple definition of `OperatorMin<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1830): first defined here
scan_app.cu_o: In function `OperatorMin<int>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x20310): 
multiple definition of `OperatorMin<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1850): first defined here
scan_app.cu_o: In function `OperatorMax<double>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x20330): 
multiple definition of `OperatorMax<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1870): first defined here
scan_app.cu_o: In function `OperatorMax<float>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x20350): 
multiple definition of `OperatorMax<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1890): first defined here
scan_app.cu_o: In function `OperatorMax<unsigned int>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x20370): 
multiple definition of `OperatorMax<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18b0): first defined here
scan_app.cu_o: In function `OperatorMax<int>::identity() const':
tmpxft_00004f70_00000000-4_scan_app.compute_10.cudafe1.cpp:(.text+0x20390): 
multiple definition of `OperatorMax<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18d0): first defined here
segmented_scan_app.cu_o: In function `OperatorMin<double>::identity() const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
e40): multiple definition of `OperatorMin<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x17f0): first defined here
segmented_scan_app.cu_o: In function `OperatorMin<float>::identity() const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
e60): multiple definition of `OperatorMin<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1810): first defined here
segmented_scan_app.cu_o: In function `OperatorMin<unsigned int>::identity() 
const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
e80): multiple definition of `OperatorMin<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1830): first defined here
segmented_scan_app.cu_o: In function `OperatorMin<int>::identity() const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
ea0): multiple definition of `OperatorMin<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1850): first defined here
segmented_scan_app.cu_o: In function `OperatorMax<double>::identity() const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
ec0): multiple definition of `OperatorMax<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1870): first defined here
segmented_scan_app.cu_o: In function `OperatorMax<float>::identity() const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
ee0): multiple definition of `OperatorMax<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1890): first defined here
segmented_scan_app.cu_o: In function `OperatorMax<unsigned int>::identity() 
const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
f00): multiple definition of `OperatorMax<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18b0): first defined here
segmented_scan_app.cu_o: In function `OperatorMax<int>::identity() const':
tmpxft_00004f71_00000000-4_segmented_scan_app.compute_10.cudafe1.cpp:(.text+0x2c
f20): multiple definition of `OperatorMax<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18d0): first defined here
spmvmult_app.cu_o: In function `OperatorMin<double>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x1590): 
multiple definition of `OperatorMin<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x17f0): first defined here
spmvmult_app.cu_o: In function `OperatorMin<float>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x15b0): 
multiple definition of `OperatorMin<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1810): first defined here
spmvmult_app.cu_o: In function `OperatorMin<unsigned int>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x15d0): 
multiple definition of `OperatorMin<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1830): first defined here
spmvmult_app.cu_o: In function `OperatorMin<int>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x15f0): 
multiple definition of `OperatorMin<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1850): first defined here
spmvmult_app.cu_o: In function `OperatorMax<double>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x1610): 
multiple definition of `OperatorMax<double>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1870): first defined here
spmvmult_app.cu_o: In function `OperatorMax<float>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x1630): 
multiple definition of `OperatorMax<float>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x1890): first defined here
spmvmult_app.cu_o: In function `OperatorMax<unsigned int>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x1650): 
multiple definition of `OperatorMax<unsigned int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18b0): first defined here
spmvmult_app.cu_o: In function `OperatorMax<int>::identity() const':
tmpxft_00004f81_00000000-4_spmvmult_app.compute_10.cudafe1.cpp:(.text+0x1670): 
multiple definition of `OperatorMax<int>::identity() const'
compact_app.cu_o:tmpxft_00004f69_00000000-4_compact_app.compute_10.cudafe1.cpp:(
.text+0x18d0): first defined here
collect2: ld returned 1 exit status

What version of the product are you using? On what operating system?

cuda 3.1 and cudpp_read_only

Please provide any additional information below.

Why not add a shared library build in the make or common.mk?

Original issue reported on code.google.com by olearypa...@gmail.com on 17 Sep 2010 at 10:12

GoogleCodeExporter commented 9 years ago
I'm getting the same errors building simpleCUDPP, using the instructions from 
the Doxygen without modification.

Original comment by KyleSi...@gmail.com on 30 Oct 2010 at 4:58

GoogleCodeExporter commented 9 years ago
I see similar link errors while linking to external programs. I added "inline" 
for those functions in cudpp_util.h and re-compiled the library. It then worked 
for me. 

Original comment by zhang.yo...@gmail.com on 26 Jun 2011 at 2:55

GoogleCodeExporter commented 9 years ago
This is fixed by using CMake in trunk / CUDPP 2.0.

Original comment by harr...@gmail.com on 22 Jul 2011 at 5:03