[petsc-users] kokkos and include flags

Steven Dargaville dargaville.steven at gmail.com
Wed Feb 19 17:17:49 CST 2025


Hi

I'm trying to build my application code (which includes C and Fortran
files) with a Makefile based off $PETSC_DIR/share/petsc/Makefile.basic.user
by using the variables and rules defined in
${PETSC_DIR}/lib/petsc/conf/variables. My application uses petsc as well as
another library, and hence I have to add some extra include statements
pointing at the other library during compilation. Currently I have been
doing:

# Read in the petsc compile/linking variables and makefile rules
include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

# Add the extra include files
PETSC_FC_INCLUDES += $(INCLUDE_OTHER_LIB)
PETSC_CC_INCLUDES += $(INCLUDE_OTHER_LIB)


which works very well, with the correct include flags from
INCLUDE_OTHER_LIBS being added to the compilation of both fortran and C
files.

If however I try and compile a kokkos file, named adv_1dk.kokkos.cxx (by
calling "make adv_1dk"), the extra flags are not included. If I instead
call "make adv_1dk.kokkos", the rule for cxx files is instead triggered and
correctly includes the include flags, but this just calls the c++ wrapper,
rather than the nvcc_wrapper and therefore breaks when kokkos has been
built with cuda (or hip, etc).

Just wondering if there is something I have missed, from what I can tell
the kokkos rules don't use the PETSC_CC_INCLUDES during compilation.

Thanks for all your help
Steven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250219/f380645b/attachment-0001.html>


More information about the petsc-users mailing list