[ncl-install] Installing ncarg on OS X 10.9 with ifort

David Brown dbrown at ucar.edu
Mon Sep 15 23:24:13 MDT 2014


I don't think M_PI is simply a GNU-ism. With the right macros it is part of
the C library math.h. According to the GNU C Library document:

These constants come from the Unix98 standard and were also available in
4.4BSD; therefore they are only defined if _XOPEN_SOURCE=500, or a more
general feature select macro, is defined.

M_PI is one of "these constants". There is certainly evidence on the
internet that with the right flags the Intel compiler can recognize M_PI,
e.g.:
https://software.intel.com/en-us/forums/topic/265759

 -dave


On Mon, Sep 15, 2014 at 8:22 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:

> Hi Dave,
>
> I'm not totally sure about this one, but it appears M_PI *may* be a
> GNU-ism -- a non-standard constant specific to the gcc compiler. I'll
> investigate this further, but if that's the case, we clearly should not
> rely on such a compiler-specific idiom.  In the mean time, you could patch
> your copy of cro.c with the appropriate definition in order to move
> forward.
>
> You say there are many errors -- are they beyond just this particular
> symbol being undefined?
>
> Rick
>
>
>
> Message: 1
> Date: Mon, 15 Sep 2014 15:56:26 -0300
> From: Dave Lane <dlane at ap.stmarys.ca>
> Subject: [ncl-install] Installing ncarg on OS X 10.9 with ifort
> To: ncl-install at ucar.edu
> Message-ID: <5417365A.5010200 at ap.stmarys.ca>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> I am having troubles building NCAR Graphics (6.2.0) on OS 10.9 with
> ifort (V13.0.2).
>
> First of all, with the same machine I have successfully compiled it with
> gfortran (both library versions are needed by the researcher).
>
> The first error (there are many) is:
>
> gcc-mp-4.9 -ansi -m64 -fopenmp -lsz  -O  -I../../../.././include
> -I/opt/intel/composer_xe_2011_sp1.10.328/compiler/include
> -I/opt/X11/include -I/opt/local/include -I/opt/X11/include/freetype2
> -I/opt/local/hdf4/ifort/include -I/opt/local/szip/ifort/include
> -DDarwin    -DCTXT -DX11 -DPS -DPDF -DPIX  -DSYSV -D_POSIX_SOURCE
> -D_XOPEN_SOURCE -DByteSwapped -D__UNIXOS2__ -DNeedFuncProto    -c -o
> cro.o cro.c
> cro.c: In function 'cro_Polymarker':
> cro.c:1451:71: error: 'M_PI' undeclared (first use in this function)
>               cairo_arc(context, xc, yc, mscale * marker_size, 0., 2. *
> M_PI);
> ^
> cro.c:1451:71: note: each undeclared identifier is reported only once
> for each function it appears in
> make[5]: *** [cro.o] Error 1
>
> The cro.c file is this one: ./ncarg2d/src/libncarg_gks/cdrivers/cro.c
>
> Any idea where MP_I is supposed to be defined?
>
> --- Dave
>
>
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-install/attachments/20140915/2acc639d/attachment-0001.html 


More information about the ncl-install mailing list