arw2arl compilation

General questions and postings pertaining to the use of HYSPLIT regardless of the platform. For platform specific questions, use the HYSPLIT Platform forums.
Post Reply
brownbagel
Posts: 5
Joined: February 22nd, 2016, 1:27 pm
Registered HYSPLIT User: Yes

arw2arl compilation

Post by brownbagel »

Hello,

Recently, I have been attempting to compile arw2arl function on Ubuntu 14.04 using gfortran.

However, when I try to compile the makefile using 'make' I get the following error message:

Code: Select all

gfortran -o ../../exec/arw2arl -O2 -fconvert=big-endian -frecord-marker=4 -ffree-form -Dgfortran -I/usr/include arw2arl.f libarw.a -I/usr/lib -lnetcdff -I../../library -lhysplit  
/usr/bin/ld: cannot find -lhysplit
collect2: error: ld returned 1 exit status
make: *** [arw2arl] Error 1
Here are the following 'modifications' I have made to the makefile:
-> I specified the file path for the locations of netcdf.so & netcdff.(NETLIB) and the locations of netcdf.h netcdf.inc (NETINC).
-> I changed

Code: Select all

 LINKS = -L$(NETLIB) -lnetcdff -L../../library -lhysplit
into

Code: Select all

 LINKS = -I$(NETLIB) -lnetcdff -I../../library -lhysplit
in order to avoid the "undefined reference ..._ error.

Any help would be greatly appreciated.
M.
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: arw2arl compilation

Post by ariel.stein »

You need to compile the hysplit library located in library/hysplit first.
brownbagel
Posts: 5
Joined: February 22nd, 2016, 1:27 pm
Registered HYSPLIT User: Yes

Re: arw2arl compilation

Post by brownbagel »

Thanks for the reply, I just did another fresh compile using compile.sh script, but the log file still displays the same error.
I then checked out the library/hysplit/ folder and tried to compile it, but it seems like the original bash script has already taken care of it.

Code: Select all

make: `../libhysplit.a' is up to date.
Attachments
compile.log
compile error log
(10.9 KiB) Downloaded 296 times
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: arw2arl compilation

Post by ariel.stein »

got to the subdirectory data2arl/arw2arl/ and type make there.
brownbagel
Posts: 5
Joined: February 22nd, 2016, 1:27 pm
Registered HYSPLIT User: Yes

Re: arw2arl compilation

Post by brownbagel »

Sorry, my problem was solved. I'll post my mistake for chives.

Initially, I've put -I in the LINKS part of the make file (see above post) is because I'm getting the following error:

Code: Select all

gfortran -o ../../exec/arw2arl -O2 -fconvert=big-endian -frecord-marker=4 -ffree-form  -I/usr/include arw2arl.f libarw.a -L/usr/lib -lnetcdf  -L../../library -lhysplit  
/tmp/ccyMA3dR.o: In function `MAIN__':
arw2arl.f:(.text+0x8a3): undefined reference to `nf_open_'
arw2arl.f:(.text+0x1548): undefined reference to `nf_get_var_real_'
arw2arl.f:(.text+0x6f66): undefined reference to `nf_close_'
arw2arl.f:(.text+0xa6ff): undefined reference to `nf_strerror_'
arw2arl.f:(.text+0xb600): undefined reference to `nf_strerror_'
However, the correct solution to this error is by commenting out

Code: Select all

LINKS = -L$(NETLIB) -lnetcdf  -L../../library -lhysplit
for

Code: Select all

 LINKS = -L$(NETLIB) -lnetcdff -L../../library -lhysplit
since I have netCDF4 (as outlined in the readme)

and putting -I causes this error:

Code: Select all

/usr/bin/ld: cannot find -lhysplit
gfortran 4.8.4, netCDF 4 library

silly me, thanks for your time.
Post Reply

Return to “Users”