Quickstart

  1. Install Xcode and the Xcode Command Line Tools
  2. Agree to Xcode license in Terminal: sudo xcodebuild -license
  3. Install MacPorts for your version of the Mac operating system:

Installing MacPorts

The gfortran maintainers offer nice Apple-style installers for: macOS Sierra (10.12): download gfortran 6.3 OS X El Capitan (10.11): download gfortran 6.1 OS X Yosemite (10.10): download gfortran 5.2 or gfortran 4.9.2 OS X Mavericks (10.9): download gfortran 4.9.0 or gfortran 4.8.2 OS X Mountain Lion (10.8): download gfortran 4.8.2. Apr 27, 2012 Install. This is how I installed gfortran on my Mac: Visit hpc.sourceforge.net, and select a binary distribution for your version of Mac OS X, e.g. Gfortran-snwleo-intel-bin.tar.gz for Snow Leopard. Download the file and open the download directory in Terminal. To install gfortran do the following. Download the binaries from gcc.gnu.org: Binaries available for gfortran MacOS The gfortran maintainers offer nice Apple-style installers for: macOS Sierra (10.12): download gfortran 6.3 OS X El Capitan (10.11): download gfortran 6.1 OS X Yosemite (10.10): download gfortran 5.2 or gfortran 4.9.2.

Keeping your software up to date is one of the most important things you can do to maintain your Apple product's security. Learn how to. Xcode version for el capitan free. Learn how to and how to allow important. The latest version of iOS and iPadOS is 15.0.1. The latest version of macOS is 11.6.

MacPorts version 2.7.1 is available in various formats for download and installation (note, if you are upgrading to a new major release of macOS, see the migration info page):

  • “pkg” installers for Big Sur, Catalina, and Mojave, for use with the macOS Installer. This is the simplest installation procedure that most users should follow after meeting the requirements listed below. Installers for legacy platforms High Sierra, Sierra, El Capitan, Yosemite, Mavericks, Mountain Lion, Lion, Snow Leopard, Leopard and Tiger are also available.
  • In source form as either a tar.bz2 package or a tar.gz one for manual compilation, if you intend to customize your installation in any way.
  • Git clone of the unpackaged sources, if you wish to follow MacPorts development.
  • The selfupdate target of the port(1) command, for users who already have MacPorts installed and wish to upgrade to a newer release.

Checksums for our packaged downloads are contained in the corresponding checksums file.

The public key to verify the detached GPG signatures can be found under the attachments section on jmr's wiki page. (Direct Link).

Please note that in order to install and run MacPorts on macOS, your system must have installations of the following components:

  1. Apple's Xcode Developer Tools (version 12.2 or later for Big Sur, 11.3 or later for Catalina, 10.0 or later for Mojave, 9.0 or later for High Sierra, 8.0 or later for Sierra, 7.0 or later for El Capitan, 6.1 or later for Yosemite, 5.0.1 or later for Mavericks, 4.4 or later for Mountain Lion, 4.1 or later for Lion, 3.2 or later for Snow Leopard, or 3.1 or later for Leopard), found at the Apple Developer site, on your Mac operating system installation CDs/DVD, or in the Mac App Store. Using the latest available version that will run on your OS is highly recommended, except for Snow Leopard where the last free version, 3.2.6, is recommended.

    With Xcode 4 and later, users need to accept the Xcode EULA by either launching Xcode or running:

  2. Apple's Command Line Developer Tools, which can be installed on recent OS versions by running this command in the Terminal:

    Older versions are found at the Apple Developer site, or they can be installed from within Xcode back to version 4. Users of Xcode 3 or earlier can install them by ensuring that the appropriate option(s) are selected at the time of Xcode's install ('UNIX Development', 'System Tools', 'Command Line Tools', or 'Command Line Support').

  3. (Optional) The X11 windowing environment, for ports that depend on the functionality it provides to run. You have multiple choices for an X11 server:
    • Install the xorg-server port from MacPorts (recommended).
    • The XQuartz Project provides a complete X11 release for macOS including server and client libraries and applications.
    • Apple's X11.app is provided by the “X11 User” package on older OS versions. It is always installed on Lion, and is an optional installation on your system CDs/DVD with previous OS versions.

macOS Package (.pkg) Installer

The easiest way to install MacPorts on a Mac is by downloading the pkg or dmg for Big Sur, Catalina, Mojave, High Sierra, Sierra, El Capitan, Yosemite, Mavericks, Mountain Lion, Lion, Snow Leopard, Leopard or Tiger and running the system's Installer by double-clicking on the pkg contained therein, following the on-screen instructions until completion.

This procedure will place a fully-functional and default MacPorts installation on your host system, ready for usage. If needed your shell configuration files will be adapted by the installer to include the necessary settings to run MacPorts and the programs it installs, but you may need to open a new shell for these changes to take effect.

The MacPorts “selfupdate” command will also be run for you by the installer to ensure you have our latest available release and the latest revisions to the “Portfiles” that contain the instructions employed in the building and installation of ports. After installation is done, it is recommended that you run this step manually on a regular basis to to keep your MacPorts system always current:

At this point you should be ready to enjoy MacPorts!

Type “man port” at the command line prompt and/or browse over to our Guide to find out more information about using MacPorts. Help is also available.

Source Installation

If on the other hand you decide to install MacPorts from source, there are still a couple of things you will need to do after downloading the tarball before you can start installing ports, namely compiling and installing MacPorts itself:

  1. cd” into the directory where you downloaded the package and run “tar xjvf MacPorts-2.7.1.tar.bz2” or “tar xzvf MacPorts-2.7.1.tar.gz”, depending on whether you downloaded the bz2 tarball or the gz one, respectively.
  2. Build and install the recently unpacked sources:
    • cd MacPorts-2.7.1
    • ./configure && make && sudo make install
    Optionally:
    • cd ./
    • rm -rf MacPorts-2.7.1*

These steps need to be perfomed from an administrator account, for which “sudo” will ask the password upon installation. This procedure will install a pristine MacPorts system and, if the optional steps are taken, remove the as of now unnecessary MacPorts-2.7.1 source directory and corresponding tarball.

To customize your installation you should read the output of “./configure --help | more” and pass the appropriate options for the settings you wish to tweak to the configuration script in the steps detailed above.

Fortran compiler for mac

You will need to manually adapt your shell's environment to work with MacPorts and your chosen installation prefix (the value passed to configure's --prefix flag, defaulting to /opt/local):

Gfortran
  • Add ${prefix}/bin and ${prefix}/sbin to the start of your PATH environment variable so that MacPorts-installed programs take precedence over system-provided programs of the same name.
  • If a standard MANPATH environment variable already exists (that is, one that doesn't contain any empty components), add the ${prefix}/share/man path to it so that MacPorts-installed man pages are found by your shell.
  • For Tiger and earlier only, add an appropriate X11 DISPLAY environment variable to run X11-dependent programs, as Leopard takes care of this requirement on its own.

Lastly, you need to synchronize your installation with the MacPorts rsync server:

Upon completion MacPorts will be ready to install ports!

It is recommended to run the above command on a regular basis to keep your installation current. Type “man port” at the command line prompt and/or browse over to our Guide to find out more information about using MacPorts. Help is also available.

Git Sources

If you are developer or a user with a taste for the bleeding edge and wish for the latest changes and feature additions, you may acquire the MacPorts sources through git. See the Guide section on installing from git.

Download Gfortran For Mac

Purpose-specific branches are also available at the https://github.com/macports/macports-base/branches url.

Mac

Alternatively, if you'd simply like to view the git repository without checking it out, you can do so via the GitHub web interface.

Selfupdate

Fortran Compiler For Mac

For

If you already have MacPorts installed and have no restrictions to use the rsync networking protocol (tcp port 873 by default), the easiest way to upgrade to our latest available release, 2.7.1, is by using the selfupdate target of the port(1) command. This will both update your ports tree (by performing a sync operation) and rebuild your current installation if it's outdated, preserving your customizations, if any.

Other Platforms

Running on platforms other than macOS is not the main focus of The MacPorts Project, so remaining cross-platform is not an actively-pursued development goal. Nevertheless, it is not an actively-discouraged goal either and as a result some experimental support does exist for other POSIX-compliant platforms such as *BSD and GNU/Linux.

The full list of requirements to run MacPorts on these other platforms is as follows (we assume you have the basics such as GCC and X11):

  • Tcl (8.4 or 8.5), with threads.
  • mtree for directory hierarchy.
  • rsync for syncing the ports.
  • cURL for downloading distfiles.
  • SQLite for the port registry.
  • GNUstep (Base), for Foundation (optional, can be disabled via configure args).
  • OpenSSL for signature verification, and optionally for checksums. libmd may be used instead for checksums.

Normally you must install from source or from an git checkout to run MacPorts on any of these platforms.

Help

Help on a wide variety of topics is also available in the project Guide and through our Trac portal should you run into any problems installing and/or using MacPorts. Of particular relevance are the installation & usage sections of the former and the FAQ section of the Wiki, where we keep track of questions frequently fielded on our mailing lists.

If any of these resources do not answer your questions or if you need any kind of extended support, there are many ways to contact us!

Mandatory tools

In order to compile R for macOS, you will need the following tools:
  • Xcode developer tools from Apple
    Xcode can be obtained from Apple AppStore and the Xcode developer page. Older versions are available in the 'more' section of the Developer pages (Apple developer account necessary).
  • GNU Fortran compiler
    Unfortunately Xcode doesn't contain a Fortran compiler, therefore you will have to install one. We recommend official GNU Fortran binaries from F.X.Coudert. CRAN High-Sierra builds currently use GNU Gortran 8.2 from that page (note that even though compiled for Mojave it is compatible with High Sierra).
    gfortran-8.2-Mojave.dmg (ca. 87MB, GNU Fortran 8.2 from F.X.Coudert)
    SHA256 hash: 81d379231ba5671a5ef1b7832531f53be5a1c651701a61d87e1d877c4f06d369

    This is a copy of GNU Fortran 8.2 build from https://github.com/fxcoudert/gfortran-for-macOS/releases

    Make sure you add /usr/local/gfortran/bin to your PATH in order to use this compiler. This can be done, e.g. by
    export PATH=$PATH:/usr/local/gfortran/bin

Download Gfortran For Mac Software

NOTE: In order to retain compatibility with native R we recommend using above tools. Although it is possible to compile R using tools from other package managers such as Homebrew, MacPorts or Fink, such binaries are by definition incompatible with macOS native libraries and applications. If you choose one of those package managers, make sure you compile everything using those tools including R and all packages and libraries you intend to use.Gfortran

Mandatory libraries

Download Gfortran For Mac Free

Old versions of R provided fall-back versions of dependend libraries. This is no longer the case, the following libraries are not present in most recent macOS (or are too old) and have to be installed before R can be compiled:

Gfortran Mac Install

  • liblzma (aka xz-utils) https://tukaani.org/xz/
  • PCRE2https://www.pcre.org/ built with --disable-jit (JIT is buggy on macOS)
  • bzip2 may need to be installed if the system version is too old
Binaries for the above libraries are available in /libs-4 as well as many others that are useful for R packages (see optional libraries below).

Download Gfortran For Mac Windows 10

Note that all binaries used by CRAN are built using the recipes system and thus can be trasparently re-built accordingly.

Optional tools and libraries

The following tools and libraries are optional. R can be compiled without them, but they provide additional capabilities to R.
  • LaTeX
    In order to produce documentation, LaTeX is necessary. It can be obtained from several places, for example as a part of MacTeX.
  • GNU readline,
    Although Mac OS X comes with readline-replacement library, it lack some functionality like backward search etc. Therefore many user prefer GNU readline. For macOS 10.13 download see libs-4 on this site (for older OS X verions see libs).
  • PNG, JPEG and TIFF libraries
    If bitmap manipulation libraries are present, R will add graphics device support for those bitmap formats. There are also other package that take advantage of PNG and JPEG, so it is in general a good idea to install them.Again, they are available in /libs-4 (new) and /libs (old).
  • cairo
    R support for cairo graphics can be enabled by installing cario and dependent libraries (also provided in /libs-4).
  • subversion
    If you want to check out R from the SVN repository, you will need subversion. It was included in Xcode 9 and earlier, but is no longer. We are providing a signed binary:
    subversion-1.14.0-darwin15.6.tar.gz(SHA1: 9dab09d6cf608bea6224bdc3ec3e95893e4e9800)
    which works on OS X 10.11 (El Capitan) and higher, is relocatable, i.e., you can put it anywhere you want since it only depends on system libraries.
    (Static build with: apr-1.7.0, apr-util-1.6.1, openssl-1.1.1g, serf-1.3.9, sqlite-3.33.0, subversion-1.14.0)
    This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)
(sources for open source software not linked directly)

Download Gfortran For Mac Software

Old version of this page for much older OS X versions.

Disclaimer

All software is provided 'as is' and any express or implied warranties, including, but but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the publisher, copyright owner or contributors be liable for any direct, indirect, incidental,special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.