Hi Paul,

  A colleague of mine, and nevertheless a friend, was in the same
predicament. I installed gfortran and psplot for him successfully. Note
that I am more of a Linux person than a MacOS. Here is what I did
- installed brew
- installed gfortran with brew
- downloaded psplot from source and build it w/ cmake and make
- downloaded GSL with brew
- install xquartz to add X support (w/ brew?)
- compiled his codes, that needed some tweaking to adjust to the latest
version of psplot

I wrote Makefile files for him, here is what on looks like for his desktop
Mac Studio running Sonoma 14.6.1

FC = gfortran -std=gnu -ffixed-line-length-132
GSL=/opt/homebrew/Cellar/gsl/2.7.1
LDIR = /Users/gmelnick/plplot/lib-5.15.0/lib
MDIR = /Users/gmelnick/plplot/lib-5.15.0/lib/fortran/modules/plplot
CODE = AFGL_TRANS

code:
       $(FC) -c $(CODE).f -I$(MDIR)
       $(FC) -o $(CODE) $(CODE).o -L$(LDIR) -lplplotfortran

As you can see, the build of plplot was installed in
/Users/gmelnick/plplot/lib-5.15.0/lib, GSL in the cellar
The options to gfortran are needed to accommodate his fortran style.

On his MacBook Pro laptop, running Sequoia 15.2, the Makefile became:

FC = gfortran -std=gnu -ffixed-line-length-132
GSL=/opt/homebrew/Cellar/gsl/2.8
LDIR = /Users/gmelnick/plplot/lib-5.15.0/lib
MDIR = /Users/gmelnick/plplot/lib-5.15.0/lib/fortran/modules/plplot
CODE = AFGL_TRANS

code:
      $(FC) -c $(CODE).f -I$(MDIR)
      $(FC) -o $(CODE) $(CODE).o -L$(LDIR) -lplplotfortran

Note that for his laptop, I had to build psplot from source with gfortran
v13, not v14, and had to install cairo and maybe more to get the
xcairo device to work properly. The xwin device was not behaving the same
way under  OSX15.2 than OSX14.6.1 (gfortran 13.1 vs 13.2).

Also the psplot lib loaded with brew would not support either xwin or
xcairo (interactive devices), hence the need to build psplot from source
(cmake, make, make install, nothing special, besides specifying the
destination for the install, using gfortran-13 for OX15.2 and checking that
cmake find the libs to build the xwin and xcairo devices). Also, the
location of the dynamics libs needed to be specified w/ an env variable to
run (DYLD_LIBRARY_PATH)

As far as creating exec that can be distributed, you need to link
differently (and compile?) to use static libs instead of dynamic ones,
otherwise you will need to distributed the dyn libs too (ldd is the linux
command to show dyn libs info, it may work the same way under OSX?). Check
the doc on gfortran for static linking.

Hope this helps.

    Cheers,
      Sylvain
--



On Mon, Jan 27, 2025 at 10:07 PM p...@krusic.org <p...@krusic.org> wrote:

> Really sorry/embarrassed to ask this, but has anyone tried building
> distributable f77 programs that use plplot for plotting with the latest Mac
> OS?
>
> I have installed gfortran in /usr/local/bin and plplot in
> /opt/homebrew/Cellar/ what I cannot figure out is which libraries must be
> included when attempting to build a program. Till now I have been using
> Absofts last compiler which automatically included all the necessary plplot
> libraries with a simple button, but alas that product is no longer with us.
> Now I am faced with going back to the old command line/unix terminal mode
> and the years have not been kind -Apple’s continual OS updates haven’t
> helped much either. Like probably many on this forum I provide a number of
> programs for my community and I would like to continue maintaining them.
> The demise of Absoft’s wonderful compiler has put a cramp on that.
>
> As you can see from my attempt below, I really do not know what I am doing
> here, or maybe enough to be dangerous. Any direction would be much
> appreciated!
>
> Sincerely,
>
> -pjk
>
>
>
> /usr/local/bin/gfortran -ffixed-line-length-132 -fdec -fdec-static \
>
>         -o x01f x01f.f PLpgPLOT_fonts.o  \
>
>         -I/opt/homebrew/include/ -L /opt/homebrew/lib \
>
>         -L`pwd` -L/opt/homebrew/Cellar/plplot/5.15.0_4/lib \
>
>         -L/opt/homebrew/Cellar/plplot/5.15.0_4/lib/fortran/modules/plplot \
>
>         -L opt/homebrew/lib -lpng -lz -L/opt/X11 -lX11 -lXau -lXdmcp
> _______________________________________________
> Plplot-general mailing list
> Plplot-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-general
>
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to