|
From: Alan W. I. <Ala...@gm...> - 2020-07-23 07:59:42
|
On 2020-07-22 20:38+0100 Peter Williams wrote:
> Hello Plplot
> I am at present migrating some PlPlot programs from Windows 10 to linux
> (mint 64 bit),
> To facilitate this I have downloaded cmake and Plplot-5.15.0.tar.gz from
> your website.
> Following the instructions from your wiki I built an installation
> consisting of static
> libraries. In order to test the installation I wrote a very simple program
> PlPlotTest.c:
>
> #include <stdio.h>
> #include "plplot.h"
> int main()
> {
> printf("Plotting example\n");
> plsdev("ps"); plsfnam("TestPlplot.ps");plinit();
> plenv(-1.0 , 1.0 ,-1.0,1.0,1,2);
> pljoin(-0.5,-0.5,0.5,0.5);
> plend();
> printf("Plot finished\n");
> return 1;
> }
> and attempted to compile it with
>
> gcc -c -I /home/peter/plplot/install_directory/include/plplot PlPlotTest.c
> gcc -o PlPlotTest.exe PlPlotTest.o -L
> /home/peter/plplot/install_directory/lib -lplplot -lcsirocsa -lqsastime
> -lm -lX11
>
> An object file PlPlotTest.o was generated with no errors, but the linking
> failed with [undefined pthread library references].
> I am very new to linux. Can you tell me what the linking should be?
Hi Peter:
If you execute "man gcc" and look for the -pthread option it says
"-pthread
Define additional macros required for using the POSIX threads library. You should use this option
consistently for both compilation and linking."
Therefore, I suggest you add the -pthread option to *both* the compile
(gcc -c ....) and link (gcc -o ....) steps above to see if those
changes solve solve the pthread library linking issues you have
encountered.
Alan
__________________________
Alan W. Irwin
Research affiliation with the Department of Physics and Astronomy,
University of Victoria, Victoria, BC, Canada.
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.org); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
|