mesa-users] On getting pgplot to work

alfred at alfred at
Tue Oct 5 15:41:42 EDT 2010

For those with problems getting PGPLOT compiled and the demos run:

I compiled pgplot with ifort in order to be compatible with compiler I
used for the mesa modules. When using ifort, make sure that is sourced; i.e. that the machine knows where to find the
ifort libraries:

source /opt/intel/Compiler/11.1/073/bin/ ia32

(or whereever your compiler is located (to find out, try "whereis")

after having successfully compiled and linked the pgplot package in
/usr/local/pgplot in my case and having placed the libraries of pgplot
in /usr/local/lib I tried to run pgplot with mkxwin:

the contents of my mkxwin was:

ifort pgdemo_xwin.f -o demo -L/usr/local/lib -lpgplot -L/usr/X11R6/lib -lX11

then doing the following:

pgplot > ./mkxwin
pgplot > ./demo

resulted in:

./demo: error while loading shared libraries: cannot
open shared object file: No such file or directory

even though:

pgplot > whereis /usr/local/lib/ /usr/local/lib/

To remedy the above problem, proceed as described in the README file in
mesa/utils/pglot: set the following environment variables in the
appropriate ...rc file (in my case, I placed it in .bashrc)

export DISPLAY=":0"
export PGPLOT_DEV=/xwin
export PGPLOT_DIR=/usr/local/lib
export PGPLOT_FONT=/usr/local/bin/grfont.dat

*in addition* to what is written in the README file, I also set

export LD_LIBRARY_PATH=/usr/local/lib

(this is explained e.g. at the website:

the last line, referring to LD_LIBRARY_PATH, must point correctly
to the place where is stored (in my case /usr/local/lib).

So, after that you might enjoy playing with stars and seeing  
"real-time" plots.
The Mesa idea is really great! Thanks!

More information about the Mesa-users mailing list