Skip to content

Yosemite Clang

Glen Hansen edited this page Jul 27, 2015 · 13 revisions

Mac OSX Yosemite 10.10.4

  • Apple LLVM version 7.0.0 (clang-700.0.53.3)
  • XCode Version 7.0 beta
  • 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.8

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

Building HDF5

  • Version 1.8.15-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" --enable-parallel --with-zlib=/usr/local/mpich-3.1.4 --prefix=/usr/local/mpich-3.1.4
      make -j 4
      make install
    

Building Netcdf

  • Version 4.3.3.1

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

      #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="-I/usr/local/mpich-3.1.4/include -march=native -O3" CXXFLAGS="-I/usr/local/mpich-3.1.4/include -march=native -O3" FCFLAGS="-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-cdmremote --disable-dap --disable-doxygen --enable-netcdf4
      make -j 4 
      make install
    

Building boost

  • Version 1.58.0

  • Build boost with the commands

      echo "using mpi : /usr/local/mpich-3.1.4/bin/mpicxx ;" >> ./tools/build/v2/user-config.jam
      ./bootstrap.sh --with-libraries=signals,regex,filesystem,system,mpi,serialization,thread,program_options,exception --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
    

Build Trilinos

  • If you want to use the OSX BLAS Framework, edit "packages/teuchos/numerics/src/Teuchos_BLAS_wrappers.hpp", changing

      #      include <vecLib/cblas.h>
    

to

	#      include <cblas.h>
  • do-configure script

      #!/bin/sh
      #
      export TRILINOS_HOME=/Users/gahanse/Codes/Trilinos
      BUILD_DIR=`pwd`
      INSTALL_DIR=/usr/local/trilinos/MPI_REL
      BOOST_DIR=/usr/local/mpich-3.1.4
      LIB_DIR=/usr/local/mpich-3.1.4
      MPI_BASE_DIR=/usr/local/mpich-3.1.4
      NETCDF=/usr/local/mpich-3.1.4
      HDFDIR=/usr/local/mpich-3.1.4
      PARMETISDIR=/usr/local/mpich-3.1.4
    
      cmake \
          -Wno-dev \
          -D Trilinos_CONFIGURE_OPTIONS_FILE:FILEPATH=$TRILINOS_HOME/sampleScripts/AlbanySettings.cmake \
          -D Trilinos_EXTRA_REPOSITORIES:STRING="SCOREC" \
          -D Trilinos_ENABLE_SCOREC:BOOL=ON \
          -D SCOREC_DISABLE_STRONG_WARNINGS:BOOL=ON \
          -D CMAKE_BUILD_TYPE:STRING=NONE \
          -D CMAKE_CXX_FLAGS:STRING="-O3 -march=native -DNDEBUG" \
          -D CMAKE_C_FLAGS:STRING="-O3 -march=native -DNDEBUG" \
          -D CMAKE_Fortran_FLAGS:STRING="-O3 -march=native -Wa,-q -DNDEBUG" \
          -D Rythmos_ENABLE_DEBUG:BOOL=ON \
          -D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \
          -D Tpetra_INST_INT_LONG_LONG:BOOL=ON \
          -D Tpetra_INST_INT_INT:BOOL=ON \
          -D Tpetra_INST_DOUBLE:BOOL=ON \
          -D Tpetra_INST_FLOAT:BOOL=OFF \
          -D Tpetra_INST_COMPLEX_FLOAT:BOOL=OFF \
          -D Tpetra_INST_COMPLEX_DOUBLE:BOOL=OFF \
          -D Tpetra_INST_INT_LONG:BOOL=OFF \
          -D Tpetra_INST_INT_UNSIGNED:BOOL=OFF \
          -D Zoltan_ENABLE_ULONG_IDS:BOOL=ON \
          -D Teuchos_ENABLE_LONG_LONG_INT:BOOL=ON \
          -D Teuchos_ENABLE_COMPLEX:BOOL=OFF \
          -D ZOLTAN_BUILD_ZFDRIVE:BOOL=OFF \
          -D KokkosClassic_DefaultNode:STRING="Kokkos::Compat::KokkosSerialWrapperNode" \
          -D Trilinos_ENABLE_Kokkos:BOOL=ON \
          -D Trilinos_ENABLE_KokkosCore:BOOL=ON \
          -D Phalanx_KOKKOS_DEVICE_TYPE:STRING="SERIAL" \
          -D Phalanx_INDEX_SIZE_TYPE:STRING="INT" \
          -D Phalanx_SHOW_DEPRECATED_WARNINGS:BOOL=OFF \
          -D Kokkos_ENABLE_Serial:BOOL=ON \
          -D Kokkos_ENABLE_OpenMP:BOOL=OFF \
          -D Kokkos_ENABLE_Pthread:BOOL=OFF \
          -D Trilinos_ENABLE_OpenMP:BOOL=OFF \
      \
          -D TPL_ENABLE_MPI:BOOL=ON \
          -D MPI_BASE_DIR:PATH=$MPI_BASE_DIR \
      \
          -D TPL_ENABLE_Matio:BOOL=OFF \
      \
          -D TPL_ENABLE_MPI:BOOL=ON \
          -D MPI_BASE_DIR:PATH=$MPI_BASE_DIR \
      \
          -D TPL_ENABLE_Pthread:BOOL=OFF \
      \
          -D TPL_ENABLE_Boost:BOOL=ON \
          -D TPL_ENABLE_BoostLib:BOOL=ON \
          -D TPL_ENABLE_BoostAlbLib:BOOL=ON \
          -D Boost_INCLUDE_DIRS:PATH=$BOOST_DIR/include \
          -D Boost_LIBRARY_DIRS:PATH=$BOOST_DIR/lib \
          -D BoostLib_INCLUDE_DIRS:PATH=$BOOST_DIR/include \
          -D BoostLib_LIBRARY_DIRS:PATH=$BOOST_DIR/lib \
          -D BoostAlbLib_INCLUDE_DIRS:PATH=$BOOST_DIR/include \
          -D BoostAlbLib_LIBRARY_DIRS:PATH=$BOOST_DIR/lib \
      \
          -D TPL_ENABLE_Netcdf:STRING=ON \
          -D Netcdf_INCLUDE_DIRS:PATH=$NETCDF/include \
          -D Netcdf_LIBRARY_DIRS:PATH=$NETCDF/lib \
      \
          -D TPL_ENABLE_HDF5:STRING=ON \
          -D HDF5_INCLUDE_DIRS:PATH="${HDFDIR}/include" \
          -D TPL_HDF5_LIBRARIES:PATH="${HDFDIR}/lib/libhdf5_hl.a;${HDFDIR}/lib/libhdf5.a;${LIB_DIR}/lib/libz.a" \
      \
          -D TPL_ENABLE_Zlib:STRING=ON \
          -D Zlib_INCLUDE_DIRS:PATH=$LIB_DIR/include \
          -D TPL_Zlib_LIBRARIES:PATH="$LIB_DIR/lib/libz.a" \
      \
          -D TPL_ENABLE_BLAS:STRING=ON \
          -D TPL_ENABLE_LAPACK:STRING=ON \
          -D BLAS_INCLUDE_DIRS:STRING="/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers" \
          -D BLAS_LIBRARY_DIRS:STRING="/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current" \
          -D LAPACK_INCLUDE_DIRS:STRING="/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers" \
          -D LAPACK_LIBRARY_DIRS:STRING="/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current" \
      \
          -D TPL_ENABLE_ParMETIS:STRING=ON \
          -D ParMETIS_INCLUDE_DIRS:PATH="${PARMETISDIR}/include" \
          -D ParMETIS_LIBRARY_DIRS:PATH="${PARMETISDIR}/lib" \
      \
          -D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_DIR \
          -D Trilinos_EXTRA_LINK_FLAGS:STRING="-L${HDFDIR}/lib -L${LIB_DIR}/lib -lnetcdf -lhdf5_hl -lhdf5 -lz" \
      \
          -D Trilinos_ENABLE_Moertel:BOOL=ON \
          -D Moertel_ENABLE_EXAMPLES:BOOL=ON \
          -D Moertel_ENABLE_Morkon:BOOL=ON \
          -D Trilinos_ENABLE_TriKota:BOOL=OFF \
          -D HAVE_INTREPID_KOKKOSCORE:BOOL=ON \
          -D Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF \
          -D Trilinos_ENABLE_Amesos2:BOOL=ON \
          -D Amesos2_ENABLE_KLU2:BOOL=ON \
      \
      $EXTRA_ARGS \
      ${TRILINOS_HOME}
    

Build Albany

  • CMake configure script:

      #!/bin/sh
      
      export ALB_EPETRA=ON
      export ALB_ENABLE_SCOREC=ON
      export ALB_ENABLE_LCM=ON
      export ALB_ENABLE_LAME=OFF
      export ALB_ENABLE_HYDRIDE=OFF
      export ALB_ENABLE_QCAD=OFF
      export ALB_ENABLE_MOR=OFF
      export ALB_ENABLE_ASCR=OFF
      export ALB_ENABLE_AERAS=OFF
      export ALB_ENABLE_FELIX=OFF
      export ALB_ENABLE_AlbanyCI=OFF
      export ALB_DEBUG=OFF
      export ALB_ENABLE_CHECK_FPE=OFF
      export ALB_FLUSH_DENORMALS=ON
      export ALB_ENABLE_SPECULATIVE=OFF
      export ALB_ENABLE_SG_MP=OFF
      export ALB_ENABLE_PERF_TESTS=ON
      export TRILINOS_INSTALL_DIR=/usr/local/trilinos/MPI_REL
      
      export ALB_VERBOSE=OFF
      
      cmake \
            -D ALBANY_TRILINOS_DIR:FILEPATH="$TRILINOS_INSTALL_DIR" \
            -D ENABLE_LCM:BOOL=${ALB_ENABLE_LCM} \
            -D ENABLE_AERAS:BOOL=${ALB_ENABLE_AERAS} \
            -D ENABLE_QCAD:BOOL=${ALB_ENABLE_QCAD} \
            -D ENABLE_HYDRIDE:BOOL=${ALB_ENABLE_HYDRIDE} \
            -D ENABLE_LCM_SPECULATIVE:BOOL=${ALB_ENABLE_SPECULATIVE} \
            -D ENABLE_LAME:BOOL=${ALB_ENABLE_LAME} \
            -D CMAKE_VERBOSE_MAKEFILE:BOOL=${ALB_VERBOSE} \
            -D ENABLE_DEBUGGING:BOOL=${ALB_DEBUG} \
            -D ENABLE_CHECK_FPE:BOOL=${ALB_ENABLE_CHECK_FPE} \
            -D ENABLE_SCOREC:BOOL=${ALB_ENABLE_SCOREC} \
            -D ENABLE_FELIX:BOOL=${ALB_ENABLE_FELIX} \
            -D ENABLE_MOR:BOOL=${ALB_ENABLE_MOR} \
            -D ENABLE_ALBANY_CI:BOOL=${ALB_ENABLE_AlbanyCI} \
            -D ENABLE_ASCR:BOOL=${ALB_ENABLE_ASCR} \
            -D ENABLE_SG_MP:BOOL=${ALB_ENABLE_SG_MP} \
            -D ENABLE_PERFORMANCE_TESTS:BOOL=${ALB_ENABLE_PERF_TESTS} \
            -D ALBANY_CTEST_TIMEOUT:INTEGER=70 \
      \
      ..
    

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

Clone this wiki locally