[ncl-talk] C interface

Mary Haley haley at ucar.edu
Fri Nov 14 09:59:28 MST 2014


1) The undefined c_csaxxx symbols are coming from the "libngmath.a"
library.  If you add "-lngmath" after "-lncarg_c", this should take care of
them.

2) To get EPS files in NCAR Graphics C code, you need to change the
"workstation type" argument in a call to "gopen_ws".  It's the last
argument, and is an integer.  You can see documentation on the arguments at:

http://www.ncarg.ucar.edu/gks/wks.html

Here are some of them:

                    1    -  NCGM
                    8    -  non-existing X11 window.
                   11    -  PDF in portrait mode.
                   12    -  PDF in landscape mode.
                   20    -  color PostScript in portrait mode.
                   21    -  color Encapsulated PostScript (EPS) in portrait
mode
                   22    -   color Encapsulated PostScript Interchange
format (EPSI) in portrait mode.
                   26    -  color PostScript in landscape mode.
                   27    -  color Encapsulated PostScript  (EPS)  in
 landscape mode.
                   28    -   color Encapsulated PostScript Interchange
format (EPSI) in landscape mode.

3) I'm afraid I don't have any answers for you on NCAR Graphics.  We are
focusing on ways to parallelize NCL under the hood.  Some of these involve
speeding up internal graphics routines with OpenMP calls, or improving
algorithms in general.

--Mary


On Fri, Nov 14, 2014 at 4:30 AM, Mathieu Dutour <mathieu.dutour at gmail.com>
wrote:

> I would like to use the NCAR graphics but from a C++ interface, that
> is by using the C interface.
>
> The commands to compile the binaries is "nhlcc" and it works for
> most examples. However, for some of them, there are missing
> symbols. For example:
> mathieu at mathieu-N56VJ:~/opt/ncl_ncarg-6.2.1/lib/ncarg/examples$ nhlcc
> c_csex01.c
> gcc -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -DNeedFuncProto
> -ansi -fPIC -fopenmp -O c_csex01.c -L/home/mathieu/opt/ncl_ncarg-6.2.1/lib
> -L/usr/X11R6/lib64 -I/home/mathieu/opt/ncl_ncarg-6.2.1/include
> -I/usr/X11R6/include -lhlu -lncarg -lncarg_gks -lncarg_c -lX11 -lXext
> -lcairo -lfontconfig -lpixman-1 -lfreetype -lexpat -lpng -lz -lpthread
> -lXrender -lbz2 -lgfortran -lm
> /tmp/ccJ9Y1tK.o: In function `main':
> c_csex01.c:(.text+0x7d6): undefined reference to `c_csa1s'
> c_csex01.c:(.text+0x831): undefined reference to `c_csa1s'
> c_csex01.c:(.text+0x88c): undefined reference to `c_csa1s'
> I can fix some of those errors, however, there are many libraries in the
> lib directory and it is not so easy to get it right.
>
> Secondly, in .ncl I can produce the pictures directly in .eps, .pdf or
> .png but the examples (67 of them!) gives the examples as "gmeta"
> file. What would be the command for creating .eps files.
>
> Lastly, I would like to be able to use NCL in parallel. However, some
> command such as
> c_frame();
> make it clear that the library has some global variables and so is not
> thread-safe. As anybody managed to use NCAR graphics in parallel?
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141114/80402a23/attachment.html 


More information about the ncl-talk mailing list