Compilation of RTTOV-14 using conda

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #51023
    Sylvain HeillietteSylvain Heilliette
    Participant

    Hi All,

    I tried to use the recipe described in point 9) of RTTOV FAQ (https://nwp-saf.eumetsat.int/site/software/rttov/documentation/rttov-faqs/)

    The compilation started well. But if failed at the link stage:

    cd ../../tmp-gfortran-conda/test && /home/syh074/.conda/envs/rttov14/bin/gfortran -I../../forPython/include -D_RTTOV_NETCDF -I/home/syh074/.conda/envs/rttov14//include -fPIC -O3 -ffree-line-length-none -fmax-stack-var-size=128000 -I../../forPython/mod -c ../../src/test/example_aer_file_fwd.F90 -o ../../forPython/obj/example_aer_file_fwd.o
    cd ../../tmp-gfortran-conda/test && /home/syh074/.conda/envs/rttov14/bin/gfortran -o ../../forPython/bin/example_aer_file_fwd.exe ../../forPython/obj/example_aer_file_fwd.o -L../../forPython/lib -lrttov14_test -lrttov14_brdf_atlas -lrttov14_other -lrttov14_emis_atlas -lrttov14_coef_io -lrttov14_netcdf -lrttov14_parallel -lrttov14_main -L/home/syh074/.conda/envs/rttov14//lib -lnetcdff -lnetcdf -lnetcdf -lhdf5_hl -lhdf5 -lsz -lz -lcurl -lm
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libdl.so.2: undefined reference to `_dl_catch_error@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__nanosleep_nocancel@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libdl.so.2: undefined reference to `_dl_signal_error@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__twalk@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__call_tls_dtors@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__tsearch@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__mmap@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__tdelete@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `_IO_enable_locks@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__tfind@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__sigtimedwait@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__libc_fcntl64@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__pause_nocancel@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__tunable_get_val@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__write_nocancel@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__mprotect@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__munmap@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__open64_nocancel@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__read_nocancel@GLIBC_PRIVATE’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /lib64/libpthread.so.0: undefined reference to `__close_nocancel@GLIBC_PRIVATE’
    collect2: error: ld returned 1 exit status

    It is possible to I put wrong information in my gfortran-conda arch file.
    In particular I was not sure on how to interpret step 5:

    5. Update LDFLAGS: LDFLAGS=”-shared $LDFLAGS”

    Here is my gfortran-conda arch file:

    FC=/home/syh074/.conda/envs/rttov14/bin/gfortran
    FC77=/home/syh074/.conda/envs/rttov14/bin/gfortran
    CC=/home/syh074/.conda/envs/rttov14/bin/gcc
    LDFLAGS_ARCH=
    CFLAGS_ARCH= -std=c89
    FFLAGS_ARCH=-fPIC -O3 -ffree-line-length-none -fmax-stack-var-size=128000
    AR=ar r
    #LDFLAGS=”-shared $LDFLAGS”
    F2PY=f2py –fcompiler=gnu95
    F2PYFLAGS_ARCH=”-fPIC -ffree-line-length-none”
    F2PYLDFLAGS_ARCH=
    FFLAGS_ARCH_lapack=-fPIC -O3

    Any suggestion ?

    Many Thanks,

    Sylvain Heilliette

    #51032
    James HockingJames Hocking
    Keymaster

    Hi Sylvain,

    Can you try adding -shared to LDFLAGS_ARCH? I could replicate the error you got without this, and adding it fixed the issue.

    You may need to install meson in your conda environment too.

    I have updated the FAQ to reflect the above.

    Best wishes,
    James

    #51035
    Sylvain HeillietteSylvain Heilliette
    Participant

    Many thanks for your suggestion.

    With your modification, I now get another error message:

    cd ../../tmp-gfortran-conda/mw_scatt_coef && /home/syh074/.conda/envs/rttov14/bin/gfortran -o ../../test/bin/rttov_scatt_make_coef.exe ../../test/obj/rttov_scatt_make_coef.o -L../../test/lib -lrttov14_mw_scatt_coef -lrttov14_other -lrttov14_coef_io -lrttov14_netcdf -lrttov14_main -L/home/syh074/.conda/envs/rttov14//lib -lnetcdff -lnetcdf -lnetcdf -lhdf5_hl -lhdf5 -lsz -lz -lcurl -lm -shared
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: ../../test/lib/librttov14_mw_scatt_coef.a(scatdb.o): warning: relocation against stderr@@GLIBC_2.2.5' in read-only section.text’
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: ../../test/lib/librttov14_mw_scatt_coef.a(scatdb.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5′ can not be used when making a shared object; recompile with -fPIC
    /fs/site5/eccc/mrd/rpndat/syh074/.conda/envs/rttov14/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: final link failed: bad value
    collect2: error: ld returned 1 exit status
    make[1]: *** [Makefile:84: ../../test/bin/rttov_scatt_make_coef.exe] Error 1
    make[1]: Leaving directory ‘/fs/homeu2/eccc/mrd/rpndat/syh074/codedir/rttov14OfficielGfortran/src/mw_scatt_coef’
    make: *** [Makefile:27: mw_scatt_coef/bin] Error 2

    I will look into meson to if it might help.

    #51037
    James HockingJames Hocking
    Keymaster

    Hi Sylvain,

    Apologies, I forgot that I also had to add -fPIC to CFLAGS_ARCH (I got the same error). This seems to be something new with the latest version of gcc (v15).

    Regarding meson, you need this if you are building the Python wrapper and you are using Numpy v2.x.

    Best wishes,
    James

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