This is my best guess:

You system probably has multi-threading enabled. gcc can compile to 
exploit that. I'm guessing the -pthread flag is passed to the compiler 
to invoke some pragmas that include bookkeeping essential for threading 
using the pthreads library and/or include the relevant header-files and 
  paths.

The -lpthread obviously tells gcc to link to the pthreads library.

I'm just surprised that your pkg-config files don't include this info.

Perhaps your HDF5 got built with pthreads and your main application that 
you are linking HDF5 to must include pthreads support to complete the 
dependency chain.

cheers!
Manoj


Mani Chandra wrote:
> Hey Manoj!
>  Thanks for that tip.It now works!......I thought I'd have to start 
> installing again on a clean slate but I guess I can start working 
> now.Though I still like to install everything into a directory and use 
> it from there cause I still dont have harminv etc..
> Could you tell me why adding -pthread and -lpthread worked??
> Thanks
> Mani chandra
> 
> --- On *Sun, 13/1/08, Manoj Rajagopalan /<[EMAIL PROTECTED]>/* wrote:
> 
>     From: Manoj Rajagopalan <[EMAIL PROTECTED]>
>     Subject: Re: [Meep-discuss] (no subject)
>     To: meep-discuss@ab-initio.mit.edu
>     Date: Sunday, 13 January, 2008, 8:21 PM
> 
>     Try adding the -pthread and -lpthread options to your compilation 
>     command line
> 
>     -- Manoj
> 
> 
>     Mani Chandra wrote:
>     >
>      Hi!
>     > After resolving the eps() issue the pthread thing cropped up 
>     > again!...Initially I thought it was because I commented out some lines 
>     > but this time it's appearing even when I try to compile the full
>     program...
>     > 
>     > #include <meep.hpp>
>     > using namespace meep;
>     > double eps(const vec &p);
>     > int main(int argc,char **argv)
>     > {
>     >     initialize mpi(argc,argv);
>     >     double resolution=20;
>     >     volume v = vol2d(5,10,resolution);
>     >     structure s(v,eps,pml(1.0));
>     >     fields f(&s);
>     > 
>     >     f.output_hdf5(Dielectric,v.surroundings());
>     > 
>     >     double freq = 0.3,fwidth=0.1;
>     >     gaussian_src_time src(freq,fwidth);
>     >     f.add_point_source(Ey,src,vec(1.1,2.3));
>     >     while (f.time() < f.last_source_time())
>     >     {
>     >         f.step();
>     >     }
>     > 
>     >    
>      f.output_hdf5(Hz,v.surroundings());
>     >    
>     >     return 0;
>     > }
>     > 
>     > double eps(const vec &p)
>     > {
>     >     if (p.x() < 2 && p.y() < 3)
>     >         return 12.0;
>     >     return 1.0;
>     > }
>     > 
>     > [EMAIL PROTECTED] /usr/home/mc/MEEP files]# g++ `pkg-config --cflags 
> meep` 
>     > test1.cpp -o test1 `pkg-config --libs meep`
>     > /usr/local/lib/libhdf5.so: undefined reference to `pthread_equal'
>     > /usr/local/lib/libhdf5.so: undefined reference to
>     `pthread_setcancelstate'
>     > 
>     > Thanks for all the help:)
>     > Mani chandra
>     > Physics sophomore
>     > IIT Kanpur
>     > 
>     > 
>     > ------------------------------------------------------------------------
>     > Save all your chat conversations. Find them online. 
>     >
>     
> <http://in.rd.yahoo.com/tagline_webmessenger_3/*http://in.messenger.yahoo.com/webmessengerpromo.php>
> 
>     > 
>     >
>      
>     > 
>     > ------------------------------------------------------------------------
>     > 
>     > _______________________________________________
>     > meep-discuss mailing list
>     > meep-discuss@ab-initio.mit.edu
>     > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
> 
>     _______________________________________________
>     meep-discuss mailing list
>     meep-discuss@ab-initio.mit.edu
>     http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
> 
> 
> ------------------------------------------------------------------------
> 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here. 
> <http://in.rd.yahoo.com/tagline_mail_4/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/>
>  
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> meep-discuss mailing list
> meep-discuss@ab-initio.mit.edu
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to