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

Roberts, Nathan V. nvroberts at alcf.anl.gov
Tue Mar 31 11:38:58 MDT 2015


Sriram,

It looks to me like your linker (ld) line is missing any reference to the specific packages you're linking against.   I think if you ran

/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.10.1 -weak_reference_mismatches non-weak -o a.out -L/usr/local/trilinos/lib /usr/local/trilinos/lib/libepetra.a -L/usr/local/openmpi/lib -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. /var/folders/7_/szrqp0mx0_dfw5082v6zl5900000gn/T//ccc2mGV3.o -lmpi_cxx -lmpi -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v

instead (assuming libeptra.a is in fact the name of your built Epetra library), then you'd get past the error you report.  In my link lines, I have a very long list of libraries, one for each Trilinos package.  (I'm using a CMake-based build system, which takes care of writing those link lines automatically.)

Regards,
Nate

On Mar 31, 2015, at 12:16 PM, "Krishnaswamy,Sriram" <sriram.krish at ufl.edu<mailto:sriram.krish at ufl.edu>> wrote:

Hey Nathan,

I have compiled the packages I need (Epetra, Tpetra, Teuchos, Kokkos and Thyra) and, except for Teuchos which failed two tests, all the packages passed all the tests and the compilation was successful.

I’m having trouble with the linker though. Almost no package is being linked correctly. I tried to the Hello World Epetra example given here - https://code.google.com/p/trilinos/wiki/EpetraLesson01 - and this is the verbose error log of the same. I use the same compiler I used while configuring Epetra.

Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../gcc-4.9-20141029/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.9.2 20141029 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.10.1' '-I' '/usr/local/trilinos/include' '-L/usr/local/trilinos/lib' '-v' '-I' '/usr/local/openmpi/include' '-L/usr/local/openmpi/lib' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/cc1plus -quiet -v -I /usr/local/trilinos/include -I /usr/local/openmpi/include -D__DYNAMIC__ EpetraHelloWorld.cpp -fPIC -quiet -dumpbase EpetraHelloWorld.cpp -mmacosx-version-min=10.10.1 -mtune=core2 -auxbase EpetraHelloWorld -version -o /var/folders/7_/szrqp0mx0_dfw5082v6zl5900000gn/T//ccF7mahH.s
GNU C++ (GCC) version 4.9.2 20141029 (prerelease) (x86_64-apple-darwin14.0.0)
compiled by GNU C version 4.9.2 20141029 (prerelease), GMP version 6.0.0, MPFR version 3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../../../x86_64-apple-darwin14.0.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/trilinos/include
 /usr/local/openmpi/include
 /usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../../../include/c++/4.9.2
 /usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../../../include/c++/4.9.2/x86_64-apple-darwin14.0.0
 /usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../../../include/c++/4.9.2/backward
 /usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
GNU C++ (GCC) version 4.9.2 20141029 (prerelease) (x86_64-apple-darwin14.0.0)
compiled by GNU C version 4.9.2 20141029 (prerelease), GMP version 6.0.0, MPFR version 3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c0a1d89bdb8ef292bcb2f0d5b923240f
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.10.1' '-I' '/usr/local/trilinos/include' '-L/usr/local/trilinos/lib' '-v' '-I' '/usr/local/openmpi/include' '-L/usr/local/openmpi/lib' '-shared-libgcc' '-mtune=core2'
 as -arch x86_64 -force_cpusubtype_ALL -o /var/folders/7_/szrqp0mx0_dfw5082v6zl5900000gn/T//ccc2mGV3.o /var/folders/7_/szrqp0mx0_dfw5082v6zl5900000gn/T//ccF7mahH.s
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/:/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/:/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/:/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/:/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/:/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.10.1' '-I' '/usr/local/trilinos/include' '-L/usr/local/trilinos/lib' '-v' '-I' '/usr/local/openmpi/include' '-L/usr/local/openmpi/lib' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/collect2 -dynamic -arch x86_64 -macosx_version_min 10.10.1 -weak_reference_mismatches non-weak -o a.out -L/usr/local/trilinos/lib -L/usr/local/openmpi/lib -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. /var/folders/7_/szrqp0mx0_dfw5082v6zl5900000gn/T//ccc2mGV3.o -lmpi_cxx -lmpi -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 4.9.2 20141029 (prerelease)
/usr/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.10.1 -weak_reference_mismatches non-weak -o a.out -L/usr/local/trilinos/lib -L/usr/local/openmpi/lib -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. /var/folders/7_/szrqp0mx0_dfw5082v6zl5900000gn/T//ccc2mGV3.o -lmpi_cxx -lmpi -lstdc++ -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-241.9
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7m armv7em
Library search paths:
/usr/local/trilinos/lib
/usr/local/openmpi/lib
/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2
/usr/local/lib
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
  "Epetra_MpiComm::Epetra_MpiComm(ompi_communicator_t*)", referenced from:
      _main in ccc2mGV3.o
  "Epetra_MpiComm::~Epetra_MpiComm()", referenced from:
      _main in ccc2mGV3.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Regards,
Sriram


On Mar 31, 2015, at 11:44 AM, Roberts, Nathan V. <nvroberts at alcf.anl.gov<mailto:nvroberts at alcf.anl.gov>> wrote:

Sriram,

Sorry for the delayed response.  Have you resolved these issues?

I'm unclear on what is and is not working for you.  Does the Trilinos build complete?  It sounds like it does, and maybe after that you're having trouble building a driver that links against it?  If that's the case, perhaps you could post to the list the details of what you're trying to build, and how.

I'm not an expert on these things, though I have managed to get them working for myself in various contexts, including under Yosemite, and I'm happy to help if I can.  (But if you're still working on this, please do post responses to the list—that way, others can also help, and those with similar issues may benefit from the discussion.)

Regards,
Nate


On Mar 22, 2015, at 10:34 PM, "Krishnaswamy,Sriram" <sriram.krish at ufl.edu<mailto:sriram.krish at ufl.edu>> wrote:

Hi Nathan,

I used the native clang compilers and it compiled but I still have the same linker error when I try to run the sample code. I had mentioned about this briefly in the first mail I had sent. I need Teuchos mainly for its SerialDenseMatrix, RefCountPtr and TimeMonitor.

The SerialDenseMatrix works perfectly fine but the other two don’t.

This is the error output when I try to include just RefCountPtr:

Undefined symbols for architecture x86_64:
  "Teuchos::ActiveRCPNodesSetup::ActiveRCPNodesSetup()", referenced from:
      ___cxx_global_var_init in trilinos-4dc913.o
  "Teuchos::ActiveRCPNodesSetup::~ActiveRCPNodesSetup()", referenced from:
      ___cxx_global_var_init in trilinos-4dc913.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is the error output when I try to include just TimeMonitor:

Undefined symbols for architecture x86_64:
  "Teuchos::TimeMonitor::summarize(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, bool, bool, Teuchos::ECounterSetOp, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)", referenced from:
      Teuchos::TimeMonitorSurrogateImpl::summarize(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in trilinos-8da256.o
  "Teuchos::demangleName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      Teuchos::TypeNameTraits<Teuchos::RCP<Teuchos::TimeMonitorSurrogateImpl> >::concreteName(Teuchos::RCP<Teuchos::TimeMonitorSurrogateImpl> const&) in trilinos-8da256.o
      Teuchos::TypeNameTraits<Teuchos::TimeMonitorSurrogateImpl>::concreteName(Teuchos::TimeMonitorSurrogateImpl const&) in trilinos-8da256.o
      Teuchos::TypeNameTraits<Teuchos::TimeMonitorSurrogateImpl>::name() in trilinos-8da256.o
      Teuchos::TypeNameTraits<Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> > >::concreteName(Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> > const&) in trilinos-8da256.o
  "Teuchos::RCPNodeHandle::unbindOne()", referenced from:
      Teuchos::RCPNodeHandle::unbind() in trilinos-8da256.o
  "Teuchos::RCPNodeTracer::addNewRCPNode(Teuchos::RCPNode*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      Teuchos::RCPNodeHandle::RCPNodeHandle<Teuchos::TimeMonitorSurrogateImpl>(Teuchos::RCPNode*, Teuchos::TimeMonitorSurrogateImpl*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle(Teuchos::RCPNode*, Teuchos::ERCPStrength, bool) in trilinos-8da256.o
  "Teuchos::RCPNodeTracer::isTracingActiveRCPNodes()", referenced from:
      Teuchos::RCPNodeHandle::RCPNodeHandle<Teuchos::TimeMonitorSurrogateImpl>(Teuchos::RCPNode*, Teuchos::TimeMonitorSurrogateImpl*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle(Teuchos::RCPNode*, Teuchos::ERCPStrength, bool) in trilinos-8da256.o
  "Teuchos::RCPNodeTracer::getCommonDebugNotesString()", referenced from:
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::throw_invalid_obj_exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, void const*, Teuchos::RCPNode const*, void const*) const in trilinos-8da256.o
  "Teuchos::RCPNodeTracer::getExistingRCPNodeGivenLookupKey(void const*)", referenced from:
      Teuchos::RCPNode* Teuchos::RCPNodeTracer::getExistingRCPNode<Teuchos::TimeMonitorSurrogateImpl>(Teuchos::TimeMonitorSurrogateImpl*) in trilinos-8da256.o
  "Teuchos::ActiveRCPNodesSetup::ActiveRCPNodesSetup()", referenced from:
      ___cxx_global_var_init in trilinos-8da256.o
  "Teuchos::ActiveRCPNodesSetup::~ActiveRCPNodesSetup()", referenced from:
      ___cxx_global_var_init in trilinos-8da256.o
  "Teuchos::CommandLineProcessor::getTimeMonitorSurrogate()", referenced from:
      Teuchos::TimeMonitorSurrogateImplInserter::TimeMonitorSurrogateImplInserter() in trilinos-8da256.o
  "Teuchos::CommandLineProcessor::setTimeMonitorSurrogate(Teuchos::RCP<Teuchos::CommandLineProcessor::TimeMonitorSurrogate> const&)", referenced from:
      Teuchos::TimeMonitorSurrogateImplInserter::TimeMonitorSurrogateImplInserter() in trilinos-8da256.o
  "Teuchos::TestForException_break(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      Teuchos::debugAssertStrength(Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle<Teuchos::TimeMonitorSurrogateImpl>(Teuchos::RCPNode*, Teuchos::TimeMonitorSurrogateImpl*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::throw_invalid_obj_exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, void const*, Teuchos::RCPNode const*, void const*) const in trilinos-8da256.o
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::~RCPNodeTmpl() in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle(Teuchos::RCPNode*, Teuchos::ERCPStrength, bool) in trilinos-8da256.o
  "Teuchos::TestForException_getThrowNumber()", referenced from:
      Teuchos::debugAssertStrength(Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle<Teuchos::TimeMonitorSurrogateImpl>(Teuchos::RCPNode*, Teuchos::TimeMonitorSurrogateImpl*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::throw_invalid_obj_exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, void const*, Teuchos::RCPNode const*, void const*) const in trilinos-8da256.o
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::~RCPNodeTmpl() in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle(Teuchos::RCPNode*, Teuchos::ERCPStrength, bool) in trilinos-8da256.o
  "Teuchos::TestForException_incrThrowNumber()", referenced from:
      Teuchos::debugAssertStrength(Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle<Teuchos::TimeMonitorSurrogateImpl>(Teuchos::RCPNode*, Teuchos::TimeMonitorSurrogateImpl*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, Teuchos::ERCPStrength) in trilinos-8da256.o
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::throw_invalid_obj_exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, void const*, Teuchos::RCPNode const*, void const*) const in trilinos-8da256.o
      Teuchos::RCPNodeTmpl<Teuchos::TimeMonitorSurrogateImpl, Teuchos::DeallocDelete<Teuchos::TimeMonitorSurrogateImpl> >::~RCPNodeTmpl() in trilinos-8da256.o
      Teuchos::RCPNodeHandle::RCPNodeHandle(Teuchos::RCPNode*, Teuchos::ERCPStrength, bool) in trilinos-8da256.o
  "Teuchos::RCPNode::impl_pre_delete_extra_data()", referenced from:
      Teuchos::RCPNode::pre_delete_extra_data() in trilinos-8da256.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Regards,
Sriram

On Mar 21, 2015, at 11:36 PM, Roberts, Nathan V. <nvroberts at alcf.anl.gov<mailto:nvroberts at alcf.anl.gov>> wrote:

Sriram,

You might try starting over with a new build directory and your latest configuration file.  I've run into cases where there are leftover build products from a previous build configuration that were continuing to cause hard-to-diagnose issues.

If that doesn't do it, I'd suggest simplifying your approach in the following ways:
1. Use clang for all building.  I have had good luck with clang, and no reason to suspect that you wouldn't.
2. Use Apple's BLAS and LAPACK builds.  Again, I've had good luck with these, and you should be able to get them by just deleting the appropriate LIBRARY_DIRS and LIBRARY_NAMES from your configuration.

If you really want gcc or other BLAS/LAPACK libraries, you can always mix those in later.  Of the two suggestions, I think #1 is the more likely to make a difference.

Regards,
Nate

On Mar 21, 2015, at 3:10 PM, Krishnaswamy,Sriram <sriram.krish at ufl.edu<mailto:sriram.krish at ufl.edu>> wrote:

Hello Nathan, Bill and Ramesh,

Thanks a lot for your suggestions. I took some time to work out all of them.

I tried all your suggestions but I’m still at the same point. I’m really not sure what I’m doing wrong.

1. I cleaned my Mac - rolled back to Mavericks for a factory install and updated to OS X to get the latest Xcode.
2. I built GNU/GCC libraries on top of the native clang libraries.
3. I removed the ‘-lgfortran’ flag
4. I also built openmpi, blas and lapack manually (as Ramesh suggested)
5. I used home-brew for scotch, boost (‘include’ the way Nate suggested) and hdf5
6. I switched off Fortran libraries off (as Bill suggested)
7. I also switched CTrilinos and ForTrilinos packages for now.

I had a problem with Sacado and so I removed it but the exact error with Teuchos remains.

This is my current configuration file.

#!/bin/sh
TRILINOS_PATH=/Users/sriramkswamy/Downloads/trilinos-11.12.1-Source
OPENMPI=/usr/local/openmpi
BOOST_INCLUDE=/usr/local/Cellar/boost/1.57.0/include
HDF5=/usr/local/Cellar/hdf5/1.8.14
SCOTCH=/usr/local/Cellar/scotch/6.0.3
EXTRA_ARGS=$@

rm -f CMakeCache.txt
rm -rf CMakeFiles

cmake \
  -D CMAKE_BUILD_TYPE:STRING=DEBUG \
  -D TPL_ENABLE_Boost:BOOL=ON  \
  -D TPL_Boost_INCLUDE_DIRS:PATH=$BOOST_INCLUDE \
  -D TPL_ENABLE_Scotch:BOOL=ON \
  -D Scotch_INCLUDE_DIRS:FILEPATH="$SCOTCH/include" \
  -D Scotch_LIBRARY_DIRS:FILEPATH="$SCOTCH/lib" \
  -D TPL_ENABLE_BLAS:STRING=ON \
  -D BLAS_LIBRARY_DIRS:FILEPATH="/usr/local/BLAS" \
  -D BLAS_LIBRARY_NAMES:STRING="libblas.a" \
  -D TPL_ENABLE_LAPACK:STRING=ON \
  -D LAPACK_LIBRARY_DIRS:FILEPATH="/usr/local/LAPACK" \
  -D LAPACK_LIBRARY_NAMES:STRING="liblapack.a" \
  -D Trilinos_ENABLE_Fortran:BOOL=OFF \
  -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 -g -O3" \
  -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 TPL_ENABLE_HDF5:BOOL=ON \
  -D HDF5_LIBRARY_DIRS:FILEPATH="$HDF5/lib" \
  -D HDF5_LIBRARY_NAMES:STRING="hdf5" \
  -D TPL_HDF5_INCLUDE_DIRS:FILEPATH="$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_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 \
  -D Trilinos_ASSERT_MISSING_PACKAGES=OFF \
  -Wno-dev \
$EXTRA_ARGS \
$TRILINOS_PATH


Regards,
Sriram Krishnaswamy


On Mar 20, 2015, at 5:15 PM, Roberts, Nathan V. <nvroberts at alcf.anl.gov<mailto:nvroberts at alcf.anl.gov>> wrote:

(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






_______________________________________________
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/20150331/9a87b828/attachment.html>


More information about the Trilinos-Users mailing list