Open TomGoffrey opened 10 months ago
Using pkg-config does not work for me. When adding it I get the following error when compiling
$ make COMPILER=gfortran
mpif90 -c -O3 -g -std=f2003 -ffpe-summary=invalid,zero,overflow -I../SDF/FORTRAN/include -Iobj -Jobj -I/usr/include -o obj/electrostatic.o -DPER_SPECIES_WEIGHT -DELECTROSTATIC -DNEUTRAL_COLLISIONS -DPETSC -DSEE -DPART_PERP_POSITION -D_COMMIT='"v4.17.14-386-g8a55b28e-dirty"' -D_DATE=1706880367 -D_MACHINE='"login1.viking2.yor.alces.network"' -Isrc/include src/physics_packages/electrostatic.F90
src/physics_packages/electrostatic.F90:22:6:
22 | USE petscvec
| 1
Fatal Error: Cannot open module file ‘petscvec.mod’ for reading at (1): No such file or directory
compilation terminated.
make[1]: *** [Makefile:416: electrostatic.o] Error 1
make[1]: Leaving directory '/mnt/scratch/users/moe505/epoch/epoch1d'
make: *** [Makefile:474: commit] Error 2
I do not get this error when using the current setup. Note that the right Makefile is the one in the epoch_ltp_1d
branch.
Looks to me like pkgconfig can't find your PETSc installation. I've always used this method when including PETSc - given it's listed as the recommended method on the getting started page:
https://petsc.org/release/manual/getting_started/
Suspect you need to add the PETSc location to your PKG_CONFIG_PATH
variable.
Don't have strong preference for which option we go for (beyond following PETSc's own recommendations), but should be documented.
The Makefile doesn't automatically pick up the required PETSc flags.
Looking at the Makefile I'm assuming variables such as
PETSC_DIR
should be set.The use of pkg-config removes the requirement of the user to set these variable: