ARPA-SIMC / libsim

Command-line utilities and fortran modules for meteorological data processing
GNU General Public License v2.0
7 stars 1 forks source link

Update debian package #100

Closed edigiacomo closed 2 years ago

spanezz commented 2 years ago

I have force-pushed my current attempt at debian packaging in the debian branch. Force push was necessary after rebasing the debian branch on current master.

I have dropped dependencies on libemos and libcnf-deb, that are not available and it looks like they are not used by configure.ac.

I have built and installed an updated libfortrangis-dev.

Configure on bullseye currently fails:

./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking size of size_t... 8
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...  -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
checking for dpkg-architecture... /usr/bin/dpkg-architecture
checking log4c.h usability... yes
checking log4c.h presence... yes
checking for log4c.h... yes
checking for log4c_init in -llog4c... yes
checking for Fortran flag to compile .f90 files... none
Fortran 2003 C bindings found!
vapor code not included
alchimia code not included
configure: error: shapelib C bindings not found!

The relevant bit from config.log should be:

configure:6741: result: Fortran 2003 C bindings found!
configure:6778: result: vapor code not included
configure:6806: result: alchimia code not included
configure:6836: gfortran -c -g -O2 -fbackslash -I/usr/lib/x86_64-linux-gnu/fortran/x86_64-linux-gnu-gfortran-10 -I/usr/include  conftest.f90 >&5
conftest.f90:2:12:

    2 |        USE shapelib
      |            1
Fatal Error: Cannot open module file 'shapelib.mod' for reading at (1): No such file or directory
compilation terminated.
configure:6836: $? = 1
configure: failed program was:
|       program main
|        USE shapelib
|       end
configure:6845: error: shapelib C bindings not found!

Could you help me out figure out the right set of dependencies for libsim?

dcesari commented 2 years ago

Shapelib module (shapelib.mod, kind of .h) is from fortrangis-dev, it looks like it is expected in /usr/lib/x86_64-linux-gnu/fortran/x86_64-linux-gnu-gfortran-10. Maybe it is installed elsewhere!?

dcesari commented 2 years ago

Continuing the thread:

I confirm that libemos and libcnf-deb are obsolete dependencies.

Default dependencies (without -enable-* or --disable-*) should be:

If fortrangis is already there with gdal support, it may be worth to --enable-gdal which adds some functionalities.

dcesari commented 2 years ago

Shapelib module (shapelib.mod, kind of .h) is from fortrangis-dev, it looks like it is expected in /usr/lib/x86_64-linux-gnu/fortran/x86_64-linux-gnu-gfortran-10. Maybe it is installed elsewhere!?

BTW we declare Fortran modules in autotools as nodist_include_HEADERS so they go in /usr/include and we move them in specfile after make install, if you can suggest a cleaner (but simple!) way to install them suddenly in the right place, it could be useful.

edigiacomo commented 2 years ago

Shapelib module (shapelib.mod, kind of .h) is from fortrangis-dev, it looks like it is expected in /usr/lib/x86_64-linux-gnu/fortran/x86_64-linux-gnu-gfortran-10. Maybe it is installed elsewhere!?

I think they're not installed:

$ monci ci -s jammy -b debian --debug
...
2022-09-28 15:20:00 INFO system.jammy stderr: dh_missing: warning: usr/include/fortranc.mod exists in debian/tmp but is not installed to anywhere
2022-09-28 15:20:00 INFO system.jammy stderr: dh_missing: warning: usr/include/gdal.mod exists in debian/tmp but is not installed to anywhere
2022-09-28 15:20:00 INFO system.jammy stderr: dh_missing: warning: usr/include/proj6.mod exists in debian/tmp but is not installed to anywhere
2022-09-28 15:20:00 INFO system.jammy stderr: dh_missing: warning: usr/include/shapelib.mod exists in debian/tmp but is not installed to anywhere
...
edigiacomo commented 2 years ago

I have pushed a PR that should solve the issue in arpa-simc/fortrangis#20

edigiacomo commented 2 years ago

There were other problems in fortrangis related to shlibs. I have fixed them in ARPA-SIMC/fortrangis#20 and pushed some fixes for libsim debian package in the debian branch. Now fortrangis and libsim packages should compile successfully.

spanezz commented 2 years ago

I confirm that they compile successfully here

edigiacomo commented 2 years ago

I moved the debian dir to ubuntu/jammy, debian/bullseye and debian/sid branches in order to build the package with git-buildpackage.

spanezz commented 2 years ago

It looks good, and .debs built fine with the current debian branches and the newer fortrangis