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

Satish Balay balay at mcs.anl.gov
Mon Apr 23 16:26:43 CDT 2012


'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

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 \
> 
> 
> 
> 
> 
> 




More information about the petsc-dev mailing list