Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to enable UDUNITS, not UDUNITS2 #257

Open
haze1986 opened this issue Aug 30, 2022 · 8 comments
Open

Unable to enable UDUNITS, not UDUNITS2 #257

haze1986 opened this issue Aug 30, 2022 · 8 comments

Comments

@haze1986
Copy link

haze1986 commented Aug 30, 2022

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.

@czender
Copy link
Member

czender commented Aug 30, 2022

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"

@haze1986
Copy link
Author

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

@czender
Copy link
Member

czender commented Aug 30, 2022

Nevertheless, try the suggestion.

@haze1986
Copy link
Author

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.

@czender
Copy link
Member

czender commented Aug 30, 2022

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

@haze1986
Copy link
Author

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?

@czender
Copy link
Member

czender commented Aug 30, 2022

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

@haze1986
Copy link
Author

I have rebuilt and arrived at the same error still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants