[petsc-dev] Cross compile with .c and .cu files

Daniel Lowell redratio1 at gmail.com
Mon Apr 23 16:19:32 CDT 2012


Hi all,

I'm building a matrix type with two separate files dai.c and diakerns.cu.
If I "make all" in the PETSc root dir, it will be unable to find the object
file from the .cu file; i.e., I get this:

/usr/bin/ar: diakerns.o: No such file or directory

However if I merely do a "make lib" inside the matrix type directory I have
no problem. This has happened to other types I've create, I end up just
shoving everything into one large .cu file to quickly deal with it.
Here what the folder level makefile looks like:



SOURCECU = diakerns.cu
SOURCEC  = dia.c
SOURCEF  =
SOURCEH  = dia.h
OBJSC    = dia.o diakerns.o
OBJSF    =
LIBBASE  = libpetscmat
DIRS     =
MANSEC   = Mat
LOCDIR   = src/mat/impls/dia/seq/




This is what my configuration script for petsc root looks like:


MPI_DIR="--with-mpi-dir=$MPICH2_HOME"
LAD="--download-f-blas-lapack=yes"
CUD="--with-cuda-dir=/soft/cuda-4.2/cuda"
./config/configure.py $MPI_DIR $LAD $CUD \
--with-debugging=1 \
--with-cudac="nvcc -m64 -g -G -v" \
--with-precision=double \
--with-clanguage=c \
--with-cuda-arch=sm_20 \





-- 
Daniel Lowell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120423/ea1641aa/attachment.html>


More information about the petsc-dev mailing list