Ah - libfast is written to work with mixed builds. But there is abug with sharing a variable with .c and .cu builds rules.
Pushed a fix now. The makefile below should now be: SOURCECU = diakerns.cu SOURCEC = dia.c OBJSCU = diakerns.o OBJSC = dia.o Satish On Mon, 23 Apr 2012, Matthew Knepley wrote: > On Mon, Apr 23, 2012 at 5:26 PM, Satish Balay <balay at mcs.anl.gov> wrote: > > > 'make libfast' can't handle different file types [but 'make lib' can]. > > > > For libfast to work - you can split up the sources into multiple dirs. > > > > i.e > > > > src/mat/impls/dia/seq/dia.c > > src/mat/impls/dia/seq/seqcusp/diakerns.cu > > > The Python build can handle this. > > Matt > > > > > > Satish > > > > On Mon, 23 Apr 2012, Daniel Lowell wrote: > > > > > 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 \ > > > > > > > > > > > > > > > > > > > > > > > > >