Sorry about the crossposting - I thought the issue pertained to all three NG's.
I am including prior activity on Usenet on the thread for your benefit.
>>> Hi >>> Thanks, >>> MS >> The mentioned NAG module provides to Fortran what is characterized under >> /Sakis > Thanks for your response. > I located the GETENV intrinsic in Intel Fortran intrinsics. I edited the > 1. Included the recommended interface block : > INTERFACE > 2. Intel Getenv takes only two arguments - VAR and VALUE. So I got rid of the > (The commented out lines indicate the original code). > Now I proceeded to compile the code : > Warning 101 at (878:/usr/local/src/pgplot/examples/pgdemo1.f) : Constant > 1043 Lines Compiled > Could someone suggest what this means since getenv is defined in Vaxlib. > Thanks, > MS. Warning 101 at (878:/usr/local/src/pgplot/examples/pgdemo1.f) : Constant 1043 Lines Compiled Now this seems to involve my X11 libraries. Could someone suggest what this
---------------------------------------------------------------------------
>>> I am trying to port the NAG95 configuration files to my compiler
>>> (Intel
>>> Fortran). I came across the following piece of code over which my
>>> compiler chokes :
>>> C*GRGENV -- get value of PGPLOT environment parameter (NAGWare f95)
>>> C+
>>> ~ SUBROUTINE GRGENV(NAME, VALUE, L)
>>> ~ USE F90_UNIX_ENV, ONLY : GETENV
>>> ~ CHARACTER*(*) NAME, VALUE
>>> ~ INTEGER L
>>> C
>>> C Return the value of a PGPLOT environment parameter. In Sun/Convex-UNIX,
>>> C environment parameters are UNIX environment variables; e.g. parameter
>>> C ENVOPT is environment variable PGPLOT_ENVOPT. Translation is not
>>> C recursive and is case-sensitive.
>>> C
>>> C Arguments:
>>> C NAME : (input) the name of the parameter to evaluate.
>>> C VALUE : receives the value of the parameter, truncated or extended
>>> C with blanks as necessary. If the parameter is undefined,
>>> C a blank string is returned.
>>> C L : receives the number of characters in VALUE, excluding
>>> C trailing blanks. If the parameter is undefined, zero is
>>> C returned.
>>> C--
>>> C 25-Mar-1988
>>> C-----------------------------------------------------------------------
>>> ~ INTEGER I, LIN, ERRNO
>>> ~ CHARACTER*32 TEST
>>> C
>>> ~ TEST = 'PGPLOT_'//NAME
>>> ~ LIN = INDEX(TEST, ' ')-1
>>> ~ ERRNO = 0
>>> ~ CALL GETENV(TEST(:LIN), VALUE, ERRNO=ERRNO)
>>> ~ IF (ERRNO.NE.0 .OR. VALUE.EQ.' ') THEN
>>> ~ L = 0
>>> ~ ELSE
>>> ~ DO 10 I=LEN(VALUE),1,-1
>>> ~ L = I
>>> ~ IF (VALUE(I:I).NE.' ') GOTO 20
>>> ~ 10 CONTINUE
>>> ~ L = 0
>>> ~ 20 CONTINUE
>>> ~ END IF
>>> ~ END
>>> --------------------------------------------------------
>>> The predefined module F90_UNIX_ENV, is a NAG peculiarity. Is there an
>>> equivalent module on Intel Fortran that would do the job ?
>> Unix
>> System Calls and
>> other useful functions. Those are available to pure unix/linux compilers
>> (like g77, vast f90, etc)
>> as intrinsics. Intel provides them too as extension to the standard, so that
>> you can for example
>> get file stats, command line arguments etc. I suggest, if you really want
>> to have a module
>> with the mentioned NAG functionality that you can create one, where you
>> rename IARG and similar
>> Intel/Unix specific functions to Unix_something, as NAG does. Myself is often
>> doing that to provide
>> portability between Linux and Windows to fortran code that needs such
>> specific functionality.
> source file :
> SUBROUTINE GETENV (VAR, VALUE)
> CHARACTER(LEN=*) VAR, VALUE
> END SUBROUTINE
> END INTERFACE
> third argument :
> ! CALL GETENV(TEST(:LIN), VALUE, ERRNO=ERRNO)
> CALL GETENV(TEST(:LIN), VALUE)
> ! IF (ERRNO.NE.0 .OR. VALUE.EQ.' ') THEN
> IF (VALUE.EQ.' ') THEN
> f95 -c grgenv.f
> It compiled successfully. Now when I try to run a make (after
> including -
> Vaxlib and -static as options), I get the following as an error at the end of
> a fairly long compilation o/p "
> truncated -- precision too great
> external function PGBSJ0
> external function PGBSJ1
> external function PGRNRM
> external function PGRAND
> /usr/local/src/pgplot/libpgplot.so: undefined reference to `getenv_'
> make: *** [pgdemo1] Error 1
demo programs (over which it choked above) are different in the configuration
file. I added Vaxlib to the above (along with -static -KPIC -O) and got the
following error :
truncated -- precision too great
external function PGBSJ0
external function PGBSJ1
external function PGRNRM
external function PGRAND
/usr/X11R6/lib/libX11.a(XlcDL.o): In function `try_both_dlsym':
XlcDL.o(.text+0xe2): undefined reference to `dlsym'
XlcDL.o(.text+0x107): undefined reference to `dlsym'
/usr/X11R6/lib/libX11.a(XlcDL.o): In function `open_object':
XlcDL.o(.text+0x557): undefined reference to `dlopen'
/usr/X11R6/lib/libX11.a(XlcDL.o): In function `close_object':
XlcDL.o(.text+0x5cd): undefined reference to `dlclose'
means ? I am crossposting it to c.o.l.m as they might have some opinion on
this.