I have changed
the file provamod.o into the library libprovamod.a by means of the command
ar rcs libprovamod.a provamod.o
Then I gave the command
f2py -c -I$(pwd) -L$(pwd) -m prova provasub.f90 -lprovamod
python3
Python 3.12.4 (main, Jul 15 2024, 12:17:32) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import prova
>>> quit()
I no longer get error messages.
Nevertheless I don't understand why in the f2py help there is
"Extra options (only effective with -c):
--link-<resource> Link extension module with <resource> as defined
by numpy.distutils/system_info.py. E.g. to link
with optimized LAPACK libraries (vecLib on MacOSX,
ATLAS elsewhere), use --link-lapack_opt.
See also --help-link switch. [NO_MESON]
-L/path/to/lib/ -l<libname>
-D<define> -U<name>
-I/path/to/include/
<filename>.o <filename>.so <filename>.a"
It seems that there is the possibility to link object files too (it
doesn't say NO MESON)
Stefano