Skip to content

STK: Cannot build as shared library on OSX #2994

@jrood-nrel

Description

@jrood-nrel

When building with STK enabled on OSX (Sierra) as a shared library using Clang v9.0.0-apple and GCC 7.3.0, I get this error:

Undefined symbols for architecture x86_64:
  "stk::handle_assert(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_ostringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)", referenced from:
      sierra::MPI::AllReduce(ompi_communicator_t*, sierra::MPI::ReduceSet const&) in MPI.cpp.o
      sierra::MPI::(anonymous namespace)::ReduceCheck::copyout(void*&) const in MPI.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [packages/stk/stk_util/stk_util/parallel/libstk_util_parallel.12.13.dylib] Error 1
make[1]: *** [packages/stk/stk_util/stk_util/parallel/CMakeFiles/stk_util_parallel.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

When building as a static library on OSX, everything works fine. Also when building either shared or static with STK enabled on Linux works fine. I used Spack to investigate this, so I install with either trilinos+shared or trilinos~shared when testing this. The easiest way to see this I think would be to use spack install nalu-wind on OSX Sierra to see Trilinos fail with this error. (Update: I developed a workaround for this in Spack, so it won't build as a shared library on OSX)

@trilinos/stk

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLOSED_DUE_TO_INACTIVITYIssue or PR has been closed by the GitHub Actions bot due to inactivity.MARKED_FOR_CLOSUREIssue or PR is marked for auto-closure by the GitHub Actions bot.pkg: STK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions