Compilation problem with X libraries (PGPLOT with Intel Fortran Compiler)

Compilation problem with X libraries (PGPLOT with Intel Fortran Compiler)

Post by Madhusudan Sing » Wed, 21 Aug 2002 03:24:54



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.
-------------------------------------------------------------------------------------------------

> On Friday 16 August 2002 20:46, Athanasios Migdalas



>>> Hi
>>>         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 ?

>>> Thanks,

>>> MS

>>  The mentioned  NAG module provides to Fortran what is characterized under
>>  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.

>> /Sakis

> Thanks for your response.

> I located the GETENV intrinsic in Intel Fortran intrinsics. I edited the
> source file :

> 1. Included the recommended interface block :

>       INTERFACE
>          SUBROUTINE GETENV (VAR, VALUE)
>          CHARACTER(LEN=*) VAR, VALUE
>          END SUBROUTINE
>       END INTERFACE

> 2. Intel Getenv takes only two arguments - VAR and VALUE. So I got rid of the
> 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

> (The commented out lines indicate the original code).

>         Now I proceeded to compile the code :
>         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 "

> Warning 101 at (878:/usr/local/src/pgplot/examples/pgdemo1.f) : Constant
> truncated -- precision too great
>    external function PGBSJ0
>    external function PGBSJ1
>    external function PGRNRM
>    external function PGRAND

> 1043 Lines Compiled
> /usr/local/src/pgplot/libpgplot.so: undefined reference to `getenv_'
> make: *** [pgdemo1] Error 1

> Could someone suggest what this means since getenv is defined in Vaxlib.

> Thanks,

> MS.

Hate to respond to my own post, but I just realised that the input flags for the
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 :

Warning 101 at (878:/usr/local/src/pgplot/examples/pgdemo1.f) : Constant
truncated -- precision too great
   external function PGBSJ0
   external function PGBSJ1
   external function PGRNRM
   external function PGRAND

1043 Lines Compiled
/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'

Now this seems to involve my X11 libraries. Could someone suggest what this
means ? I am crossposting it to c.o.l.m as they might have some opinion on
this.

 
 
 

Compilation problem with X libraries (PGPLOT with Intel Fortran Compiler)

Post by Madhusudan Sing » Wed, 21 Aug 2002 10:35:41


Quote:>> > 1. Included the recommended interface block :

>> >       INTERFACE
>> >          SUBROUTINE GETENV (VAR, VALUE)
>> >          CHARACTER(LEN=*) VAR, VALUE
>> >          END SUBROUTINE
>> >       END INTERFACE

> Try telling the compiler that GETENV is an intrinsic? Have not tried this with
> Intel, but it used to work great with
> the old free (not any more) Vast f90 compilr (oh well ;-) for Linux.

> If you wish, I can post to you one such module
> that I created and used for  prortability between Linux Vast f90 and Salford
> Win FTN95. Maybe you can be helped
> by looking at them?!

> /Sakis

I am sure it could help. However, this error seemed to go away after I included
Vaxlib option in the demo programs section.

The following errors now are confusing me :

- Show quoted text -

Quote:>> Hate to respond to my own post, but I just realised that the input flags for
>> the 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 :

>> Warning 101 at (878:/usr/local/src/pgplot/examples/pgdemo1.f) : Constant
>> truncated -- precision too great
>>    external function PGBSJ0
>>    external function PGBSJ1
>>    external function PGRNRM
>>    external function PGRAND

>> 1043 Lines Compiled
>> /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'

>> Now this seems to involve my X11 libraries. Could someone suggest what this
>> means ? I am crossposting it to c.o.l.m as they might have some opinion on
>> this.

What could these X errors mean ?

 
 
 

Compilation problem with X libraries (PGPLOT with Intel Fortran Compiler)

Post by Madhusudan Sing » Thu, 22 Aug 2002 02:05:17


On Tuesday 20 August 2002 10:19, Bernie Borenstein


Quote:>> >> 1043 Lines Compiled
>> >> /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'

>> >> Now this seems to involve my X11 libraries. Could someone suggest what
>> >> this means ? I am crossposting it to c.o.l.m as they might have some
>> >> opinion on
> These are dynamic loading routines.  Add -ldl to your link and that
> should resolve them.

> BB

Thanks. I added -ldl to the Cflags and -Bdynamic to the Fflags and this error
went away. Now I have a more basic error :

 DATA SAMPLE/
     1 'Normal:  \fnABCDQ efgh 1234 \ga\gb\gg\gd \gL\gH\gD\gW',
     2 'Roman:  \frABCDQ efgh 1234 \ga\gb\gg\gd \gL\gH\gD\gW',
     3 'Italic:  \fiABCDQ efgh 1234 \ga\gb\gg\gd \gL\gH\gD\gW',
     4 'Script:  \fsABCDQ efgh 1234 \ga\gb\gg\gd \gL\gH\gD\gW',
     5 '\fif\fr(\fix\fr) = \fix\fr\u2\dcos(2\gp\fix\fr)e\u\fix\fr\u2',
     6 '\fiH\d0\u \fr= 75 \(2233) 25 km s\u-1\d Mpc\u-1\d',
     7 '\fsL/L\d\(2281)\u\fr = 5\.6 \x 10\u6\d (\gl1216\A)',

This line has an invalid character somewhere around \x 10\u6\d

     8 'Markers: 3=\m3, 8=\m8, 12=\m12, 28=\m28.',
     9 'Cyrillic: \(2830)\(2912)\(2906)\(2911)\(2919)\(2917)\(2915).'/

I am not savvy with these control sequences and what they mean, so cannot
imagine what it might be. Any ideas ?

Thanks again :)