Problems installing WRFSI on Sun - Repost from old forum

Setting up the SI part of the WRF.

Problems installing WRFSI on Sun - Repost from old forum

Postby malonso » Sun Nov 30, 2008 12:00 am

Hello everyone

This is my very first post on the forum and I am just starting out working with the WRF model so please bear with me. I was able to install the WRF model itself and compile it without any problems on a Sun Workstation (i.e., the ndown.exe, real.exe, and wrf.exe executables were successfully created in the main/ directory). I am now attempting to install the WRF standard initialization (WRFSI) package, but when I run the installation perl script "install_wrfsi.pl" I am getting many compile errors that I do not know how to fix. I am going to cut and paste the output to the screen below (or at least parts of it):

------------------------------------------------------------------------------------
Code: Select all
Routine: Install_wrfsi

Path to perl: /usr/bin/perl

--path_to_netcdf not specified, attempting to determine...
netCDF path found from environment variable.

Do you want to install the WRF SI graphical user interface? [y|n]: y
Okay... WRF SI GUI will be installed:

--machine_type not specified, attempting to determine...
Compiling for sun
Directory setup:
SRCROOT = /u13/wrf/wrf_model/WRFV2/wrfsi
INSTALLROOT = /u13/wrf/wrf_model/WRFV2/wrfsi
DATAROOT = /u13/wrf/wrf_model/WRFV2/wrfsi/domains
EXT_DATAROOT = /u13/wrf/wrf_model/WRFV2/wrfsi/extdata
GEOG_DATAROOT = /u13/wrf/wrf_model/WRFV2/wrfsi/extdata/GEOG
TEMPLATES = /u13/wrf/wrf_model/WRFV2/wrfsi/templates
NETCDF = /u13/wrf/wrf_model/netcdf-3.6.0-p1/
Make and install wrfsi binaries in /u13/wrf/wrf_model/WRFV2/wrfsi
ar: creating liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
In file included from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/time.h:90,
                 from /usr/include/sys/time.h:411,
                 from /usr/include/sys/select.h:17,
                 from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/types.h:278,
                 from getfilenames_c.c:99:
/usr/include/sys/siginfo.h:74: parse error before `pthread_attr_t`
/usr/include/sys/siginfo.h:74: warning: no semicolon at end of struct or union
/usr/include/sys/siginfo.h:76: parse error before `}'
getfilenames_c.c: In function `getfilenames_c_':
getfilenames_c.c:179: `alphasort` undeclared (first use this function)
getfilenames_c.c:179: (Each undeclared identifier is reported only once
getfilenames_c.c:179: for each function it appears in.)
make: Fatal error: Command failed for target `getfilenames_c.o'
Current working directory /u13/wrf/wrf_model/WRFV2/wrfsi/src/lib<br>make: Fatal error: Command failed for target `lib'

      use horiz_interp
          ^           
"proc_geodat.f", Line = 16, Column = 11: ERROR: "HORIZ_INTERP" is specified as the module name on a USE statement, but the compiler cannot find it.

f90comp: 672 SOURCE LINES
f90comp: 1 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI
make: Fatal error: Command failed for target `proc_geodat.o`
Current working directory /u13/wrf/wrf_model/WRFV2/wrfsi/src/grid
make: Fatal error: Command failed for target `ggminstall`
make: Fatal error: Don't know how to make target `grib_prep.exe`
Current working directory /u13/wrf/wrf_model/WRFV2/wrfsi/src/grib_prep
make: Fatal error: Command failed for target `gprepinstall`

MODULE hinterp_setup
       ^             
"module_hinterp_setup.F", Line = 37, Column = 8: ERROR: The compiler has detected errors in module "HINTERP_SETUP".  No module information file will be created for this module.

   USE wrf_metadata
       ^           
"module_hinterp_setup.F", Line = 39, Column = 8: ERROR: "WRF_METADATA" is specified as the module name on a USE statement, but the compiler cannot find it.

   USE wrfsi_maxdims
       ^             
"module_hinterp_setup.F", Line = 40, Column = 8: ERROR: "WRFSI_MAXDIMS" is specified as the module name on a USE statement, but the compiler cannot find it.

----------------------------------------------------------------------------------------

The errors continued down the page but this is just the first part of it. The README file states that if errors occur when compiling you may have to examine the file 'makefile_"machine".inc.in' to ensure that it conforms to their environment, which I think in my case would be 'makefile_sun.inc.in' in the src/include/ directory correct? Now, what exactly would I have to check or change in this file, if this is indeed the problem? If anyone has experienced similar problems or could provide any help here I would really appreciate it. Thanks a lot
malonso
Site Admin
 
Posts: 158
Joined: Sun Mar 02, 2008 9:48 pm

Re: Problems installing WRFSI on Sun - Repost from old forum

Postby kwthomas » Sun Nov 30, 2008 12:03 am

malonso wrote:
Code: Select all
In file included from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/time.h:90,
                 from /usr/include/sys/time.h:411,
                 from /usr/include/sys/select.h:17,
                 from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/types.h:278,
                 from getfilenames_c.c:99:
/usr/include/sys/siginfo.h:74: parse error before `pthread_attr_t`



Your first error seems to be problems when compiling sys/types.h. Based on the output, I'd say you are using gcc 2.7.2. That is a rather old compiler. I'd start by upgrading to a newer version of "gcc". If using the Sun compilers is an option, then I'd go that route.

When whatever was compiled didn't build, other commands that should have run weren't. This is likely why you had more errors later on. Files that should have been built weren't.

Kevin W. Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
Norman, Oklahoma
Kevin W. Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
kwthomas
 
Posts: 208
Joined: Thu Aug 07, 2008 6:53 pm

Re: Problems installing WRFSI on Sun - Repost from old forum

Postby malonso » Sun Nov 30, 2008 12:08 am

Thanks Kevin for your response. I found out that one of our system admins here at FSU just installed new versions of both Fortran and C compilers onto our system. The version of C we have is the Sun Studio 9 C compiler released by Sun and was installed this past April. The version of Fortran we have is the Sun Studio 9 f95 compiler version 8.0 which was also obtained directly from Sun and installed in April.

Here are a few things that I have tried so far. In the 'Makefile' in the SRCROOT directory I changed:

include $(SRCROOT)/src/include/makefile.inc
to
include $(SRCROOT)/src/include/makefile_sun.inc.in

Then, in file 'makefile_sun.inc.in' in src/include I changed:
CC=gcc
to
CC=cc

so that the gcc would not be used. I then ran the installation perl script again and got the following output to the screen:

----------------------------------------------------------------------------------------
Code: Select all
Routine: Install_wrfsi
Path to perl: /usr/bin/perl
--path_to_netcdf not specified, attempting to determine...
netCDF path found from environment variable.
Do you want to install the WRF SI graphical user interface? [y|n]: y
Okay... WRF SI GUI will be installed:

--machine_type not specified, attempting to determine...
Compiling for sun
Directory setup:
SRCROOT = /u13/wrf/wrf_model/WRFV2/wrfsi
INSTALLROOT = /u13/wrf/wrf_model/WRFV2/wrfsi
DATAROOT = /u13/wrf/wrf_model/WRFV2/wrfsi/domains
EXT_DATAROOT = /u13/wrf/wrf_model/WRFV2/wrfsi/extdata
GEOG_DATAROOT = /u13/wrf/wrf_model/WRFV2/wrfsi/extdata/GEOG
TEMPLATES = /u13/wrf/wrf_model/WRFV2/wrfsi/templates
NETCDF = /u13/wrf/wrf_model/netcdf-3.6.0-p1/
Make and install wrfsi binaries in /u13/wrf/wrf_model/WRFV2/wrfsi
"cio.c", line 51: warning: implicit function declaration: in_to_im_
ar: creating liblaps.a
ar: writing liblaps.a
"fort2c_str.c", line 100: warning: implicit function declaration: strlen
"fort2c_str.c", line 109: warning: implicit function declaration: strncpy
"fort2c_str.c", line 111: warning: implicit function declaration: strncat
"fort2c_str.c", line 115: warning: implicit function declaration: strcpy
ar: writing liblaps.a
"getfilenames_c.c", line 167: warning: implicit function declaration: strcpy
"getfilenames_c.c", line 169: warning: implicit function declaration: strcat
"getfilenames_c.c", line 175: warning: implicit function declaration: nstrncpy_
"getfilenames_c.c", line 177: warning: implicit function declaration: strlen
"getfilenames_c.c", line 179: warning: implicit function declaration: scandir
"getfilenames_c.c", line 179: undefined symbol: alphasort
"getfilenames_c.c", line 191: warning: implicit function declaration: free
"getfilenames_c.c", line 197: warning: implicit function declaration: strcmp
"getfilenames_c.c", line 272: warning: implicit function declaration: strncpy
cc: acomp failed for getfilenames_c.c
make: Fatal error: Command failed for target `getfilenames_c.o'
Current working directory /u13/wrf/wrf_model/WRFV2/wrfsi/src/lib
make: Fatal error: Command failed for target `lib'

      use horiz_interp
          ^           
"proc_geodat.f", Line = 16, Column = 11: ERROR: "HORIZ_INTERP" is specified as the module name on a USE statement, but the compiler cannot find it. 
..
..
..
---------------------------------------------------------------------------------------

I no longer get the same errors I was getting before with the sys/types.h but there still seems to be a problem compiling the program 'getfilenames_c.c'.  There is a variable 'alphasort' on line 179 that the compiler says is undefined.  I searched through the 'getfilenames_c.c' program and 'alphasort' appears only once on line 179.  Here is the syntax there: *numfiles = scandir(dirname, &amp;namelist,0,alphasort);

Is 'alphasort' some intrinsic function to C that perhaps our compiler is not recognizing for some reason?  Just for kicks I tried removing the variable 'alphasort' from this line and reran the perl script.  When I did this the compile errors for 'getfilenames_c.c' went away except for some warnings and everything appeared to be going smoothly, until the script was attempting to compile another C program called 'bacio.c'.  Here is part of what was printed to the screen:

-----------------------------------------------------------------------------------------
..
..
..
ar: writing liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
ar: writing liblaps.a
"bacio.c", line 121: warning: old-style declaration or incorrect type for: nactual
"bacio.c", line 124: syntax error before or at: if
"bacio.c", line 124: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 124: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 130: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 130: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 143: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 143: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 144: warning: old-style declaration or incorrect type for: mode
"bacio.c", line 157: warning: old-style declaration or incorrect type for: tempchar
"bacio.c", line 157: identifier redeclared: tempchar
        current : int
        previous: pointer to char : "bacio.c", line 116
"bacio.c", line 157: warning: improper pointer/integer combination: op "="
"bacio.c", line 157: an address is not allowed in a constant initializer for an integral type whose size is smaller than the size of a pointer
"bacio.c", line 158: warning: old-style declaration or incorrect type for: i
"bacio.c", line 159: warning: old-style declaration or incorrect type for: j
"bacio.c", line 160: warning: old-style declaration or incorrect type for: tempchar
"bacio.c", line 160: identifier redefined: tempchar
        current : pointer to int
        previous: int : "bacio.c", line 157
"bacio.c", line 160: undefined symbol: fname
"bacio.c", line 160: cannot dereference non-pointer type
"bacio.c", line 160: warning: improper pointer/integer combination: op "="
..
..
..

----------------------------------------------------------------------------------------

It appears to me that our C compiler is having big problems with this code and I cannot figure out why. Can someone please let me know if you have been able to install the WRFSI code successfully on a Sun system and if so what C compiler did you use? Also, any other suggestions would be appreciated. Thanks
malonso
Site Admin
 
Posts: 158
Joined: Sun Mar 02, 2008 9:48 pm

Re: Problems installing WRFSI on Sun - Repost from old forum

Postby kwthomas » Sun Nov 30, 2008 12:12 am

I did some checking on the SGI system that I run WRFSI on. My Sunblade 100 just doesn't have the memory that I need for my big jobs.

I have found that scandir/alphasort comes from"dir.h" on the SGI, but not on the Sun. I found the info buried in /usr/ucbinclude. That is the "ucb" stuff that people aren't supposed to use any more. By the way, I'm running Solaris 8, so your location may vary.

I couldn't get the code to compile, even after modifying the "sun" makefile master, meaning somebody doesn't pass the correct info along. The easiest way is to edit the "getfilenames_c.c" file and manually add:

extern int alphasort;

When you link, you'll be using -L/usr/ucblib -lucb.

The bacio.c error is due to a missing "#ifdef SUN" case in the code. You can clone the LINUX code and surround it by the missing ifdef.

With these changes, I was able to get the code to build, though I haven't tested it yet. No guarantees that it will work.

Kevin Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
Norman, Oklahoma
Kevin W. Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
kwthomas
 
Posts: 208
Joined: Thu Aug 07, 2008 6:53 pm

Re: Problems installing WRFSI on Sun - Repost from old forum

Postby malonso » Sun Nov 30, 2008 12:17 am

Thanks again Kevin for your suggestions, but you'll have to forgive me because I am not really familiar with C at all (I mostly write in Fortran) and I find a lot of this #ifdef SUN stuff kind of confusing. I just need a little clarification.

malonso wrote:I couldn't get the code to compile, even after modifying the "sun" makefile master, meaning somebody doesn't pass the correct info along. The easiest way is to edit the "getfilenames_c.c" file and manually add:<br><br>extern int alphasort;


Where exactly within the 'getfilenames_c.c' code do I add this line?

malonso wrote:When you link, you'll be using -L/usr/ucblib -lucb.


What exactly do you mean by this? That is, where do I add this or how do I link to it?

malonso wrote:The bacio.c error is due to a missing "#ifdef SUN" case in the code. You can clone the LINUX code and surround it by the missing ifdef.


I just tried this but I still got the exact same errors I was getting before. The compiler is still having problems with program 'bacio.c'.

I did notice there were Makefiles in some of the src/lib/... directories. Do I need to edit these at all to get things to work? For instance, in the directory where 'bacio.c' is located: src/lib/w3lib/ there is a 'Makefile' there. In this file do I have to change

include $(SRCROOT)/src/include/makefile.inc
to
include $(SRCROOT)/src/include/makefile_sun.inc.in

since I am using 'makefile_sun.inc.in' for my environment? Thank you very much...you have been very helpful so far
malonso
Site Admin
 
Posts: 158
Joined: Sun Mar 02, 2008 9:48 pm

Re: Problems installing WRFSI on Sun - Repost from old forum

Postby kwthomas » Sun Nov 30, 2008 12:22 am

pshafer wrote:Thanks again Kevin for your suggestions, but you'll have to forgive me because I am not really familiar with C at all (I mostly write in Fortran) and I find a lot of this #ifdef SUN stuff kind of confusing. I just need a little clarification.

I couldn't get the code to compile, even after modifying the "sun" makefile master, meaning somebody doesn't pass the correct info along. The easiest way is to edit the "getfilenames_c.c" file and manually add:

extern int alphasort;


Where exactly within the 'getfilenames_c.c' code do I add this line?

pshafer wrote:When you link, you'll be using -L/usr/ucblib -lucb.


What exactly do you mean by this? That is, where do I add this or how do I link to it?

pshafer wrote:The bacio.c error is due to a missing "#ifdef SUN" case in the code. You can clone the LINUX code and surround it by the missing ifdef.


I just tried this but I still got the exact same errors I was getting before. The compiler is still having problems with program 'bacio.c'.

I did notice there were Makefiles in some of the src/lib/... directories. Do I need to edit these at all to get things to work? For instance, in the directory where 'bacio.c' is located: src/lib/w3lib/ there is a 'Makefile' there. In this file do I have to change

include $(SRCROOT)/src/include/makefile.inc
to
include $(SRCROOT)/src/include/makefile_sun.inc.in

since I am using 'makefile_sun.inc.in' for my environment? Thank you very much...you have been very helpful so far :) [/quote]
For "extern int alphasort();", add it after the line:

size_t nmatch;

Make sure you include the trailing ";".

For the libraries, edit "src/include/makefile_sun.inc.in". Change the "LDFLAGS" line to:

LDFLAGS=-L/usr/ucblib -lucb

When you rerun "install_wrfsi.pl", the change will be picked up, with "makefile.inc" being automatically updated.

For the "bacio.c", did you make the change in two places? If you did only one, you missed one. If that doesn't work, then just remove the "#ifdef LINUX"/"#ifdef SUN" lines. Remove the corresponding "#endif" lines a couple lines below them.

Kevin Thomas
Kevin W. Thomas
Center for Analysis and Prediction of Storms
University of Oklahoma
kwthomas
 
Posts: 208
Joined: Thu Aug 07, 2008 6:53 pm

Re: Problems installing WRFSI on Sun - Repost from old forum

Postby malonso » Sun Nov 30, 2008 12:24 am

Kevin,

GREAT NEWS!! Your suggestions worked and everything finally compiled! The big question is will it run? Now the real fun begins. You have been a huge help with this...thanks a lot.
malonso
Site Admin
 
Posts: 158
Joined: Sun Mar 02, 2008 9:48 pm


Return to Installation

Who is online

Users browsing this forum: No registered users and 2 guests