<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I have a toy application code built on PETSc which needs to compile and link a .cu file.<div class=""><br class=""></div><div class="">I'd love to be able to configure PETSc (with CUDA), and then use a modified version of share/petsc/Makefile.user to compile and link my code, using a consistent set of compilers, libraries, and flags.  Makefile.user uses petsc.pc (via pkg-config) and implicit GNU make rules to do almost everything for you for C, C++, and Fortran.</div><div class=""><br class=""></div><div class="">However, I don't think it currently supports CUDA, and I'm not familiar enough with BuildSystem or pkg-config to quickly add support myself, so I resort to the "old" way, including things like this in my Makefile:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class="">include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">%.o : %.cu</div></div><div class=""><div class="">        $(CUDAC) -c $(CUDAC_FLAGS) $(CUDA_INCLUDE) -o $@ $<</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">app : ${OBJ}</div></div><div class=""><div class="">        $(<a href="http://LINK.cc" class="">LINK.cc</a>) -o $@ $^ $(LDLIBS) $(CUDA_LIB)</div></div><div class=""><br class=""></div><div class=""><br class=""></div></blockquote></div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Is it possible / easy / advisable to add CUDA support to petsc.pc ?</div></div></body></html>