G95 version 0.91 - How to Download and Install on Mac OS X
Saturday the 7th of November, 2009

    version 0.91

      View the most recent changes for the g95 port at: g95.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for g95.
      The raw portfile for g95 0.91 is located here:
      http://g95.darwinports.com/dports/lang/g95/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/g95


      # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
      The g95 Portfile 51050 2009-05-17 01:13:19Z takeshi macports.org $

      PortSystem 1.0

      Name: g95
      Version: 0.91
      Revision: 1
      Platform: darwin
      Category: lang
      Maintainers: takeshi
      Description: Another GNU Fortran 95 compiler
      Long Description: G95 is a stable, production Fortran 95 compiler available for multiple cpu architectures and operating systems. Innovations and optimizations continue to be worked on. Parts of the F2003 standard have been implemented in g95.
      Homepage: http://g95.org/
      Master Sites: ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.0.4/:gcc http://ftp.g95.org/v${version}/:g95

      set version_gcc 4.0.4
      set dcore gcc-core-${version_gcc}.tar.bz2
      dist_subdir gcc40
      set dg95 ${name}_source.tgz
      set gcclib lib/gcc-lib/${os.arch}-apple-${os.platform}${os.version}/${version_gcc}
      distfiles ${dcore}:gcc ${dg95}:g95

      Checksums: ${dcore} md5 193e0a7a471cca70e374974bc5a60137 ${dcore} sha1 55c664b33a4dc6b2130c47da28a1d6daab732ce9 ${dcore} rmd160 af67dc8385942450f6b27ad83a6b9e3d22f779a1 ${dg95} md5 35e1852e09b69555bc07f30d0ab4b6ba ${dg95} sha1 aa58510c04e357439a4bf34c54d380e9079395d5 ${dg95} rmd160 f0a8325c0e930d69d2def16eaa3c6c21dfd2b5a8

      depends_lib port:odcctools

      Patch Files: patch-Makefile.in.diff

      universal_variant no

      extract.only ${dg95}

      pre-fetch {
      file delete ${distpath}/${dg95}
      }

      post-extract {
      system "tar jxvf ${distpath}/${dcore} -C ${workpath}"
      }

      pre-configure {
      file mkdir ${workpath}/gcc-${version_gcc}/${name}
      reinplace "s|tjmp %%edx|tjmp *%%edx|" ${workpath}/gcc-${version_gcc}/gcc/config/i386/i386.c
      if {[variant_isset darwin_9]} {
      reinplace "s|i686|i386|" ${workpath}/gcc-${version_gcc}/gcc/config/i386/darwin.h
      set gcc_configargs "--with-as=/usr/bin/as --with-ld=/usr/bin/ld --with-nm=/usr/bin/nm"
      } else {
      reinplace "s|/usr/bin/libtool|${prefix}/bin/odlibtool|" ${workpath}/gcc-${version_gcc}/gcc/config/darwin.h
      set gcc_configargs "--with-as=${prefix}/bin/odas --with-ld=${prefix}/bin/odld --with-nm=${prefix}/bin/odnm"
      }
      system "unset CPPFLAGS; unset LDFLAGS; export CPPFLAGS=-I${prefix}/include; cd ${workpath}/gcc-${version_gcc}/${name}; ../configure --prefix=${prefix}/${gcclib} --with-libiconv-prefix=${prefix}/include --enable-languages=c ${gcc_configargs} --with-included-gettext; make"
      }

      configure.args --with-gcc-dir=${workpath}/gcc-${version_gcc}

      post-build {
      system "cd ${worksrcpath}; tar zxvf libf95.a-${version}.tar.gz; cd libf95.a-${version}; export CFLAGS='-O2 -fno-common'; ./configure --prefix=${prefix}; make"
      }

      pre-destroot {
      reinplace "s|${prefix}/${gcclib}|${destroot}${prefix}/${gcclib}|g" ${worksrcpath}/Makefile
      reinplace "s|${prefix}/${gcclib}|${destroot}${prefix}/${gcclib}|g" ${worksrcpath}/libf95.a-${version}/Makefile
      }

      destroot {
      system "cd ${worksrcpath}; make install prefix=${destroot}${prefix}; cd libf95.a-${version}; make install prefix=${destroot}${prefix}; ranlib ${destroot}${prefix}/${gcclib}/libf95.a; ranlib ${destroot}${prefix}/${gcclib}/libgcc.a; ranlib ${destroot}${prefix}/${gcclib}/libgcc_eh.a"
      file mkdir ${destroot}${prefix}/share/doc/${name}
      file rename ${destroot}${prefix}/G95Manual.pdf ${destroot}${prefix}/share/doc/${name}
      system "ln -sf ${prefix}/${gcclib}/libf95.a ${destroot}${prefix}/lib/libf95.a"
      file mkdir ${destroot}${prefix}/${gcclib}/lib
      system "ln -sf ${prefix}/${gcclib}/libgcc_s.1.0.dylib ${destroot}${prefix}/${gcclib}/lib/libgcc_s.1.0.dylib"
      system "ln -sf ${prefix}/${gcclib}/libgcc_s.1.0.dylib ${destroot}${prefix}/${gcclib}/lib/libgcc_s.dylib"
      }

      platform darwin 9 {
      patchfiles-append patch-host-darwin.c.diff patch-darwin-fallback.c.diff
      depends_lib-delete port:odcctools
      }

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/g95
      % sudo port install g95
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching g95
      ---> Verifying checksum for g95
      ---> Extracting g95
      ---> Configuring g95
      ---> Building g95 with target all
      ---> Staging g95 into destroot
      ---> Installing g95
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using g95 with these commands:
      %  man g95
      % apropos g95
      % which g95
      % locate g95

     Where to find more information:

    Darwin Ports



    Lightbox this page.