From f4ebd4d4e4db9651a9719bcd485b961cc41c9b68 Mon Sep 17 00:00:00 2001 From: Karl Smith Date: Thu, 25 Apr 2019 18:40:09 +0000 Subject: [PATCH] Change F77 to FC; defined CC, FC (and LD for ext func) in site_specific.mk files; update README.md with info on these changes git-svn-id: file:///home/users/tmap/svn/repos/ferret/branches/pyferret@26201 fdbf22ae-c210-0410-be80-ca943da6b8f8 --- README.md | 153 +++++++++--------- bin/build_fonts/unix/Makefile | 4 +- external_functions/cat/Makefile | 2 +- external_functions/closest_in_list/Makefile | 2 +- external_functions/cmprsi_by/Makefile | 2 +- external_functions/contributed/Makefile | 2 +- external_functions/convolve/Makefile | 2 +- external_functions/date_and_time/Makefile | 2 +- external_functions/decimate/Makefile | 2 +- .../platform_specific.mk.i386-linux | 4 - .../ef_utility/platform_specific.mk.intel-mac | 4 - .../platform_specific.mk.x86_64-linux | 4 - .../ef_utility/site_specific.mk.in | 22 +++ external_functions/eof/Makefile | 2 +- external_functions/examples/Makefile | 2 +- external_functions/extrema/Makefile | 4 +- .../featurecollections/Makefile | 2 +- external_functions/fft/Makefile | 4 +- external_functions/godae_obs/Makefile | 2 +- external_functions/gridding/Makefile | 5 +- external_functions/hinterp/Makefile | 8 +- external_functions/lanczos/Makefile | 2 +- external_functions/las/Makefile | 8 +- external_functions/ncedit/Makefile | 5 +- external_functions/obs_viz/Makefile | 2 +- external_functions/pnpoly/Makefile | 8 +- external_functions/romea/Makefile | 2 +- external_functions/sort/Makefile | 8 +- external_functions/statistics/Makefile | 8 +- external_functions/stringfcns/Makefile | 8 +- external_functions/tax_times/Makefile | 2 +- external_functions/transpose/Makefile | 2 +- external_functions/v5d/Makefile | 2 +- external_functions/zaxr/Makefile | 2 +- platform_specific.mk.i386-linux | 3 - platform_specific.mk.i386-linux-gnu | 3 - platform_specific.mk.intel-mac | 3 - platform_specific.mk.x86_64-linux | 9 +- platform_specific.mk.x86_64-linux-gnu | 3 - site_specific.mk.in | 11 ++ 40 files changed, 191 insertions(+), 134 deletions(-) diff --git a/README.md b/README.md index 06bf38a68..f626f0c52 100644 --- a/README.md +++ b/README.md @@ -3,45 +3,44 @@ The PyFerret program and Python module from NOAA/PMEL. See [https://ferret.pmel.noaa.gov/Ferret/](https://ferret.pmel.noaa.gov/Ferret/) for more information about Ferret and PyFerret. -This repository is regularly synchronized with PyFerret repository at PMEL -(the pyferret branch of the ferret project in the subversion repository at +This repository is regularly synchronized with PyFerret repository at PMEL +(the pyferret branch of the ferret project in the subversion repository at PMEL) using git-svn. #### Legal Disclaimer -*This repository is a software product and is not official communication -of the National Oceanic and Atmospheric Administration (NOAA), or the -United States Department of Commerce (DOC). All NOAA GitHub project -code is provided on an 'as is' basis and the user assumes responsibility -for its use. Any claims against the DOC or DOC bureaus stemming from -the use of this GitHub project will be governed by all applicable Federal -law. Any reference to specific commercial products, processes, or services -by service mark, trademark, manufacturer, or otherwise, does not constitute -or imply their endorsement, recommendation, or favoring by the DOC. -The DOC seal and logo, or the seal and logo of a DOC bureau, shall not -be used in any manner to imply endorsement of any commercial product +*This repository is a software product and is not official communication +of the National Oceanic and Atmospheric Administration (NOAA), or the +United States Department of Commerce (DOC). All NOAA GitHub project +code is provided on an 'as is' basis and the user assumes responsibility +for its use. Any claims against the DOC or DOC bureaus stemming from +the use of this GitHub project will be governed by all applicable Federal +law. Any reference to specific commercial products, processes, or services +by service mark, trademark, manufacturer, or otherwise, does not constitute +or imply their endorsement, recommendation, or favoring by the DOC. +The DOC seal and logo, or the seal and logo of a DOC bureau, shall not +be used in any manner to imply endorsement of any commercial product or activity by the DOC or the United States Government.* ## Ferret/PyFerret Documentation -For more information on using PyFerret, see the Ferret and PyFerret documentation under +For more information on using PyFerret, see the Ferret and PyFerret documentation under [https://ferret.pmel.noaa.gov/Ferret/](https://ferret.pmel.noaa.gov/Ferret/) Information about the Ferret email users group, and archives of past discussions -from the group (which should be searched prior to sending a question to the email -users group) can be found at +from the group (which should be searched prior to sending a question to the email +users group) can be found at [https://ferret.pmel.noaa.gov/Ferret/email-users-group/](https://ferret.pmel.noaa.gov/Ferret/email-users-group/) ## Jupyter / iPython notebook -The latest ferretmagic module from Patrick Brockmann for using PyFerret +The latest ferretmagic module from Patrick Brockmann for using PyFerret with the iPython notebook can be obtained using `pip install ferretmagic`, or see [https://pypi.org/project/ferretmagic/](https://pypi.org/project/ferretmagic/). Note that this only installs the ferretmagic module for PyFerret; it does not install PyFerret. ## Anaconda Installation - Linux, OS X, and Windows 10/bash - -Download and install minicoda for your system from +Download and install minicoda for your system from [https://docs.conda.io/en/latest/miniconda.html](https://docs.conda.io/en/latest/miniconda.html) Note that Windows 10 bash must use the Linux version! Either python version of miniconda is fine; PyFerret works with ether python 2.x or python 3.x @@ -53,7 +52,7 @@ Execute the following command on the terminal to install `pyferret` as well as ``` (substituting `/my/path/to/miniconda` with the appropriate value). -To start using PyFerret, execute the following command from a Bourne shell +To start using PyFerret, execute the following command from a Bourne shell (such as bash) that you will be working in: ```shell . /my/path/to/miniconda/bin/activate FERRET @@ -74,7 +73,7 @@ will set up all the variables that PyFerret needs. (You can test whether the PyFerret environment is activated by issuing the command `echo $FER_DATA` and see if it returns a directory name.) -If you usually work under a C-shell (such as tcsh) or outside the conda environment, +If you usually work under a C-shell (such as tcsh) or outside the conda environment, you may want to create a Bourne shell script that activates and runs PyFerret within the Bourne shell that is created for running the script. Such a script would look something like the following @@ -83,11 +82,11 @@ Such a script would look something like the following . /my/path/to/miniconda/bin/activate FERRET /my/path/to/miniconda/envs/FERRET/bin/pyferret $* ``` -(substituting `/my/path/to/miniconda` with the appropriate value. If you used another +(substituting `/my/path/to/miniconda` with the appropriate value. If you used another name for the environment, substitute that name for `FERRET` in the above script.) -If this script was called `pyferret.sh`, made executable (`chmod 755 pyferret.sh`), and placed -in a directory listed in your `$PATH` enviroment variable, you can just type `pyferret.sh` (followed -by any desired arguments) from the command line to run PyFerret. +If this script was called `pyferret.sh`, made executable (`chmod 755 pyferret.sh`), +and placed in a directory listed in your `$PATH` enviroment variable, you can just type +`pyferret.sh` (followed by any desired arguments) from the command line to run PyFerret. ## Installation from prebuilt tar.gz file @@ -114,18 +113,16 @@ If you do not have the Ferret/PyFerret standard datasets, they can be obtained f The contents can be put extracted/cloned to whatever location desired. Extract the PyFerret tar.gz file in the desired location. -Starting with PyFerret v7, there is only one tar.gz file which -extracts all its contents to a subdirectory that it creates -(as apposed to Ferret which has separate `fer_environment` and -`fer_executables` tar.gz files that extract into the current directory). -If desired, at this time you can change the name of this subdirectory -that was created. - -Move into this PyFerret installation directory and run the `bin/Finstall` -script to create the `ferret_paths.sh`, `ferret_paths.csh`, and `pyferret` -scripts. The value of `FER_DIR`, the Ferret/PyFerret installation directory, -should be this installation directory, which can be specified as `.` (a period) -which means the current directory. +Starting with PyFerret v7, there is only one tar.gz file which extracts all its contents +to a subdirectory that it creates (as apposed to Ferret which has separate `fer_environment` +and `fer_executables` tar.gz files that extract into the current directory). +If desired, at this time you can change the name of this subdirectory that was created. + +Move into this PyFerret installation directory and run the `bin/Finstall` script +to create the `ferret_paths.sh`, `ferret_paths.csh`, and `pyferret` scripts. +The value of `FER_DIR`, the Ferret/PyFerret installation directory, should be +this installation directory, which can be specified as `.` (a period) which means +the current directory. (If `FER_DIR` is already defined for another Ferret/PyFerret installation, you will need to tell the script to use a new value.) For `FER_DSETS`, the Ferret/PyFerret standard datasets, specify the directory @@ -141,19 +138,27 @@ e.g., bash) or `source ferret_paths.csh` (for C-type shells; e.g. tcsh). ## Building PyFerret from source -Please note that these are general instructions that are not fully verified; names +Please note that these are general instructions that are not fully verified; names of installation packages may vary slightly for you particular operating system. -In particular, some systems have special development (`-dev`) packages that provide -the include files, and shared-object libraries without a numeric extension, that are +In particular, some systems have special development (`-dev`) packages that provide +the include files, and shared-object libraries without a numeric extension, that are needed for compiling and linking the PyFerret code. On other systems, these include and library files are part of the standard package. These instructions assume your package manager provides recent versions of HDF5 and NetCDF. +#### If you have previously built PyFerret from source + +The definitions of CC, FC, and LD (the last only for building external +functions written in Fortran) were moved to the `site_specific.mk.in` files. +(These were previously defined in the `platform_specific.mk.*` files.) +If you already have customized `site_specific.mk` files, please appropriately +updated your customized files with these additional definitions. + #### Packages from the package manager -If not already installed on your system, install the following packages using the package -manager for your operating system, or a command-line package installation program such as -`yum` or `apt-get` (which needs to be run as a system administator - as "root" - or using +If not already installed on your system, install the following packages using the package +manager for your operating system, or a command-line package installation program such as +`yum` or `apt-get` (which needs to be run as a system administator - as "root" - or using the `sudo` privilege escalation program): - `gfortran`, or `gcc` (Gnu Compiler Collection) on some systems - for the gfortran compiler and library - `libcairo`, `libcairo-dev`, `cairo`, or `cairo-dev` - for the cairographics library and include files @@ -163,8 +168,8 @@ the `sudo` privilege escalation program): - `netcdf` - for NetCDF 4.x include and library files The NetCDF package should add the HDF5 packages as a dependency. -Some package manager programs (such as Homebrew) have their own version of Python separate -from the operating system; if so, the NumPy and PyQt packages should add the python package(s) +Some package manager programs (such as Homebrew) have their own version of Python separate +from the operating system; if so, the NumPy and PyQt packages should add the python package(s) as dependencies. You may also want, if not already installed: @@ -173,14 +178,14 @@ You may also want, if not already installed: - `pyshp`, or `python-pyshp` - for shapefile functions in PyFerret Note that `pyshp` is pure-python code and can also be installed using `pip2` -(part of python2.x) or `pip3` (part of python3.x). +(part of python2.x) or `pip3` (part of python3.x). #### PyFerret source code -The green `Clone or download` button at the top of the PyFerret GitHub +The green `Clone or download` button at the top of the PyFerret GitHub `Code` page/tab gives you options for obtaining the latest PyFerret source code. -You can get a copy of the latest source as a zip file, but a better option, -if you can, is to use "git" commands to clone the repository (the source code, +You can get a copy of the latest source as a zip file, but a better option, +if you can, is to use "git" commands to clone the repository (the source code, plus history and version control of the source code) to your local system. The git comands to clone the PyFerret repository look something like the following @@ -206,6 +211,8 @@ configuration file appropriately for your system; for example: DIR_PREFIX = $(HOME)/git/PyFerret INSTALL_FER_DIR = /usr/local/PyFerret BUILDTYPE = x86_64-linux +CC = $(shell which gcc) +FC = $(shell which gfortran) PYTHON_EXE = python2.7 GFORTRAN_LIB = $(shell $(FC) --print-file-name=libgfortran.a) CAIRO_LIBDIR = @@ -224,21 +231,18 @@ Similarly, copy `external_functions/ef_utility/site_specific.mk.in` to `external_functions/ef_utility/site_specific.mk`: ```shell BUILDTYPE = x86_64-linux +CC = $(shell which gcc) +FC = $(shell which gfortran) +LD = $(shell which gfortran) PYTHON_EXE = python2.7 ``` -The compilers used are specified in the `platform_specific.mk.*` file -appropriate for your system. (The final extension is the value of `BUILDTYPE` -given in your `site_specific.mk` file.) If you wish to use a different -compiler that that given (usually `gfortran` and `gcc`), change the value of -`CC`, `FC`, and `F77` in the appropriate `platform_specific.mk.*` file. - -If you have previously built PyFerret (successfully or not) from this source +If you have previously built PyFerret (successfully or not) from this source directory or repository, run the command: ```shell make clean ``` -to make sure you remove all previously generated files. +to make sure you have removed all previously generated files. Then run the command: ```shell make @@ -247,17 +251,18 @@ to build PyFerret. This build will take a bit of time (minutes) and will generate a lot of output, so you may wish to redirect output and run this command in the background. -When the build has successfully completed, install PyFerret in the location given -by the value of `INSTALL_FER_DIR` in the `site_specific.mk` file by running the following -command. (If the installation directory exists and is not empty, you should -move or remove any contents of that directory to ensure a clean installation.) +When the build has successfully completed, install PyFerret in the location given +by the value of `INSTALL_FER_DIR` in the `site_specific.mk` file by running the +following command. +(If the installation directory exists and is not empty, you should move or remove +any contents of that directory to ensure a clean installation.) ```shell make install ``` -You may need to be logged in as a system administrator (as "root") or use the "sudo" -privilege escalation command (thus, `sudo make install`), to install PyFerret -system-wide (such as installing in `/usr/local/PyFerret` as in the example -`site_specific.mk` file given above. +You may need to be logged in as a system administrator (as "root") or use the +"sudo" privilege escalation command (thus, `sudo make install`), to install +PyFerret system-wide (such as installing in `/usr/local/PyFerret` as in the +example `site_specific.mk` file given above. #### Standard Ferret/PyFerret datasets @@ -265,33 +270,33 @@ If you do not have the standard Ferret/PyFerret datasets, they can be downloaded [https://github.com/NOAA-PMEL/FerretDatasets/](https://github.com/NOAA-PMEL/FerretDatasets/) either as a zip file download or as a git cloned repository (similar to obtaining the PyFerret source). -If you already have a copy of these datasets on your system, these datasets can be +If you already have a copy of these datasets on your system, these datasets can be shared between Ferret and PyFerret, including different versions of these programs. You can also add any of your own datasets that might be frequently used. These datasets will be needed as part of the following PyFerret configuration. #### (Py)Ferret configuration -Change to the PyFerret installation directory (the value of `INSTALL_FER_DIR`) +Change to the PyFerret installation directory (the value of `INSTALL_FER_DIR`) created above and run the script: ```shell bin/Finstall ``` to create the `ferret_paths.sh`, `ferret_paths.csh`, and `pyferret` scripts. -The value of `FER_DIR`, the Ferret/PyFerret installation directory, should be this -installation directory, which can be specified as `.` (a period) which means the +The value of `FER_DIR`, the Ferret/PyFerret installation directory, should be this +installation directory, which can be specified as `.` (a period) which means the current directory. -The value of `FER_DSETS` should be the directory containing the standard +The value of `FER_DSETS` should be the directory containing the standard Ferret/PyFerret dataset mentioned above. -Before running PyFerret for the first time in a new terminal window (shell), -you will need to set the Ferret/PyFerret environment variables using the +Before running PyFerret for the first time in a new terminal window (shell), +you will need to set the Ferret/PyFerret environment variables using the appropriate `ferret_paths` script: ```shell . /my/path/to/ferret_paths.sh ``` -(a period, a space, and the path to the `ferret_paths.sh` script) -for Bourne-type shells (such as bash), or +(a period, a space, and the path to the `ferret_paths.sh` script) +for Bourne-type shells (such as bash), or ```shell source /my/path/to/ferret_paths.csh ``` diff --git a/bin/build_fonts/unix/Makefile b/bin/build_fonts/unix/Makefile index 23e620a8b..cfa58ce13 100644 --- a/bin/build_fonts/unix/Makefile +++ b/bin/build_fonts/unix/Makefile @@ -4,7 +4,7 @@ # builds and runs the executable to write the # binary character and symbol font files. # Just use long lists of files. -# Expects environment variables F77 and PLOTFONTS to be defined. +# Expects environment variables FC and PLOTFONTS to be defined. # No need for any compiler flags. include ../../../site_specific.mk @@ -13,7 +13,7 @@ include ../../../platform_specific.mk.$(BUILDTYPE) all: binary binary: binary.F - $(F77) $(FFLAGS) -o binary binary.F + $(FC) $(FFLAGS) -o binary binary.F ./binary in_fnt01a.chr fnt01.chr ./binary in_fnt02a.chr fnt02.chr ./binary in_fnt03a.chr fnt03.chr diff --git a/external_functions/cat/Makefile b/external_functions/cat/Makefile index 14a542264..a7c53df74 100644 --- a/external_functions/cat/Makefile +++ b/external_functions/cat/Makefile @@ -26,7 +26,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/closest_in_list/Makefile b/external_functions/closest_in_list/Makefile index b365de121..651f7b225 100644 --- a/external_functions/closest_in_list/Makefile +++ b/external_functions/closest_in_list/Makefile @@ -25,7 +25,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/cmprsi_by/Makefile b/external_functions/cmprsi_by/Makefile index 74747b408..714d01edc 100644 --- a/external_functions/cmprsi_by/Makefile +++ b/external_functions/cmprsi_by/Makefile @@ -30,7 +30,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/contributed/Makefile b/external_functions/contributed/Makefile index 214f89890..830dac806 100644 --- a/external_functions/contributed/Makefile +++ b/external_functions/contributed/Makefile @@ -33,7 +33,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/convolve/Makefile b/external_functions/convolve/Makefile index 684b2c5e0..98b8a15be 100644 --- a/external_functions/convolve/Makefile +++ b/external_functions/convolve/Makefile @@ -28,7 +28,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/date_and_time/Makefile b/external_functions/date_and_time/Makefile index 23a485ceb..f8a1319f6 100644 --- a/external_functions/date_and_time/Makefile +++ b/external_functions/date_and_time/Makefile @@ -37,7 +37,7 @@ DAT_OBJS = date_decode.o time_decode.o secs_to_ymdhms.o $(LD) $(LD_DYN_FLAGS) $(DAT_OBJS) $*.o $(SYSLIBS) -o $*.so .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(DAT_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/decimate/Makefile b/external_functions/decimate/Makefile index 62e4cc89a..f0e7dc88a 100644 --- a/external_functions/decimate/Makefile +++ b/external_functions/decimate/Makefile @@ -19,7 +19,7 @@ SUB_OBJS = piecewise_subs.o # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/ef_utility/platform_specific.mk.i386-linux b/external_functions/ef_utility/platform_specific.mk.i386-linux index 27b9404cf..75c3769a9 100644 --- a/external_functions/ef_utility/platform_specific.mk.i386-linux +++ b/external_functions/ef_utility/platform_specific.mk.i386-linux @@ -9,16 +9,12 @@ INCLUDES = -I. -I../ef_utility -I../ef_utility/ferret_cmn -CC = $(shell which gcc) CFLAGS = -fPIC -m32 -O -Ddouble_p $(INCLUDES) -FC = $(shell which gfortran) -F77 = $(shell which gfortran) FFLAGS = -fPIC -m32 -O -Ddouble_p -fno-second-underscore \ -fno-backslash -fdollar-ok -ffixed-line-length-132 \ -fdefault-real-8 -fdefault-double-8 -malign-double $(INCLUDES) -LD = $(shell which gfortran) LD_DYN_FLAGS = -fPIC -m32 -shared -Wl,--no-undefined SYSLIBS = ../ef_utility/copy_ferret_ef_mem_subsc.o \ -L$(INSTALL_FER_DIR)/lib/$(PYTHON_EXE)/site-packages/pyferret \ diff --git a/external_functions/ef_utility/platform_specific.mk.intel-mac b/external_functions/ef_utility/platform_specific.mk.intel-mac index 23e318bfc..294e507bc 100644 --- a/external_functions/ef_utility/platform_specific.mk.intel-mac +++ b/external_functions/ef_utility/platform_specific.mk.intel-mac @@ -9,16 +9,12 @@ INCLUDES = -I. -I../ef_utility -I../ef_utility/ferret_cmn -CC = $(shell which clang) CFLAGS = -fPIC -O -Ddouble_p $(INCLUDES) -FC = $(shell which gfortran) -F77 = $(shell which gfortran) FFLAGS = -fPIC -O -Ddouble_p -fno-second-underscore \ -fno-backslash -fdollar-ok -ffixed-line-length-132 \ -fdefault-real-8 -fdefault-double-8 -O $(INCLUDES) -LD = $(shell which gfortran) LD_DYN_FLAGS = -fPIC -bundle -undefined dynamic_lookup SYSLIBS = ../ef_utility/copy_ferret_ef_mem_subsc.o diff --git a/external_functions/ef_utility/platform_specific.mk.x86_64-linux b/external_functions/ef_utility/platform_specific.mk.x86_64-linux index ae03e3941..f3fdbc5d5 100644 --- a/external_functions/ef_utility/platform_specific.mk.x86_64-linux +++ b/external_functions/ef_utility/platform_specific.mk.x86_64-linux @@ -9,16 +9,12 @@ INCLUDES = -I. -I../ef_utility -I../ef_utility/ferret_cmn -CC = $(shell which gcc) CFLAGS = -fPIC -m64 -O -Ddouble_p $(INCLUDES) -FC = $(shell which gfortran) -F77 = $(shell which gfortran) FFLAGS = -fPIC -m64 -O -Ddouble_p -fno-second-underscore \ -fno-backslash -fdollar-ok -ffixed-line-length-132 \ -fdefault-real-8 -fdefault-double-8 -O $(INCLUDES) -LD = $(shell which gfortran) LD_DYN_FLAGS = -fPIC -m64 -shared -Wl,--no-undefined # Some compilers add an OS spec between libpyferret and .so # This also takes care of whether to use lib or lib64 diff --git a/external_functions/ef_utility/site_specific.mk.in b/external_functions/ef_utility/site_specific.mk.in index a844cd24a..38a2b904c 100644 --- a/external_functions/ef_utility/site_specific.mk.in +++ b/external_functions/ef_utility/site_specific.mk.in @@ -33,6 +33,28 @@ BUILDTYPE = x86_64-linux # INSTALL_FER_DIR = $(HOME)/PyFerret INSTALL_FER_DIR = $(FER_DIR) +## ========================= +## C and Fortran compilers to use. The construct "$(shell which gcc)" assigns +## the response to "which gcc" run from a Bourne shell (such as bash). +## When compiling for Mac OS X, one may wish to use clang instead of gcc. +## If you wish to use values already defined in you shell environment when +## you run make, comment out all definitions of CC and FC (do NOT leave blank). +## ========================= +# CC = $(shell which clang) +CC = $(shell which gcc) +FC = $(shell which gfortran) + +## ========================= +## Linker used to generate executables and shared-object libraries. +## Normally the Fortran compiler is used which then calls the actual +## linker with appropriate flags and system-level Fortran libraries. +## The construct "$(shell which gfortran)" assigns the response to +## "which gfortran" run from a Bourne shell (such as bash). +## If you wish to use a value already defined in you shell environment when +## you run make, comment out all definitions of LD (do NOT leave blank). +## ========================= +LD = $(shell which gfortran) + ## ========================= ## Python version used by PyFerret ## ========================= diff --git a/external_functions/eof/Makefile b/external_functions/eof/Makefile index 3eef714bc..a6d69c952 100644 --- a/external_functions/eof/Makefile +++ b/external_functions/eof/Makefile @@ -38,7 +38,7 @@ SUB_OBJS = eofsubs.o # once eof_space etc are linked into Ferret dont need SUB_OBJS .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/examples/Makefile b/external_functions/examples/Makefile index 7d215770e..c62a7e6f9 100644 --- a/external_functions/examples/Makefile +++ b/external_functions/examples/Makefile @@ -32,7 +32,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/extrema/Makefile b/external_functions/extrema/Makefile index 80b787b5f..7288fda31 100644 --- a/external_functions/extrema/Makefile +++ b/external_functions/extrema/Makefile @@ -31,10 +31,10 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.o: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o minminmax.o maxminmax.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/featurecollections/Makefile b/external_functions/featurecollections/Makefile index 76c953d37..f217bfc09 100644 --- a/external_functions/featurecollections/Makefile +++ b/external_functions/featurecollections/Makefile @@ -17,7 +17,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/fft/Makefile b/external_functions/fft/Makefile index fdf03847d..c89a1a6b5 100644 --- a/external_functions/fft/Makefile +++ b/external_functions/fft/Makefile @@ -9,7 +9,7 @@ # remove refs to ef_utility/*.o (now in ferret executable) # # 2/2001 debug macros -# 1/2002 need $(F77) in .F.so rule +# 1/2002 need $(FC) in .F.so rule # and compile ffta_sample, fftp_sample functions # 7/2012 Do not need a special platform_specific file. @@ -37,7 +37,7 @@ SUB_OBJS = fftinv_subs.o fftsubs.o # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/godae_obs/Makefile b/external_functions/godae_obs/Makefile index 5c1297806..f9872909f 100644 --- a/external_functions/godae_obs/Makefile +++ b/external_functions/godae_obs/Makefile @@ -34,7 +34,7 @@ GOB_OBJS = ocn_obs.o $(LD) $(LD_DYN_FLAGS) $(GOB_OBJS) $*.o $(SYSLIBS) -o $*.so .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(GOB_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/gridding/Makefile b/external_functions/gridding/Makefile index 67f9dfa0f..7988821e7 100644 --- a/external_functions/gridding/Makefile +++ b/external_functions/gridding/Makefile @@ -32,9 +32,12 @@ SUB_OBJS = modscatminmax.o nobsxytv.o scat2grid_subs_mask.o # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/hinterp/Makefile b/external_functions/hinterp/Makefile index e0e6f6c50..6a2e7ed5e 100644 --- a/external_functions/hinterp/Makefile +++ b/external_functions/hinterp/Makefile @@ -32,9 +32,15 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so +.c.o: + $(CC) $(CFLAGS) -c $< + +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/lanczos/Makefile b/external_functions/lanczos/Makefile index 9ed5be4a8..501c70901 100644 --- a/external_functions/lanczos/Makefile +++ b/external_functions/lanczos/Makefile @@ -27,7 +27,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/las/Makefile b/external_functions/las/Makefile index 64256cf12..9f4cb2511 100644 --- a/external_functions/las/Makefile +++ b/external_functions/las/Makefile @@ -32,9 +32,15 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so +.c.o: + $(CC) $(CFLAGS) -c $< + +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/ncedit/Makefile b/external_functions/ncedit/Makefile index ce3418255..3daffb839 100644 --- a/external_functions/ncedit/Makefile +++ b/external_functions/ncedit/Makefile @@ -32,9 +32,12 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/obs_viz/Makefile b/external_functions/obs_viz/Makefile index 819f000fc..ebb7b2cae 100644 --- a/external_functions/obs_viz/Makefile +++ b/external_functions/obs_viz/Makefile @@ -26,7 +26,7 @@ DAT_OBJS = flag2ddups.o # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(DAT_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/pnpoly/Makefile b/external_functions/pnpoly/Makefile index 214b37ee8..0f092d4fd 100644 --- a/external_functions/pnpoly/Makefile +++ b/external_functions/pnpoly/Makefile @@ -25,9 +25,15 @@ SUB_OBJS = pnpoly_subs.o # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so +.c.o: + $(CC) $(CFLAGS) -c $< + +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/romea/Makefile b/external_functions/romea/Makefile index 20244ad97..a0fbf731d 100644 --- a/external_functions/romea/Makefile +++ b/external_functions/romea/Makefile @@ -31,7 +31,7 @@ SUB_OBJS = rr_density.o # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(SUB_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/sort/Makefile b/external_functions/sort/Makefile index 5b453a9b3..b6b23062c 100644 --- a/external_functions/sort/Makefile +++ b/external_functions/sort/Makefile @@ -32,9 +32,15 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so +.c.o: + $(CC) $(CFLAGS) -c $< + +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/statistics/Makefile b/external_functions/statistics/Makefile index fd41ad7b3..11f6b29c5 100644 --- a/external_functions/statistics/Makefile +++ b/external_functions/statistics/Makefile @@ -31,9 +31,15 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so +.c.o: + $(CC) $(CFLAGS) -c $< + +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/stringfcns/Makefile b/external_functions/stringfcns/Makefile index caed256c2..9c0580f51 100644 --- a/external_functions/stringfcns/Makefile +++ b/external_functions/stringfcns/Makefile @@ -32,9 +32,15 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so +.c.o: + $(CC) $(CFLAGS) -c $< + +.F.o: + $(FC) $(FFLAGS) -c $< + # # Targets # diff --git a/external_functions/tax_times/Makefile b/external_functions/tax_times/Makefile index 890e0c8a7..d172ba874 100644 --- a/external_functions/tax_times/Makefile +++ b/external_functions/tax_times/Makefile @@ -28,7 +28,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/transpose/Makefile b/external_functions/transpose/Makefile index 1714d7419..79c7e06e6 100644 --- a/external_functions/transpose/Makefile +++ b/external_functions/transpose/Makefile @@ -32,7 +32,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/v5d/Makefile b/external_functions/v5d/Makefile index 65a5c2685..ce9596a70 100644 --- a/external_functions/v5d/Makefile +++ b/external_functions/v5d/Makefile @@ -35,7 +35,7 @@ V5D_OBJS = binio.o v5d.o $(CC) $(V5DFLAGS) $(CFLAGS) -c $< .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $(V5D_OBJS) $*.o $(SYSLIBS) -o $*.so # diff --git a/external_functions/zaxr/Makefile b/external_functions/zaxr/Makefile index d1fceacc3..85c970175 100644 --- a/external_functions/zaxr/Makefile +++ b/external_functions/zaxr/Makefile @@ -30,7 +30,7 @@ include ../ef_utility/platform_specific.mk.$(BUILDTYPE) # .F.so: - $(F77) $(FFLAGS) -c $< + $(FC) $(FFLAGS) -c $< $(LD) $(LD_DYN_FLAGS) $*.o $(SYSLIBS) -o $*.so # diff --git a/platform_specific.mk.i386-linux b/platform_specific.mk.i386-linux index ec60d75d6..4d3b5621a 100644 --- a/platform_specific.mk.i386-linux +++ b/platform_specific.mk.i386-linux @@ -86,9 +86,6 @@ endif -DNO_PREPEND_STRING \ -DSTAR_1_SUPPORTED - CC = $(shell which gcc) - FC = $(shell which gfortran) - F77 = $(shell which gfortran) AR = $(shell which ar) RANLIB = $(shell which ranlib) diff --git a/platform_specific.mk.i386-linux-gnu b/platform_specific.mk.i386-linux-gnu index 31eb8a037..9c9dc8a2a 100644 --- a/platform_specific.mk.i386-linux-gnu +++ b/platform_specific.mk.i386-linux-gnu @@ -86,9 +86,6 @@ endif -DNO_PREPEND_STRING \ -DSTAR_1_SUPPORTED - CC = $(shell which gcc) - FC = $(shell which gfortran) - F77 = $(shell which gfortran) AR = $(shell which ar) RANLIB = $(shell which ranlib) diff --git a/platform_specific.mk.intel-mac b/platform_specific.mk.intel-mac index ea28d4f0b..4ecbdc82c 100644 --- a/platform_specific.mk.intel-mac +++ b/platform_specific.mk.intel-mac @@ -86,9 +86,6 @@ endif -DNO_PREPEND_STRING \ -DSTAR_1_SUPPORTED - CC = $(shell which clang) - FC = $(shell which gfortran) - F77 = $(shell which gfortran) AR = $(shell which ar) RANLIB = $(shell which ranlib) diff --git a/platform_specific.mk.x86_64-linux b/platform_specific.mk.x86_64-linux index 7cff3dfa0..494f31c24 100644 --- a/platform_specific.mk.x86_64-linux +++ b/platform_specific.mk.x86_64-linux @@ -43,7 +43,11 @@ else endif ifeq ($(strip $(GLIB2_LIBDIR)),) - GLIB2_INCLUDE = -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib/glib-2.0/include +ifeq ($(shell /bin/ls -d /usr/lib64/glib-2.0/include),/usr/lib64/glib-2.0/include) + GLIB2_INCLUDE = -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include +else + GLIB2_INCLUDE = -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include +endif else GLIB2_INCLUDE = -I$(GLIB2_LIBDIR)/../include/glib-2.0 -I$(GLIB2_LIBDIR)/glib-2.0/include endif @@ -86,9 +90,6 @@ endif -DNO_PREPEND_STRING \ -DSTAR_1_SUPPORTED - CC = $(shell which gcc) - FC = $(shell which gfortran) - F77 = $(shell which gfortran) AR = $(shell which ar) RANLIB = $(shell which ranlib) diff --git a/platform_specific.mk.x86_64-linux-gnu b/platform_specific.mk.x86_64-linux-gnu index 6bd532230..40d28523d 100644 --- a/platform_specific.mk.x86_64-linux-gnu +++ b/platform_specific.mk.x86_64-linux-gnu @@ -86,9 +86,6 @@ endif -DNO_PREPEND_STRING \ -DSTAR_1_SUPPORTED - CC = $(shell which gcc) - FC = $(shell which gfortran) - F77 = $(shell which gfortran) AR = $(shell which ar) RANLIB = $(shell which ranlib) diff --git a/site_specific.mk.in b/site_specific.mk.in index e30792f3b..c777acb7a 100644 --- a/site_specific.mk.in +++ b/site_specific.mk.in @@ -34,6 +34,17 @@ BUILDTYPE = x86_64-linux # BUILDTYPE = i386-linux-gnu # BUILDTYPE = intel-mac +## ========================= +## C and Fortran compilers to use. The construct "$(shell which gcc)" assigns +## the response to "which gcc" run from a Bourne shell (such as bash). +## When compiling for Mac OS X, one may wish to use clang instead of gcc. +## If you wish to use values already defined in you shell environment when +## you run make, comment out all definitions of CC and FC (do NOT leave blank). +## ========================= +# CC = $(shell which clang) +CC = $(shell which gcc) +FC = $(shell which gfortran) + ## ========================= ## Python executable to invoke for build and install. ## =========================