From: Alan W. I. <ir...@be...> - 2004-07-02 15:30:12
|
On 2004-07-02 01:40-0700 asdf asdf wrote: > - >>> Hi, >>> >>> I need to get PlPlot 5.3.1 working. I have >> followed >>> the installation instructions, running >> ./configure, >>> make, and make install. When I try to run the >> example >>> programs, I keep getting undefined references to >> all >>> the functions used in the code. I have installed >> this >>> under Red-hat 7.1. >>> Please give me some tips this is getting >>> frustrating@@@@ >> >> We need more details, please. Was this for the >> installed examples or in the >> build tree? If installed (which is our least >> complicated and therefore most >> reliable method of testing the examples), what >> command did you use to build >> the examples? >> >> Alan >> ___ > > Hi again, > > Thanks for replying. > I'm not sure about what you are talking about when you > say the build tree. Anyway, I went into the > /home/me/plplot-5.3.1/examples/c directory and used > the command gcc -o ex1 x01c.c. First I get the message > that the header files cannot be found i.e. plplot.h > etc. So to quickly get past this I hard coded them in > the example file ie #include "/directory/plplot.h". > That solved that problem. I then had the problem of > undefined references. I installed redhat 7.2 and now > am getting many more errors. > > I will post these errors soon, but in the mean time I > am looking for a good way to install plplot and > compile and run an example file. > > This is what I did after I downloaded the file: > > gunzip plplot-5.3.1.tar.gz...OK > > tar -xvf plplot-5.3.1.tar...OK > > cd plplot-5.3.1...OK BTW, you are now in the build tree, i.e., the place where you run ./configure > > ./configure...No obvoius errors What was the --prefix option for ./configure or did you just use the default (/usr/local)? > > make...seems OK > > make install...seems OK Let's assume the above install --prefix was /usr/local/plplot. Then try the following: Put /usr/local/plplot/bin first on your path. This is an important step. PATH="/usr/local/plplot/bin:"$PATH cd /tmp # make copy of installed examples tree cp -a /usr/local/plplot/share/plplot5.3.1/examples . cd /tmp/examples # Build all examples for copy of installed examples tree. make # Generate lots of example postscript results ./plplot-test.sh (Note, plplot-test.sh has lots of other possibilities for output. Try ./plplot-test.sh --help to see those additional possibilities.) > > cd examples...OK This is not correct. You are trying to build examples in the build tree referring to build tree headers and libraries, and that takes a special command (make check), but let's not go there and stick to the installed examples for now for the reasons I mentioned before, and also because the installed version of PLplot is what your programmes will be interacting with in future. > > make...OK > > cd c > > make...nothing to build...no executables > > gcc -o ex1 x01c.c...errors Even if you were in the installed examples tree (which you are not) this is not quite correct. You need a number of specific options for that build and link command. Those are all supplied properly by the make command in the copied installed examples tree above. If you look more carefully at the Makefile in the installed examples tree you will see references to the command plplot-config --cflags --libs (there are other options as well if you have C++ source or fortran source or if you are compiling some command to be used in a Tcl/Tk environment) The results of that command on my system are as follows: -I/usr/local/plplot/include/plplot -L/usr/local/plplot/lib /usr/local/plplot/lib/libplplotd.so -Wl,--rpath -Wl,/usr/local/plplot/lib -Wl,--rpath -Wl,/usr/local/plplot/lib I encourage you to use this command to find out necessary options to build the examples rather than cutting and pasting from this e-mail because the specifics will be different on your system depending on your particular configuration options. Also, note you can build examples anywhere with the options generated by plplot-config, but these options are specific to the installed version of the PLplot headers and libraries and are not suitable if you want to use the header files and libraries in the build tree. Good luck! Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |