Re: [petsc-dev] broken options handling with intel 16.0 compilers on mac OS

2015-09-19 Thread Blaise A Bourdin
Hi,

I was traveling and did not have time to finish investigating, but there seems 
to be an issue with fortran get_command_argument and friends in mixed language 
mode. I will continue to investigate and will report back.

Blaise

> On Sep 19, 2015, at 10:18 AM, Satish Balay  wrote:
> 
> [from the available logs] its not clear what the issue is.
> 
> PETSc fortran interface attempts to use getarg_() and iargc_() [fortran
> library functions] - or its variants - directly from C.
> 
> This usage is non-standard and messy [and some compiler folks - said -
> its unsupported usage].
> 
> Also - configure attempts to guess the fortran link libraries - and
> constructs a link command cCompilerLibs + cxxCompilerLibs +
> fortranCompilerLibs.
> 
> Perhaps there is a bug in this detection code - thats triggering this
> error. Its verifyable by attempting to use:
> 
> --with-clib-autodetect=0 --with-clib-autodetect=0 --with-cxxlib-autodetect=0 
> LIBS='liblist'
> 
> where 'liblist' should be determined manually - for the linking of
> C/fortran/CXX to work correctly.
> 
> My fix attempts to call command_argument_count(),
> get_command_argument() directly from fortran - and if that doesn't
> work - then its likely a compiler bug..
> 
> [which one can try to replicate with a simple test code]
> 
> Satish
> 
> On Thu, 17 Sep 2015, Jeff Hammond wrote:
> 
>> Please report this via premier.intel.com.
>> 
>> Jeff
>> 
>> On Wed, Sep 16, 2015 at 11:13 AM, Blaise A Bourdin  wrote:
>> 
>>> Hi,
>>> 
>>> I am testing intel 16 compilers under mac OS, and notice that options
>>> handling for all past and current versions of petsc is broken in fortran
>>> (options are not parsed).
>>> I narrowed it down to *argc at start.c:168 always being 0 when intel 16 is
>>> used (but taking the right value using intel 15 or gcc 5), but I can’t find
>>> my way through the multiple macros to figure out what is really the matter…
>>> The problem does not seem to arise under linux with the same compilers.
>>> 
>>> Any idea of what is going on? Any test I can run to help (I assume that
>>> you don’t have a test box with the latest intel compilers)? Is it a petsc
>>> bug or an intel bug?
>>> 
>>> I use an up to date pets-dev master, and the configure.log file is
>>> available at
>>> https://filestogeaux.lsu.edu/public/download.php?FILE=bourdin/89329uFByT9
>>> 
>>> Thanks,
>>> 
>>> Blaise
>>> 
>>> --
>>> Department of Mathematics and Center for Computation & Technology
>>> Louisiana State University, Baton Rouge, LA 70803, USA
>>> Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276
>>> http://www.math.lsu.edu/~bourdin
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>> 

-- 
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin









Re: [petsc-dev] broken options handling with intel 16.0 compilers on mac OS

2015-09-19 Thread Satish Balay
[from the available logs] its not clear what the issue is.

PETSc fortran interface attempts to use getarg_() and iargc_() [fortran
library functions] - or its variants - directly from C.

This usage is non-standard and messy [and some compiler folks - said -
its unsupported usage].

Also - configure attempts to guess the fortran link libraries - and
constructs a link command cCompilerLibs + cxxCompilerLibs +
fortranCompilerLibs.

Perhaps there is a bug in this detection code - thats triggering this
error. Its verifyable by attempting to use:

--with-clib-autodetect=0 --with-clib-autodetect=0 --with-cxxlib-autodetect=0 
LIBS='liblist'

where 'liblist' should be determined manually - for the linking of
C/fortran/CXX to work correctly.

My fix attempts to call command_argument_count(),
get_command_argument() directly from fortran - and if that doesn't
work - then its likely a compiler bug..

[which one can try to replicate with a simple test code]

Satish

On Thu, 17 Sep 2015, Jeff Hammond wrote:

> Please report this via premier.intel.com.
> 
> Jeff
> 
> On Wed, Sep 16, 2015 at 11:13 AM, Blaise A Bourdin  wrote:
> 
> > Hi,
> >
> > I am testing intel 16 compilers under mac OS, and notice that options
> > handling for all past and current versions of petsc is broken in fortran
> > (options are not parsed).
> > I narrowed it down to *argc at start.c:168 always being 0 when intel 16 is
> > used (but taking the right value using intel 15 or gcc 5), but I can’t find
> > my way through the multiple macros to figure out what is really the matter…
> > The problem does not seem to arise under linux with the same compilers.
> >
> > Any idea of what is going on? Any test I can run to help (I assume that
> > you don’t have a test box with the latest intel compilers)? Is it a petsc
> > bug or an intel bug?
> >
> > I use an up to date pets-dev master, and the configure.log file is
> > available at
> > https://filestogeaux.lsu.edu/public/download.php?FILE=bourdin/89329uFByT9
> >
> > Thanks,
> >
> > Blaise
> >
> > --
> > Department of Mathematics and Center for Computation & Technology
> > Louisiana State University, Baton Rouge, LA 70803, USA
> > Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276
> > http://www.math.lsu.edu/~bourdin
> >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 


Re: [petsc-dev] broken options handling with intel 16.0 compilers on mac OS

2015-09-19 Thread Satish Balay
This change is now merged master [Its setup as the prefered mode to
get fortran command line arguments]

Satish

On Wed, 16 Sep 2015, Satish Balay wrote:

> Well - the petscconf.h is identicall for both builds. So the change in
> behavior must be due to some internal changes in ifort on Mac [as you
> say - it works fine on linux]
> 
> Can you try using the branch 'balay/ftn-command_argument' - and see if
> that works for you?
> 
> Satish
> 
> On Wed, 16 Sep 2015, Blaise A Bourdin wrote:
> 
> > Hi Satish,
> > 
> > It is at 
> > https://filestogeaux.lsu.edu/public/download.php?FILE=bourdin/38806CDddLJ
> > 
> > > On Sep 16, 2015, at 10:34 AM, Satish Balay  wrote:
> > > 
> > > Do you have configure.log fr intel-15 compiler - on the same machine?
> > > 
> > > It would be good to compare petscconf.h between intel-15 and intel-16.
> > 
> > bourdin@galerkin:petsc-dev (master)$ diff 
> > Darwin-intel15.0-g//include/petscconf.h 
> > Darwin-intel16.0-g//include/petscconf.h
> > 85c85
> > < #define PETSC_LIB_DIR "/opt/HPC/petsc-dev/Darwin-intel15.0-g/lib"
> > ---
> > > #define PETSC_LIB_DIR "/opt/HPC/petsc-dev/Darwin-intel16.0-g/lib"
> > 489c489
> > < #define PETSC_ARCH "Darwin-intel15.0-g"
> > ---
> > > #define PETSC_ARCH "Darwin-intel16.0-g”
> > Not very exciting!
> > 
> > I am attaching the one for intel16
> > 
> > 
>