Hi Chris,

> If I recall correctly:  The ExtUtils::F77 is used to check for
> fortran and the libraries needed to compile a Perl XS module.
> As such, the output of the libraries is washed through the
> ExtUtil::MakeMaker libs() routine which will drop libraries
> that do not exist.
> 
> Are you using the libraries for another purpose (i.e. non-perl XS)?

I'm making a package that contains a couple of fortran routines that
are called from corresponding pdl pp_def subroutines in a .pd file. I'm
using Module::Build, Module::Build::Pluggable::PDL and
Module::Build::Pluggable::Fortran in  the process of automatically
building the .xs file and the fortran libraries. Thus, I'm using
Build.PL instead of Makefile.PL to build the package. I'm not
using ExtUtils::MakeMaker explicitly and I'm not sure if it is called
implicitly or if it's functionality is somehow taken up by the
alternative Build modules.

I made a simplified package (attached) that does nothing but print a
line from fortran when called from perl/pdl to illustrate my problem.
If I install ExtUtils::F77 v.1.17 I get the following output:

    $ # unpack the package and build it
    $ tar xfz Rem-0-TRIAL.tar.gz; cd Rem-0-TRIAL
    $ perl Build.PL

    ExtUtils::F77: Version 1.17
    Loaded ExtUtils::F77 version 1.17
    Found compiler f77
    Found compiler gfortran
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib -lgfortran -lm
    ExtUtils::F77: Validating -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib 
-lgfortran -lm   [ok]
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib -lgfortran -lm
    ExtUtils::F77: Validating -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib 
-lgfortran -lm   [ok]
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    Compiling the test Fortran program...
    Executing the test program...
    Congratulations you seem to have a working f77!
    Created MYMETA.yml and MYMETA.json
    Creating new 'Build' script for 'Rem' version '0'

    $ ./Build

    ExtUtils::F77: Version 1.17
    Loaded ExtUtils::F77 version 1.17
    Found compiler f77
    Found compiler gfortran
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib -lgfortran -lm
    ExtUtils::F77: Validating -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib 
-lgfortran -lm   [ok]
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    Compiling the test Fortran program...
    Executing the test program...
    Congratulations you seem to have a working f77!
    gfortran -c -o fortran/subrutina.o -O3 -fPIC fortran/subrutina.f
    # process_pd_files

    ExtUtils::F77: Version 1.17
    Loaded ExtUtils::F77 version 1.17
    Found compiler f77
    Found compiler gfortran
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib -lgfortran -lm
    ExtUtils::F77: Validating -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib 
-lgfortran -lm   [ok]
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    # provides....lib/Rem/RemPd.pd
    Building Rem
    cc 
-I/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/PDL/Core
 -I/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.1/x86_64-linux/CORE 
-DXS_VERSION="0" -DVERSION="0" -fPIC -c -fwrapv -fno-strict-aliasing -pipe 
-fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -O2 -o lib/Rem/RemPd.o lib/Rem/RemPd.c
    ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Rem/RemPd/RemPd.bs')
    cc -shared -O2 -L/usr/local/lib -fstack-protector-strong -o 
blib/arch/auto/Rem/RemPd/RemPd.so lib/Rem/RemPd.o 
-L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib -lgfortran -lm fortran/subrutina.o

     $ # Run a simple script to test the package.
     $ perl -Mblib -MRem::RemPd -E 'PDL::subrutina()'
     hello from fortran




When I compile and run the same package using ExtUtils::F77 v.1.19 I
obtain instead (I added '****' to emphasize the error messagges):

    $ tar xfz Rem-0-TRIAL.tar.gz; cd Rem-0-TRIAL
    $ perl Build.PL

    ExtUtils::F77: Version 1.19
    Loaded ExtUtils::F77 version 1.19
    Found compiler f77
    Found compiler gfortran
    ExtUtils::F77: gfortran version 5.3.1
    ExtUtils::F77: gfortran version 5.3.1
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 
-lquadmath -L/usr/lib -lgfortran -lm
    Found compiler=GNU - skipping validation of 
-L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 -lquadmath 
-L/usr/lib -lgfortran -lm
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 
-lquadmath -L/usr/lib -lgfortran -lm
    Found compiler=GNU - skipping validation of 
-L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 -lquadmath 
-L/usr/lib -lgfortran -lm
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    Compiling the test Fortran program...
    Executing the test program...
    Congratulations you seem to have a working f77!
    Created MYMETA.yml and MYMETA.json
    Creating new 'Build' script for 'Rem' version '0'

    $ ./Build

    ExtUtils::F77: Version 1.19
    Loaded ExtUtils::F77 version 1.19
    Found compiler f77
    Found compiler gfortran
    ExtUtils::F77: gfortran version 5.3.1
    ExtUtils::F77: gfortran version 5.3.1
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 
-lquadmath -L/usr/lib -lgfortran -lm
    Found compiler=GNU - skipping validation of 
-L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 -lquadmath 
-L/usr/lib -lgfortran -lm
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:
    Compiling the test Fortran program...
    Executing the test program...
    Congratulations you seem to have a working f77!
    gfortran -c -o fortran/subrutina.o -O3 -fPIC fortran/subrutina.f
    # process_pd_files

    ExtUtils::F77: Version 1.19
    Loaded ExtUtils::F77 version 1.19
    Found compiler f77
    Found compiler gfortran
    ExtUtils::F77: gfortran version 5.3.1
    ExtUtils::F77: gfortran version 5.3.1
    ExtUtils::F77: Using system=Linux compiler=GNU
    Runtime: -L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 
-lquadmath -L/usr/lib -lgfortran -lm
    Found compiler=GNU - skipping validation of 
-L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 -lquadmath 
-L/usr/lib -lgfortran -lm
    ExtUtils::F77: Compiler: gfortran
    ExtUtils::F77: Cflags:

    # provides....lib/Rem/RemPd.pd
    Building Rem
    cc 
-I/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/PDL/Core
 -I/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.1/x86_64-linux/CORE 
-DXS_VERSION="0" -DVERSION="0" -fPIC -c -
    fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o 
lib/Rem/RemPd.o lib/Rem/RemPd.c
    ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Rem/RemPd/RemPd.bs')
    cc -shared -O2 -L/usr/local/lib -fstack-protector-strong -o 
blib/arch/auto/Rem/RemPd/RemPd.so lib/Rem/RemPd.o 
-L/usr/lib/gcc/x86_64-linux-gnu/5 -lgcc_ext.10.5 -lgcc_s.10.5 -lquadmath 
-L/usr/lib -lgfortran -lm for
    tran/subrutina.o
    **** /usr/bin/ld: cannot find -lgcc_ext.10.5
    **** /usr/bin/ld: cannot find -lgcc_s.10.5
    **** collect2: error: ld returned 1 exit status
    **** error building blib/arch/auto/Rem/RemPd/RemPd.so from lib/Rem/RemPd.o 
at 
/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.1/ExtUtils/CBuilder/Base.pm
 line 320.

    $ perl -Mblib -MRem::RemPd -E 'PDL::subrutina()'
    **** Can't locate loadable object for module Rem::RemPd in @INC (@INC 
contains: /home/mochan/txt/cache/16/Rem-0-TRIAL/blib/arch 
/home/mochan/txt/cache/16/Rem-0-TRIAL/blib/lib 
/home/mochan/perl5/perlbrew/perls/perl-5.2
    2.0/lib/site_perl/5.22.1/x86_64-linux 
/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.1 
/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.1/x86_64-linux 
/home/mochan/perl5/perlbrew/perls/per
    l-5.22.0/lib/5.22.1 
/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux 
/home/mochan/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0 
/home/mochan/perl5/perlbrew/perls/perl-5.22.0
    /lib/site_perl .) at -e line 0.
    Compilation failed in require.
    BEGIN failed--compilation aborted.

So in summary, when using v.1.19 my fortran library is not built and
the simple script can't run, while it does work without problems with
v.1.17. I don't know if I'm making something wrong that somehow works
with the previous versions of ExtUtils::F77, if something is wrong
with the build systems M::B::P::PDL and MBP::Fortran or if something
is wrong with the ExtUtils::F77? The validation step of the libraries
is being skipped by the new version, which might be related to the
fact that the nonexistent libraries are not being dropped.

  
> If so, please submit a bug report to the CPAN bug for ExtUtils::F77
> and include the failure that the current extra-but-no-op libraries
> causes.

Is this a bug I should report?

Meanwhile, is there something which I can do to avoid my problem in
systems that have 1.19 installed?

Thanks for your time/advice,
Luis



-- 

                                                                  o
W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
Apdo. Postal 48-3, 62251             |                           (*)/\/  \
Cuernavaca, Morelos, México          | [email protected]   /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB


Attachment: Rem-0-TRIAL.tar.gz
Description: application/gzip

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to