Wrf Preprocessing System (WPS V3) Mac OS X 10.5.6

Wrf Preprocessing System (WPS V3) Mac OS X 10.5.6

I have compiled WRF V3 and NetCDF with ifort and icc. But I am having trouble getting past configure with version 3 of WPS. (Mac OS X 10.5.6. ifort and icc 11.0. 64 bit Intel based Mac Pro with a case sensitive /usr/local)

I have environment pretty much set up as it was for WRF build and per the intel online recipe. I get a bunch of ld errors on compile. Here is configure.wps as generated by configure. I have edited that file to use the intel compilers but I don't think I have it correct. (configure.intel.wps)

Final attachment is from "env". I apologize I could not figure out how to attach text files Does this make sense? Do you think the problem is with configure? If you know where I can find a working configure.wps for this arch and compiler set I would really like to have a look at it. I am going to install NCL and make sure I have grib2 required libs installed although I am not sure how to get ld to find them.

#######################################
LD ERRORS an example of compile errors
fort -ip -Wl,-stack_addr,0xF10000000 -Wl,-stack_size,0x64000000 -o metgrid.exe cio.o wrf_debug.o bitarray_module.o constants_module.o datatype_module.o module_stringutil.o gridinfo_module.o metgrid.o input_module.o interp_module.o interp_option_module.o list_module.o llxy_module.o met_data_module.o minheap_module.o misc_definitions_module.o module_date_pack.o module_debug.o module_map_utils.o module_mergesort.o output_module.o parallel_module.o process_domain_module.o queue_module.o read_met_module.o rotate_winds_module.o storage_module.o write_met_module.o \ /usr/local/WPS/../WRFV3/frame/pack_utils.o /usr/local/WPS/../WRFV3/frame/module_machine.o \ /usr/local/WPS/../WRFV3/frame/module_internal_header_util.o \ -I/usr/local/WPS/../WRFV3/external/io_netcdf -I/usr/local/WPS/../WRFV3/external/io_grib_share - I/usr/local/WPS/../WRFV3/external/io_grib1 -I/usr/local/WPS/../WRFV3/external/io_int - I/usr/local/WPS/../WRFV3/inc \ -L/usr/local/WPS/../WRFV3/external/io_grib1 -lio_grib1 - L/usr/local/WPS/../WRFV3/external/io_grib_share -lio_grib_share -L/usr/local/WPS/../WRFV3/external/io_int - lwrfio_int -L/usr/local/WPS/../WRFV3/external/io_netcdf -lwrfio_nf -L/usr/local//lib -lnetcdf \ Undefined symbols: "_cio_set_log_filename_", referenced from: _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o "_cio_printf_", referenced from: _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o "_cio_printi_", referenced from: _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o "_cio_prints_", referenced from: _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o _module_debug_mp_mprintf_ in module_debug.o
ld: symbol(s) not found

AttachmentSize
Downloadapplication/octet-stream configure.intel.wps2.74 KB
10 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Intel compiler support has 2 people who build and tune WRF and write up 'how tos' on building WRF. I know they are finishing up their WRF 3 writeup. Unfortunately, your timing is bad - BOTH of them are out on vacation until Monday. One chap was working on the Mac OS port just before vacation too.

If you can wait until Monday, I am sure you will get an answer or some assistance.

but just as an amateur looking into this, the functions missing are 'cio_*', and on a web search I see cio_set_log_filename being called from sub mprint in MODULE module_debug. So, where are the cio routines in WRF? These are not Intel functions, these are part of WRF or it's requisite libraries. Can you search your source for cio* ? Perhaps you are missing a library on your link.

ron

Quoting - Ronald Green (Intel)
Intel compiler support has 2 people who build and tune WRF and write up 'how tos' on building WRF. I know they are finishing up their WRF 3 writeup. Unfortunately, your timing is bad - BOTH of them are out on vacation until Monday. One chap was working on the Mac OS port just before vacation too.

If you can wait until Monday, I am sure you will get an answer or some assistance.

but just as an amateur looking into this, the functions missing are 'cio_*', and on a web search I see cio_set_log_filename being called from sub mprint in MODULE module_debug. So, where are the cio routines in WRF? These are not Intel functions, these are part of WRF or it's requisite libraries. Can you search your source for cio* ? Perhaps you are missing a library on your link.

ron

Hey Ron,

Thanks, I noticed the same thing. I did a "find . -name "cio*" " on WPS source root and found four object files with that name. I am puzzled. Standard error has a lot of squawking like this:

gribcode.f90(838): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MODULE_GRIB]
use module_grib
------^

I am going to try going back to WPSV3.0. Current version is 3.1.

The vacation thing is crazy funny because I am under the gun to decide to go with an Xserve cluster or linux by Friday afternoon. The decision at this point hinges on building WPS.

I appreciate the insight.

Quoting - volzaeff.uaa.alaska.edu

Hey Ron,

Thanks, I noticed the same thing. I did a "find . -name "cio*" " on WPS source root and found four object files with that name. I am puzzled. Standard error has a lot of squawking like this:

gribcode.f90(838): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MODULE_GRIB]
use module_grib
------^

I am going to try going back to WPSV3.0. Current version is 3.1.

The vacation thing is crazy funny because I am under the gun to decide to go with an Xserve cluster or linux by Friday afternoon. The decision at this point hinges on building WPS.

I appreciate the insight.

I have one quick recommendation, which probably does not apply to you: do not use Xcode to try to build this. The Fortran integration is a 'limited feature' and one limitation is that the integration does not respect module dependencies.

Which leads to the error above: gribcode.f90 is being compiled prior to module_grib OR your -I or -module is not pointing to where the compiled module is located.

I would recommend contacting the WRF providers for assistance as there is little to no chance of our engineers returning until Monday.

Looking at your configure file, I am not sure you are referencing the latest instructionsfor building WRF (it is for 2.2, but the comments still pertain to the WRF 3.0). Comparing your file to the configure filewe are using internally it looks like most of the differences are covered by these instructions. I don't have any direct experience with 3.0 (I have been building 2.2 while the main support engineer who works on it is on vacation this week) but think this BKM is your best bet. Note you do need to export NETCDF=/home/local/netcedf or wherever it is installed before building.

Wendy

WRF 3 has compiled successfully and I have tested it based on the BMK.Tthe additions to LDFLAGS were added because wrf.exe v3.1 was seg faulting. The ld flags are supposed to be a way of setting or unsetting stack size for Mac. I don't think they affect the WPS build.

The WRF help responded to my request for help finding a correct configuration by noting that the CPP_FLAGS directive "-D_DOUBLEUNDERSCORE" should be "-D_UNDERSCORE".

I have compiled the executables for metgrid.exe and geogrid.exe using the UNDERSCORE directive and the following includes and flags (see configure.defaults). However I still am generating errors from some of the modules in the ungrib build. Most notably rd_grib2.f90. I get a bunch of syntax errors like this:

++++++++++++++++
ifort -c -O3 -xT -ip -no-prec-div -m64 rd_grib2.f90 -I. -I./ngl/g2
rd_grib2.f90(39): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: *
SUBROUTINE rd_grib2(junit, gribflnm, hdate,
--------------------------------------------------^
rd_grib2.f90(40): error #5082: Syntax error, found '&' when expecting one of: ; BLOCK BLOCKDATA PROGRAM MODULE TYPE COMPLEX BYTE ...
& grib_edition, ireaderr, debug_level)
--------^
rd_grib2.f90(40): error #5277: Unbalanced parentheses
& grib_edition, ireaderr, debug_level)

( etc......)

+++++++++++++++++

The object code for rd_grib2.f90 does not compile. Subsequently ld fails for ungrib.exe. Does this look like noncompliant f90 code errors? I am pretty sure this code compiles with gfortran and pgf90.

-
Karl

Here is a an excerpt from WPS/arch/configure.defaults. I hacked it a bit. I hope it makes sense.

configure.defaults.

###########################################################
#ARCH Darwin serial, INTEL, ifort compiler, serial
#
#COMPRESSION_LIBS = -L/stink/gill/WPS_LIBS/local/lib
# -ljasper -lpng12 -lpng -lz
#COMPRESSION_INC = -I/stink/gill/WPS_LIBS/local/include
COMPRESSION_LIBS = -L/usr/local/lib -ljasper
-L/usr/X11/lib -lpng12 -lpng -lz
COMPRESSION_INC = -I/usr/local/include -I/usr/X11/include
FC = ifort
SFC = ifort
#FFLAGS = -ffree-form -g -fendian=big
FFLAGS = -O3 -xT -ip -no-prec-div -m64
#F77FLAGS = -ffixed-form -g -fendian=big
F77FLAGS = -O3 -xT -ip -no-prec-div -m64
FNGFLAGS = $(FFLAGS)
#LDFLAGS = -g
LDFLAGS = -ip -Wl,-stack_addr,0xF10000000 -Wl,-stack_size,0x64000000
CC = icc
SCC = icc
#CFLAGS = -g
CFLAGS = -O3 -xT -ip -no-prec-div -m64
CPP = /usr/bin/cpp -C -P -traditional
CPPFLAGS = -D_UNDERSCORE -DBYTESWAP -DIO_NETCDF -DBIT32 -DMACOS
RANLIB = ranlib

###########################################################

Karl,

Sorry I do not have experience with WPS and we do not have build instructions on it. Our WRF experts will be back on Monday and I will ask one of the to post back to this thread with any information we have.

Wendy

Hi,

I have never tried to install WPSV2.2.1 with WRFV3.0.1.1 on MAC. Im going to do it during this week. But I have installed it on Linux (RHEL 5.3 64 bit) successfully. I have written small installation recommendations for WPSV2 with WRFV3 with all required software on Nehalem with RHEL 5.3. Unfortunately it is a draft version and I cannot upload the full version. But Ill upload a piece which regards WPSV2:

1) This document is written for WRFV3.0.1.1 and WPSV2.2.1.
2) All sources of libraries and packages were uploaded to directory /opt.
3) Everything was done in root mode.
4) All scripts were written in Vi IMproved, a programmers text editor (vim).
5) System on which everything were checked was NHM(i7) RHEL 5.3 64-bit.
WPS and WRF you can download here http://www.mmm.ucar.edu/wrf/users/download/get_source2.html
or
http://www.mmm.ucar.edu/wrf/users/download/get_sources.html
This packages require:
1)Jasper
2)zlib
3)libjpeg
4)netcdf
5)ncl_ncarg
6)HDF

--------------------------------------------------------------------------------------------------
WPS Installation
$tar -xvf WPSV2.2.1.TAR.gz
$cd /opt/WPS/
!!!!!!!!
NOTE:
You should add 2 lines
"
os="ARCH"
mach="ARCH"
"
in the file ./configure, before last but one line
"
perl arch/Config.pl -perl=$PERL -netcdf=$NETCDF -os=$os -mach=$mach

" .
Then you'll get option to choose type of architecture yourself.
!!!!!!!!
Create script build_WPS.sh:
#!/bin/sh
#INTEL_COMPILER_TOPDIR directory where Intel Compiler has been instaaled
export INTEL_COMPILER_TOPDIR="/opt/intel/Compiler/11.0/083"
#Setting invironmet variables for the Intel C++ Compiler Professional Edition for Linux
. $INTEL_COMPILER_TOPDIR/bin/intel64/iccvars_intel64.sh
#Setting invironmet variables for the Intel Fortran Compiler Professional Edition for Linux
. $INTEL_COMPILER_TOPDIR/bin/intel64/ifortvars_intel64.sh
export NETCDF=/opt/netcdf-4.0
export JASPERLIB=/usr/local/lib
export JASPERINC=/usr/local/include
export WRF_DIR=/opt/WRFV3
export FC=ifort
./configure
exit 0
./compile
"
$chmod 777 ./build_WPS.sh
$./build_WPS.sh
!!!!!!!!
NOTE:
1)
Replace in the file "configure.wps" line
WRF_DIR = ../WRFV2
by lines
#if you want to use WRFV3
WRF_DIR = /opt/WRFV3
or
#if you want to use WRFV2
WRF_DIR = /opt/WRFV2
In the file "./build_WPS.sh" comment out lines
./configure
exit 0
!!!!!!!!
In the file "./build_WPS.sh" comment out lines
./configure
exit 0
$((./build_WPS.sh) 3>&2 2>&1 1>&3 | tee build_WPS.err ) 2>&1 | tee build_WPS.log
or
$./build_WPS.sh 2>&1 | tee build_WPS.log
--------------------------------------------------------------------------------------------------

Please keep us updated regarding this issue.

Thanks,
Kirill.

Quoting - volzaeff.uaa.alaska.edu

WRF 3 has compiled successfully and I have tested it based on the BMK.Tthe additions to LDFLAGS were added because wrf.exe v3.1 was seg faulting. The ld flags are supposed to be a way of setting or unsetting stack size for Mac. I don't think they affect the WPS build.

The WRF help responded to my request for help finding a correct configuration by noting that the CPP_FLAGS directive "-D_DOUBLEUNDERSCORE" should be "-D_UNDERSCORE".

I have compiled the executables for metgrid.exe and geogrid.exe using the UNDERSCORE directive and the following includes and flags (see configure.defaults). However I still am generating errors from some of the modules in the ungrib build. Most notably rd_grib2.f90. I get a bunch of syntax errors like this:

++++++++++++++++
ifort -c -O3 -xT -ip -no-prec-div -m64 rd_grib2.f90 -I. -I./ngl/g2
rd_grib2.f90(39): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: *
SUBROUTINE rd_grib2(junit, gribflnm, hdate,
--------------------------------------------------^
rd_grib2.f90(40): error #5082: Syntax error, found '&' when expecting one of: ; BLOCK BLOCKDATA PROGRAM MODULE TYPE COMPLEX BYTE ...
& grib_edition, ireaderr, debug_level)
--------^
rd_grib2.f90(40): error #5277: Unbalanced parentheses
& grib_edition, ireaderr, debug_level)

( etc......)

+++++++++++++++++

The object code for rd_grib2.f90 does not compile. Subsequently ld fails for ungrib.exe. Does this look like noncompliant f90 code errors? I am pretty sure this code compiles with gfortran and pgf90.

-
Karl

Here is a an excerpt from WPS/arch/configure.defaults. I hacked it a bit. I hope it makes sense.

configure.defaults.

###########################################################
#ARCH Darwin serial, INTEL, ifort compiler, serial
#
#COMPRESSION_LIBS = -L/stink/gill/WPS_LIBS/local/lib
# -ljasper -lpng12 -lpng -lz
#COMPRESSION_INC = -I/stink/gill/WPS_LIBS/local/include
COMPRESSION_LIBS = -L/usr/local/lib -ljasper
-L/usr/X11/lib -lpng12 -lpng -lz
COMPRESSION_INC = -I/usr/local/include -I/usr/X11/include
FC = ifort
SFC = ifort
#FFLAGS = -ffree-form -g -fendian=big
FFLAGS = -O3 -xT -ip -no-prec-div -m64
#F77FLAGS = -ffixed-form -g -fendian=big
F77FLAGS = -O3 -xT -ip -no-prec-div -m64
FNGFLAGS = $(FFLAGS)
#LDFLAGS = -g
LDFLAGS = -ip -Wl,-stack_addr,0xF10000000 -Wl,-stack_size,0x64000000
CC = icc
SCC = icc
#CFLAGS = -g
CFLAGS = -O3 -xT -ip -no-prec-div -m64
CPP = /usr/bin/cpp -C -P -traditional
CPPFLAGS = -D_UNDERSCORE -DBYTESWAP -DIO_NETCDF -DBIT32 -DMACOS
RANLIB = ranlib

###########################################################

Hi Karl,
The code for rd_grib2.f90 is written in fixed format (label incolumns 1-5, continuation character in column 6, main source starts column 7), whereas the compiler is assuming free format because of the file type .f90. You should add -fixed (or -FI) to your compiler options for this and any other files that use fixed format.rd_grib2.f90was the only fixed format file that I could spot at a quick glance.

Martyn

Martyn-

I have successfully compiled. metgrid.exe, ungrib.exe and geogrid.exe. I have not tested yet.

I compiled all source with options as above, then compiled the rd_grib2.f90 in WPS/ungrib/src from the command line using -FI. Prior to the configure step below I edited the configure.defaults under WPS/arch. another user might be able to follow this recipe using an altered configure.defaults. I will move this information to WRF Users Forum.

koyukuk:WPS ruser$ ./clean -a
koyukuk:WPS ruser$ ./configure
koyukuk:WPS ruser$ cd ungrib/src
koyukuk:src ruser$ ifort -c -O3 -ip -no-prec-div -m64 -FI rd_grib2.f90 -I. -I./ngl/g2
koyukuk:WPS ruser$ cd ../../
koyukuk:WPS ruser$ ./compile

Success!

thanks

-

Karl

Attachments: 

AttachmentSize
Downloadapplication/octet-stream configure.defaults37.56 KB

Leave a Comment

Please sign in to add a comment. Not a member? Join today