[Debian-med-packaging] Bug#702882: Fwd: f2c and autotools

Mathieu Malaterre malat at debian.org
Thu Mar 14 08:44:54 UTC 2013


For reference.


---------- Forwarded message ----------
From: Giulio Paci <giuliopaci at gmail.com>
Date: Thu, Mar 14, 2013 at 3:04 AM
Subject: Re: f2c and autotools
To: Mathieu Malaterre <malat at debian.org>
Cc: Debian Mentors List <debian-mentors at lists.debian.org>


Il 13/03/2013 16:01, Mathieu Malaterre ha scritto:
> Hi there,
>
>   I am trying to work on #702882
>
>   Upstream is basically doing:
>
> if test "$internal_f2c" = "no"; then
>   AC_CHECK_LIB([f2c], [f77_alloc_], [],
>      AC_CHECK_LIB([f2c], [f77_alloc], [],
>         AC_CHECK_LIB([f2c], [F77_ALLOC_], [],
>            AC_CHECK_LIB([f2c], [F77_ALLOC], [],
>               [AC_MSG_RESULT(not found, trying to use -lf2c anyway.)]))))
>   LDFLAGS="${LDFLAGS}"
> else  AC_DEFINE([INTERNAL_F2C], [1], [Define to 1 if you use the internal
> F2C library])
> fi
>
>
>   As explained in #702882#5, this fails on debian system since one
> cannot link to f2c without first defining a MAIN__ symbol. Has anyone
> work on autotools and f2c issue on debian in the past ? How should one
> use the autotools *F77* macros to handle this case ?

As far as I can see there is no fortran code in the igraph package and
as far as I know all the *F77* *FC* macros are useful only to detect
proper setup for a specific
fortran compiler.

I do not think the check above is properly done. However to make it
pass, you should (see the attached patch):
1) use C compiler in AC_CHECK_LIB (an AC_LANG_POP(C++) was missing)
2) force the AC_CHECK_LIB to create a MAIN__ function instead of main
(the -Dmain=MAIN__ flags is used for that)
3) check for a function that is in libf2c (e.g., f_open)
4) use the -Dmain=MAIN__ flags wherever you are issuing checks that
involves linking libf2c

This however is only part of the problem: you still have to solve the
issue of providing the correct flags/the correct source at compile
time.

I do not know what is the best way to deal with this kind of problems in Debian.

Bests,
        Giulio.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ugly_fix.patch
Type: text/x-patch
Size: 3023 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20130314/19cebdad/attachment.bin>


More information about the Debian-med-packaging mailing list