Urania

A blog named for the muse of Astronomy containing musings by an astronomer

PGPLOT on Snow Leopard

Posted on October 23, 2009 by admin

One of the packages I use a lot in my research is the venerable PGPLOT package put together by Tim Pearson (currently at Caltech). You see evidence of this set of plotting routines in the figures in many astronomy papers from the 1980s onward. PGPLOT was written in FORTRAN and supports a wide variety of drivers to export its graphics, including color postscript, GIF, and Xwindows displays. In addition to using PGPLOT, I use PGPLOT.pm, a perl module for calling PGPLOT from perl scripts written by Karl Glazebrook.  I have used it to make interactive perl scripts for ‘marking’ spectral lines in HI spectra among other things.

When I moved to Snow Leopard, I discovered that I could not get PGPLOT.pm compiled against the PGPLOT package that comes with Scisoft OSX and soon realized this was because Perl on my Mac Pro is 64-bit whereas the PGPLOT package included with Scisoft OSX was 32 bit. I decided to compile PGPLOT 64-bit native to try to remedy the problem and on the way discovered a few other issues. Here’s what I did to get both PGPLOT and PGPLOT.pm working under Snow Leopard (on both 32-bit and 64-bit computers).

  1. Determine 32/64-bit nature of hardware: Since a lot of people don’t know a priori whether their processor is 32 or 64-bit, here’s a simple command line test.  Type the following into the command line:
    sysctl hw | grep 64bit

    If the response is
    hw.cpu64bit_capable: 1

    you have a 64-bit system. If the response is
    hw.cpu64bit_capable: 0

    you have a 32-bit system. If it is something else, well, you are on your own!
  2. Install GFORTRAN: The first thing I did was install Gnu Fortran (aka gfortran) as configured by Gaurav Hanna at the High Performance Computing for Mac OS X website. It turns out the version he compiled for Snow Leopard (here) is 64-bit Intel ONLY, so for my venerable first generation MacBook Pro, I grabbed the 32-bit Intel Leopard version (here), which worked fine in Snow Leopard. Installing them is a simple matter of issuing the proper tar command to unpack the tarball into /usr/local, where all the binaries are installed.
    • sudo tar -C / -xzvf gfortran-snwleo-intel.bin.gz

      (for the 64-bit Snow Leopard version)
    • sudo tar -C / -xzvf gfortran-leopard-intel.bin.gz

      (for the 32-bit Leopard version)

    Once they are installed, you simply have to make sure /usr/local/bin is in your $PATH.

  3. Install PGPLOT: I grabbed the PGPLOT source code from Tim Pearson’s website (here) and untarred the tarball into /usr/local/src/pgplot, the default location the code expects to be in (based on the instructions in the install-unix.txt file included in the source code tarball).
    sudo tar -C /usr/local/src/ -xzvf pgplot pgplot5.2.tar.gz
  4. Install sys_macosx configuration: The PGPLOT source code has various compiler configurations stored in “configuration directories” but it doesn’t come with one for Mac OS X. The MacPorts folks, when they ported PGPLOT, did create such a configuration. However, that configuration is hard coded to require AquaTerm, a nice MacOS X native display program that has not been made 64-bit compliant yet. Furthermore, their version of the configuration requires g77 to compile. The only g77 I could find was not 64-bit compliant, so I ended up hacking the sys_macosx/ configuration directory to include a new gfortran configuration that didn’t require AquaTerm. I am making a tarball of that configuration directory available in the pgplot5.2_macosx_addition.tgz which you can download and unpack into the PGPLOT source directory using:
    sudo tar -C -xzvf /usr/local/src/pgplot5.2_macosx_addition.tgz

    [The above line was edited to fix an error noticed by a commenter. – Juan (Oct. 24, 2009)]
  5. Compile the PGPLOT binaries: At this point, if you follow the instructions in the install-unix.txt file in the PGPLOT directory you will be fine, baring in mind the configuration you want to use is the “maxosx gfortran_gcc” configuration. However, I will outline the steps I used below.
    1. Create a PGPLOT library/binary directory:Create a directory to contain the PGPLOT libraries. I created /usr/local/pgplot using the command:
      sudo mkdir /usr/local/pgplot
    2. Choose the graphics drivers you want: Copy the drivers.list file from the source directory to this new pgplot directory and edit it to match your needs:
      cd /usr/local/pgplot
      sudo cp /usr/local/src/pgplot/drivers.list .
      sudo vi drivers.list

      (You can replace this last step with emacs or whatever text editor you prefer). You make a graphics driver part of the compilation by removing the leading exclamation point from the line. I choose to activate the X-Window drivers, the GIF drivers (to create GIF images), and the PostScript printer drivers (which you can use to create PostScript versions of plots for publication). Be aware PNG support requires libpng be installed.
    3. Create the makefile: We now need to create the makefile using PGPLOT’s makemake script. Within the /usr/local/pgplot directory execute:
      sudo /usr/local/src/pgplot/makemake /usr/local/src/pgplot  macosx gfortran_gcc

      which should result in the following output
      Reading configuration file: /usr/local/src/pgplot/sys_macosx/gfortran_gcc.conf
      Selecting uncommented drivers from ./drivers.list
      Found drivers GIDRIV NUDRIV PSDRIV XWDRIV
      Creating make file: makefile
      Determining object file dependencies.
    4. Create all the binaries: Now you just have to create all the binaries, which is a simple make command:
      sudo make

      Assuming everything proceeds without error, you should then see at the end of the output
      *** Finished compilation of PGPLOT ***
      
      Note that if you plan to install PGPLOT in a different
      directory than the current one, the following files will be
      needed.
      
             libpgplot.a
             libpgplot.dylib
             grfont.dat
             rgb.txt
             pgxwin_server
      
      Also note that subsequent usage of PGPLOT programs requires that
      the full path of the chosen installation directory be named in
      an environment variable named PGPLOT_DIR.

      At this point, you should (if you are going to use PGPLOT within perl or C compile the C library as well using
      sudo make cpg

      Finally, clean out all the temporary object files, you don’t need them. Do this using the makefile by typing
      sudo make clean

      If you want to test if things are working you can run one of the PGPLOT demo programs created in this directory. However, the pgdemo* executables seem hard coded to expect the pgplot libraries in the /usr/local/lib directory, to it might be a good idea to do the following step before trying the demos. [Edited in response to a comment about the demos not working. – Juan (Oct. 24, 2009)]
    5. Copy library and header files: This step is optional, but since most programs (including the pgdemo* executables) don’t look in /usr/local/pgplot for library and header files, I copy them to /usr/local/lib and /usr/local/include respectively using
      sudo cp *.a /usr/local/lib
      sudo cp *.dylib /usr/local/lib
      sudo cp *.h /usr/local/include
  6. Making sure I use these PGPLOT binaries: Since I am using Scisoft OSX, I modified my ~/.tcshrc file to change the PGPLOT related environmental variables after loading Scisoft’s environment
    setenv PGPLOT_DIR /usr/local/pgplot/

    . If you are not using Scisoft, you can place these lines anywhere in your ~/.tcshrc file. If you stick to using bash, then the corresponding lines in the ~/.bashrc file that you need to create (after setting up Scisoft, if you are using that) are:
    export PGPLOT_DIR=/usr/local/pgplot/

    At this point you have a working PGPLOT set of libraries installed. You can stop here if you just want to use PGPLOT from C or FORTRAN source code. If you want to use PGPLOT from within Perl, you need to go further.
  7. Install the ExtUtils:: F77 perl module: In order to install PGPLOT support, you need to install ExtUtils:F77 first. You can download ExtUtils::F77 here and once you untar the tarball,
    tar xzvf ExtUtils-F77-1.16.tar.gz

    it can be easily compiled using the following standard perl module compilation steps:
    cd ExtUtils-F77-1.16
    perl Makefile.PL
    make
    sudo make install
  8. Install the PGPLOT perl module: You can download PGPLOT here. Untar the tarball.
    tar xzvf PGPLOT-2.20.tar.gz

    We start as we usually do for Perl modules, creating the makefile using the Makefile.PL script:
    cd ExtUtils-F77-1.16

    Unfortunately, the Makefile.PL script will create a makefile this creates doesn’t work because it doesn’t call gfortran so we have to change the Makefile.PL script to know about gfortran. So load Makefile.PL and edit the line that reads
    use ExtUtils::F77;

    to read
    use ExtUtils::F77 qw{Darwin GFortran};

    Once you have done that, create the makefile using
    perl Makefile.PL

    Now you still have a problem because this makefile is designed to create a universal binary. However, depending on which platform you downloaded gfortran for (in step 1), you only have 64-bit intel or 32-bit intel support. So you have to delete all mentions of
    -arch ppc

    from the makefile as well as removing
    -arch i386

    if you are compiling on a 64-bit system or
    -arch x86_64

    if you are compiling on a 32-bit system. Once you have done that, you can finish installing the perl module using:
    make
    make test
    sudo make install

    I did have some issues with make test because it couldn’t find my X-windows driver due to a bad environment, but the compile reported no errors and I was able to get the make test to work once I had the proper environmental variable settings for PGPLOT_DIR (see step 5).

So that is it, I now have working PGPLOT installations with perl support on both my 32-bit MacBook Pro and my 64-bit Mac Pro.

 

[Edited on December 28, 2009 to add the first step to determine whether your system is 32/64-bit.]

28 to “PGPLOT on Snow Leopard”

  1. Grappin says:
    Thanks for all these nice instructions - it almost works for me a) about the OS X addition. You write: sudo tar -C /usr/local/src/pgplot5.2_macosx_addition.tgz which is incomplete The following worked for me: sudo tar -C /usr/local/src/pgplot -xvf pgplot5.2_macosx_addition.tar b) I arrive up to point 4d included, everything seems ok However I cannot run any pgdemo file: sudo ./pgdemo2 dyld: Library not loaded: /usr/local/lib/libpgplot.dylib Referenced from: /usr/local/pgplot/./pgdemo2 Reason: image not found Trace/BPT trap What is wrong with libpgplot.dylib?
  2. Grappin says:
    well, of course the solution is to copy libpgplot.dylib from /usr/local/pgplot to/usr/local/lib/libpgplot.dylib where pgplot expects to find it now pgplot works thanks again
  3. Peter Jung says:
    The build went O.K., and the demos work O.K. with the xwindow drivers. The GIF drivers and many others result in segmentation faults. Who can help?
  4. Jack says:
    At step 4d I run into a errors with GRGENV.F and GRTERMIO.C. I've copied the info here. I made a couple of quick changes to GRGENV.F that allows it to compile. Basically, deleted the Readonly Attribute, replace * with a file name, and changed pause to write and read statements. I am new to the MAC OSX, which also means I am new to GFORTRAN, GCC, etc. (I've programmed in Fortran on IBM 360/370s, VAX, MSDOS, and a few others, but just got my first MAC and trying to come up to speed. Any suggestions as to what is causing these problems and how to fix them would be greatly appreciated. Jack jack {at} jriegel(.)com (ERRORS IN GRGENV.F - Appears that the compiler does not like Readonly; Some of the lines exceed the default line length; it doesn’t like the use of FILE=*; and, it doesn’t like pause statements ) gfortran -c /usr/local/src/pgplot/sys_mac/grgenv.f /usr/local/src/pgplot/sys_mac/grgenv.f:63.59: Open(Unit = lun,File=FilNam,Status='OLD',Err = 10,Readonly) 1 Error: Syntax error in OPEN statement at (1) /usr/local/src/pgplot/sys_mac/grgenv.f:67.66: 10 Open(Unit = lun,File='pgplotenvnames',Status='OLD',Err = 20,Readon 1 Error: Syntax error in OPEN statement at (1) /usr/local/src/pgplot/sys_mac/grgenv.f:74.18: 20 CALL GRWARN('Could not find file PGPLOTENVNAMES in current directo 1 Error: Unterminated character constant beginning at (1) /usr/local/src/pgplot/sys_mac/grgenv.f:75.18: CALL GRWARN('A dialog box will come up allowing you to find the fi 1 Error: Unterminated character constant beginning at (1) /usr/local/src/pgplot/sys_mac/grgenv.f:76.18: CALL GRWARN('environment variables. Hit return for the dialog box 1 Error: Unterminated character constant beginning at (1) /usr/local/src/pgplot/sys_mac/grgenv.f:77.72: Pause 1 Warning: Deleted feature: PAUSE statement at (1) /usr/local/src/pgplot/sys_mac/grgenv.f:78.20: Open(Unit=lun,File=*,STATUS='OLD',err=100,Readonly) 1 Error: Syntax error in OPEN statement at (1) make: *** [grgenv.o] Error 1 (ERRORS IN GRTERMIO.C - Appears that there is a conflict with and intrinsic c function called strncpy; Compiler doesn’t like something about the Record statement) gfortran -c /usr/local/src/pgplot/sys_mac/grsy00.f gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/grtermio.c /usr/local/src/pgplot/sys/grtermio.c: In function ‘groter_’: /usr/local/src/pgplot/sys/grtermio.c:39: warning: incompatible implicit declaration of built-in function ‘strncpy’ gfortran -c /usr/local/src/pgplot/sys_mac/grtrml.f gfortran -c /usr/local/src/pgplot/sys/grtter.f gfortran -c /usr/local/src/pgplot/sys_mac/gruser.f /usr/local/src/pgplot/sys_mac/gruser.f:29.9: Record /StringHandle/ UserName 1 Error: Unclassifiable statement at (1) /usr/local/src/pgplot/sys_mac/gruser.f:32.6: STRING = UserName.h^.P^ 1 Error: Unclassifiable statement at (1) make: *** [gruser.o] Error 1
  5. Jack says:
    FOLLOW UP{ The GRGENV.F file in sys_mac was a problem. The one in sys was a better start for my MAC. Need to confirm, but it seems to be working Still have a conflict with an intrinsic c function called strncpy; Number of args is different. In a number of routines (ie grdate.c, grtermio.c, grgmem.c, grfileio.c, gruser.c, the names were mangled. The functions need to have a trailing underscore, but the define statements were not setting the option for that. I have finally managed to run the first demo to output to gif files. However, the naming scheme for the 2nd and higher number files is such that the MAC does not recognize them as gif files. Renaming them works, but I need to find in the source code where the default names are created so I can avoid this step in the future. A quick point in the right direction would save some time. Also, I have not been able to generate interactive output. I guess that will be the hurdle for tomorrow unless somebody has a tip.
  6. Daniel says:
    Step 4d terminates in an error. I get several ranlib errors such as the following ar: creating archive libpgplot.a ranlib: archive member: libpgplot.a(grdate.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) Any ideas?
  7. Matt K says:
    Daniel: I got that error because you're using the 32-bit compiler when you have 64-bit perl. Check what type of perl you have with 'perl -V' and look for cpu-64 or some such flag. Then pick the gfortran that matches the 32-bit or 64-bit perl you have.
  8. Matt K says:
    ...and also a big thank you for this page! I was also stuck with compiling PGPLOT and struggling with the gfortran problem. It's great to get a clear explanation of why I was getting these errors. Cheers!
  9. Jean GUIBERT says:
    subject: About makemake for installation of PGPLOT on a Mac I am installing pgplot5.2 on an Intel mac running under mac OSX 10.5.7. (leopard) gfortran is already installed and working. My question refers to building the makefile. I tried to follow step 4.C above, namely: "4. c Create the makefile: We now need to create the makefile using PGPLOT’s makemake script. Within the /usr/local/pgplot directory execute: sudo /usr/local/src/pgplot/makemake /usr/local/src/pgplot macosx gfortran_gcc which should result in the following output Reading configuration file: /usr/local/src/pgplot/sys_macosx/gfortran_gcc.conf Selecting uncommented drivers from ./drivers.list Found drivers GIDRIV NUDRIV PSDRIV XWDRIV Creating make file: makefile Determining object file dependencies." so, I typed the command : guibert> /usr/local/src/pgplot/makemake /usr/local/src/pgplot/ macosx gfort and got the following message: The second argument must be one of the following operating systems: aix alliant arc bsd convex cray cygwin dos epix2 freebsd fujitsu gnuwin32 hp irix linux mac msdos next openstep osf1 salford sol2 solx86 sun4 ultrix vms win So, I replaced macosx by mac, and typed: guibert> /usr/local/src/pgplot/makemake /usr/local/src/pgplot/ mac gfort and got a new message: ls: /usr/local/src/pgplot//sys_mac/*.conf: No such file or directory No configuration files found for mac So, what should I do ? with thanks! Jean Guibert
  10. admin says:
    To Jean GUIBERT: I believe you missed a part of step 2 4, specifically where you have to install the sys_macosx components to pgplot in /usr/local/src/pgplot. Juan
  11. Daniel says:
    Matt K: thanks for the tip. I installed the correct version of gfortran, but there was another 32-bit version already on my machine that it was trying to use. I removed it and all worked fine. THanks for the site and help!!!!!
  12. Michael says:
    Hi, I have the following problem by creating the binaries. When trying to compile everything I receive the following warning and error message: gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/grtermio.c /usr/local/src/pgplot/sys/grtermio.c: In function ‘groter_’: /usr/local/src/pgplot/sys/grtermio.c:39: warning: incompatible implicit declaration of built-in function ‘strncpy’ .o grtermio.o grtrml.o grtter.o gruser.o | sort | uniq` ar: creating archive libpgplot.a ranlib: archive member: libpgplot.a(grdate.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grfileio.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) I saw the previous post on this topic but somehow I could not solve the problem by using a 64bit flag. When using the 64bit flag I receive the following error message: .o grgenv.o grgetc.o grglun.o grgmem.o grgmsg.o grlgtr.o groptx.o grsy00.o grtermio.o grtrml.o grtter.o gruser.o | sort | uniq` -L/usr/X11R6/lib -lX11 -lgfortran -lSystem ld: warning: in /usr/local/lib/libgfortran.dylib, file is not of required architecture Undefined symbols: Thanks for the help. Best regards, Michael
  13. admin says:
    Michael, If you are on a 64-bit machine, you must use the 64-bit version of the gfortran compiler (the "Snow Leopard" version), otherwise, you must use the 32-bit version of gfortran (the "Leopard" version). Mess that up in any way and you get the errors you see about cputype not matching. If you type the command "sysctl hw |grep 64bit" and get the response "hw.cpu64bit_capable: 1", you have 64-bit hardware, if you get the response "hw.cpu64bit_capable: 0", you have 32-bit hardware.
  14. Michael says:
    Hi, Thanks a lot it worked out :). Best regards, Michael
  15. Alan says:
    I took the notion of using pgplot within perl tonight, but couldn't get around the 32-bit/64-bit install problem until I read your blog. Fantastically helpful, thank you!
  16. Justin says:
    First of all thank you for making this tutorial. Secondly I get the same error as Jean above, but I did follow all the instructions. Do you have any ideas how I could resolve this? bash-3.2$ sudo /usr/local/src/pgplot/makemake /usr/local/src/pgplot macosx gfortran_gcc The second argument must be one of the following operating systems: aix alliant arc bsd convex cray cygwin dos epix2 freebsd fujitsu gnuwin32 hp irix linux mac msdos next openstep osf1 salford sol2 solx86 sun4 ultrix vms win
  17. admin says:
    Hi Justin: Your error suggests you didn't install the pgplot macosx additions I put together in the proper place (which is what I stated in the comment following Jean's comment about his error). You need to download pgplot5.2_macosx_addition.tgz as indicated in step 4 (sorry, the step number changed when I edited the blog post, step 4 is the current number) and expand it. If it is correctly unpacked, then there should exist a directory at /usr/local/src/pgplot/sys_macosx. If that directory doesn't exist, then the 'macosx' argument will be unrecognized when you attempt to compile pgplot.
  18. Maria says:
    Hi everyone, I have the same problem but I think I followed all the instructions and still can't solve it. When running "sudo make" I get: /usr/local/src/pgplot/sys/grfileio.c: In function ‘grofil_’: /usr/local/src/pgplot/sys/grfileio.c:82:5: warning: incompatible implicit declaration of built-in function ‘strncpy’ gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/gruser.c ar ru libpgplot.a \ `ls pgarro.o pgask.o pgaxis.o pgaxlg.o pgband.o pgbbuf.o pgbeg.o pgbin.o pgbox.o pgbox1.o pgcirc.o pgcl.o pgclos.o pgcn01.o pgcnsc.o pgconb.o pgconf.o pgconl.o pgcons.o pgcont.o pgconx.o pgcp.o pgctab.o pgcurs.o pgdraw.o pgebuf.o pgend.o pgenv.o pgeras.o pgerr1.o pgerrb.o pgerrx.o pgerry.o pgetxt.o pgfunt.o pgfunx.o pgfuny.o pggray.o pghi2d.o pghis1.o pghist.o pghtch.o pgiden.o pgimag.o pginit.o pglab.o pglcur.o pgldev.o pglen.o pgline.o pgmove.o pgmtxt.o pgncur.o pgnoto.o pgnpl.o pgnumb.o pgolin.o pgopen.o pgpage.o pgpanl.o pgpap.o pgpixl.o pgpnts.o pgpoly.o pgpt.o pgpt1.o pgptxt.o pgqah.o pgqcf.o pgqch.o pgqci.o pgqcir.o pgqclp.o pgqcol.o pgqcr.o pgqcs.o pgqdt.o pgqfs.o pgqhs.o pgqid.o pgqinf.o pgqitf.o pgqls.o pgqlw.o pgqndt.o pgqpos.o pgqtbg.o pgqtxt.o pgqvp.o pgqvsz.o pgqwin.o pgrect.o pgrnd.o pgrnge.o pgsah.o pgsave.o pgscf.o pgsch.o pgsci.o pgscir.o pgsclp.o pgscr.o pgscrl.o pgscrn.o pgsfs.o pgshls.o pgshs.o pgsitf.o pgslct.o pgsls.o pgslw.o pgstbg.o pgsubp.o pgsvp.o pgswin.o pgtbox.o pgtext.o pgtick.o pgtikl.o pgupdt.o pgvect.o pgvsiz.o pgvstd.o pgvw.o pgwedg.o pgwnad.o \ pgadvance.o pgbegin.o pgcurse.o pglabel.o pgmtext.o pgncurse.o pgpaper.o pgpoint.o pgptext.o pgvport.o pgvsize.o pgvstand.o pgwindow.o grarea.o grbpic.o grchsz.o grclip.o grclos.o grclpl.o grctoi.o grcurs.o grdot0.o grdot1.o grdtyp.o gresc.o grepic.o gretxt.o grfa.o grfao.o grgfil.o grgray.o grimg0.o grimg1.o grimg2.o grimg3.o grinit.o gritoc.o grlen.o grlin0.o grlin1.o grlin2.o grlin3.o grlina.o grmcur.o grmker.o grmova.o grmsg.o gropen.o grpage.o grpars.o grpixl.o grpocl.o grprom.o grpxpo.o grpxps.o grpxpx.o grpxre.o grqcap.o grqci.o grqcol.o grqcr.o grqdev.o grqdt.o grqfnt.o grqls.o grqlw.o grqpos.o grqtxt.o grqtyp.o grquit.o grrec0.o grrect.o grsci.o grscr.o grscrl.o grsetc.o grsets.o grsfnt.o grsize.o grskpb.o grslct.o grsls.o grslw.o grsyds.o grsymk.o grsyxd.o grterm.o grtext.o grtoup.o grtrim.o grtrn0.o grtxy0.o grvct0.o grwarn.o grxhls.o grxrgb.o grexec.o \ gidriv.o nudriv.o psdriv.o ttdriv.o wddriv.o xwdriv.o grdate.o grfileio.o grflun.o grgcom.o grgenv.o grgetc.o grglun.o grgmem.o grgmsg.o grlgtr.o groptx.o grsy00.o grtermio.o grtrml.o grtter.o gruser.o | sort | uniq` ar: libpgplot.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) ar: libpgplot.a: Inappropriate file type or format make: *** [libpgplot.a] Error 1 What can I do? I have a 64-bit Snowleopard BTW. Thanks.
  19. Wenzheng says:
    To Maria: You can fix the problem by replacing "ar ru " to be "libtool -s -o". Juan: I compiled PGPLOT on my macpro with SL, and the system is x64. So, I use gcc version 4.5.0 and the gfortran (x86_64-apple-darwin10). However, such warnings like: In function ‘groter_’: /usr/local/src/pgplot/sys/grtermio.c:39:5: warning: incompatible implicit declaration of built-in function ‘strncpy’ still exist. What's kind of -m64 options should I set for compiling? I also could not plot any figures with the demos. The only option for drawing is NULL, no matter what I change to drivers.list. Thanks a lot!
  20. Peter says:
    Hi, I have the same problem as Maria as above and can't seem to solve the problem with Wenzheng's reply. When I type "sudo make" I end up with the following error message: /usr/local/src/pgplot/sys/grfileio.c: In function ‘grofil_’: /usr/local/src/pgplot/sys/grfileio.c:82: warning: incompatible implicit declaration of built-in function ‘strncpy’ gfortran -c /usr/local/src/pgplot/sys/grflun.f gfortran -c /usr/local/src/pgplot/sys/grgcom.f gfortran -c /usr/local/src/pgplot/sys/grgenv.f gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/grgetc.c gfortran -c /usr/local/src/pgplot/sys/grglun.f gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/grgmem.c gfortran -c /usr/local/src/pgplot/sys/grgmsg.f gfortran -c /usr/local/src/pgplot/sys/grlgtr.f gfortran -c /usr/local/src/pgplot/sys/groptx.f gfortran -c /usr/local/src/pgplot/sys/grsy00.f gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/grtermio.c /usr/local/src/pgplot/sys/grtermio.c: In function ‘groter_’: /usr/local/src/pgplot/sys/grtermio.c:39: warning: incompatible implicit declaration of built-in function ‘strncpy’ gfortran -c /usr/local/src/pgplot/sys/grtrml.f gfortran -c /usr/local/src/pgplot/sys/grtter.f gcc -c -DPG_PPU -O2 -I. /usr/local/src/pgplot/sys/gruser.c ar ru libpgplot.a \ `ls pgarro.o pgask.o pgaxis.o pgaxlg.o pgband.o pgbbuf.o pgbeg.o pgbin.o pgbox.o pgbox1.o pgcirc.o pgcl.o pgclos.o pgcn01.o pgcnsc.o pgconb.o pgconf.o pgconl.o pgcons.o pgcont.o pgconx.o pgcp.o pgctab.o pgcurs.o pgdraw.o pgebuf.o pgend.o pgenv.o pgeras.o pgerr1.o pgerrb.o pgerrx.o pgerry.o pgetxt.o pgfunt.o pgfunx.o pgfuny.o pggray.o pghi2d.o pghis1.o pghist.o pghtch.o pgiden.o pgimag.o pginit.o pglab.o pglcur.o pgldev.o pglen.o pgline.o pgmove.o pgmtxt.o pgncur.o pgnoto.o pgnpl.o pgnumb.o pgolin.o pgopen.o pgpage.o pgpanl.o pgpap.o pgpixl.o pgpnts.o pgpoly.o pgpt.o pgpt1.o pgptxt.o pgqah.o pgqcf.o pgqch.o pgqci.o pgqcir.o pgqclp.o pgqcol.o pgqcr.o pgqcs.o pgqdt.o pgqfs.o pgqhs.o pgqid.o pgqinf.o pgqitf.o pgqls.o pgqlw.o pgqndt.o pgqpos.o pgqtbg.o pgqtxt.o pgqvp.o pgqvsz.o pgqwin.o pgrect.o pgrnd.o pgrnge.o pgsah.o pgsave.o pgscf.o pgsch.o pgsci.o pgscir.o pgsclp.o pgscr.o pgscrl.o pgscrn.o pgsfs.o pgshls.o pgshs.o pgsitf.o pgslct.o pgsls.o pgslw.o pgstbg.o pgsubp.o pgsvp.o pgswin.o pgtbox.o pgtext.o pgtick.o pgtikl.o pgupdt.o pgvect.o pgvsiz.o pgvstd.o pgvw.o pgwedg.o pgwnad.o \ pgadvance.o pgbegin.o pgcurse.o pglabel.o pgmtext.o pgncurse.o pgpaper.o pgpoint.o pgptext.o pgvport.o pgvsize.o pgvstand.o pgwindow.o grarea.o grbpic.o grchsz.o grclip.o grclos.o grclpl.o grctoi.o grcurs.o grdot0.o grdot1.o grdtyp.o gresc.o grepic.o gretxt.o grfa.o grfao.o grgfil.o grgray.o grimg0.o grimg1.o grimg2.o grimg3.o grinit.o gritoc.o grlen.o grlin0.o grlin1.o grlin2.o grlin3.o grlina.o grmcur.o grmker.o grmova.o grmsg.o gropen.o grpage.o grpars.o grpixl.o grpocl.o grprom.o grpxpo.o grpxps.o grpxpx.o grpxre.o grqcap.o grqci.o grqcol.o grqcr.o grqdev.o grqdt.o grqfnt.o grqls.o grqlw.o grqpos.o grqtxt.o grqtyp.o grquit.o grrec0.o grrect.o grsci.o grscr.o grscrl.o grsetc.o grsets.o grsfnt.o grsize.o grskpb.o grslct.o grsls.o grslw.o grsyds.o grsymk.o grsyxd.o grterm.o grtext.o grtoup.o grtrim.o grtrn0.o grtxy0.o grvct0.o grwarn.o grxhls.o grxrgb.o grexec.o \ gidriv.o nudriv.o psdriv.o ttdriv.o xwdriv.o grdate.o grfileio.o grflun.o grgcom.o grgenv.o grgetc.o grglun.o grgmem.o grgmsg.o grlgtr.o groptx.o grsy00.o grtermio.o grtrml.o grtter.o gruser.o | sort | uniq` ar: creating archive libpgplot.a ranlib: archive member: libpgplot.a(grdate.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grfileio.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grgetc.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grgmem.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grtermio.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(gruser.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(xwdriv.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib libpgplot.a ranlib: archive member: libpgplot.a(grdate.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grfileio.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grgetc.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grgmem.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(grtermio.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(gruser.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) ranlib: archive member: libpgplot.a(xwdriv.o) cputype (16777223) does not match previous archive members cputype (7) (all members must match) make: *** [libpgplot.a] Error 1. Anyone has any ideas? Thanks!
  21. kris walker says:
    Hello, Thanks for the website. I have a 64-bit Mac Pro. I had also successfully compiled on 64-bit before this, but didn't create a macosx device. I had a problem with seg violation on running pgdemo programs outputting to GIF device. I contacted Tim Pearson. He gave me a fix which I am about to try, but also suggested I check out your site. I just downloaded your tarball and tried it out on a fresh install, but to a local directory rather than /usr/local/pgplot. Everything compiled nicely, but when I went to execute pgdemo1, I get: >./pgdemo1 dyld: Library not loaded: /usr/local/lib/libpgplot.dylib Referenced from: /Users/walker/Research_Projects/Lib/PGPLOT/./pgdemo1 Reason: image not found Trace/BPT trap I've changed the pgplot_dist and environment variables appropriately. Any idea what I am doing wrong? I always prefer static libs. Is there an option to force all builds to use the static lib in the PGPLOT directory? I looked in the makefile that was build and here is the demo build section: pgdemo1: $(DEMDIR)/pgdemo1.f $(FCOMPL) $(FFLAGD) -o pgdemo1 $(DEMDIR)/pgdemo1.f $(PGPLOT_LIB) $(LIBS) And PGPLOT_LIBS is defied to be PGPLOT_LIB=-L`pwd` -lpgplot and SHARED_LIB is SHARED_LIB=libpgplot.dylib SHARED_LD=gcc -dynamiclib -single_module -o libpgplot.dylib -install_name /usr/local/lib/libpgplot.dylib Seems to be trying to build a shared lib version for some reason (maybe a mac system setting)? kris
  22. kris walker says:
    This is a test to separate lines on output display. IF a space exists between "display." and "IF", then use left-angle-braket P right-angle-bracket to create new lines on output display. kris
  23. jc says:
    If anyone has problem with values.h and equivalently malloc, the solution is: cd /usr/local/include sudo ln -s limits.h values.h this just creates a symbolic link from values to limits (the SL equivalent of values.h)
  24. David says:
    I'm having the same problem as Peter Jung above. I'm on a brand new iMac Intel 64bit with OS X 10.6 Build went fine and the xwindow/ps drivers work fine. The GIF driver results in this output: /usr/local/pgplot/pgdemo1 Graphics device/type (? to see list, default /NULL): ? PGPLOT v5.2.2 Copyright 1997 California Institute of Technology Interactive devices: /XWINDOW (X window window@node:display.screen/xw) Non-interactive file formats: /GIF (Graphics Interchange Format file, landscape orientation) /VGIF (Graphics Interchange Format file, portrait orientation) /NULL (Null device, no output) /PS (PostScript file, landscape orientation) /VPS (PostScript file, portrait orientation) /CPS (Colour PostScript file, landscape orientation) /VCPS (Colour PostScript file, portrait orientation) Graphics device/type (? to see list, default /NULL): /GIF version=v5.2.2 state=OPEN user=itsadmin now=22-May-2010 05:21 device=pgplot.gif file=pgplot.gif type=GIF dev/type=pgplot.gif/GIF hardcopy=YES terminal=NO cursor=NO Plot dimensions (x,y; inches): 9.99, 7.99 (mm): 253.70, 202.90 Segmentation fault I tried redoing the steps with the same results. I did down to and including step 6 above Any ideas/thoughts/suggestions greatly appreciated
  25. David says:
    Several people including Juan and Peter above helped but to fix the "Segmentation fault" with /GIF, Kris Waler relayed Tim Pearsons advice: The GIF driver and some other drivers need a minor modification for 64-bit systems: Edit the file pgplot/drivers/gidriv.f and change one INTEGER declaration to INTEGER*8, as indicated in the code: C Note: for 64-bit operating systems, change the following C declaration to INTEGER*8: C INTEGER PIXMAP, WORK That is the above line should read: INTEGER*8 PIXMAP, WORK (and then recompile).
  26. David says:
    Dear Juan, I tried step 8 above to get the Perl Module working but seem to have a problem which may be the same as yours. PGPLOT_DIR is defined as /usr/local/pgplot/ but I get this when running make test: PGPLOT-2.20 itsadmin$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl Default Device for plot tests [recommend /XSERVE] ? /XSERVE ============== Running test1.p ============== Can't load 'blib/arch/auto/PGPLOT/PGPLOT.bundle' for module PGPLOT: dlopen(blib/arch/auto/PGPLOT/PGPLOT.bundle, 2): no suitable image found. Did find: blib/arch/auto/PGPLOT/PGPLOT.bundle: mach-o, but wrong architecture at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207, line 1. at test1.p line 3 Compilation failed in require at test1.p line 3, line 1. BEGIN failed--compilation aborted at test1.p line 3, line 1. ============== Running test2.p ============== Attempt to reload PGPLOT.pm aborted. Compilation failed in require at test2.p line 3, line 1. BEGIN failed--compilation aborted at test2.p line 3, line 1. ============== Running test3.p ============== Attempt to reload PGPLOT.pm aborted. Compilation failed in require at test3.p line 3, line 1. BEGIN failed--compilation aborted at test3.p line 3, line 1. Any suggestions?
  27. Carla says:
    Hi, than you for the instructions. UI followed them and all works until the step 5 d). When, infact, the compilation stars I receive the following error message: gfortran -c /usr/local/src/pgplot/drivers/mfdriv.f /usr/local/src/pgplot/drivers/mfdriv.f:159.42: OPEN (UNIT = LUN, FILE = CHR(:LCHR), CARRIAGECONTROL = 'NONE', 1 Error: Syntax error in OPEN statement at (1) /usr/local/src/pgplot/drivers/mfdriv.f:201.17: CLOSE (LUN, DISPOSE = 'KEEP') 1 Error: Syntax error in CLOSE statement at (1) /usr/local/src/pgplot/drivers/mfdriv.f:188.18: COMBUF(1) = '8001'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:257.27: COMBUF(1) = '8203'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:268.18: COMBUF(1) = '9001'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:323.18: COMBUF(1) = 'C101'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:353.18: COMBUF(1) = 'C301'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:366.21: COMBUF(1) = 'A701'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:405.18: COMBUF(1) = 'C004'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:425.18: COMBUF(1) = 'C401'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:445.18: COMBUF(1) = 'A701'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check /usr/local/src/pgplot/drivers/mfdriv.f:589.24: BUFFER(I) = '8400'X 1 Error: Arithmetic overflow converting INTEGER(16) to INTEGER(2) at (1). This check can be disabled with the option -fno-range-check make: *** [mfdriv.o] Error 1 dhcp25:pgplot> Can somebody help me to understand the problem? Tanks in advance
  28. Pat Durrell says:
    Hi; I am having the same problem with MKDRIV.F as Carla. Now, I can get rid of most of the errors by simply adding -fno-range-check to the compiler flags under mfdriv.o towards the end of the makefile. However, I continue to get the first two errors: gfortran -fno-range-check -c /usr/local/src/pgplot/drivers/mfdriv.f /usr/local/src/pgplot/drivers/mfdriv.f:159.42: OPEN (UNIT = LUN, FILE = CHR(:LCHR), CARRIAGECONTROL = 'NONE', 1 Error: Syntax error in OPEN statement at (1) /usr/local/src/pgplot/drivers/mfdriv.f:201.17: CLOSE (LUN, DISPOSE= 'KEEP') 1 Error: Syntax error in CLOSE statement at (1) make: *** [mfdriv.o] Error 1 Any comment on these? Thanks!


Leave a Reply


  • Translate

  • Astro Pic o' the Day

  • Archives

  • Admin



↑ Top