jllodra / ncdump-json

Modified ncdump to output data in json format
85 stars 28 forks source link

Build changes for GCC-9, MacOS Catalina and new netcdf binary and library installed with Homebrew #16

Closed bokjo closed 4 years ago

bokjo commented 4 years ago

Hello @jllodra,

Thanks for ncdump-json, really appreciated it!

I had to install it on macOS Catalina and had some problems so here are some improvements that fixed it for me.

Sorry I didn't have enough time to parameterize everything and some Linux or Windows to test it too. I believe that the Linux package is really similar and for Windows using something like Chocolatey to install the latest version of netcdf should do the job.

NOTE: for the dynamic libs in cmake for Linux you should use '.so' and for Windows '.dll' files

Flow...

Since the brew package homebrew/science/netcdf is no longer available you have to install the new package with comes with the libraries and the included header files.

brew install netcdf

The netcdf package also installs the latest GCC (v9) which should be enough Brew standard install location is /usr/local/Cellar

Also, you need the pkg-config installed which is not listed in the installation steps.

Putting this here so someone checking it can use it...

1. $ brew install netcdf
2. $ brew install pkg-config
3. $ brew install cmake
jllodra commented 4 years ago

Hi @bokjo,

Thank you so much for your contribution. MacOS users will appreciate this!

I haven't looked at your changes yet, but you say you haven't tested on Linux. Do you have the time to do a quick test on latest Debian or Ubuntu and share your findings before merging?

Warm regards

bokjo commented 4 years ago

Hi @bokjo,

Thank you so much for your contribution. MacOS users will appreciate this!

I haven't looked at your changes yet, but you say you haven't tested on Linux. Do you have the time to do a quick test on the latest Debian or Ubuntu and share your findings before merging?

Warm regards

Hello @jllodra,

I'll try to check it out on Linux this weekend and add different parameterized build variables for MacOS(APLLE) and Linux ( unfortunately cannot check for Windows)

For macOS, I'm assuming that the user will install NetCDF with Homebrew. Hope that different package manages for Linux distros behave similarly and that the latest version of NetCDF comes with the libraries as well.

Will let you know the outcome.

Kind Regards, Bojanche S.

bokjo commented 4 years ago

Hello @jllodra

I've checked on Ubuntu 18.04 LTS with GCC7 and Debian10 with GCC8 and managed to build it with one simple hack! (I don't know why the .so files are missing but the hack did the job)

cd /usr/lib/x86_64-linux-gnu

sudo ln -s libhdf5_serial.so libhdf5.so

sudo ln -s libhdf5_serial_hl.so libhdf5_hl.so

The idea is from this Github issue here

I've also added the parameterized check for building on macOS and the missing pkg-config in the README

Kind Regards, @bokjo

jllodra commented 4 years ago

Thank you for this!

bokjo commented 4 years ago

Thank you for this!

My pleasure :)

BobHu14 commented 4 years ago

Can you provide the converted JSON file