Re: wrapit

From: Saji Njarackalazhikam Hameed <saji_at_nyahnyahspammersnyahnyah>
Date: Sat, 18 Aug 2007 21:10:43 +0900

Matt,

If you look up the NCL reference manual in the NCL website (ncl.ucar.edu)
you can find how "wrapit77" is to be used. WRAPIT is a wrapper for wrapit77.

Recently I had to produce 32-bit shared objects on a 64-bit machine (it was
possible using portland group compiler). Anyway I had to write a
customised WRAPIT. The following code is in Ruby, but it should be easy
to translate into bash or csh. It follows the prescription for using
"wrapit77" in the reference manual.

You should be able to write up something similar for your specific
purpose.

saji
...

;;;;;;;;;; START OF CUSTOMISED WRAPPER for wrapit77 ;;;;;;;;
#!/usr/bin/ruby

if ARGV.length==0
  puts "wrapit.rb is a program to create shared \
objects for use within NCL"
  puts "It is restricted to creating 32-bit \
binaries using portland group compiler for f77 or f90 code"
  puts "please use WRAPIT if this is not your \
purpose"
  puts "USAGE : wrapit.rb file.f(77/90)"
  exit
end

cmd=$0
fname=ARGV[0]
puts (" Execute #{cmd} for #{fname}")

ext=fname.split(/\./)[1]
basename=fname.split(/\./)[0]
ext.upcase!

if ext=="F90"
  stubfile=basename+".stub"
  # check if stubfile is present or give warning
else
  stubfile=fname
end
wrapper=`wrapit77 < #{stubfile}`
File.open("#{basename}_W.c","w") do |myfile|
        myfile.write(wrapper)
end
`pgcc -tp=px -fPIC -c #{basename}_W.c -I${NCARG_ROOT}/include`
`pgf90 -tp=px -c #{fname}`
`pgf90 -tp=px -fPIC -shared -o #{basename}.so #{basename}_W.o #{basename}.o -lpgf90`

# remove intermediate files
`rm #{basename}_W.c #{basename}_W.o #{basename}.o`

;;;;; END OF CODE ;;;;;;;;;;;;;;

* Matt Fearon <matt_at_guero.sr.unh.edu> [2007-08-17 13:23:46 -0400]:

> Dear NCL users,
> Trying to get WRAPIT working on a different machine. Getting the following
> error;
>
> WRAPIT Version: 041207
> COMPILING findpts.f90
> FATAL ERROR: g77 can not compile f90 code
>
> How can get WRAPIT to recognize my gfortran 95 compiler and to stop looking
> for g77?
> thanks,
> Matt
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Saji N. Hameed
APEC Climate Center          				+82 51 668 7470
National Pension Corporation Busan Building 12F         
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705			saji_at_apcc21.net
KOREA
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Aug 18 2007 - 06:10:43 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 20 2007 - 09:30:37 MDT