[petsc-users] kokkos and include flags

Satish Balay balay.anl at fastmail.org
Wed Feb 19 18:32:08 CST 2025


Try setting CPPFLAGS, FPPFLAGS, CXXPPFLAGS [and not via PETSC_FC_INCLUDES].

I think kokkos compile targets [for *.kokkos.cxx sources]  should pick up one of them. 

for ex:

>>>
CPPFLAGS = -Wall
FPPFLAGS = -Wall
CXXPPFLAGS = -Wall

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

...
<<<

Satish

On Wed, 19 Feb 2025, Steven Dargaville wrote:

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



More information about the petsc-users mailing list