Some plplot functions cannot be linked with gfortran

31 views
Skip to first unread message

Mac Sar

unread,
Apr 2, 2015, 8:58:10 AM4/2/15
to gnu-f...@googlegroups.com
I have a fortran code which uses plplot functions as below:

   call plsetopt('geometry','800x600+800+1')
   call plsetopt('np',' ') ! No pause between pages
   call plsdev('xwin')
   call plinit()
   call plfontld(1)
   call plfont(2)
   call plssym(0.0d0,1.5d0)  ! Set symbol size
   call pladv(0)             ! Advance and set page
   call plschr(0.0d0,0.8d0)  ! Set character scale
   call plvpor(0.15d0,0.85d0,0.15d0,0.85d0)
   call plwind(xmin,xmax,vmin,vmax) ! Set scale
   call plbox('BCNST',0.0d0,0,'BCNST',0.0d0,0) ! Draw box
   call pllab('x','v',titre)
   call plpoin(1,x(1),x(2),18) ! Plot one point with symbol 17
   call plssym(0.0d0,0.8d0)  ! Reset symbol size to small symbol

I compile the code with either of these two commands:

gfortran -I/usr/include/plplot  langevin.f -o langevin -lplplotf95cd -lplplotd

or

gfortran langevin.f -o langevin $(pkg-config --cflags --libs plplotd-f95)s

But still some of the pplot functions are not successfully linked including: plsetopt, plsdev, plbox, pllab and plpoin (while others are ok). I have gfortran 4.6 and libplplot 5.9.9 (and cairo drivers) on Ububtu 12.

I receive linker errors (if I comment those lines, I will not):
langevin.f:(.text+0xe55): undefined reference to plsetopt_'
langevin.f:(.text+0xe69): undefined reference to plsdev_'
langevin.f:(.text+0xf4e): undefined reference to plbox_'
langevin.f:(.text+0xf84): undefined reference to pllab_'
langevin.f:(.text+0xfaf): undefined reference to `plpoin_'


Would you please advise? Thanks.

Reply all
Reply to author
Forward
0 new messages