Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with PGPLOT and gFORTRAN in UBUNTU

Status
Not open for further replies.

12cou

Technical User
Dec 10, 2009
4
ES
Hi everyone,

Im trying to run PGPLOT with my gfortran codes, under UBUNTU 8.10. I have installed the software following this:
Everything seemed to be ok, as the final './pgdemo1' worked fine.

Then I tryed to compile the code put in this thread:

I found no problem with the command: 'gfortran test.f95 /usr/lib/libpng.so -o test -L/usr/X11R6/lib -lX11 -L/usr/lib -lpgplot'

And here is my trouble. When I try to compile the code test.f95 from the folder test_folder I write: gfortran -o TEST test.f95, and the bash answer me:

/tmp/ccY7pvbc.o: In function `MAIN__':
:(plot.f95.text+0x115): undefined reference to `pgopen_'
:(plot.f95.text+0x159): undefined reference to `pgenv_'
:(plot.f95.text+0x18d): undefined reference to `pglab_'
:(plot.f95.text+0x1ad): undefined reference to `pgline_'
:(plot.f95.text+0x1cf): undefined reference to `pgpt_'
:(plot.f95.text+0x1d4): undefined reference to `pgclos_'

Im afraid I maybe didnt quite catch what I suppose to do...

Anybody can help me?

Thanks in advance
 
Do you mean compile or link or both.

Compile = convert from Fortran to intermediate format
Link = combine all code in intermediate format to form executable

gfortran -c will compile only
gfortran will compile and link

If you typed gfortran -o xxx xxx.f it will attempt to compile and link xxx.f. If you don't provide the libraries it requires, then it will moan because they are unresolved references.

If you're using pgplot, you need /usr/lib/libpng.so -L/usr/X11R6/lib -lX11 -L/usr/lib -lpgplot'
 
Ok, I uderstand. But how do I know if these libraries are already installed on my computer? I cant find them via synaptics...

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top