Opened 5 years ago

Closed 5 years ago

#57728 closed defect (fixed)

ncarg: CvtStringGenArrayToCmap unable to find rgb error

Reported by: lvankampenhout (Leo van Kampenhout) Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: Dave-Allured (Dave Allured)
Port: ncarg

Description

I have problems with setting custom colors using gsn_define_colormap()

warning:CvtStringGenArrayToCmap:Unable to find rgb of "white", using white

Example script attached. I do not remember having this problem in previous version of NCL (< 6.5.0).

Attachments (2)

test.ncl (139 bytes) - added by lvankampenhout (Leo van Kampenhout) 5 years ago.
ncarg.install.1126c.log.tar (2.7 MB) - added by Dave-Allured (Dave Allured) 5 years ago.
During the NCARG/NCL build, a number of warnings are thrown when compiling rgb.c. This might be related to the current issue. Here is the full console output from my recent build. Other versions of rgb.c show up in dependency ports, earlier in the console log. Please see NCARG's rgb.c messages near the end.

Change History (10)

Changed 5 years ago by lvankampenhout (Leo van Kampenhout)

Attachment: test.ncl added

comment:1 Changed 5 years ago by lvankampenhout (Leo van Kampenhout)

The first step is to check whether this is a NCL 6.5.0 problem or a problem with the port. Unfortunately, I don't have access to any other install of NCL 6.5 besides this one.

UPDATE: I just installed NCL 6.5.0 through conda as suggested on the NCL website (http://www.ncl.ucar.edu/Download/)

This gave a working installation that does not yield the warning (which is in fact an error, since the colors won't be used).

Last edited 5 years ago by lvankampenhout (Leo van Kampenhout) (previous) (diff)

comment:2 Changed 5 years ago by jmroot (Joshua Root)

Cc: tenomoto openmaintainer removed
Owner: set to tenomoto
Status: newassigned
Summary: CvtStringGenArrayToCmap unable to find rgb errorncarg: CvtStringGenArrayToCmap unable to find rgb error

comment:3 Changed 5 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:4 Changed 5 years ago by Dave-Allured (Dave Allured)

Thank you for the short reproducer. I can reproduce this on Mac OS 10.13.6 with MacPorts 2.5.4, Xcode 10.1, and NCARG/NCL 6.5.0. Some of the NCL built-in examples also demo this problem:

> ng4ex cn05n
fatal:CvtStringToColorIndex: Unable to convert string "PaleGreen4" to requested type
Etc.

I traced this to two bad installed color database files that are generated during the NCARG source build process. The bad files are rgb.dir and rgb.pag. Under Macports, the program rgb.c runs improperly and outputs bad database files, and that is as far as I could get for now.

comment:5 Changed 5 years ago by Dave-Allured (Dave Allured)

Here is another workaround, besides Conda. Remarkably, you can manually compile and run rgb.c in standalone mode, and this will now generate correct versions of the two database files. You can then replace the two bad files in your Macports install directory.

Alternatively, you could bring in good versions of rgb.dir and rgb.pag from some other installed version of NCARG/NCL. It appears that these binary files are identical in both Mac and Linux 64-bit installs.

Bad versions from my recent local build identify like this:

> ls -go rgb*
-rw-r--r--  1    4096 Nov 26 22:44 rgb.dir
-rw-r--r--  1   26624 Nov 26 22:44 rgb.pag

> md5 rgb*
MD5 (rgb.dir) = aa0c7a1422062833952bbfba2afd38bc
MD5 (rgb.pag) = 3da80327b34549c1ea22d5f6e83b3f41

Good versions identify like this:

> ls -go rgb*
-rw-r--r--  1    4096 Dec  5 18:08 rgb.dir
-rw-r--r--  1   16384 Dec  5 18:08 rgb.pag

> md5 rgb*
MD5 (rgb.dir) = 547694cc1d9a22fdff2f019c3cfdd796
MD5 (rgb.pag) = bee91a15479082c09da4368f090792c1

The program rgb.c is only in the source distro, and not installed. It must be linked with an NCARG internal library, libncarg_c. Let me know if anyone wants stand-alone compile instructions, or working copies of the two database files.

Changed 5 years ago by Dave-Allured (Dave Allured)

Attachment: ncarg.install.1126c.log.tar added

During the NCARG/NCL build, a number of warnings are thrown when compiling rgb.c. This might be related to the current issue. Here is the full console output from my recent build. Other versions of rgb.c show up in dependency ports, earlier in the console log. Please see NCARG's rgb.c messages near the end.

comment:6 Changed 5 years ago by Dave-Allured (Dave Allured)

It looks like parallel building is the problem. The build log suggests that two simultaneous runs of rgb executable are writing on top of the same two output files, thereby corrupting both.

One workaround is to build or rebuild NCARG with parallel building disabled. If there is an existing bad build, then precede this with port clean ncarg or port uninstall ncarg as needed.

port install ncarg build.jobs=1

More information about turning off parallel builds: https://trac.macports.org/wiki/howto/ParallelBuilding

comment:7 Changed 5 years ago by Dave-Allured (Dave Allured)

Port maintainer, please disable parallel building in the NCARG port file. Thanks.

use_parallel_build  no

comment:8 Changed 5 years ago by tenomoto (Takeshi Enomoto)

Resolution: fixed
Status: assignedclosed

In 6e9bdd25d0683a76e99040ea79faf26353c733d1/macports-ports (master):

ncarg: disable parallel build

  • disable parallel build to avoid simultaneous runs of rgb

Closes: #57728

Note: See TracTickets for help on using tickets.