Compile ERA52ARL.f issue: possible absolute path in object code

Post questions and find resources to convert meteorological data into a format HYSPLIT can read.
Post Reply
jago_scolab1
Posts: 3
Joined: April 4th, 2024, 4:58 am
Registered HYSPLIT User: Yes

Compile ERA52ARL.f issue: possible absolute path in object code

Post by jago_scolab1 »

Thanks for making available and maintaining HYSPLIT
I have successfully installed the latest version of EECODES in /opt/eecdodes, as far as I'm able to run grib_dump and grib_to_netcdf on grib files, and eccodes.mod exists in /opt/eccodes/include .
I have downloaded the latest version of HYSPLIT for CENTOS 7, hysplit.v5.3.0_CentOS7.9.2009 .
In the directory data2arl/era52arl there are three files: era52arl.f, era52arl.o, and Makefile. In Makefile I have just modified two directions pointing to eccodes/lib that now point to eccodes/lib64
When typing sudo make in the era52arl directory I get the following error:

Code: Select all

(base) [jago@isabelc era52arl]$ sudo make
[sudo] password for jago: 
gfortran -g -O2 -g -fconvert=big-endian -frecord-marker=4 -fPIC -falign-commons -finit-local-zero  -ffree-form   -o ../../exec/era52arl era52arl.o  -L../../library -lhysplit
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: era52arl.o: en la función `MAIN__':
/home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/data2arl/era52arl/era52arl.f:447: referencia a `__grib_api_MOD_grib_multi_support_on' sin definir
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/data2arl/era52arl/era52arl.f:450: referencia a `__grib_api_MOD_grib_open_file' sin definir
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/data2arl/era52arl/era52arl.f:455: referencia a `__grib_api_MOD_grib_count_in_file' sin definir
...
This happens many times and the issue is likely on that of /home/chrisl/.... There is no username "chrisl" in my server and I cannot change this path because it is not anywhere... I wondered it might be in the era52arl.o . Have you any hint to solve this? I'm so close to finish the installation...
Thanks again!
sonny.zinn
Posts: 361
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: Compile ERA52ARL.f issue: possible absolute path in object code

Post by sonny.zinn »

You might want to delete era52arl.o and try again. era52arl.o is an object file created from era52arl.f.
jago_scolab1
Posts: 3
Joined: April 4th, 2024, 4:58 am
Registered HYSPLIT User: Yes

Re: Compile ERA52ARL.f issue: possible absolute path in object code

Post by jago_scolab1 »

Thank you, I deleted era52arl.o and typed again sudo make. The output is still

Code: Select all

(base) [jago@isabelc era52arl]$ sudo make
gfortran -g -O2 -g -fconvert=big-endian -frecord-marker=4 -fPIC -falign-commons -finit-local-zero  -ffree-form   -o ../../exec/era52arl era52arl.o -L/opt/eccodes/lib64 -leccodes_f90 -leccodes  -L../../library -lhysplit
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: ../../library/libhysplit.a(pakset.o): in function `pakset_':
/home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/library/hysplit/pakset.f:146: reference to `_gfortran_stop_numeric_f08' undefined
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: ../../library/libhysplit.a(pakrec.o): in function `pakrec_':
/home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/library/hysplit/pakrec.f:92: reference to `_gfortran_stop_numeric_f08' undefined
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/library/hysplit/pakrec.f:141: reference to `_gfortran_stop_numeric_f08' undefined
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: ../../library/libhysplit.a(pakini.o): in function `pakini_':
/home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/library/hysplit/pakini.f:64: reference to `_gfortran_stop_numeric_f08' undefined
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: ../../library/libhysplit.a(pakndx.o): in function `pakndx_':
/home/chrisl/hysplit.v5.3.0_CentOS7.9.2009/library/hysplit/pakndx.f:160: reference to `_gfortran_stop_numeric_f08' undefined
collect2: error: ld returned 1 exit status
make: *** [Makefile:40: era52arl] Error 1
So the absolute path "/home/chrisl" where the compilation process is looking at is not related to the object code, maybe to a Hysplit library... The user chrisl does not exist in the server, so it is coming from somewhere. In any case, can you help with this, pls?
Thanks
sonny.zinn
Posts: 361
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: Compile ERA52ARL.f issue: possible absolute path in object code

Post by sonny.zinn »

Thank you for the update. It looks like you are using a newer version of gfortran compiler.

The source code for era52arl and other converters are provided at https://www.ready.noaa.gov/HYSPLIT_data2arl.php. Download hysplit_data2arl.zip that appears near the bottom of the web page. Unzip it and copy Makefile.inc.gfortran to Makefile.inc in the same directory. Edit Makefile.inc to suit your environment including paths to EECODE library and include files. Change directory to era52arl and run make.
jago_scolab1
Posts: 3
Joined: April 4th, 2024, 4:58 am
Registered HYSPLIT User: Yes

Re: Compile ERA52ARL.f issue: possible absolute path in object code

Post by jago_scolab1 »

Thank you very much!
I was working with the latest "full" Hysplit version for CentOS7, hysplit.v5.3.0_CentOS7.9.2009.tar.gz , but following your suggestion, I downloaded the newest version of hysplit_data2arl.zip . I unzipped it and compiled libhysplit.a by running make into metproj/library. Then I replaced with it the file libhysplit.a that already resided in the library directory of the "full" hysplit (in my case, in /opt/hysplit/library).
After that, working with the "full" hysplit, in /opt/hysplit/data2arl/era52arl , I run sudo make (using the appropriate paths to ECCODES in Makefile.inc), and era52arl compiled smoothly.
The fortran version I used did not affect anything.

So, looking at the error messages when using the file libhysplit.a included by default in the "full" latest version of Hysplit, that library (not any object code) was probably created using an absolute path (/home/chrisl/) where hysplit resided. If so, this should be modified. When using hysplit_data2arl.zip, the compilation of era52arl works like a charm.


Thanks again,

Jose
Post Reply

Return to “Conversion programs”