[ncl-talk] C interface

Mathieu Dutour mathieu.dutour at gmail.com
Fri Nov 14 04:30:12 MST 2014


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141114/6b5fcc51/attachment.html 


More information about the ncl-talk mailing list