Yosemite Clang

Glen Hansen edited this page Apr 19, 2017 · 12 revisions

Mac OSX Yosemite 10.10.5

  • Apple LLVM version 7.0.2 (clang-700.1.81)
  • XCode Version 7.2.1 (7C1002)
  • Use GNU Fortran (GCC) 5.1.0

Building MPICH

  • Version 3.1.4

      ./configure --prefix=/usr/local/mpich-3.1.4
      make -j 4
      make install
    

Building ZLib

  • Version 1.2.11

      CC=mpicc CFLAGS="-O3 -march=native" ./configure --64 --archs="-arch x86_64" --prefix=/usr/local/mpich-3.1.4
      make -j 4
      make install
    

Building Yaml

  • git clone git@github.com:jbeder/yaml-cpp.git

      GCC_MPI_DIR=/usr/local/mpich-3.1.4
    
      cmake \
          -DCMAKE_CXX_COMPILER:STRING=${GCC_MPI_DIR}/bin/mpicxx \
          -DCMAKE_CXX_FLAGS:STRING='-march=native -O3 -DNDEBUG' \
          -DCMAKE_C_COMPILER:STRING=${GCC_MPI_DIR}/bin/mpicc \
          -DCMAKE_C_FLAGS:STRING='-march=native -O3 -DNDEBUG' \
          -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mpich-3.1.4 \
          -DCMAKE_BUILD_TYPE:STRING=Release \
          -DBUILD_SHARED_LIBS:BOOL=ON \
          -DYAML_CPP_BUILD_TOOLS:BOOL=OFF \
      ..
    
      make -j 4
      make install
    
  • Need to edit the rpath after the dylib is installed

      install_name_tool -id /usr/local/mpich-3.1.4/lib/libyaml-cpp.0.5.3.dylib /usr/local/mpich-3.1.4/lib/libyaml-cpp.0.5.3.dylib
    

Building HDF5

  • Version 1.10.0-patch1

      ./configure CC=mpicc FC=mpifort CXX=mpicxx CXXFLAGS="-fPIC -march=native -O3" CFLAGS="-fPIC -march=native -O3" FCFLAGS="-fPIC -march=native -Wa,-q -O3" LDFLAGS="-fPIC -L/usr/local/mpich-3.1.4/lib -march=native -O3" --enable-parallel --with-zlib=/usr/local/mpich-3.1.4 --prefix=/usr/local/mpich-3.1.4
      make -j 4
      make install
    

Building parallel-netcdf

  • Version 1.8.1

  • Configure and build:

      ./configure --prefix=/usr/local/mpich-3.1.4 CC=/usr/local/mpich-3.1.4/bin/mpicc \
      FC=/usr/local/mpich-3.1.4/bin/mpifort CXX=/usr/local/mpich-3.1.4/bin/mpicxx \
      CXXFLAGS="-O3 -march=native -fPIC" CFLAGS="-O3 -march=native -fPIC" FFLAGS="-O3 -march=native -fPIC" \
      FCFLAGS="-O3 -march=native -fPIC"
    
      make -j 4 
      make install
    

Building Netcdf

  • Version 4.4.1.1

  • Edit the file include/netcdf.h. Make the following edits near line 265:

      #define NC_MAX_DIMS    65536    /* max dimensions per file */
      #define NC_MAX_ATTRS    8192
      #define NC_MAX_VARS   524288    /* max variables per file */
      #define NC_MAX_NAME   256
      #define NC_MAX_VAR_DIMS      8     /* max per variable dimensions */
    
  • Build

      ./configure --prefix=/usr/local/mpich-3.1.4 CC=mpicc FC=mpifort CXX=mpicxx \
      CFLAGS="-fPIC -I/usr/local/mpich-3.1.4/include -march=native -O3" \
      CXXFLAGS="-fPIC -I/usr/local/mpich-3.1.4/include -march=native -O3" \
      FCFLAGS="-fPIC -I/usr/local/mpich-3.1.4/include -march=native -Wa,-q -O3" \
      LDFLAGS=-L/usr/local/mpich-3.1.4/lib --disable-fsync --disable-doxygen --enable-netcdf4 --enable-pnetcdf
      make -j 4 
      make install
    

Building Boost

  • Version 1.63.0

  • I could not figure out how to get the boost build to properly treat the "rpath" on Yosemite, so I hacked it. Please edit "tools/build/src/tools/darwin.jam", changing the following line to change the install name to include the install path:

      actions link.dll bind LIBRARIES
      {
          "$(CONFIG_COMMAND)" -dynamiclib -Wl,-single_module -install_name "/usr/local/mpich-3.1.4/lib/$(<:B)$(<:S)" -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) -framework$(_)$(FRAMEWORK:D=:S=) $(OPTIONS) $(USER_OPTIONS)
      }
    
  • Build boost with the commands

      echo "using mpi : /usr/local/mpich-3.1.4/bin/mpicxx : <cxxflags>"-O3 -DNDEBUG -march=native" <include>/usr/local/mpich-3.1.4/include <library-path>/usr/local/mpich-3.1.4/lib <find-shared-library>mpi ;" > ~/user-config.jam
      echo 'using darwin : : : <compileflags>"-O3 -march=native" <library-path>/usr/local/mpich-3.1.4/lib <find-shared-library>mpi ;' >> ~/user-config.jam
      ./bootstrap.sh --with-libraries=signals,regex,filesystem,system,mpi,serialization,thread,program_options,exception,chrono,date_time --prefix=/usr/local/mpich-3.1.4
      ./b2 -j 4
      ./b2 -j 4 install
    

Building ParMetis

  • Version 4.0.3

  • Edit metis.h to use an IDXTYPEWIDTH of 64

      cd parmetis-4.0.3/metis/include
      vi metis.h
      #define IDXTYPEWIDTH 64
    
  • Run CMake to build metis

      cd /usr/local/src/parmetis-4.0.3/
      mkdir build
      cd build
      export metis=/usr/local/src/parmetis-4.0.3/metis
      cmake \
      -DCMAKE_INSTALL_PREFIX=/usr/local/mpich-3.1.4 \
      -DMETIS_PATH=$metis \
      -DGKLIB_PATH=$metis/GKlib \
      -DCMAKE_C_COMPILER=mpicc \
      -DCMAKE_C_FLAGS="-O3 -march=native -fPIC" \
      -DCMAKE_CXX_COMPILER=mpicxx \
      -DCMAKE_CXX_FLAGS="-O3 -march=native -fPIC" \
      ..
      make -j 4
      make install
    
      cp libmetis/libmetis.a /usr/local/mpich-3.1.4/lib
      cp /usr/local/src/parmetis-4.0.3/metis/include/metis.h /usr/local/mpich-3.1.4/include
    

SuperLU (optional)

SuperLU is optional in a Trilinos build.

  • Version 4.3 (later versions do not appear to be supported in Amesos currently)

      mkdir /usr/local/mpich-3.1.4/SuperLU_4.3
      mkdir /usr/local/mpich-3.1.4/SuperLU_4.3/include
      mkdir /usr/local/mpich-3.1.4/SuperLU_4.3/lib
    
  • Edit make.inc for your machine and environment

      SuperLUroot     = /usr/local/mpich-3.1.4/SuperLU_4.3
      SUPERLULIB      = $(SuperLUroot)/lib/libsuperlu_4.3.a
    
      TMGLIB          = libtmglib.a
      BLASDEF     = -DUSE_VENDOR_BLAS
      BLASLIB     = /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/libblas.a
    
      LIBS            = $(SUPERLULIB) $(BLASLIB)
    
      ARCH         = ar
      ARCHFLAGS    = cr
      RANLIB       = ranlib
    
      CC           = mpicc 
      CFLAGS       = -fPIC -O3 -DPRNTlevel=0 -DNDEBUG
      NOOPTS       = -O0
      FORTRAN      = mpifort
      FFLAGS       = -fPIC -O3
    
      LOADER       = $(CC)
      LOADOPTS     =
      CDEFS        = -DAdd_
    
  • Build SuperLU

      make -j 4
      cd SRC
      cp *.h /usr/local/mpich-3.1.4/SuperLU_4.3/include
    
  • Version 5.2.1 (experimental - does not appear to build with Amesos currently)

      mkdir /usr/local/mpich-3.1.4/SuperLU_5.2.1
      mkdir /usr/local/mpich-3.1.4/SuperLU_5.2.1/include
      mkdir /usr/local/mpich-3.1.4/SuperLU_5.2.1/lib
    
  • Edit make.inc for your machine and environment

      SuperLUroot     = /usr/local/mpich-3.1.4/SuperLU_5.2.1
      SUPERLULIB      = $(SuperLUroot)/lib/libsuperlu.a
    
      TMGLIB          = libtmglib.a
      BLASDEF     = -DUSE_VENDOR_BLAS
      BLASLIB     = /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/libblas.a
    
      LIBS            = $(SUPERLULIB) $(BLASLIB)
    
      ARCH         = /usr/bin/ar
      ARCHFLAGS    = cr
      RANLIB       = /usr/bin/ranlib
    
      CC           = mpicc
      CFLAGS       = -fPIC -DNDEBUG -O3 -DPRNTlevel=0 -DAdd_
      NOOPTS       = -O0
      FORTRAN      = mpifort
      FFLAGS       = -fPIC -O3
    
      LOADER       = $(CC)
      LOADOPTS     =
    
  • Build SuperLU

      make -j 4
      cd SRC
      cp *.h /usr/local/mpich-3.1.4/SuperLU_5.2.1/include
    

Build Trilinos

  • do-configure script in the Albany Repo

  • Make a build directory at the top level of your Trilinos repo clone

      cd Trilinos
      mkdir build
      cd build
    
  • Download the above file as "do-configure" in the above build directory, then make it executable

      chmod +x ./do-configure
    
  • Edit the do-configure script to match your system and above TPL builds

  • Configure and build Trilinos

      ./do-configure
      make -j 4
      make -j 4 install
    

Build Albany

  • CMake configure script in the Albany Repo

  • Make a "build" directory at the top level of the Albany repo clone, download the "do-configure" file, and edit as appropriate

  • Do the build:

      ./do-configure
      make -j 4
      ctest
    

Misc utilities in Yosemite

MacVim

  • Instructions at http://colinwhite.net/dropplets/MacVim

  • Get recent MacVim

      git clone https://github.com/b4winckler/macvim
    
  • Build it

      cd macvim/src
    
      LDFLAGS=-L/usr/lib ./configure --with-features=huge \
      	--enable-rubyinterp \
      	--enable-pythoninterp \
      	--enable-perlinterp \
      	--enable-cscope
    
      make -j 4
    
  • Copy macvim/src/MacVim/build/Release/MacVim.app to Applications folder

OpenSSH (SFTP) with History and Filename Completion

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.