ROMS 3.0 make problems

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

ROMS 3.0 make problems

#1 Unread post by m.hadfield »

In her latest post on the "ROMS Tips" forum, topic gmake

viewtopic.php?t=183

Kate says
I'm going ahead with this change for my code, though it may cause trouble for some
Er, yes :roll:

The ROMS build make system was restructured in the way described by Kate for the 3.0 release and as a result I can't run the current ROMS on the NIWA Cray T3E any more.

The T3E has Gnu make version 3.79.1 as part of its "open software" module. My attempts to build 3.80 and 3.81 have been unsuccessful. (The executable is built OK but fails pretty much every test in "make check" and is generally non-functional.) I'm not optimistic about overcoming these problems.

Unfortunately Gmake 3.79.1 doesn't work with the latest ROMS make files. First, there's some code in makefile specifically designed to stop it

Code: Select all

NEED_VERSION := 3.80 3.81
$(if $(filter $(MAKE_VERSION),$(NEED_VERSION)),,        \
 $(error This makefile requires one of GNU make version $(NEED_VERSION).))
but once I bypass that it still fails very early on. I'm pretty sure it's related to the use of the eval function in the Module.mk files, as this function is not mentioned in the 3.79.1 documentation. For example here is the latest version (SVN revision 29) of ROMS/Nonlinear/Module.mk:

Code: Select all

# svn $Id: Module.mk 29 2007-04-23 19:23:26Z arango $
#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
# Copyright (c) 2002-2007 The ROMS/TOMS Group             Kate Hedstrom :::
#   Licensed under a MIT/X style license                                :::
#   See License_ROMS.txt                                                :::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

local_sub  := ROMS/Nonlinear

local_lib  := libNLM.a
local_src  := $(wildcard $(local_sub)/*.F)

$(eval $(call make-library,$(local_lib),$(local_src)))

$(eval $(compile-rules))
and here is the corresponding file released with ROMS 2.3 ( SVN revision 8 )

Code: Select all

# svn $Id: Module.mk 8 2007-02-06 19:00:29Z arango $
#::::::::::::::::::::::::::::::::::::::::::::::::::::: Hernan G. Arango :::
# Copyright (c) 2002-2007 The ROMS/TOMS Group             Kate Hedstrom :::
#   Licensed under a MIT/X style license                                :::
#   See License_ROMS.txt                                                :::
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

local_sub  := ROMS/Nonlinear

local_lib  := libNLM.a
local_src  := $(wildcard $(local_sub)/*.F)
path_srcs  += $(local_src)

local_src  := $(patsubst $(local_sub)/%.F,%.F,$(local_src))
local_objs := $(subst .F,.o,$(local_src))

libraries += $(local_lib)
sources   += $(local_src)

$(local_lib): $(local_objs)
	$(AR) $(ARFLAGS) $@ $^
	$(RANLIB) $@
The former is shorter and cleaner, but it doesn't work with Gmake 3.79.1; the latter does.

By the way, SVN version 27 was fine.

As I recall a very similar issue arose a couple of years ago and was addressed by modifying the code in the Module.mk files. Could this be done again? Would a simple reversion to the older files work, or is their something about the new build structure that prevents that?

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

#2 Unread post by kate »

I knew this was going to happen...

There is nothing preventing you from going to the old style Module.mk and makefile. It should work as it always did, putting all the cruft in the top level directory. You should also be able to change things around so that it puts the stuff in Build if you invoke "make" from Build. What we have now has the makefile in the top directory and it puts most everything under Build.

I don't know a way to do this last with older makes, though they used to do it. I remember typing "make bootstrap" to build gcc once into stage1, using that gcc to build in stage2, etc. I never studied that Makefile, though. Actually, that Makefile was made by autoconf, which I have given up on for use with Fortran (see here and here if you care to see my struggles with it).

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

#3 Unread post by m.hadfield »

Thanks for the response, Kate. :)

I have looked further into getting a functional make 3.81 on the T3E. It may be just a matter of carrying over a small set of source patches from the earlier version. The problem at the moment is something to do with return codes from subshells being misinterpreted, so it may not be too hard to fix.

If that doesn't work I'll graft the old make files onto the new source tree.

I agree that building in a Build subdirectory is nice. I think it's only worth trying alternative methods to achieve this if there are other people who can't upgrade make to 3.81.

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

#4 Unread post by m.hadfield »

You'll all be pleased to know that Gnu make 3.81 is now installed on the NIWA Cray T3E and I can build the current version of ROMS.

This is thanks to the efforts of our sysadmin Chris Edsall, who had to back out some changes in external process control that were introduced into Gnu make between versions 3.79.1 and 3.80.

Three cheers for Chris :D :D :D

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

#5 Unread post by kate »

Hip, hip, hooray!

nageswararao

#6 Unread post by nageswararao »

Dear m.hadfield,
Can u please tell where did u downloaded the GNU make 3.81 version and also how to install it for RHEL-3 with 64-bit AMD opteron processors since I am also in the same problem.

Thanks in advance.

With regards,
G.NageswaraRao.

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

#7 Unread post by m.hadfield »

You can get the Gnu Make 3.81 source here

ftp://ftp.gnu.org/gnu/make/make-3.81.tar.gz

and build it according to the instructions in the INSTALL file.

Doubtless there are binary packages of Make around for RHEL-3, but I don't know where.

nageswararao

#8 Unread post by nageswararao »

Thank u m.hadfield for providing me the link.
I will come back to u after installing it.

With best regards,
G.NageswaraRao.

nageswararao

#9 Unread post by nageswararao »

I downloaded the Gnu Make 3.81 version and when I am trying to install it, I got the following error:
configure:2185: error: C compiler cannot create executables
I am not getting what does it mean.
when I tried to run ./configure, the following log file was created
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU make configure 3.81, which was
generated by GNU Autoconf 2.59. Invocation command line was

$ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = darpan.npol.org
uname -m = x86_64
uname -r = 2.4.21-20.ELsmp
uname -s = Linux
uname -v = #1 SMP Sat Sep 18 18:28:16 PDT 2004

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/jdk1.5.0_04/bin
PATH: /shared/Matlab2006b/bin
PATH: /shared/nagesh/gfortran/gcc-4.2/bin
PATH: /usr/local/jdk1.5.0_04/bin
PATH: /usr/kerberos/sbin
PATH: /usr/kerberos/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/X11R6/bin
PATH: /opt/c3-4/
PATH: /opt/ganglia/bin
PATH: /opt/maui/bin
PATH: /opt/torque/bin
PATH: /opt/torque/sbin
PATH: /opt/rocks/bin
PATH: /opt/rocks/sbin
PATH: /shared/netcdf/bin
PATH: /shared/FortranCompiler/intel_fc_80/bin
PATH: /root/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1385: checking for a BSD-compatible install
configure:1440: result: /usr/bin/install -c
configure:1451: checking whether build environment is sane
configure:1494: result: yes
configure:1559: checking for gawk
configure:1575: found /bin/gawk
configure:1585: result: gawk
configure:1595: checking whether make sets $(MAKE)
configure:1615: result: yes
configure:1831: checking for gcc
configure:1847: found /shared/nagesh/gfortran/gcc-4.2/bin/gcc
configure:1857: result: gcc
configure:2101: checking for C compiler version
configure:2104: gcc --version </dev>&5
gcc (GCC) 4.2.4 20080220 (prerelease)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2107: $? = 0
configure:2109: gcc -v </dev>&5
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /projects/tob/gcc-4_2-branch/configure --enable-languages=c,fortran --prefix=/projects/tob/gcc-4.2
Thread model: posix
gcc version 4.2.4 20080220 (prerelease)
configure:2112: $? = 0
configure:2114: gcc -V </dev>&5
gcc: '-V' option must have argument
configure:2117: $? = 1
configure:2140: checking for C compiler default output file name
configure:2143: gcc conftest.c >&5
/usr/bin/ld: unrecognized option '--as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
configure:2146: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "GNU make"
| #define PACKAGE_TARNAME "make"
| #define PACKAGE_VERSION "3.81"
| #define PACKAGE_STRING "GNU make 3.81"
| #define PACKAGE_BUGREPORT "bug-make@gnu.org"
| #define PACKAGE "make"
| #define VERSION "3.81"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2185: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /shared/nagesh/gmake_3.81/make-3.81/config/missing --run aclocal-1.9'
ALLOCA=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /shared/nagesh/gmake_3.81/make-3.81/config/missing --run tar'
ANSI2KNR=''
AR=''
AUTOCONF='${SHELL} /shared/nagesh/gmake_3.81/make-3.81/config/missing --run autoconf'
AUTOHEADER='${SHELL} /shared/nagesh/gmake_3.81/make-3.81/config/missing --run autoheader'
AUTOMAKE='${SHELL} /shared/nagesh/gmake_3.81/make-3.81/config/missing --run automake-1.9'
AWK='gawk'
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GETLOADAVG_LIBS=''
GLOBINC=''
GLOBLIB=''
GMSGFMT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
INTLLIBS=''
KMEM_GROUP=''
LDFLAGS=''
LIBICONV=''
LIBINTL=''
LIBOBJS=''
LIBS=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /shared/nagesh/gmake_3.81/make-3.81/config/missing --run makeinfo'
MAKE_HOST=''
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
NEED_SETGID=''
OBJEXT=''
PACKAGE='make'
PACKAGE_BUGREPORT='bug-make@gnu.org'
PACKAGE_NAME='GNU make'
PACKAGE_STRING='GNU make 3.81'
PACKAGE_TARNAME='make'
PACKAGE_VERSION='3.81'
PATH_SEPARATOR=':'
PERL=''
POSUB=''
RANLIB=''
REMOTE=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
U=''
USE_CUSTOMS_FALSE=''
USE_CUSTOMS_TRUE=''
USE_LOCAL_GLOB_FALSE=''
USE_LOCAL_GLOB_TRUE=''
USE_NLS=''
VERSION='3.81'
WINDOWSENV_FALSE=''
WINDOWSENV_TRUE=''
XGETTEXT=''
ac_ct_CC='gcc'
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${prefix}/share'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/shared/nagesh/gmake_3.81/make-3.81/config/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ------------- ##
## Output files. ##
## ------------- ##

MAINT_MAKEFILE=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "make"
#define PACKAGE_BUGREPORT "bug-make@gnu.org"
#define PACKAGE_NAME "GNU make"
#define PACKAGE_STRING "GNU make 3.81"
#define PACKAGE_TARNAME "make"
#define PACKAGE_VERSION "3.81"
#define VERSION "3.81"

configure: exit 77

Can anybody help me in this context.
Thanks in advance.

With best regards,
G.NageswaraRao.

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

#10 Unread post by robertson »

The problem is with you linker (ld). Use google to search for "ld unrecognized option as-needed" for possible causes and solutions.

Good luck

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

#11 Unread post by kate »

It's wanting to use gcc as a C compiler. Are you sure you have it installed correctly? Have you tried it on a toy C program?

nageswararao

#12 Unread post by nageswararao »

I got solution. I had installed gfortran in my system and this path conflicting the default gcc compiler path. So when I gave the default gcc path then it ran well and I could install the gmake-3.81 version. Thanks one and all for giving their valuable suggestions.

With best regards,
G.NageswaraRao.

Post Reply