[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cuda compilation
From: |
Tomas Oberhuber |
Subject: |
cuda compilation |
Date: |
Tue, 29 Dec 2009 19:25:36 +0100 |
User-agent: |
KMail/1.9.10 |
Hi,
I am experiencing some troubles with cuda. I studied mailing lists about
autoconf, automake and libtool and from what I have read
(
Is it possible to check nvcc compilation with autoconf?
http://stackoverflow.com/questions/1973846/is-it-possible-to-check-nvcc-compilation-with-autoconf
Automake and CUDA
http://www.mail-archive.com/address@hidden/msg01279.html
Libtool generating flags incompatible with nvcc
http://old.nabble.com/Libtool-generating-flags-incompatible-with-nvcc-td25248683.html
and
http://lists.gnu.org/archive/html/bug-libtool/2009-09/msg00000.html
)
I have understood that from the linking point of view nvcc and gcc are
compatible. So one should only compile .cu files with nvcc and then link all
together with gcc. To compile .cu files with nvcc I did this in my
Makefile.am
include ${top_srcdir}/cuda.mk
where cuda.mk is
SUFFIXES = .cu
.cu.$(OBJEXT):
$(NVCC) -c $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $
(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ $<
libcore_tests_sources = tnlLongVectorCUDATester.cu \
tnlLongVectorCUDATester.h
check_LTLIBRARIES = libcore-tests.la
libcore_tests_la_SOURCES = $(libcore_tests_sources)
as I have learned from 'Automake and CUDA'. However, I get this
/bin/bash ../libtool --tag=CXX --mode=link ccache
g++ -g -O2 -I/usr/local/cuda/include -DHAVE_CUDA -DHAVE_CPPUNIT -I../../src
-I../../src/debug -I../src/debug -I/usr/local/cuda/include -DHAVE_CUDA
-I../src/debug -I../src/core -I../src/diff -I../../src -I../../../src
-L/usr/local/cuda/lib64 -lcudart -lcppunit -o
tnl-unit-tests-dbg tnl-unit-tests.o libtnl-dbg-0.1.la
core/libcore-tests-dbg.la
libtool: link: ccache
g++ -g -O2 -I/usr/local/cuda/include -DHAVE_CUDA -DHAVE_CPPUNIT -I../../src
-I../../src/debug -I../src/debug -I/usr/local/cuda/include -DHAVE_CUDA
-I../src/debug -I../src/core -I../src/diff -I../../src -I../../../src -o
.libs/tnl-unit-tests-dbg
tnl-unit-tests.o -L/usr/local/cuda/lib64 ./.libs/libtnl-dbg-0.1.so
core/.libs/libcore-tests-dbg.a -lcudart /usr/lib/libcppunit.so -ldl -Wl,-rpath
-Wl,/home/oberhuber/local/lib
tnl-unit-tests.o: In function `TestCaller':
/usr/include/cppunit/TestCaller.h:119: undefined reference to
`tnlLongVectorCUDATester<float>::testKernel()'
simply tnlLongVectorCUDATester.cu is completely omitted. If I change it to
tnlLongVectorCUDATester.cpp (only in Makefile.am) I get
make[2]: *** No rule to make target
`../../../src/core/tnlLongVectorCUDATester.cpp', needed by
`tnlLongVectorCUDATester.lo'. Stop.
so automake now tries to compile it.
Can anybody, please, help me and tell me what I am doing wrong?
Thanks a lot, Tomas Oberhuber.
- cuda compilation,
Tomas Oberhuber <=