Skip to content

makefile - ld warnings for bin/stansummary #904

@mitzimorris

Description

@mitzimorris

Summary:

On MacOS, after changes to src/cmdstan/stansummary.cpp, make bin/stansummary results in extensive linker warnings.

command is:

clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT       -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.7 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include    -DBOOST_DISABLE_ASSERTS            -Wl,-L,"/Users/mitzi/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/mitzi/github/stan-dev/cmdstan/stan/lib/stan_math/lib/tbb"  bin/cmdstan/stansummary.o stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a         -o bin/stansummary

(also note, stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a listed twice)

output is:

ld: warning: direct access in function 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool)' from file 'stan/lib/stan_math/lib/boost_1.72.0/stage/lib/libboost_program_options.a(value_semantic.o)' to global weak symbol 'guard variable for std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool)::empty' from file 'bin/cmdstan/stansummary.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

Description:

The following doesn't work:

> make build
> touch src/cmdstan/stansummary.cpp
> make bin/stansummary

Reproducible Steps:

see description

Current Output:

see description

Expected Output:

Just recompile/link stansummary - should need to recompile all libraries given that no setting have changed.

Additional Information:

searches on error turned up discussion of visilibity flags - my experience is the same as here:

https://developer.apple.com/forums/thread/43164

Current Version:

v2.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions