[Trilinos-Users] Trilinos doesn't compile on OS X; Tried everything I know

Roberts, Nathan V. nvroberts at alcf.anl.gov
Fri Mar 20 15:15:03 MDT 2015


(Looks like I neglected to cc the list in my reply—resending.)

Sriram,

I have a MacBook Air running OS X 10.10.2 with a Trilinos build; I've loaded your configure file and tried building using it, tweaking in a couple places to match my own system.  I am using OpenMPI 1.8.3.

The important things that I changed:
1. In the CMAKE_CXX_FLAGS line, I removed the "-lgfortran" bit; it wouldn't configure for me with that in place.
2. In the TPL_Boost_INCLUDE_DIRS:PATH line, I changed it to be <my boost location>/include; you seem to have <your boost location>/include/boost.  I think this may in fact be the source of your Teuchos compilation errors.
3. I deleted the TPL_BLAS_LIBRARIES:FILEPATH and TPL_LAPACK_LIBRARIES:FILEPATH lines; I believe the Trilinos cmake configure found Apple's versions of these for me.

These changes got me to the 98% mark; then there was a failure in building the Stokhos tests; the error output was:
In file included from …publicTrilinos/packages/stokhos/test/Performance/MPVectorKernels/TestSpMv.cpp:45:
In file included from …publicTrilinos/packages/stokhos/test/Performance/MPVectorKernels/TestSpMv.hpp:44:
In file included from …publicTrilinos/packages/stokhos/src/sacado/kokkos/Stokhos_Sacado_Kokkos.hpp:45:
In file included from …publicTrilinos/packages/stokhos/src/sacado/kokkos/vector/Stokhos_Sacado_Kokkos_MP_Vector.hpp:53:
In file included from …publicTrilinos/packages/stokhos/src/sacado/kokkos/Stokhos_KokkosTraits.hpp:45:
In file included from …publicTrilinos/packages/sacado/src/Sacado_Traits.hpp:61:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:35: error: no matching
      function for call to 'fabs'
abs(double __x) _NOEXCEPT {return fabs(__x);}
                                  ^~~~
Perhaps someone else can chime in on how best to fix this issue; what I did was simply to disable the tests.  After that it built fine.

My OpenMPI install is one that I built from source<http://www.open-mpi.org/software/ompi/>, using Apple's clang compiler with fairly vanilla options.

Here, I'm not building Trilinos 11.12.1, but a version from the public Git repository last updated in mid-January.  I expect that the same setup would work for 11.12.1, however.

My tweaked version of your build script is attached; hopefully this will get you up and running, or at least closer to it.

Regards,
Nate

#!/bin/sh
TRILINOS_PATH=../..
OPENMPI=/Users/nroberts/lib/openmpi-1.8.3
BOOST_INCLUDE=/usr/local/Cellar/boost/1.56.0/include
EXTRA_ARGS=$@

rm -f CMakeCache.txt
rm -rf CMakeFiles

cmake \
  -D CMAKE_BUILD_TYPE:STRING=DEBUG \
  -D TPL_ENABLE_BLAS:BOOL=ON \
  -D TPL_ENABLE_LAPACK:BOOL=ON \
  -D TPL_ENABLE_Boost:BOOL=ON  \
  -D TPL_Boost_INCLUDE_DIRS:PATH=$BOOST_INCLUDE \
  -D TPL_ENABLE_MPI:BOOL=ON \
  -D MPI_BASE_DIR:PATH="$OPENMPI"\
  -D MPI_BIN_DIR:PATH="$OPENMPI/bin"\
  -D MPI_INCLUDE_PATH:PATH="$OPENMPI/include" \
  -D MPI_USE_COMPILER_WRAPPERS:BOOL=ON \
  -D MPI_EXEC:FILEPATH="$OPENMPI/bin/mpiexec" \
  -D MPI_Fortran_COMPILER:FILEPATH="$OPENMPI/bin/mpif90" \
  -D MPI_CXX_COMPILER:FILEPATH="$OPENMPI/bin/mpicxx" \
  -D MPI_C_COMPILER:FILEPATH="$OPENMPI/bin/mpicc" \
  -D CMAKE_CXX_FLAGS:STRING="-ansi -Wall -pedantic" \
  -D HAVE_GCC_ABI_DEMANGLE:BOOL=ON \
  -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
  -D Trilinos_ENABLE_DEFAULT_PACKAGES:BOOL=ON \
  -D DART_TESTING_TIMEOUT:STRING=600 \
  -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
  -D Trilinos_ENABLE_CTrilinos:BOOL=ON\
  -D Trilinos_ENABLE_ForTrilinos:BOOL=ON\
  -D TPL_ENABLE_HDF5:BOOL=ON \
  -D HDF5_LIBRARY_DIRS:FILEPATH=/Users/nroberts/lib/hdf5/lib \
  -D HDF5_LIBRARY_NAMES:STRING="hdf5" \
  -D TPL_HDF5_INCLUDE_DIRS:FILEPATH=/Users/nroberts/lib/hdf5/include \
  -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
  -D Trilinos_ENABLE_Amesos:BOOL=ON \
  -D Trilinos_ENABLE_Amesos2:BOOL=ON \
  -D Trilinos_ENABLE_Anasazi:BOOL=ON \
  -D Trilinos_ENABLE_AztecOO:BOOL=ON \
  -D Trilinos_ENABLE_Belos:BOOL=ON \
  -D Trilinos_ENABLE_EpetraExt:BOOL=ON \
  -D Trilinos_ENABLE_Galeri:BOOL=ON \
  -D Trilinos_ENABLE_GlobiPack:BOOL=ON \
  -D Trilinos_ENABLE_Ifpack2:BOOL=ON \
  -D Trilinos_ENABLE_Intrepid:BOOL=ON \
  -D Trilinos_ENABLE_Kokkos:BOOL=ON \
  -D Trilinos_ENABLE_Moocho:BOOL=ON \
  -D Trilinos_ENABLE_NOX:BOOL=ON \
  -D Trilinos_ENABLE_LOCA:BOOL=ON \
  -D Trilinos_ENABLE_Piro:BOOL=ON \
  -D Trilinos_ENABLE_Plris:BOOL=ON \
  -D Trilinos_ENABLE_RTOp:BOOL=ON \
  -D Trilinos_ENABLE_Shards:BOOL=ON \
  -D Trilinos_ENABLE_Rythmos:BOOL=ON \
  -D Trilinos_ENABLE_Sacado:BOOL=ON \
  -D Trilinos_ENABLE_ShyLU:BOOL=ON \
  -D Trilinos_ENABLE_Stokhos:BOOL=ON \
  -D Trilinos_ENABLE_Stratimikos:BOOL=ON \
  -D Trilinos_ENABLE_Teko:BOOL=ON \
  -D Trilinos_ENABLE_Teuchos:BOOL=ON \
  -D Trilinos_ENABLE_Thyra:BOOL=ON \
  -D Trilinos_ENABLE_Tpetra:BOOL=ON \
  -D Trilinos_ENABLE_Trios:BOOL=ON \
  -D Trilinos_ENABLE_TriUtils:BOOL=ON \
  -D Trilinos_ENABLE_Xpetra:BOOL=ON \
  -D Trilinos_ENABLE_Zoltan:BOOL=ON \
  -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON \
  -D Trilinos_ENABLE_TESTS:BOOL=OFF \
  -D Trilinos_ENABLE_EXAMPLES:BOOL=ON \
  -DTrilinos_ASSERT_MISSING_PACKAGES=OFF \
  -Wno-dev \
$EXTRA_ARGS \
$TRILINOS_PATH



On Mar 19, 2015, at 6:48 PM, Krishnaswamy,Sriram <sriram.krish at ufl.edu<mailto:sriram.krish at ufl.edu>> wrote:

Hello,

I represent the Stochastic Systems Lab<http://web.mae.ufl.edu/~mrinalkumar/Research/research.html> at the University of Florida. I am currently working on parallelizing the numerical method developed by my colleague to solve high dimensional Fokker-Planck Equation and I plan on using Trilinos and MPI for that.

I am facing a problem with getting Trilinos 11.12.1 to work on my MacBook Pro with OS X 10.10.2. I receive an architecture error - “Undefined symbols for architecture x86_64" - when I try to run Trilinos after compilation.

I posted an initial version of the question on Stack Exchange but have made some progress since then. I had initially tried to change the BLAS and LAPACK libraries but to no avail. I figured the compilation was a problem with the Fortran library in Mac and hence, after initially failing when trying to disable it, I added CXX flags and specified both Fortran libraries - from Homebrew and native - and after that it compiled. But the same architecture error keeps coming up when I try to run it.

Also, I tried compiling individual package by package and have figured out that the problem is with the Teuchos, and everything that directly depends on it, which seems to compile but invokes the architecture error when tried to run. I tried compiling it with Homebrew, based on the discussion in issue #887,  and it resulted in the same error when tried to run, although it did compile.

I have also tried compiling the entire package on a brand new Mac Pro with no change in result.

My configure file<https://gist.github.com/sriramkswamy/403db0748cc5af51cd86>
My CMakeError.log<https://gist.github.com/sriramkswamy/35cfc234958835d1982c> (when it didn’t compile initially and is due to the same architecture error)
My original stack exchange post<http://scicomp.stackexchange.com/questions/19156/trilinos-on-osx-fails-to-compile-from-source-and-compiles-from-homebrew-but-fail>
The Homebrew issue discussion<https://github.com/Homebrew/homebrew-science/issues/887>
My brew config<https://gist.github.com/sriramkswamy/7dd362441100e12ec1fd>
The test code I’m trying to run<https://gist.github.com/sriramkswamy/09583bc374ba2ddeffb4>
My mpic++ log when tried to run<https://gist.github.com/sriramkswamy/978a04058ccd13ff2edb> - this is the same with both Homebrew and manual compilation.

Any help regarding this would be great! Thank you for your time.

Regards,
Sriram Krishnaswamy

PS: I had sent the mail before confirming my account for the mailing list and it was put on hold. I deeply apologize if the mail has been sent twice.
_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov<mailto:Trilinos-Users at software.sandia.gov>
https://software.sandia.gov/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20150320/d4cc372a/attachment.html>


More information about the Trilinos-Users mailing list