Boost version 1.41.0 - How to Download and Install on Mac OS X
Sunday the 21st of March, 2010

    version 1.41.0

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


      # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
      The boost Portfile 60717 2009-11-20 22:43:52Z ryandesign macports.org $

      PortSystem 1.0

      Name: boost
      Version: 1.41.0
      Category: devel
      Platform: darwin
      Maintainers: nox openmaintainer
      Description: Collection of portable C++ source libraries

      Long Description: Boost provides free portable peer-reviewed C++ libraries. The emphasis is on portable libraries which work well with the C++ Standard Library.

      Homepage: http://www.boost.org
      Master Sites: sourceforge
      distname ${name}_[join [split ${version} .] _]
      use_bzip2 yes

      Checksums: md5 8bb65e133907db727a2a825c5400d0a6 sha1 31134e28866b90c39ca4a903c263e036bb25550c rmd160 a604ef5a6f6f5bf50be59206c8534258ab431aea

      Patch Files: patch-libs-random-random_device.cpp.diff

      post-extract {
      file mkdir ${worksrcpath}/libs/random/build
      copy ${filespath}/libs-random-build-Jamfile.v2 ${worksrcpath}/libs/random/build/Jamfile.v2
      }

      depends_build path:bin/bjam:boost-jam

      depends_lib port:zlib port:bzip2

      configure {
      reinplace -E "s|-install_name \"|&${prefix}/lib/|" ${worksrcpath}/tools/build/v2/tools/darwin.jam
      write_jam "using darwin : : ${configure.cxx} ;"
      }

      build.cmd bjam
      build.target
      build.args -d2 --layout=tagged --debug-configuration --ignore-site-config --user-config=user-config.jam --without-python --without-mpi -sBZIP2_INCLUDE=${prefix}/include -sBZIP2_LIBPATH=${prefix}/lib -sZLIB_INCLUDE=${prefix}/include -sZLIB_LIBPATH=${prefix}/lib

      use_parallel_build yes

      pre-build {
      set jobs ${build.jobs}
      # if set to '0', use the number of cores for the number of jobs
      if {${jobs} == 0} {
      set jobs [exec /usr/sbin/sysctl -n hw.availcpu]
      }
      if {[string is integer -strict ${jobs}] && ${jobs} > 1} {
      build.pre_args-append -j${jobs}
      }
      }

      destroot.cmd bjam
      destroot.destdir --prefix=${destroot}${prefix}

      pre-destroot {
      eval destroot.args ${build.args}
      }

      set pythons_suffixes {24 25 26}

      set pythons_ports {}
      foreach s ${pythons_suffixes} {
      lappend pythons_ports python${s}
      }

      proc python_dir {} {
      global pythons_suffixes
      foreach s ${pythons_suffixes} {
      if {[variant_isset python${s}]} {
      set p python[string index ${s} 0].[string index ${s} 1]
      return [file normalize [exec ${p} -c "import sys; print sys.prefix"]/lib/${p}/site-packages]
      }
      }
      error "Python support not enabled."
      }

      proc write_jam s {
      global worksrcpath
      set config [open ${worksrcpath}/user-config.jam a]
      puts ${config} ${s}
      close ${config}
      }

      foreach s ${pythons_suffixes} {
      set p python${s}
      set v [string index ${s} 0].[string index ${s} 1]
      set i [lsearch -exact ${pythons_ports} ${p}]
      set c [lreplace ${pythons_ports} ${i} ${i}]
      eval [subst {
      variant ${p} description "Build Boost.Python for Python ${v}" conflicts ${c} {
      depends_lib-append port:${p}
      build.args-delete --without-python

      post-configure {
      write_jam "using python : : ${prefix}/bin/python${v} ;"
      }
      }
      }]
      }

      Variant: icu description {Enable Unicode support in Boost.Regex through ICU} {
      depends_lib-append port:icu
      build.args-append -sICU_PATH=${prefix}
      }

      Variant: graphml description {Enable GraphML support in Boost.Graph} {
      depends_lib-append port:expat
      build.args-append -sEXPAT_INCLUDE=${prefix}/include -sEXPAT_LIBPATH=${prefix}/lib
      }

      Variant: openmpi description {Build Boost.MPI} {
      depends_lib-append port:openmpi
      build.args-delete --without-mpi

      post-configure {
      write_jam "using mpi : ${prefix}/bin/openmpic++ : : ${prefix}/bin/openmpirun ;"
      }

      if {![catch python_dir]} {
      if {[variant_isset st]} {
      patchfiles-append patch-libs-mpi-build-Jamfile.v2.diff
      }

      post-destroot {
      set site_packages [python_dir]
      xinstall -d ${destroot}${site_packages}/boost
      xinstall -m 644 ${worksrcpath}/libs/mpi/build/__init__.py ${destroot}${site_packages}/boost

      set l ${site_packages}/boost/mpi.so
      move ${destroot}${prefix}/lib/mpi.so ${destroot}${l}
      system "install_name_tool -id ${l} ${destroot}${l}"
      }
      }
      }

      Variant: debug description {Build debug libraries} {
      build.args-append variant=debug,release define=_GLIBCXX_DEBUG
      }

      Variant: doc description {Install documentation} {
      post-destroot {
      set docdir ${prefix}/share/doc/${name}-${version}
      xinstall -d ${destroot}${docdir}
      set l [expr [string length ${worksrcpath}] + 1]
      fs-traverse f [glob -directory ${worksrcpath} *] {
      set dest ${destroot}${docdir}/[string range ${f} ${l} end]
      if {[file isdirectory ${f}]} {
      if {[file tail ${f}] eq "example"} {
      copy ${f} ${dest}
      continue
      }
      xinstall -d ${dest}
      } elseif {[lsearch -exact {css htm html png svg} [string range [file extension ${f}] 1 end]] != -1} {
      xinstall -m 644 ${f} ${dest}
      }
      }
      }
      }

      Variant: st description {Build single-threaded libraries} {
      build.args-append threading=single,multi
      }

      Variant: universal {
      build.args-append pch=off

      patchfiles-append patch-tools-build-v2-tools-gcc.jam.diff

      if {[lsearch ${universal_archs} ppc*] != -1} {
      if {[lsearch ${universal_archs} *86*] != -1} {
      build.args-append architecture=combined
      } else {
      build.args-append architecture=power
      }

      if {![variant_isset powerpc]} {
      build.args-append --disable-long-double
      }
      } else {
      build.args-append architecture=x86
      }

      if {[lsearch ${universal_archs} *64] != -1} {
      if {[lsearch ${universal_archs} i386] != -1 || [lsearch ${universal_archs} ppc] != -1} {
      build.args-append address-model=32_64
      } else {
      build.args-append address-model=64
      }
      } else {
      build.args-append address-model=32
      }
      }

      platform powerpc {
      build.args-append --disable-long-double
      }

      platform darwin 8 powerpc {
      if {[variant_isset universal]} {
      build.args-append macosx-version=10.4
      }
      }

      livecheck.type regex
      livecheck.url ${homepage}
      livecheck.regex "Version (\\d+\\.\\d+\\.\\d+)"

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

     Where to find more information:

    Darwin Ports



    Lightbox this page.