Error in compile

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
pwd1
Posts: 10
Joined: Thu Feb 18, 2010 9:50 pm
Location: PWD, Philadelphia

Error in compile

#1 Unread post by pwd1 »

Below is the last several lines that report errors in my compile process. I am installing in Ubuntu Linux 9.10 with ifort.
The file upwelling.h is in the directory that is being called out.
Your help would be appreciated. Attached are my build.bash and Linux-ifort.mk files.

***************************************

In file included from ROMS/Nonlinear/bbl.F:2:
ROMS/Include/cppdefs.h:749: error: /usr/temp/ROMS/Bin/upwelling.h: No such file or directory
In file included from ROMS/Nonlinear/bc_2d.F:2:
ROMS/Include/cppdefs.h:749: error: /usr/temp/ROMS/Bin/upwelling.h: No such file or directoryIn file included from ROMS/Nonlinear/exchange_2d.F:2
:
ROMS/Include/cppdefs.h:749: error: /usr/temp/ROMS/Bin/upwelling.h: No such file or directory
In file included from ROMS/Modules/mod_param.F:2:
ROMS/Include/cppdefs.h:749: error: /usr/temp/ROMS/Bin/upwelling.h: No such file or directory
make: *** [/usr/temp/ROMS/Bin/Build/bbl.f90] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/usr/temp/ROMS/Bin/Build/bc_2d.f90] Error 1
make: *** [/usr/temp/ROMS/Bin/Build/exchange_2d.f90] Error 1
make: *** [/usr/temp/ROMS/Bin/Build/mod_param.f90] Error 1
Attachments
build.bash
(15.03 KiB) Downloaded 426 times
Linux-ifort.mk
(4.93 KiB) Downloaded 421 times

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error in compile

#2 Unread post by kate »

ROMS/Include/cppdefs.h:749: error: /usr/temp/ROMS/Bin/upwelling.h: No such file or directory
The question should be "why is it looking for upwelling.h in that directory?". Was it there and then moved? Can you "make clean" then try again?

pwd1
Posts: 10
Joined: Thu Feb 18, 2010 9:50 pm
Location: PWD, Philadelphia

Re: Error in compile

#3 Unread post by pwd1 »

Maybe I chose an unfortunate name for the Source Code directory: /usr/temp. I used snv to check out the code there, but didn't know how to move them afterward.

I will try "make clean" also.

-Thanks

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error in compile

#4 Unread post by kate »

Actually, upwelling.h is usually in the ROMS/Include directory. It looks like the distributed build.bash comes with:

Code: Select all

 export     MY_HEADER_DIR=${MY_PROJECT_DIR}

 export MY_ANALYTICAL_DIR=${MY_PROJECT_DIR}

# Put the binary to execute in the following directory.

 export            BINDIR=${MY_PROJECT_DIR}
and

Code: Select all

 export     MY_PROJECT_DIR=${PWD}
These are not the defaults I would have picked. Come to think of it, I kind of gave up on the build scripts after an experience like this.

pwd1
Posts: 10
Joined: Thu Feb 18, 2010 9:50 pm
Location: PWD, Philadelphia

Re: Error in compile

#5 Unread post by pwd1 »

Thanks for the guidance. I am a newbie to ROMS and fortran compiling, so I believe a lot of my problems were path related.

I am also new to Ubuntu and am learning that the "make clean" command doesn't appear to work. I found references to this by Googling and there appears to be an equivalent command that is run from the make-kpkg kernel-package. Not sure about this though.

After correcting several path problems in build.bash I believe I am getting stuck on the ifort section and the path required. This section looks like this on my computer.

export USE_MPI=on
export USE_MPIF90=on
export FORT=ifort

#export USE_OpenMP=on

export USE_DEBUG=on
export USE_LARGE=on
#export USE_NETCDF4=on

if [ -n "${USE_MPIF90:+1}" ]; then
case "$FORT" in
ifort )
# export PATH=/opt/intelsoft/mpich/bin:$PATH
export PATH=/opt/intel/Compiler/11.1/069/bin/intel64:$PATH
# export PATH=/opt/intelsoft/openmpi/bin:$PATH

The last lines of my compile are below. --Thanks

cd /usr/temp/ROMS/Bin/Build; -c -heap-arrays -fp-model precise -g -check uninit -ftrapuv -traceback mod_kinds.f90
/bin/sh: -c: not found
make: *** [/usr/temp/ROMS/Bin/Build/mod_kinds.o] Error 127
make: *** Waiting for unfinished jobs....
ROMS/Bin/cpp_clean /usr/temp/ROMS/Bin/Build/master.f90

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error in compile

#6 Unread post by kate »

In the makefile, there is this line:

Code: Select all

        cd $$(SCRATCH_DIR); $$(FC) -c $$(FFLAGS) $(notdir $2)
Your FC is blank, even though FORT is set. In Compilers/Linux-ifort.mk, I have:

Code: Select all

              FC := ifort
then

Code: Select all

ifdef USE_MPI
         CPPFLAGS += -DMPI
 ifdef USE_MPIF90
               FC := mpif90
 else
             LIBS += -lfmpi-pgi -lmpi-pgi
 endif
endif
then

Code: Select all

                FC := $(shell which ${FC})
You can type "make -n -p | grep FC" and I'm sure this line will be blank for you:

Code: Select all

FC := /usr/local/pkg/pgi/pgi-9.0.4/linux86-64/9.0-4/bin/pgf90
What do you get from "which ifort" or "which mpif90"?

pwd1
Posts: 10
Joined: Thu Feb 18, 2010 9:50 pm
Location: PWD, Philadelphia

Re: Error in compile

#7 Unread post by pwd1 »

Thanks for explaining the logic of the Linux-ifort.mk code. My file does have the same lines.

After typing "make -n -p | grep FC" in terminal I get this:

root@Phil:~# make -n -p | grep FC
make: *** No targets specified and no makefile found. Stop.
PREPROCESS.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F
LINK.r = $(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)
COMPILE.f = $(FC) $(FFLAGS) $(TARGET_ARCH) -c
COMPILE.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
PREPROCESS.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F
FC = f77
F77 = $(FC)
COMPILE.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c
LINK.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
LINK.f = $(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error in compile

#8 Unread post by kate »

OK, well I typed it from the top directory containing the makefile.
What do you get from "which ifort" or "which mpif90"?

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Error in compile

#9 Unread post by arango »

Mostly everybody uses the build scripts. I use them all te time. It is the best way to compile ROMS without a need to change the distributed makefile. The makefile is very complicated and it is easy to intruduce mistakes. This is the first time that I heard problems in the build script. Of course that you need to customize this script for a particular application, computer, and compiler. There is a lot of instructions about this in :arrow: WikiROMS.

pwd1
Posts: 10
Joined: Thu Feb 18, 2010 9:50 pm
Location: PWD, Philadelphia

Re: Error in compile

#10 Unread post by pwd1 »

OK, different but the same:

root@Phil:/usr/temp# make -n -p | grep FC
makefile:235: INCLUDING FILE /home/phil/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cp: cannot stat `/opt/pgisoft/netcdf/include/netcdf.mod': No such file or directory
make: *** No rule to make target `Build/MakeDepend', needed by `all'. Stop.
PREPROCESS.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F
LINK.r = $(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)
COMPILE.f = $(FC) $(FFLAGS) $(TARGET_ARCH) -c
COMPILE.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
PREPROCESS.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F
cd $$(SCRATCH_DIR); $$(FC) -c $$(FFLAGS) $(notdir $2)
FC :=
F77 = $(FC)
COMPILE.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c
LINK.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
LINK.f = $(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)
cd $(SCRATCH_DIR); $(FC) -c $(FFLAGS) $(notdir $<)
cd $(SCRATCH_DIR); $(FC) -c $(FFLAGS) mod_param.f90
cd $(SCRATCH_DIR); $(FC) -c $(FFLAGS) def_gst.f90
...

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error in compile

#11 Unread post by kate »

FC :=
Here is your problem. It is the result of the "which" test as above. Do you have mpif90 on your system? Ifort? Have you tried to compile in serial first?

pwd1
Posts: 10
Joined: Thu Feb 18, 2010 9:50 pm
Location: PWD, Philadelphia

Re: Error in compile

#12 Unread post by pwd1 »

I thought I was getting closer to resolution by going through the ifort installation again. It seems that I didn't have RPM installed before the first installation. After uninstalling/reinstalling and verifying that the problematic [for Ubuntu] libstdc++5 was installed properly, I tried to verify a test compilation. It appeared successful when I typed "./ifort /path/test.f90" and got the expected a.out file. Strangely, when I type ifort alone, I get the error "command not found".

But when I tried your test command, it still failed with "FC: " blank as shown below.

root@Phil:/usr/temp# make -n -p | grep FC
makefile:235: INCLUDING FILE /home/phil/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cp: cannot stat `/opt/pgisoft/netcdf/include/netcdf.mod': No such file or directory
make: *** No rule to make target `Build/MakeDepend', needed by `all'. Stop.
PREPROCESS.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F
LINK.r = $(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)
COMPILE.f = $(FC) $(FFLAGS) $(TARGET_ARCH) -c
COMPILE.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
PREPROCESS.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F
cd $$(SCRATCH_DIR); $$(FC) -c $$(FFLAGS) $(notdir $2)
FC :=
F77 = $(FC)
COMPILE.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c
LINK.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
LINK.f = $(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)
cd $(SCRATCH_DIR); $(FC) -c $(FFLAGS) $(notdir $<)
cd $(SCRATCH_DIR); $(FC) -c $(FFLAGS) mod_param.f90

My attempt to compile ROMS in serial also failed.

I also did a "make clean" before this.

Any suggestions would be greatly appreciated.

Thanks!

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error in compile

#13 Unread post by kate »

cp: cannot stat `/opt/pgisoft/netcdf/include/netcdf.mod': No such file or directory
make: *** No rule to make target `Build/MakeDepend', needed by `all'. Stop.
These are also problems. Thing you need to do:

1. Check the wiki for dependencies: https://www.myroms.org/wiki/index.php/Getting_Started
2. Dependencies include a working f90 compiler and the netcdf library compiled with it - generating the netcdf.mod file. Check https://www.myroms.org/wiki/index.php/ROMS_UNSW2008 too.
3. Get that compiler onto your unix path. See http://www.arsc.edu/~kate/ROMS/Slides/Intro_UNIX.ppt for some tips.

fereshteh
Posts: 79
Joined: Sun Dec 30, 2012 2:58 pm
Location: inio:Iranian National Institute for Oceanography

Re: Error in compile

#14 Unread post by fereshteh »

Hi dear
after having problem with netcdf4.0 which does not have nc-config i decide to use netcdf4.21.1. I have install it in this way:

1-
Cd /home/fkomijani/zlib 1.2.7
./configure --prefix=/home/fkomijani/NETCD4.2.1.1
make check install
2-
cd /home/fkomijani/HDF5 1.8.9
./configure --with-zlib=/home/fkomijani/NETCD4.2.1.1 --prefix=//home/fkomijani/NETCD4.2.1.1
make check install

3-
cd /home/fkomijani/netcdf4.2.1.1
CPPFLAGS=-Ihome/fkomijani/NETCD4.2.1.1/ include LDFLAGS=L/home/fkomijani/NETCD4.2.1.1 /lib ./configure --prefix=/home/fkomijani/NETCD4.2.1.1
make check install

and then add PATH=/home/fkomijani/NETCD4.2.1.1/bin:$PATH; export PATH” to .bashrc file

and then modify build.bash as below:
export FORT=gfortran
USE_MY_LIBS=on
export NC_CONFIG=/home/fkomijani/NETCD4.2.1.1/bin/nc-config
export NETCDF_INCDIR=/home/fkomijani/NETCD4.2.1.1/include
but after running this error appear:
rm -f -r core *.ipo /home/fkomijani/projects/upwelling6/Build /home/fkomijani/make_macros.mk
makefile:238: INCLUDING FILE /home/fkomijani/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cp -f /home/fkomijani/NETCD4.2.1.1/include/netcdf.mod /home/fkomijani/projects/upwelling6/Build
cp: cannot stat `/home/fkomijani/NETCD4.2.1.1/include/netcdf.mod': No such file or directory
make: *** No rule to make target `/home/fkomijani/projects/upwelling6/Build/netcdf.mod', needed by `/home/fkomijani/projects/upwelling6/Build/MakeDepend'. Stop.


I have checked NETCD4.2.1.1/include directory, there are some H5...h files and netcdf.h ,hdf5.h files and it has not netcdf.mod.
what do i do now?
And please tell me that my way to install netcdf4.2.1.1 is correct or not?
Please help me to solve this problem with roms error?
Thanks in advance
fershte

ymamoutos
Posts: 71
Joined: Fri Nov 19, 2010 2:33 pm
Location: University of Aegean

Re: Error in compile

#15 Unread post by ymamoutos »

fereshteh,

perhaps you have download and build only the
C libraries of netcdf. Check here
http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
and you will see that if you want to use the latest version of the
netcdf library you must download two zip files. The first contains the
C language libraries and the second contains the fortran libs. Also
i remember that when i compiled the hdf libraries for my pc, to
enable netcdf4/hdf5 support for netcdf lib i used the --enable-hl
flag. Good luck

Giannis

fereshteh
Posts: 79
Joined: Sun Dec 30, 2012 2:58 pm
Location: inio:Iranian National Institute for Oceanography

Re: Error in compile

#16 Unread post by fereshteh »

hi dear
i am really really appreciate for your reply
finally my problem soleved by downloading and installing netcdf4.2-fortran lib, and ocean.G is built. :D :D
But please tell me how and where you add --enable-hl flag? is this falg necessary for parallel I/O?
thanks again
sincerely yours
fereshte

Post Reply