[Thread Prev][Thread Next][Index]

Re: [ferret_users] installing ferret on OSX, 2019 experience



Hi Andy,

1.a - Anaconda does indeed have its own set of packages/libraries, so yes, there is a lot of duplication.  But this does ensure Anaconda had exactly the libraries it needs.  For the Mac, it actually is our recommended method of installing PyFerret.

1.b - On multiple occasions I have had no problem installing PyFerret using the instructions in the README.md in https://github.com/NOAA-PMEL/PyFerret under the Anaconda Installation.  (So the "/my/path/to/miniconda/bin/conda create -n FERRET -c conda-forge pyferret ferret_datasets --yes" command where "/my/path/to/miniconda" is replaced appropriately.  Note that there is no anaconda package for traditional Ferret.)  Often I then create a script called "pyferret" somewhere in the user's path (typically in $HOME/bin/) containing to conda commands to activate the FERRET environment and run the anaconda pyferret:
#! /bin/sh
.   /my/path/to/miniconda/bin/activate FERRET
/my/path/to/miniconda/envs/FERRET/bin/pyferret $*
(again, substituting /my/path/to/miniconda appropriately; remember to make the script executable - "chmod 755 pyferret") which allows the user to run PyFerret without having to worry about being in a bash shell and activating the environment.

1.c - I do not know if there are any conflicts with having both MacPorts and Anaconda.  I am not sure if that might have been a source of complications for you.

2.a - It would be nice if there was a proper "configure" for PyFerret (and possibly Ferret), but we just haven't had time available to put that together.  With the Anaconda build available, there is even less pressure to work on that.

2.b - FC is defined in platform_specific.mk.intel-mac and could be changed there.  What is there sets FC to the reply of the shell command "which gfortran".

2.c - If you wish to use NetCDF dynamic/shared libraries instead of static libraries, leave the definition of HDF5_LIBDIR empty in the site_specific.mk file.  (This goes for either traditional Ferret or PyFerret.)  If you are building for you own system (and not a distribution), one probably should use the dynamic/shared libraries; I need to update the documentation example.  With HDF5_LIBDIR empty, the flags to link in the NetCDF libraries then becomes "-L$(NETCDF_LIBDIR) -lnetcdff -lnetcdf"  (thus, leaves it up to the compiler to figure it out).

Karl



On Tue, Apr 9, 2019 at 10:16 AM Andy Jacobson <andy.jacobson@xxxxxxxx> wrote:
Howdy Folks,

I just succeeded in installing ferret 7.442 on a new Macbook running OS
X 10.14.4, and I have some experiences to report.

(1) Sure I wanted to try out pyferret. My experience with this install
was not good, however. There are confusing circular references all
throughout the website, no possibility of precompiled binaries, and
anaconda is astonishingly complex. It looks like a whole duplicate set
of unix packages, like another MacPorts/Homebrew system. I eventually
got miniconda installed, but could not convince it to download, compile,
install, or run ferret. Happy to rm -rf that whole mess.

(2) I was able to compile from source by cloning the git repo following
https://github.com/NOAA-PMEL/Ferret/blob/master/README_ferret_mac_homebrew.md
and making appropriate changes to platform_specific.mk.intel-mac and and
site_specific.mk.  Yay for the good old days. My main challenge is that
I use MacPorts, not Homebrew, for the netCDF, readline, szip, etc.
libraries. I could not get MacPorts to install static libraries in many
cases (this apparently needs to be specifically added by package
developer). Here's what I had to do:

  - copy /opt/local/bin/gfortran-mp-8 to /opt/local/bin/gfortran. Could
not convince the Make system to use a different FC. This ought to be fixed.

  - needed to install not just the MacPorts netcdf package, but also
netcdf-fortran.

  - all LIBDIR variables in site_specific.mk are set to /opt/local/lib

  - the references to .a static libraries in
platform_specific.mk.intel-mac had to be changed to .dylib:

else ifeq ($(strip $(SZ_LIBDIR)),)
#       CDFLIB          = $(NETCDF_LIBDIR)/libnetcdff.a \
#                         $(NETCDF_LIBDIR)/libnetcdf.a \
#                         $(HDF5_LIBDIR)/libhdf5_hl.a \
#                         $(HDF5_LIBDIR)/libhdf5.a
         CDFLIB          = $(NETCDF_LIBDIR)/libnetcdff.dylib \
                           $(NETCDF_LIBDIR)/libnetcdf.dylib \
                           $(HDF5_LIBDIR)/libhdf5_hl.dylib \
                           $(HDF5_LIBDIR)/libhdf5.dylib
else
#       CDFLIB          = $(NETCDF_LIBDIR)/libnetcdff.a \
#                         $(NETCDF_LIBDIR)/libnetcdf.a \
#                         $(HDF5_LIBDIR)/libhdf5_hl.a \
#                         $(HDF5_LIBDIR)/libhdf5.a \
#                         $(SZ_LIBDIR)/libsz.a
         CDFLIB          = $(NETCDF_LIBDIR)/libnetcdff.dylib \
                           $(NETCDF_LIBDIR)/libnetcdf.dylib \
                           $(HDF5_LIBDIR)/libhdf5_hl.dylib \
                           $(HDF5_LIBDIR)/libhdf5.dylib \
                           $(SZ_LIBDIR)/libsz.dylib


Sorry if this is a knock on pyferret, but my summary is that the install
system is not ready for prime time.

--
Andy Jacobson
andy.jacobson@xxxxxxxx

NOAA Earth System Research Lab
Global Monitoring Division
325 Broadway R/GMD1
Boulder, Colorado 80305

303/497-4916


--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement