Failure to Compile HYSPLIT LINUX on Cheyenne

Post any questions or comments regarding the LINUX version of HYSPLIT. This includes the model execution, GUIs, results, or graphics. Be sure to mention the version of LINUX you are using.
Post Reply
hurricanemolina
Posts: 9
Joined: June 6th, 2017, 6:04 pm
Registered HYSPLIT User: Yes

Failure to Compile HYSPLIT LINUX on Cheyenne

Post by hurricanemolina »

Hello,

I came across an issue that I cannot resolve in compiling HYSPLIT LINUX on NCAR's Cheyenne supercomputer. I was able to successfully compile a few days ago using intel/17.0.1 and the tests ran successfully. However, I was getting a
configure: error: linking to Fortran libraries from C fails
and wanted to test compiling with gnu/6.3.0, which did not fix that issue and I couldn't compile. Then decided to go back to intel/17.0.1, but have not succeeded in recompiling and now get an error very early on in the process (fcsubs), where the Makefile is not created in the /library/fcsubs directory, leading to a very early compile crash:
make: *** No rule to make target 'install'. Stop.
I deleted my previous hysplit download and redownloaded today and tried recompiling several times.

I am really confused by this because this was not an issue previously. I have attached my compile.log and config.log.

CLIB is commented out in my /trunk/exec/Makefile (# CLIB=-lfcsubs). Should it be commented out elsewhere?

What could this early compile error be related to?

This is the piece of code from ./compile.sh where the error is output:

Code: Select all

if [ "$cmd" = "all" ]; then
cd ${DIR}/library/fcsubs
   echo "Building fcsubs library"
   echo ***${PWD}   1>>${LOG} 2>>${LOG}
   rm -f *.a
   rm -f *.o
   chmod u+x configure
## ./configure CC=ncepcc --enable-aix-64 1>>${LOG} 2>>${LOG}
   ./configure      1>>${LOG} 2>>${LOG}
   make LIBA=libfcsubs.a libdir=$DIR/library install  \
                    1>>${LOG} 2>>${LOG}
   if [ $? -ne 0 ];then echo "ERROR";exit;fi
fi
Attachments
config.log.pdf
config log from /hysplit/trunk/library/fcsubs
(47.44 KiB) Downloaded 359 times
compile.log.pdf
compile log from /hysplit/trunk
(20.46 KiB) Downloaded 342 times
sonny.zinn
Posts: 354
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by sonny.zinn »

I was able to build HYSPLIT on LINUX after pulling the latest source code (svn revision 1010) and executing the compile.sh script inside the trunk directory. Executable files were created in the trunk/exec directory. GCC and GFORTRAN 4.8.5 were used on RHEL 7.

I presume that you were trying to build HYSPLIT from the same revision. Could you confirm this is the case?
hurricanemolina
Posts: 9
Joined: June 6th, 2017, 6:04 pm
Registered HYSPLIT User: Yes

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by hurricanemolina »

Correct. I executed my compile.sh script in my trunk directory. Here are my version.txt contents:
Last Changed Rev: 1010
Last Changed Date: 2019-05-21 10:00:54 -0600 (Tue, 21 May 2019)
I am using intel/17.0.1 (the default compiler on Cheyenne) and when I type which gcc I see /gpfs/u/apps/ch/opt/ncarcompilers/0.4.1/mpi/gcc.

I have gone ahead and typed a detailed description of all the changes I have made to files (e.g., CFLAGS, FC) and attached it here.

Is there a 'clean' script somewhere to retry compiling from scratch?
Attachments
step-by-step_hysplit.pdf
(23.02 KiB) Downloaded 428 times
sonny.zinn
Posts: 354
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by sonny.zinn »

Thank you for the detailed description of the steps you took. It helped me to see where the errors were coming from.

After making two additional changes, I was able to compile HYSPLIT using Intel compilers, ICC and IFORT 17.0.4.

1) compile.sh, line 105: specify options to use Intel compilers so that it would read

./configure F77=ifort CC=icc 1>>${LOG} 2>>${LOG}

This should resolve the link error with the FCSUBS library.

2) data2arl/narr2arl/Makefile: change the values of FC and CFLAGS to ifort and $(INTL), respectively, as were done elsewhere.

Please give it another try.
hurricanemolina
Posts: 9
Joined: June 6th, 2017, 6:04 pm
Registered HYSPLIT User: Yes

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by hurricanemolina »

Thank you for your detailed response.

Unfortunately, I was unable to compile HYSPLIT using the INTEL compiler following the steps you suggested. I do not have IFORT 17.0.4 available to me - we have ICC/IFORT version 17.0.1 (20161005) installed on Cheyenne. I am not sure if there are version differences? However, I am unclear about your second suggestion - I did not see CC specified in data2arl/narr2arl/Makefile or any of the other Makefile scripts. I only see CFLAGS = $(INTL) and FC = ifort. Should FC = icc instead of ifort? I left CFLAGS and FC unchanged ($(INTL), ifort), and added CC = icc. Upon applying these changes and recompiling, I still received a similar error. Compile.log in the trunk folder shows:
Build date: Thu May 30 14:22:43 MDT 2019
========================================
***/glade/u/home/molina/hysplit/trunk/library/fcsubs
checking for Fortran 77 compiler default output... a.out
checking whether the Fortran 77 compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU Fortran 77 compiler... no
checking whether ifort accepts -g... yes
checking how to get verbose linking output from ifort... -v
checking for Fortran 77 libraries... -L/glade/u/apps/opt/intel/2017u1/compilers_and_libraries/linux/lib/intel64_lin -L/glade/u/apps/ch/os/usr/lib64 -L/glade/u/apps/ch/os/lib64 -L/glade/u/apps/ch/os/usr/lib -L/glade/u/apps/ch/opt/netcdf/4.6.1/intel/17.0.1/lib -L/glade/u/apps/ch/os/lib -lnetcdff -lnetcdf -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lsz -lz -lm -ldl -lrt -ldl" -L/glade/u/apps/ch/opt/mpt/2.19/opt/hpe/hpc/mpt/mpt-2.19/lib -L/gpfs/u/apps/opt/intel/2017u1/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin -L/usr/lib64/gcc/x86_64-suse-linux/4.8/ -L/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/glade/u/apps/ch/opt/mpt/2.19/opt/hpe/hpc/mpt/mpt-2.19/lib/ -L/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib/ -L/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib -limf -lifport -lifcoremt -lsvml -lipgo -lirc -lpthread -lgcc_s -lirc_s
checking for gcc... icc
checking whether we are using the GNU C compiler... yes
checking whether icc accepts -g... yes
checking for icc option to accept ANSI C... none needed
checking for dummy main to link with Fortran 77 libraries... unknown
configure: error: linking to Fortran libraries from C fails
make: *** No rule to make target 'install'. Stop.
Why does it say we are using the GNU C compiler — is that correct for intel?

There is now a {LOG} file in the FCSUBS folder, which I did not see before. Its contents show:
configure: WARNING: you should use --build, --host, --target
configure: error: linking to Fortran libraries from C fails
Errors in the config.log file in the FCSUBS folder reveal a number of errors associated with conftest and confdefs files, such as:
conftest.F(3): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: => = . [ % ( :
choke me
^
compilation aborted for conftest.F (code 1)
configure:1466: $? = 1
configure: failed program was:
program main
#ifndef __GNUC__
choke me
#endif
configure:2395: icc -c -g -O2 conftest.c >&5
conftest.c(2): error: identifier "choke" is undefined
choke me
^

conftest.c(3): error: expected a ";"
I have attached the complete config.log (from FCSUBS) for your reference.

I decided to try compiling with GNU again given the comment in the compile.log file and applied the line ./configure F77=gfortran CC=gcc 1>>${LOG} 2>>${LOG} to the compile.sh file and added CFLAGS = $(GFOR), FC = gfortran, and CC = gcc to all relevant Makefiles. This worked. I attached a step-by-step set of instructions. Why did this work with GNU but not INTEL?

In regards to compiling with MPI, I have a question regarding the steps provided in the online instructions (https://ready.arl.noaa.gov/documents/Tu ... _unix.html). The instructions say to remove the comma from the two -DENS -DMPI lines, but I only see one line with those two variables. Is it referring to these two lines:

Code: Select all

hycm_ens : $(SRC)/hymodelc.F
        $(MPI) -o $@ $(PREP)-DENS, -DMPI $(CFLAGS) $(SRC)/hymodelc.F $(MLIB) -L$(LIB) -lhysplit
hycm_cb4 : $(SRC)/hymodelc.F
        $(MPI) -o $@ $(PREP)-DCB4, -DMPI $(CFLAGS) $(SRC)/hymodelc.F $(MLIB) -L$(LIB) -lhysplit
Also, should I be removing this comma only if I am compiling with PGF90? Or does this apply for both GNU and INTEL?
Attachments
steps_taken_tocompile.pdf
successful compile with GNU/6.3.0
(27.06 KiB) Downloaded 379 times
config.log.pdf
errors trying to compile with IFORT/7.0.1
(47.24 KiB) Downloaded 372 times
sonny.zinn
Posts: 354
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by sonny.zinn »

Oops! There were a couple of typographical errors in my earlier post. Sorry about them! They were corrected and the post should be good now.

The corrections are:

1) compile.sh, line 105: my previous post read ./configure F77=ifort CC=icc 1 >>${LOG} 2>>{LOG}.
1.A) There should have been no space between 1 and >>.
1.B) What appeared after 2>> should have had a $ sign.
Because of these two, the ./configure command did not work and an unintended file, named {LOG}, appeared. In summary, it should have been

./configure F77=ifort CC=icc 1>>${LOG} 2>>${LOG}

2) You are correct that the data2arl/narr2arl/Makefile does not have the CC variable. As you suggested, FC=ifort is correct. My copy of Makefile contains:

CFLAGS = $(INTL)
FC = ifort

Although I used Intel compilers 17.0.4 which are different from yours 17.0.1, it should not be a problem because they are different on a patch level.

You have questions about the MPI options but let's come back to them after 1) and 2) are resolved.
hurricanemolina
Posts: 9
Joined: June 6th, 2017, 6:04 pm
Registered HYSPLIT User: Yes

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by hurricanemolina »

Thank you for clarifying. I re-compiled HYSPLIT using the IFORT/ICC compilers with typos corrected and was able to generate the executables. However, the compiling process was very very slow during the FCSUBS portion (~1-hour?). The compile also crashed at this stage:
Building fcsubs library
Building hysplit source library
Building lbfgsb source library
Building exec directory programs
ERROR
Here is some output from compile.log, which still shows a positive check for GNU C compiler (below in bold). I don't know what that means.
checking for Fortran 77 compiler default output... a.out
checking whether the Fortran 77 compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU Fortran 77 compiler... no
checking whether ifort accepts -g... yes
checking how to get verbose linking output from ifort... -v
...
checking for gcc... icc
checking whether we are using the GNU C compiler... yes
checking whether icc accepts -g... yes
checking for icc option to accept ANSI C... none needed
checking for dummy main to link with Fortran 77 libraries... unknown
configure: error: linking to Fortran libraries from C fails
gcc -O -g -O2 -c -o fcsubs.o fcsubs.c
gcc -O -g -O2 -c -o swapobj.o swapobj.c
ar r libfcsubs.a fcsubs.o swapobj.o
ar: creating libfcsubs.a
ranlib libfcsubs.a
This is the end of the compile.log, where the crash happens.
timer.f:(.text+0x2a): undefined reference to `_gfortran_cpu_time_4'
Makefile:639: recipe for target 'lbfgsb' failed
make: *** [lbfgsb] Error 1
Meanwhile, I recompiled using GNU (with the steps in the earlier provided PDF doc), and the process was very fast (couple minutes for the entire compile). The GNU compile does not crash until nearly the end, which I believe is expected because I do not have IOAPI specified:
Building fcsubs library
Building hysplit source library
Building lbfgsb source library
Building exec directory programs
Building the ascii2shp converter
Building the dbf editor
Building the NARR decoder
Building the WRF-ARW decoder (requires export NetCDF lib/include)
Building the CMAQ converters (requires NetCDF & IOAPI)
ln: failed to create symbolic link ‘hysplit4.tcl’: File exists
I am going to go ahead and stick with GNU, unless you have an idea as to what is causing the slow compile with IFORT and buggy behavior.

Moving forward, do you have an answer for the MPI compile questions? :)
In regards to compiling with MPI, I have a question regarding the steps provided in the online instructions (https://ready.arl.noaa.gov/documents/Tu ... _unix.html). The instructions say to remove the comma from the two -DENS -DMPI lines, but I only see one line with those two variables. Is it referring to these two lines:

Code: Select all

hycm_ens : $(SRC)/hymodelc.F
        $(MPI) -o $@ $(PREP)-DENS, -DMPI $(CFLAGS) $(SRC)/hymodelc.F $(MLIB) -L$(LIB) -lhysplit
hycm_cb4 : $(SRC)/hymodelc.F
        $(MPI) -o $@ $(PREP)-DCB4, -DMPI $(CFLAGS) $(SRC)/hymodelc.F $(MLIB) -L$(LIB) -lhysplit
Also, should I be removing this comma only if I am compiling with PGF90? Or does this apply for both GNU and INTEL?
christopher.loughner
Posts: 81
Joined: August 15th, 2017, 3:59 pm
Registered HYSPLIT User: No

Re: Failure to Compile HYSPLIT LINUX on Cheyenne

Post by christopher.loughner »

Hi,

See the Readme in the fcsubs directory for help in compiling it with something other than the gnu compiler. Note that this library is only used for converting some GRIB meteorological datasets / model output if using the C version of the fcsubs libarary, so you may not need it.

For compiling with MPI:

1) yes, remove the comma in these two lines in the Makefile in the exec directory:

hycm_ens : $(SRC)/hymodelc.F
$(MPI) -o $@ $(PREP)-DENS, -DMPI $(CFLAGS) $(SRC)/hymodelc.F $(MLIB) -L$(LIB) -lhysplit
hycm_cb4 : $(SRC)/hymodelc.F
$(MPI) -o $@ $(PREP)-DCB4, -DMPI $(CFLAGS) $(SRC)/hymodelc.F $(MLIB) -L$(LIB) -lhysplit

2) add the following line:

hycm_std hycm_ens hycm_cb4 hytm_std \

somewhere in the all block (lines 137-162) in the Makefile in the exec directory.
Post Reply

Return to “HYSPLIT for LINUX”