MESH-Model / MESH-Dev

This repository contains the official MESH development code, which is the basis for the 'tags' listed under the MESH-Releases repository. The same tags are listed under this repository. Legacy branches and utilities have also been ported from the former SVN (Subversion) repository. Future developments must create 'forks' from this repository.
Other
2 stars 3 forks source link

Running `MESH` on Ubuntu #44

Closed kasra-keshavarz closed 1 month ago

kasra-keshavarz commented 4 months ago

Documentation suggestion

More of a documentation suggestion, as @roalva82 and I have been trying to compile MESH on Ubuntu VMs (WSL + Multipass). Here is the workflow we used to compile with gcc stack:

Serial version:

$ sudo apt update
$ sudo apt install gcc build-essential gfortran libnetcdff-dev
$ make gfortran netcdf # in MESH's source code directory

MPI version:

$ sudo apt install libopenmpi-dev openmpi-bin libnetcdf-mpi-dev libnetcdff-dev
$ make mpi_gcc netcdf

Does MESH need the parallel capability for the NetCDF library? If yes, there should be some adjustments with the library names installed to have it compile properly.

I have used Ubuntu 20.04.6 LTS, and the software stack on its package repositories. The gcc used is 9.4.0.

@roalva82 have compiled on Ubuntu 22.04 with gcc 11.4.0 and the software stack available on 22.04's remote repositories.

mee067 commented 4 months ago

I do not think MESH I/O is parallelized irrespective of the file format and therefore it won't need the parallelized netcdf library.

Mohamed Ahmed had issues trying to compile with gcc 13 and had to downgrade - just to note. He would have the details.

kasra-keshavarz commented 4 months ago

Just out of curiosity, I compiled MESH r1860 using gfortran/gcc v13.2.0 and it compiled without any issues. I don't think here is the right topic, but it would be nice to see the issue he is facing, and report it here.

Here are the specs:

Ubuntu 23.10
gfortran/gcc v13.2.0
MESH r1860

Here is NetCDF details:

$ nf-config --all

This netCDF-Fortran 4.5.4 has been built with the following features: 

  --cc        -> gcc
  --cflags    -> -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2

  --fc        -> gfortran
  --fflags    -> -I/usr/include -I/usr/include
  --flibs     -> -L/usr/lib/aarch64-linux-gnu -lnetcdff -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf -lm 
  --has-f90   -> 
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /usr
  --includedir-> /usr/include
  --version   -> netCDF-Fortran 4.5.4
$ nc-config --all

This netCDF 4.9.2 has been built with the following features: 

  --cc            -> /usr/bin/cc
  --cflags        -> -I/usr/include -I/usr/include/hdf5/serial
  --libs          -> -L/usr/lib/aarch64-linux-gnu -L/usr/lib/aarch64-linux-gnu/hdf5/serial -lnetcdf
  --static        -> -lhdf5_hl -lhdf5 -lcrypto -lcurl -lpthread -lsz -lz -ldl -lm -lxml2

  --has-dap          -> yes
  --has-dap2         -> yes
  --has-dap4         -> yes
  --has-nc2          -> yes
  --has-nc4          -> yes
  --has-hdf5         -> yes
  --has-hdf4         -> no
  --has-logging      -> no
  --has-pnetcdf      -> no
  --has-szlib        -> no
  --has-cdf5         -> yes
  --has-parallel4    -> no
  --has-parallel     -> no
  --has-nczarr       -> yes
  --has-zstd         -> yes
  --has-benchmarks   -> no
  --has-multifilters -> no
  --has-stdfilters   -> deflate szip bz2
  --has-quantize     -> no

  --prefix        -> /usr
  --includedir    -> /usr/include
  --libdir        -> /usr/lib/aarch64-linux-gnu
  --plugindir     -> 
  --version       -> netCDF 4.9.2
kasra-keshavarz commented 4 months ago

Copying him here, just in case @MIsmlAhmed

MIsmlAhmed commented 4 months ago

That was for an older MESH version (1813, I think).

kasra-keshavarz commented 4 months ago

Thank you @MIsmlAhmed, an MVCE would be great to us started fixing it. I'll try on my end later today.

dprincz commented 1 month ago

MESH does not require parallel libraries of NetCDF.