Error in compiling rttov 13.2

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #48944
    yewoon leeyewoon lee
    Participant

    Hello,
    I tried to compile rttov 13.2 with hdf5 v12.0 but rttov keeps getting errors where hdf5 library is located and I am trying to compile without hdf5.
    I returned the Makefile.local file to its state when first download it, then run Makefile.PL and then an error occured when i run the make command.

    The following error has occurred.

    cd ../../tmp-gfortran-openmp/mw_scatt && gfortran -I../..//include -fPIC -O3 -fopenmp -ffree-line-length-none -I../..//mod -c ../../src/mw_scatt/rttov_eddington_ad.F90 -o ../..//obj/rttov_eddington_ad.o
    ../../src/mw_scatt/rttov_eddington_ad.F90:293:6:

    & chanprof%prof, &! in
    1
    Error: Rank mismatch in argument ‘nprofilesad’ at (1) (scalar and rank-1)
    Makefile:125: recipe for target ‘../..//obj/rttov_eddington_ad.o’ failed
    make[1]: *** [../..//obj/rttov_eddington_ad.o] Error 1
    make[1]: Leaving directory ‘/home/lyw4836/rttov13/src/mw_scatt’
    Makefile:115: recipe for target ‘mw_scatt/lib’ failed
    make: *** [mw_scatt/lib] Error 2

    Thanks,
    yewoon

    #48946
    James HockingJames Hocking
    Keymaster

    Hi Yewoon,

    Having looked at the error again, I’m editing my previous reply: I think perhaps you have updated to RTTOV v13.2 from an earlier version of RTTOV. The interface to the rttov_integratesource_ad subroutine changed in v13.2, and either you are not using the latest version of this routine, or you have not done a clean build and your compilation is using an old object file.

    Please check the source code of src/mw_scatt/rttov_integratesource_ad.F90. The interface should look like this:

    Subroutine rttov_integratesource_ad (&
    & ccthres, &! in
    & nlevels, &! in
    & nchannels, &! in
    & nprofiles, &! in
    & lprofiles, &! in
    & angles, &! in
    & scatt_aux, &! in
    & scatt_aux_ad, &! inout
    & dp, &! in
    & dp_ad, &! inout
    & dm, &! in
    & dm_ad, &! inout
    & j_do, &! inout
    & j_do_ad, &! inout
    & j_up, &! inout
    & j_up_ad, &! inout
    & adk) ! in

    If it does not match then you have not updated your code fully to RTTOV v13.2.

    If your routine does match the above then you need to do a clean compilation to ensure all changed source files are recompiled.

    Best wishes,
    James

    • This reply was modified 1 year ago by James HockingJames Hocking. Reason: Re-read error and realised the problem is different to what I originally thought
    #48948
    yewoon leeyewoon lee
    Participant

    Thank you very much for your reply.
    The rttov_integratesource_ad.F90 file is different from the code you told me, so I want to remove and reinstall rttov13.
    Could you tell me how to delete rttov13 completely?

    Thanks,
    yewoon

    #48949
    James HockingJames Hocking
    Keymaster

    Hi Yewoon,

    To delete RTTOV you can just delete the top-level directory that was created when you downloaded and extracted the old version.

    RTTOV v13.2 is distributed as a complete package: this should be extracted into a new directory and RTTOV should be compiled there.

    Best wishes,
    James

    #48969
    yewoon leeyewoon lee
    Participant

    Hi James,
    I deleted and reinstalled rttov13 and then it was compiled successfully.
    I read User guide section 6.1 and tried to link my code against rttov, but i got an error.

    I tried this codes in /src directory :
    -lrttov13_wrapper -lrttov13_mw_scatt -lrttov13_brdf_atlas
    -lrttov13_emis_atlas -lrttov13_other -lrttov13_parallel
    -lrttov13_coef_io -lrttov13_hdf -lrttov13_main
    -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5

    And also i tried :
    -librttov13_wrapper -librttov13_mw_scatt -librttov13_brdf_atlas
    -librttov13_emis_atlas -librttov13_other -librttov13_parallel
    -librttov13_coef_io -librttov13_hdf -librttov13_main
    -libhdf5hl_fortran -libhdf5_hl -libhdf5_fortran -libhdf5

    Then i got same error :
    command not found

    Thank you,
    Yewoon

    #48970
    James HockingJames Hocking
    Keymaster

    Hi Yewoon,

    These are not commands that are executed on the commandline. You must include them in the linking step when compiling your own code. This would typically involve something like

    “-L/path/to/RTTOV/lib -lrttov13_wrapper -lrttov13_mw_scatt -lrttov13_brdf_atlas
    -lrttov13_emis_atlas -lrttov13_other -lrttov13_parallel
    -lrttov13_coef_io -lrttov13_hdf -lrttov13_main
    -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5”

    being passed to the compiler/linker either in your Makefile or on the commandline, for example.

    I can’t really advise specifically on how to compile your own code, at least not without more details, but there are many tutorials on the internet that can help.

    Best wishes,
    James

    #49758
    Atsushi MatsuokaAtsushi Matsuoka
    Participant

    Hi,

    I’ve been working on installation of rttov gui. The compilation has been successful along with hdf5-1.10.1 located at /opt/local/. When running rttovgui, an error message shows up, complaining wxPython is not installed. Although conda was used for installing all the required modules, some modules are likely missing for some reasons. Those include wxPython==4.1.1 and pypubsub==4.0.3. As a result, I cannot launch rttovgui.

    The issue is that when trying to install those missing modules, the error message says that those are incompatible. I’m confused. Any of your suggestions would be greatly appreciated.

    Below shows what I have done so far:

    1. Install hdf5 library
    $tar xvf hdf5-1.10.1.tar.gz
    $cd hdf5-1.10.1
    $./configure –prefix=/opt/local/hdf5-1.10.1 –enable-fortran
    $make
    $make check
    $sudo make install

    2. Generate python environment named “rttovgui” and install the required modules under that environment:
    $cd ~/rttov/gui
    $./install_python_for_gui.sh

    Specify the hdf5 library (installed in 1) in Makefile.local, located below “build”


    # ——————————————————————————
    HDF5_PREFIX = /opt/local/hdf5-1.10.1
    # — Uncomment one FFLAGS_HDF5 line:
    # For most compilers:
    FFLAGS_HDF5 = -D_RTTOV_HDF $(FFLAG_MOD)$(HDF5_PREFIX)/include
    # For xlf on AIX:
    # FFLAGS_HDF5 = -WF,-D_RTTOV_HDF $(FFLAG_MOD)$(HDF5_PREFIX)/include
    # — Uncomment one LDFLAGS_HDF5 line:
    # In most cases:
    LDFLAGS_HDF5 = -L$(HDF5_PREFIX)/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5
    # But you may find that you must also specify libz:
    # (NB for NAG Fortran you may also need to add -ldl)
    LDFLAGS_HDF5 = -L$(HDF5_PREFIX)/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lz
    # ———————————————

    3. Activate conda environment, rttovgui:
    $conda activate rttovgui

    (rttovgui) atsushimatsuoka@atsushimatsuoka-VirtualBox:~$

    4. Then, compile rttovgui by running rttov_compile.sh from src directory. This has been done successfully:
    $../build/rttov_compile.sh

    (rttovgui) atsushimatsuoka@atsushimatsuoka-VirtualBox:~/rttov/gui$ ls -l
    total 143464
    drwxr-xr-x 2 atsushimatsuoka atsushimatsuoka 4096 Nov 15 2022 doc
    drwxr-xr-x 2 atsushimatsuoka atsushimatsuoka 4096 Nov 15 2022 icons
    -rwxr-xr-x 1 atsushimatsuoka atsushimatsuoka 787 Nov 15 2022 install_python_for_gui.sh
    -rw-rw-r– 1 atsushimatsuoka atsushimatsuoka 146836934 Jun 26 16:39 Miniconda3-latest-Linux-x86_64.sh
    drwxr-xr-x 3 atsushimatsuoka atsushimatsuoka 4096 Nov 15 2022 r1Dvar
    drwxr-xr-x 2 atsushimatsuoka atsushimatsuoka 4096 Aug 22 06:41 rcontroller
    -rw-r–r– 1 atsushimatsuoka atsushimatsuoka 76 Nov 15 2022 requirements.txt
    drwxr-xr-x 3 atsushimatsuoka atsushimatsuoka 4096 Aug 22 01:20 rmodel
    drwxr-xr-x 4 atsushimatsuoka atsushimatsuoka 4096 Aug 22 03:41 rttov
    -rwxr-xr-x 1 atsushimatsuoka atsushimatsuoka 464 Nov 15 2022 rttovgui
    -rw-r–r– 1 atsushimatsuoka atsushimatsuoka 2069 Aug 22 06:06 rttov_gui.env
    -rw-r–r– 1 atsushimatsuoka atsushimatsuoka 3216 Nov 15 2022 rttovguienv_python3.7.yml
    -rw-r–r– 1 atsushimatsuoka atsushimatsuoka 2918 Nov 15 2022 rttovguienv.yml
    lrwxrwxrwx 1 atsushimatsuoka atsushimatsuoka 24 Nov 15 2022 rttov_gui_f2py.so -> ../lib/rttov_gui_f2py.so
    -rwxr-xr-x 1 atsushimatsuoka atsushimatsuoka 5555 Nov 15 2022 run
    drwxr-xr-x 2 atsushimatsuoka atsushimatsuoka 4096 Nov 15 2022 rview
    drwxr-xr-x 2 atsushimatsuoka atsushimatsuoka 4096 Nov 15 2022 test
    (rttovgui) atsushimatsuoka@atsushimatsuoka-VirtualBox:~/rttov/gui$

    5. Add LD_LIBRARY_PATH in the rttov_gui.env:
    LD_LIBRARY_PATH=/opt/local/hdf5-1.10.1/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH

    6. HERE ARE THE ISSUE I am facing:
    (rttovgui) atsushimatsuoka@atsushimatsuoka-VirtualBox:~/rttov/gui$ ./rttovgui
    Traceback (most recent call last):
    File “/home/atsushimatsuoka/rttov/gui/rcontroller/controller.py”, line 16, in <module> import wx
    ModuleNotFoundError: No module named ‘wx’
    (rttovgui) atsushimatsuoka@atsushimatsuoka-VirtualBox:~/rttov/gui$

    7. Trying to install wxPython…
    (rttovgui) atsushimatsuoka@atsushimatsuoka-VirtualBox:~/rttov/gui$ pip install wxPython

    Building wheels for collected packages: wxPython
    Building wheel for wxPython (setup.py) … error
    error: subprocess-exited-with-error
    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [141 lines of output]
    running bdist_wheel
    running build
    WARNING: Building this way assumes that all generated files have been
    generated already. If that is not the case then use build.py directly
    to generate the source and perform the build stage. You can use
    –skip-build with the bdist_* or install commands to avoid this
    message and the wxWidgets and Phoenix build steps in the future.
    “/home/atsushimatsuoka/miniconda3/envs/rttovgui/bin/python” -u build.py build

    Atsushi

    #49789
    Jean Marie LalandeJean Marie Lalande
    Participant

    Hello Atsushi,

    Few questions:
    – Which version python are you using?
    – can you also try:
    conda install wxPython
    mamba install wxpython

    You would need to install the mamba package manager for the second command.

    Best regards,
    Jean-Marie Lalande

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.