slcs-jsc / mptrac

Massive-Parallel Trajectory Calculations (MPTRAC) is a Lagrangian particle dispersion model for the analysis of atmospheric transport processes in the free troposphere and stratosphere.
GNU General Public License v3.0
35 stars 14 forks source link

make -j4 #6

Closed Tompythonorange closed 2 years ago

Tompythonorange commented 2 years ago

use nc2

atm_dist.c:47:3: optimized: Inlining printf/47 into main/185 (always_inline). /usr/bin/ld: cannot find -lhdf5_hl /usr/bin/ld: cannot find -lhdf5 collect2: error: ld returned 1 exit status make: [Makefile:142: atm_select] Error 1 /usr/bin/ld: cannot find -lhdf5_hl /usr/bin/ld: cannot find -lhdf5 collect2: error: ld returned 1 exit status make: [Makefile:142: atm_init] Error 1 /usr/bin/ld: cannot find -lhdf5_hl /usr/bin/ld: cannot find -lhdf5 collect2: error: ld returned 1 exit status make: *** [Makefile:142: atm_dist] Error 1 image

lars2015 commented 2 years ago

Hi Tom,

this error looks like the compiler can't find the HDF5 library.

You may have to check the library and include paths in the Makefile.

Also, if you are going to use the netCDF and GSL libraries of your Ubuntu installation, static compilation may not work, I think. Maybe try make STATIC=0, to compile the code.

This is how I got MPTRAC running on my Ubuntu 20.04 installation and how it is running here on GitHub actions as a test (see https://github.com/slcs-jsc/mptrac/actions):

1) Install GSL and netCDF development packages:

    sudo apt-get install gnuplot libnetcdf-dev libgsl-dev libhdf5-dev

2) Modify library path and include path in src/Makefile:

    INCDIR = -I/usr/include -I/usr/include/hdf5/serial
    LIBDIR = -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial

3) Compile with dynamic linking:

    make STATIC=0

4) You can check the results by running the example test case:

    make check

Best regards Lars

Tompythonorange commented 2 years ago

Hi Tom,

this error looks like the compiler can't find the HDF5 library.

You may have to check the library and include paths in the Makefile.

Also, if you are going to use the netCDF and GSL libraries of your Ubuntu installation, static compilation may not work, I think. Maybe try make STATIC=0, to compile the code.

This is how I got MPTRAC running on my Ubuntu 20.04 installation and how it is running here on GitHub actions as a test (see https://github.com/slcs-jsc/mptrac/actions):

  1. Install GSL and netCDF development packages:
    sudo apt-get install gnuplot libnetcdf-dev libgsl-dev libhdf5-dev
  1. Modify library path and include path in src/Makefile:
    INCDIR = -I/usr/include -I/usr/include/hdf5/serial
    LIBDIR = -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial
  1. Compile with dynamic linking:
    make STATIC=0
  1. You can check the results by running the example test case:
    make check

Best regards Lars

thank you I will try your steps after working,maybe, I guess should use absolute paths instead of relative paths in Makefile。

Best regards

Tompythonorange commented 2 years ago

thank you ,I got it running。

At 2022-03-23 22:22:18, "Lars Hoffmann" @.***> wrote:

Hi Tom,

this error looks like the compiler can't find the HDF5 library.

You may have to check the library and include paths in the Makefile.

Also, if you are going to use the netCDF and GSL libraries of your Ubuntu installation, static compilation may not work, I think. Maybe try make STATIC=0, to compile the code.

This is how I got MPTRAC running on my Ubuntu 20.04 installation:

Install GSL and netCDF development packages: sudo apt install libnetcdf-dev libgsl-dev

Modify library path and include path in src/Makefile: INCDIR = -I/usr/include -I/usr/include/hdf5/serial LIBDIR = -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial

Compile with dynamic linking: make STATIC=0

You can check the results by running the example test case: make check

Best regards Lars

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

lars2015 commented 2 years ago

Happy to hear! If you have any other questions, please let us know.

I will close the issues for now.

Lars