[petsc-users] --download-fblaslapack libraries cannot be used

Satish Balay balay at mcs.anl.gov
Thu Mar 12 16:42:54 CDT 2020


Can you retry with the attached patch?

BTW: Its best to use the latest patched version - i.e petsc-3.12.4.tar.gz

Satish

On Thu, 12 Mar 2020, Fande Kong wrote:

> This fixed the fblaslapack issue. Now have another issue about mumps.
> 
> Please see the log file attached.
> 
> Thanks,
> 
> Fande,
> 
> On Thu, Mar 12, 2020 at 1:38 PM Satish Balay <balay at mcs.anl.gov> wrote:
> 
> > For some reason - the fortran compiler libraries check worked fine without
> > -lgfortran.
> >
> > But now - flbaslapack check is failing without it.
> >
> > To work arround - you can use option LIBS=-lgfortran
> >
> > Satish
> >
> > On Thu, 12 Mar 2020, Fande Kong wrote:
> >
> > > Hi All,
> > >
> > > I had an issue when configuring petsc on a linux machine. I have the
> > > following error message:
> > >
> > >      Compiling FBLASLAPACK; this may take several minutes
> > >
> > >
> > ===============================================================================
> > >
> > >    TESTING: checkLib from
> > >
> > config.packages.BlasLapack(config/BuildSystem/config/packages/BlasLapack.py:120)
> > >
> > >
> > *******************************************************************************
> > >          UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for
> > > details):
> > >
> > -------------------------------------------------------------------------------
> > > --download-fblaslapack libraries cannot be used
> > >
> > *******************************************************************************
> > >
> > >
> > > The configuration log was attached.
> > >
> > > Thanks,
> > >
> > > Fande,
> > >
> >
> >
> 
-------------- next part --------------
diff --git a/config/BuildSystem/config/compilers.py b/config/BuildSystem/config/compilers.py
index 8a854db1ca..64de7bd7a5 100644
--- a/config/BuildSystem/config/compilers.py
+++ b/config/BuildSystem/config/compilers.py
@@ -909,12 +909,13 @@ Otherwise you need a different combination of C, C++, and Fortran compilers")
       return
     skipfortranlibraries = 1
     self.setCompilers.saveLog()
-    cbody = "int main(int argc,char **args)\n{return 0;}\n";
+    asub=self.mangleFortranFunction("asub")
+    cbody = "extern void "+asub+"(void);\nint main(int argc,char **args)\n{\n  "+asub+"();\n  return 0;\n}\n";
     self.pushLanguage('FC')
     if self.checkLink(includes='#include <mpif.h>',body='      call MPI_Allreduce()\n'):
-      fbody = "subroutine asub()\n      print*,'testing'\n      call MPI_Allreduce()\n      return\n      end\n"
+      fbody = "      subroutine asub()\n      print*,'testing'\n      call MPI_Allreduce()\n      return\n      end\n"
     else:
-      fbody = "subroutine asub()\n      print*,'testing'\n      return\n      end\n"
+      fbody = "      subroutine asub()\n      print*,'testing'\n      return\n      end\n"
     self.popLanguage()
     try:
       if self.checkCrossLink(fbody,cbody,language1='FC',language2='C'):


More information about the petsc-users mailing list