[ncl-install] Bad output files from rgb.c
Dave Allured - NOAA Affiliate
dave.allured at noaa.gov
Tue Dec 11 18:45:21 MST 2018
Hi Mary.
For the C compiler, I am just using MacPorts defaults. This time it turned
out to be h5cc, which I think is harmlessly wrapped around Apple's clang
compiler.
In the build log, I see that the rgb executable is run twice for no good
reason. I suspect that Macports is running parallel threads, so two
simultaneous rgb runs are writing on top of the same two output files,
thereby corrupting both. Sure enough, when I forced a single thread build,
the two database files were now written correctly.
Assuming this is the right answer, I will post a single thread workaround
to the Macports ticket. If it is possible to force single thread within
the yMakefile for rgb, that would be a good conservative improvement within
the NCARG source code.
https://trac.macports.org/ticket/57728
Thanks for your observations and suggestion to simplify the compile
command. This led me to notice the parallel runs in the build log.
--Dave
On Tue, Dec 11, 2018 at 12:47 PM Mary Haley <haley at ucar.edu> wrote:
> Hi Dave,
>
> I don't think anybody has a clue about this one and hence the lack of a
> quick response.
>
> What version of what compiler are you using? I see references to clang and
> gcc3 in your output, but it's not clear.
>
> Sometimes when I get errors like this I try to compile the same code but
> with the bare minimum of possible options. For example:
>
> cd $NCARG/ni/src/db/rgb
> make clean
> clang -I../../../.././include -c rgb.c
> clang -o rgb rgb.o -L../../../.././common/src/libncarg_c -lncarg_c
> make install
>
> This should make the "rgb" executable, and then install the three rgb.xxx
> files to $NCARG_ROOT/lib/ncarg/database. You can then try the cn05n.ncl
> example again.
>
> In your case, you'll want to substitute "clang" with whatever compiler
> you're using.
>
> If this works, then I would take a closer look at the various options that
> are being set when you compile the code using your own options, which looks
> to be this:
>
> /Users/dallured/macports/254/bin/glibtool --tag=CC --mode=compile
> /usr/bin/clang -DHAVE_CONFIG_H -I. -I. -I.. -I. -DUSE_INTERP_RESULT
> -I/Users/dallured/macports/254/include -pipe -Os -arch x86_64 -Wall
> -I/Users/dallured/macports/254/include -c -o rgb.lo `test -f rgb.c || echo
> './'`rgb.c
>
> I tried a subset of these options, and it worked fine for me:
>
> clang -c -I../../../.././include -c -pipe -Os -arch x86_64 -Wall rgb.c
> clang -o rgb rgb.o -pipe -Os -arch x86_64 -Wall
> -L../../../.././common/src/libncarg_c -lncarg_c
>
> --Mary
>
>
> On Thu, Dec 6, 2018 at 1:51 PM Dave Allured - NOAA Affiliate via
> ncl-install <ncl-install at ucar.edu> wrote:
>
>> NCL support,
>>
>> I am debugging Macports builds of NCARG/NCL 6.5.0 on Mac OS 10.13.6 (High
>> Sierra). My current build recipe works pretty well. However, there are
>> errors in the two RGB database files that are generated during the build
>> process. This leads to defects in output plots. This is demonstrated by
>> some of the example programs, such as:
>>
>> mac56:~/temp/x 31> ng4ex cn05n
>> NCAR Graphics NCL Example <cn05n>
>> Copying cn05n.ncl
>> Running NCL...
>> Copyright (C) 1995-2018 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 6.5.0
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>> fatal:CvtStringToColorIndex: Unable to convert string "PaleGreen4" to
>> requested type
>> warning:Error retrieving resource lbTitleFontColor from args -
>> Ignoring Arg
>> fatal:CvtStringToColorIndex: Unable to convert string "PaleGreen4" to
>> requested type
>> warning:Error retrieving resource tiMainFontColor from args - Ignoring
>> Arg
>>
>> <truncated>
>>
>> This is caused by bad files rgb.dir and rgb.pag that are generated by
>> rgb.c when building NCARG. I can plug in correct database files from other
>> sources, and these NCL color errors go away. The current Macports build
>> throws several warning messages about rgb.c. There is a current Macports
>> ticket with more details, including a build console log that shows the
>> rgb.c warnings:
>>
>> https://trac.macports.org/ticket/57728
>>
>> It is unclear to me whether the problem is in rgb.c itself, or in the
>> Macports build environment. Either is possible. Can you please take a
>> look and advise on a possible solution? Thanks.
>>
>> --Dave
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-install/attachments/20181211/7abc6cad/attachment-0001.html>
More information about the ncl-install
mailing list