Opened 2 years ago

Closed 7 months ago

Last modified 4 months ago

#53031 closed defect (fixed)

macports ncl fails, mac install of ncarg works

Reported by: basmac Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.3.5
Keywords: Cc: Dave-Allured (Dave Allured)
Port: ncarg

Description

Running the same script the macports /opt/local crashes with an error, whereas a separate default install of ncarg/ncl works from /usr/local.

Attached is the log, running /opt/local ncl first then /usr/local ncl second using ( ncarg @6.3.0_8+gcc6 (active))

macports fails on ElCap or new install on Sierra. The attached log is Sierra, but has the same error, on ElCap (ncarg @6.3.0_9+gcc5 (active))

The library script ESMF_regridding.ncl are the same size in /usr/local/ncl/ as under /opt/local.

Attachments (4)

ncl.mac27.log (5.2 KB) - added by basmac 2 years ago.
bar.ncl (499 bytes) - added by tenomoto (Takeshi Enomoto) 2 years ago.
test_regrid_plot.ncl (2.5 KB) - added by basmac 2 years ago.
test3.setfileoption.ncl (119 bytes) - added by Dave-Allured (Dave Allured) 8 months ago.
Reduced bug demo script

Download all attachments as: .zip

Change History (14)

Changed 2 years ago by basmac

Attachment: ncl.mac27.log added

comment:1 Changed 2 years ago by mf2k (Frank Schima)

Cc: takeshi@… removed
Keywords: ncl removed
Owner: set to tenomoto
Status: newassigned

comment:2 Changed 2 years ago by tenomoto (Takeshi Enomoto)

Thanks for reporting. I was able to reproduce the problem, but I don't have a solution at the moment.

It appears that setfileoption break the symbol table and Opt becomes undefined, I attach the simple script to cause the error.

BTW, I'd like to draw your attention the warning message on line 47.

warning:["Palette.c":1850]:NhlLoadColormapFiles: Invalid colormap directory: /opt/local/ncl/lib/ncarg/colormaps

The default NCARG_COLORMAPS should be /opt/local/lib/ncarg/colormaps.

Changed 2 years ago by tenomoto (Takeshi Enomoto)

Attachment: bar.ncl added

comment:3 Changed 2 years ago by basmac

Hi, thanks for finding the issue, when I run your bar.ncl I get the following. Is this what we are supposed to get ?

[mac27:~] bmcinnes% ncl bar.ncl

Copyright (C) 1995-2015 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.3.0 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details.

Variable: nc_file_type Type: string Total Size: 8 bytes

1 values

Number of Dimensions: 1 Dimensions and sizes: [1] Coordinates: (0) netcdf3 fatal:Variable (nc_file_type) is undefined fatal:["Execute.c":8575]:Execute: Error occurred at or near line 10 in file bar.ncl

fatal:["Execute.c":8575]:Execute: Error occurred at or near line 16 in file bar.ncl

[mac27:~] bmcinnes%

I am not sure if this is related, but the user also has this issue, for your information

I made a script that tests both the regridding and the ability to plot .png files. Here is the output when I try to run it using the /usr/local NCL version:

[mac72:~/NCL/NCLtalk/NCLmacports] mgehne% setenv NCARG_ROOT /usr/local

[mac72:~/NCL/NCLtalk/NCLmacports] mgehne% setenv PATH /usr/local/$PATH

[mac72:~/NCL/NCLtalk/NCLmacports] mgehne% source ~/.tcshrc

[mac72:~/NCL/NCLtalk/NCLmacports] mgehne% ncl test_regrid_plot.ncl

Copyright (C) 1995-2015 - All Rights Reserved

University Corporation for Atmospheric Research

NCAR Command Language Version 6.3.0

The use of this software is governed by a License Agreement.

See http://www.ncl.ucar.edu/ for more details.

(0) Regrid option is on.

(0) Plot option is on.

(0) defining data array

Variable: data

Type: float

Total Size: 259200 bytes

64800 values

Number of Dimensions: 2

Dimensions and sizes: [lat | 180] x [lon | 360]

Coordinates:

lat: [-89.5..89.5]

lon: [ 0..359]

(0) Regridding!

(0) defining new lat and lon arrays

(0) defining options for regridding

(0) Regridding using method = neareststod

dyld: Library not loaded: /usr/local/lib/libgfortran.3.dylib

Referenced from: /usr/local/ncl/bin/ESMF_RegridWeightGen

Reason: image not found

fatal:The result of the conditional expression yields a missing value. NCL can not determine branch, see ismissing function

fatal:["Execute.c":8575]:Execute: Error occurred at or near line 2938 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8575]:Execute: Error occurred at or near line 4027 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8575]:Execute: Error occurred at or near line 69 in file test_regrid_plot.ncl

[mac72:~/NCL/NCLtalk/NCLmacports] mgehne% which ncl

/usr/local/bin/ncl

[mac72:~/NCL/NCLtalk/NCLmacports] mgehne% env | grep NCARG

NCARG_ROOT=/usr/local

NCARG_COLORMAPS=/Users/mgehne/NCL/Colormaps:/usr/local/lib/ncarg/colormaps

This is a slightly different error message than I have been getting previously.

I also attached the test script if you feel like running that on your machine. Setting the options at the beginning to False turns off the regridding or plotting.

Changed 2 years ago by basmac

Attachment: test_regrid_plot.ncl added

comment:4 Changed 2 years ago by basmac

On clean mac Sierra and ncl 6.3.0 in /usr/local/, your test fails for /opt/local version of ncl and works on /usr/local version which is 10.10.

[mac27:~] bmcinnes% cd [mac27:~] bmcinnes% setenv NCARG_ROOT /opt/local [mac27:~] bmcinnes% ncl bar.ncl

Copyright (C) 1995-2015 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.3.0 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details.

Variable: nc_file_type Type: string Total Size: 8 bytes

1 values

Number of Dimensions: 1 Dimensions and sizes: [1] Coordinates: (0) netcdf3 fatal:Variable (nc_file_type) is undefined fatal:["Execute.c":8575]:Execute: Error occurred at or near line 10 in file bar.ncl

fatal:["Execute.c":8575]:Execute: Error occurred at or near line 16 in file bar.ncl

[mac27:~] bmcinnes% /usr/local/bin/ncl bar.ncl

Copyright (C) 1995-2015 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.3.0 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details.

Variable: nc_file_type Type: string Total Size: 8 bytes

1 values

Number of Dimensions: 1 Dimensions and sizes: [1] Coordinates: (0) netcdf3

Variable: nc_file_type Type: string Total Size: 8 bytes

1 values

Number of Dimensions: 1 Dimensions and sizes: [1] Coordinates: (0) netcdf4

Variable: nc_file_type Type: string Total Size: 8 bytes

1 values

Number of Dimensions: 1 Dimensions and sizes: [1] Coordinates: (0) netcdf3 [mac27:~] bmcinnes%

comment:5 Changed 2 years ago by basmac

The latest binary of ncarg 6.4.0 does not give the error using the test bar.ncl.

Can we get that installed into macports ?

thanks

Changed 8 months ago by Dave-Allured (Dave Allured)

Attachment: test3.setfileoption.ncl added

Reduced bug demo script

comment:6 Changed 8 months ago by Dave-Allured (Dave Allured)

Here is a more reduced demo for the setfileoption bug:

procedure test3 ()
begin
  setfileoption ("nc", "Format", "Classic")
  x = 99
  print (x+"")
end

begin
  test3 ()
end

This should just print "99" if NCL is working correctly. With current build ncarg.6.4.0_9 it gets this error, which is equivalent to the previously reported errors:

> ncl test3.setfileoption.ncl 
 NCAR Command Language Version 6.4.0
fatal:Variable (x) is undefined
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 5 in file test3.setfileoption.ncl
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 9 in file test3.setfileoption.ncl

The previous test script, bar.ncl, is longer than needed, and it contains an unrelated bug that can also corrupt NCL execution and print more confusing errors. The problem is a missing "undef" statement at the top, not related to the current issue.

I agree with Takeshi's previous observation that setfileoption appears to break the symbol table.

comment:7 Changed 8 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:8 Changed 7 months ago by tenomoto (Takeshi Enomoto)

setfileoption in ncarg 6.5.0 causes Segmentation Fault 11 on High Sierra. In the past the problem disappeared with some compilers #38687. So I tried a few versions of gcc only to fail. I have no idea how to fix this at the moment. I decided to revert to 6.4.0. [cdde049ce2176cdef35c2e8737f718b9d4dae9d2/macports-ports].

comment:9 Changed 7 months ago by tenomoto (Takeshi Enomoto)

Resolution: fixed
Status: assignedclosed

In 278e517b8e560b682d4a9c5ed79f9ee74530482f/macports-ports (master):

ncarg: update (again) to 6.5.0

Closes: #53031
Closes: #56870

comment:10 Changed 4 months ago by Dave-Allured (Dave Allured)

For the record only, I got this information from an NCARG/NCL developer a while back:

"The one library that I see that could potentially be an issue is HDF5 1.10.x. You cannot build or link NCL V6.4.0 against this version of HDF5. You must use HDF 1.8.x. All the other libraries look okay to me, but I have to admit that I haven't tried this exact pairing of everything, so there could be something I'm not aware of. HDF5 1.10 just flat out shouldn't work with NCL640, so I'm a bit surprised to see that and not have heard from more people running into problems."

"In NCL V6.5.0, you *can* link against HDF5 1.10.x."

When this ticket #53031 was active (2016 Dec. to 2018 Aug.), MacPorts NCARG V6.4.0 was indeed building against HDF5 1.10.x. Therefore I think it is likely that this version incompatibility was behind the setfileoption bug and other problems.

Note: See TracTickets for help on using tickets.