c++ - Eclipse: Edit toolchain (remove build step to create a shared library for CUDA) -
i trying configure eclipse such compiles shared library in 1 project , uses in another.
the problem is, using cuda plugin eclipse 1 can choose executable generating project type.
so want creating such project , modify toolchain such eclipse not execute else nvcc
.
as can see compiling library not problem:
18:27:25 **** incremental build of configuration default project cudamath **** make building file: ../test.cu invoking: cuda nvcc compiler nvcc --shared -xcompiler -fpic -o "cu_test.o" "../test.cu" && \ echo -n 'cu_test.d' ./ > 'cu_test.d' && \ nvcc -m "../test.cu" >> 'cu_test.d' nvcc warning : 'compute_10' , 'sm_10' architectures deprecated, , may removed in future release. nvcc warning : 'compute_10' , 'sm_10' architectures deprecated, , may removed in future release. finished building: ../test.cu
the problem eclipse calls g++
step of toolchain want cut off:
building target: cudamath invoking: c++ linker g++ -l/opt/cuda/lib64 -o "cudamath" ./cu_test.o -lcuda -lcublas -lcudart /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib/crt1.o: in function `_start': (.text+0x20): undefined reference `main' collect2: error: ld returned 1 exit status makefile:32: recipe target 'cudamath' failed make: *** [cudamath] error 1
is there way can this? i've been crawling through project settings can't seem find i'm looking for.
here's did using nsight eclipse edition:
- file... new cuda c/c++ project
- in next dialog, select shared library...empty project, , give project name (let's
testlib
) - finish wizard/dialog. new
testlib
project created in project explorer on left - in project explorer on left, right click on project name , create new folder source files
- open folder , create new source file. this, selected cuda c/c++ source file using cuda bitreverse "template". creates new source file bitreverse code in it.
- change
int main() {
in source fileint myfunc(){
- save source file , build project. new
libtestlib.so
built.
Comments
Post a Comment