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

    version 3.8.3

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


      The atlas Portfile 57876 2009-09-18 02:07:33Z jameskyle macports.org $

      PortSystem 1.0

      Category: math
      Name: atlas
      Version: 3.8.3
      Revision: 1

      # additional versions
      set lapackversion 3.2.1
      set lapackname lapack
      set atlasdist ${name}${version}.tar.bz2
      set lapackdist ${lapackname}.tgz

      Maintainers: jameskyle
      Platform: darwin

      Description: Portable optimal linear algebra software
      Long Description: The current version provides a complete BLAS and LAPACK API. For many operations, ATLAS achieves performance on par with machine-specific tuned libraries.

      Homepage: http://math-atlas.sourceforge.net/

      Master Sites: sourceforge:math-atlas/${name}${version}.tar.bz2:atlas http://www.netlib.org/lapack:lapack

      distfiles ${atlasdist}:atlas ${lapackdist}:lapack

      Checksums: atlas${version}.tar.bz2 md5 6c13be94a87178e7582111c08e9503bc sha1 c7546210df4796457d9e96a00444adc4c0f2e77f rmd160 0425e630d9d0c5b7aae81427a41b7eaa18447e90 lapack.tgz md5 a3202a4f9e2f15ffd05d15dab4ac7857 sha1 c75223fdef3258c461370af5d2b889d580d7f38a rmd160 e8fabba2fdd944afbc02a83599cf45a0d721030d


      # the following patch corrects extension conventions for osx's dynamic libs
      set make_patch patch-build-Make.top.diff
      use_parallel_build no
      build.target build
      build.dir ${workpath}/${name}-${version}/build

      destroot.dir ${build.dir}
      destroot.destdir DESTDIR=${destroot}${prefix}
      depends_lib port:gcc43 port:bzip2 port:gzip

      universal_variant no

      # Set fortran compiler flags
      set myf77 ${prefix}/bin/gfortran-mp-4.3

      if {${build_arch} == "x86_64" || ${build_arch} == "ppc64" } {
      set my_arch 64
      } else {
      set my_arch 32
      }

      configure.args -C xc ${prefix}/bin/gcc-mp-4.3 -C gc ${prefix}/bin/gcc-mp-4.3 -C if ${myf77} -C ic ${prefix}/bin/gcc-mp-4.3 -C dm ${prefix}/bin/gcc-mp-4.3 -C sm ${prefix}/bin/gcc-mp-4.3 -C dk ${prefix}/bin/gcc-mp-4.3 -C sk ${prefix}/bin/gcc-mp-4.3 --cc=${prefix}/bin/gcc-mp-4.3 -b ${my_arch} -Fa alg -fPIC

      configure.compiler macports-gcc-4.3



      # we are configuring from the build directory
      configure.dir ${workpath}/${name}-${version}/build
      configure.cmd ../configure

      # change the default compilers to those of gcc43 and make into shared library

      extract {
      # extract atlas and move to a consistent working directory name
      system "cd ${workpath} && bunzip2 -dc ${distpath}/${atlasdist} | gnutar --no-same-owner -xf -"
      system "mv ${workpath}/ATLAS ${workpath}/${name}-${version}"

      # extract lapack
      system "cd ${workpath} && gunzip -dc ${distpath}/${lapackdist} | gnutar --no-same-owner -xf -"
      }



      pre-configure {
      # Get some system specific variables for maximum optimization
      set cpufreq [expr {[exec sysctl -n hw.cpufrequency]/1000000}]
      ui_debug "Setting CPU Frequency for: ${cpufreq}"
      configure.args-append -D c -DPentiumCPS=${cpufreq}

      # first do a 'fake configure' of atlas so we get optimized lapack libraries
      ui_debug "performing fake configure of atlas for optimized lapack"
      # atlas docs: 3.1.2
      set atlas_path ${workpath}/${name}-${version}
      ui_debug "Clean out old temp directory if exists"
      file delete -force ${atlas_path}/temp
      file mkdir ${atlas_path}/temp
      ui_debug "Assembled Command: '${configure.cmd} ${configure.args}"
      system "cd ${atlas_path}/temp && ${configure.cmd} ${configure.args}"

      # Get the F77FLAGS
      set atlas_f77 [join [lrange [split [exec grep "F77 = " $atlas_path/temp/Make.inc ] =] 1 end] =]
      ui_debug "Found atlas F77: ${atlas_f77}"

      set atlas_fflags [join [lrange [split [exec grep "F77FLAGS = " $atlas_path/temp/Make.inc] =] 1 end] =]
      ui_debug "Found atlas F77FLAGS: ${atlas_fflags}"

      ui_debug "Remove the old test configure directory"
      file delete -force ${atlas_path}/temp

      # compile lapack
      system "cd ${workpath}/${lapackname}-${lapackversion} && cp INSTALL/make.inc.gfortran make.inc"
      reinplace "s|gfortran|${atlas_f77}|" ${workpath}/${lapackname}-${lapackversion}/make.inc
      reinplace "s|OPTS = -O2|OPTS = ${atlas_fflags}|" ${workpath}/${lapackname}-${lapackversion}/make.inc

      reinplace "s|NOOPT = -O0|NOOPT = -O2 -m${my_arch}|" ${workpath}/${lapackname}-${lapackversion}/make.inc

      reinplace "s|PLAT = _LINUX|PLAT = _darwin|" ${workpath}/${lapackname}-${lapackversion}/make.inc

      reinplace "s|LOADOPTS =|LOADOPTS = ${atlas_fflags}|" ${workpath}/${lapackname}-${lapackversion}/make.inc

      system "cd ${workpath}/${lapackname}-${lapackversion} && make lib"

      # create a build directory for atlas
      file mkdir ${workpath}/${name}-${version}/build


      configure.args-append --with-netlib-lapack=${workpath}/${lapackname}-${lapackversion}/lapack_darwin.a
      }

      post-configure {
      # recursively remove directories
      ui_debug "reinplace for make to recursively remove directories on clean"
      reinplace "s|rm -f|rm -rf|g" ${workpath}/${name}-${version}/build/Makefile

      ui_debug "patch ${name}-${version}/build/Make.top to install dynamic libs"
      system "cd ${worksrcpath}/build/ && patch -p0 < ${filespath}/${make_patch}"
      }

      pre-destroot {
      # We have to manually create the dylib shared libs as the default build does not do this
      if {[string equal "${os.arch}" "powerpc"]} {
      if {${my_arch} == "64" } {
      set myarch "ppc64"
      } else {
      set myarch "ppc"
      }
      } else {
      if {${my_arch} == "64" } {
      set myarch "x86_64"
      } else {
      set myarch "i386"
      }
      }

      set ld "ld -arch ${myarch} -dynamic -dylib -single_module -dead_strip -x -all_load -L. -L${prefix}/lib/gcc43 -ldylib1.o -dylib_install_name"

      system "cd ${workpath}/${name}-${version}/build/lib && ${ld} ${prefix}/lib/libatlas.dylib libatlas.a -o libatlas.dylib -lSystem"

      system "cd ${workpath}/${name}-${version}/build/lib && ${ld} ${prefix}/lib/libptcblas.dylib libptcblas.a -o libptcblas.dylib -latlas -lSystem"

      system "cd ${workpath}/${name}-${version}/build/lib && ${ld} ${prefix}/lib/libptf77blas.dylib libptf77blas.a -o libptf77blas.dylib -lgfortran -latlas -lSystem"

      system "cd ${workpath}/${name}-${version}/build/lib && ${ld} ${prefix}/lib/liblapack.dylib liblapack.a -o liblapack.dylib -lptf77blas -lgfortran -lptcblas -latlas -lgcc_s.1 -lSystem"

      }

      post-destroot {
      # we make soft links to the parallel built libs
      system "cd ${destroot}${prefix}/lib && ln -sf ./libptcblas.dylib libcblas.dylib && ln -sf ./libptf77blas.dylib libf77blas.dylib"
      }

    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/atlas
      % sudo port install atlas
      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 atlas
      ---> Verifying checksum for atlas
      ---> Extracting atlas
      ---> Configuring atlas
      ---> Building atlas with target all
      ---> Staging atlas into destroot
      ---> Installing atlas
    - 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 atlas with these commands:
      %  man atlas
      % apropos atlas
      % which atlas
      % locate atlas

     Where to find more information:

    Darwin Ports



    Lightbox this page.