On Mon, Jul 13, 2020 at 7:11 PM Satish Balay <balay@mcs.anl.gov> wrote:
$ git grep DMPlexLandFormLandau_Internal
include/petsc/private/dmpleximpl.h:PETSC_INTERN PetscErrorCode DMPlexLandFormLandau_Internal(Vec, Mat, const PetscInt, void *);
src/dm/impls/plex/landau/plexland.c:  DMPlexLandFormLandau_Internal - Evaluates Jacobian matrix.
src/dm/impls/plex/landau/plexland.c:PetscErrorCode DMPlexLandFormLandau_Internal(Vec a_X, Mat JacP, const PetscInt dim, void *a_ctx)
src/ts/utils/dmplexts.c:PETSC_INTERN PetscErrorCode DMPlexLandFormLandau_Internal(Vec, Mat, const PetscInt, void *);
src/ts/utils/dmplexts.c:    ierr = DMPlexLandFormLandau_Internal(X,ctx->J,dim,(void*)ctx);CHKERRQ(ierr);
src/ts/utils/dmplexts.c:    ierr = DMPlexLandFormLandau_Internal(X,ctx->J,dim,(void*)ctx); CHKERRQ(ierr);


You'll need the PETSC_EXTERN in include/petsc/private/dmpleximpl.h  and remove the duplicate prototype listing from src/ts/utils/dmplexts.c

Thanks, the first error that I got was undefined again:

arch-ci-linux-cuda-single-cxx/obj/ts/utils/dmplexts.o: In function `DMPlexLandIFunction':
2264/home/petsc/builds/KFnbdjNX/0/petsc/petsc/src/ts/utils/dmplexts.c:266: undefined reference to `DMPlexLandFormLandau_Internal'
2265arch-ci-linux-cuda-single-cxx/obj/ts/utils/dmplexts.o: In function `DMPlexLandIJacobian':
2266/home/petsc/builds/KFnbdjNX/0/petsc/petsc/src/ts/utils/dmplexts.c:305: undefined reference to `DMPlexLandFormLandau_Internal'
2267/usr/bin/ld: arch-ci-linux-cuda-single-cxx/lib/libpetscts.so.3.013.3: hidden symbol `DMPlexLandFormLandau_Internal' isn't defined
2268/usr/bin/ld: final link failed: Bad value
2269collect2: error: ld returned 1 exit status
2270gmakefile:149: recipe for target 'arch-ci-linux-cuda-single-cxx/lib/libpetscts.so.3.013.3' failed
2271make[3]: *** [arch-ci-linux-cuda-single-cxx/lib/libpetscts.so.3.013.3] Error 1
2272make[3]: *** Waiting for unfinished jobs....
2273 FC arch-ci-linux-cuda-single-cxx/obj/tao/f90-mod/petsctaomod.o
2274/home/petsc/builds/KFnbdjNX/0/petsc/petsc/lib/petsc/conf/rules:49: recipe for target 'libs' failed


https://gitlab.com/petsc/petsc/-/jobs/636864970
 

I'll try extern


Satish


> I tried to add code to DMPlexts.c and am getting this error:
>
> https://gitlab.com/petsc/petsc/-/jobs/636828148
>
> dmplexts.c:(.text+0x1a0f): undefined reference to
> `DMPlexLandFormLandau_Internal'
> 1648 <https://gitlab.com/petsc/petsc/-/jobs/636828148#L1648>
>
> with this code:
>
> PETSC_INTERN PetscErrorCode DMPlexLandFormLandau_Internal(Vec a_X, Mat
> JacP, const PetscInt dim, void *a_ctx);
> /*@
>   DMPlexLandIFunction
> @*/
> PetscErrorCode DMPlexLandIFunction(TS ts,PetscReal time_dummy,Vec X,Vec
> X_t,Vec F,void *actx)
> {
> .....
>     ierr =
> DMPlexLandFormLandau_Internal(X,ctx->J,dim,(void*)ctx);CHKERRQ(ierr);
>
> I tried with EXTERN also. Any ideas?
> Thanks,
> Mark
>