nco icon indicating copy to clipboard operation
nco copied to clipboard

Unable to enable UDUNITS, not UDUNITS2

Open haze1986 opened this issue 2 years ago • 8 comments

Dear All,

I started with a script requiring ncra to be compiled with udunits ncra: WARNING NCO was built without UDUnits. NCO is therefore unable to convert values from "seconds since 2014-01-01 00:00:00" to "seconds since 2014-01-01 00:00:00". See http://nco.sf.net/nco.html#rbs for more information. ncra: HINT Re-build or re-install NCO enabled with UDUnits.

I have success getting udunits2.2.28 compiling, no issue.

Proceeded with the following DUNITS2_PATH=.../udunits-2.2.28 ./configure --enable-udunits --enable-udunits2 Results in the following, I could never get both UDUNITS working. ENABLE_UDUNITS....... no ENABLE_UDUNITS2...... yes After compilation with UDUNITS2, I am still getting the first error complaining about UDUnits.

Would appreciate some enlightenment on whether it is possible to have ENABLE_UDUNITS....... yes and whether it is the fix to the problem or am I missing something altogether?

I also have UDUNITS 1.12.11 compiled. If this is the solution to the problem do let me know too.

haze1986 avatar Aug 30 '22 15:08 haze1986

NCO needs to know the absolute path to the UDUnits database on the system. You are compiling with relative paths, so the build might complete correct, and then fail at run time when UDUnits is no longer present at .../udunits-2.2.28. Please read the section on UDUnits in the manual here. You might export the database location with something like

export UDUNITS2_XML_PATH="${HOME}/anaconda/share/udunits/udunits2.xml"

czender avatar Aug 30 '22 16:08 czender

Apologies that I omitted the info. But it's a full path and I've censored the folder names.

haze1986 avatar Aug 30 '22 16:08 haze1986

Nevertheless, try the suggestion.

czender avatar Aug 30 '22 16:08 czender

If I may be more specific with my question: Is the error on UDUNITS complaining about udunits or udunits2. I'm not sure if I need to build and install udunits(1) or am I compiling udunits2 incorrectly. Once we clear this up it'll be easier to troubleshoot.

haze1986 avatar Aug 30 '22 17:08 haze1986

Please try the suggestion. It's a 1-liner!

czender avatar Aug 30 '22 17:08 czender

Yes Ive already tested, after export I get the same error at runtime. Which was why I'd like to try recompiling it with your suggestion to add the xml path as well. Can I confirm its udunits2 we need here?

haze1986 avatar Aug 30 '22 17:08 haze1986

Yes, UDUnits2. NCO wants to enable UDUnits2. If it cannot find UDUnits2 then it might try to enable UDUnits1.

czender avatar Aug 30 '22 17:08 czender

I have rebuilt and arrived at the same error still

haze1986 avatar Aug 31 '22 00:08 haze1986