[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20021121: Problem Building on Sun



>From: Roy Mendelssohn <address@hidden>
>Organization: NOAA/PMEL
>Keywords: 200211212057.gALKvn422014 netCDF configure

Hi Roy,

Sorry this has taken so long to get to.

>If you want I can send you all the files you request, but it is 
>pretty clear where this is failing.
>
>My environment has FC defined as f77, F90 defined as f90 and CC defined as CC.

Hopefully, CC would be defined to be 'cc' and not 'CC'.  The CC environment
variable is used for specifying the C compiler, and this is usually 'cc',
'c89', or 'gcc'.

>The version is 3.5.0. my env says _INIT_SYS_NAME=SunOS and the 
>version is 5.8. It is a Sun Ultra-80
>
>Where the configure fails is very obvious from the config.log file, 
>it is when it is trying to compile conftest.c  It gives the following 
>error messages:
>
>configure:1933: checking if Fortran "byte" is C "signed char"
>configure:1942: CC -c -DNDEBUG -O conftest.c
>"conftest.c", line 1: Error: value is not defined.
>"conftest.c", line 4: Error: The function "exit" must have a prototype.
>"conftest.c", line 5: Error: "}" expected instead of EOF.

The problem does appear to be the improper specification of the CC
environment variable.  If you are trying to define the C++ compiler,
you should define the CXX environmnet variable.  If you really were
setting the C compiler, you should:

o redefine  CC to 'cc'
o do a 'make distclean'; this will probably not work since you most likely
  have not made it to the point of creating Makefiles yet.  If it does
  fail, manually remove: config, config.cache, and config.status
o rerun configure

>Any help greatly appreciated.
>
>-Roy M.
>
>>From address@hidden Thu Nov 21 17:57:00 2002
>>Subject: Using -DNO_NETCDF_2
>
>I finally got the library to compile on the Sun.

Were you successful after changing your CC definition?

>The Compatibility 
>mentions the NO_NETCDF_2 option, but doesn't make it clear where or 
>how to use it.

The NO_NETCDF_2 flag is a C preprocessor macro that is used to make
sure that only netCDF-3 calls are used in an application.

>I can do the follow.
>
>1. run ./configure without the NO_NETCDF_2 option
>2. run make
>
>  and everything compiles fine

OK.

>Now I assume the -DNO_NETCDF_2 is a CPPFLAG, so I do:
>
>setenv CPPFLAGS "-DNDEBUG -DNO_NETCDF_2"
>
>I then:
>1. run make distclean
>2. rm config.cache
>3  run ./configure
>4 run make
>
>this gets as far as fort-genvar.c where I get a compiler error message
>
>"fort-genvar.c", line 10; undefined symbol MAX_NC_DIMS
>"fort-genvar.c", line 17; undefined symbol MAX_NC_DIMS
>"fort-genvar.c", line 52; undefined symbol MAX_NC_DIMS
>
>the compiler argument is the same except for the -DNO_NETCDF_2.  I am 
>at a loss.

I just replicated your findings for both netCDF 3.5.0 and 3.5.1-beta5.
It looks like there is a bug in that is exposed when specifying the
-DNO_NETCDF_2 flag.  You would do best to not define NO_NETCDF_2
and rebuild the distribution as you have above.

Sorry I couldn't get you past this right now.

Tom Yoksas

>From address@hidden Mon Nov 25 16:53:01 2002

Hi Tom:

You were right about the flags, which after a little fooling around I 
figured out.

As to the NO_NETCDF_2:

If I copy the definition of MAX_NC_DIMS in netcdf.h to also be 
outside the #ifdef, remove the fortv2comp from the build, and don't 
try to build any of the utilities etc, then everything goes as 
desired and actually works.

It took me quite awhile to figure this out.

Thanks for the help.