cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.31k stars 907 forks source link

Error building for MacOS #730

Open Janjs opened 2 years ago

Janjs commented 2 years ago

Describe the bug I am guessing this is a known issue as the continuous integration for Mac also fails with v2.0 (It works fine with v1.1).

It is the same error as https://ci.appveyor.com/project/cdcseacave/openmvs/build/job/qqjhlqflohr86480

[ 73%] Linking CXX executable ../../bin/InterfaceCOLMAP Undefined symbols for architecture x86_64: "boost::iostreams::zstd::best_speed", referenced from:

Desktop (please complete the following information):

Janjs commented 2 years ago

Seems to be an issue with supporting ZSTD, after I removed it, it built fine.

cdcseacave commented 2 years ago

indeed, seems a problem with the boost library that does not include all needed code in the lib files; I am not a mac expert, so pls help if you have any insight in how to solve this (maybe installing boost from a different source)?

ShaneCN commented 2 years ago

Seems to be an issue with supporting ZSTD, after I removed it, it built fine.

I meet the same building question. Could you please share how to remove ZSTD? Thank you.

adelpit commented 2 years ago

@cdcseacave Try this to rebuild from source without zstd

brew install boost
sed -i.bak -r 's/NO_ZSTD=1/NO_ZSTD=0/' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew reinstall boost --build-from-source
ShaneCN commented 2 years ago

@cdcseacave Try this to rebuild from source without zstd

brew install boost
sed -i.bak -r 's/NO_ZSTD=1/NO_ZSTD=0/' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew reinstall boost --build-from-source

It works. Very appreciate.

Janjs commented 2 years ago

@cdcseacave Try this to rebuild from source without zstd

brew install boost
sed -i.bak -r 's/NO_ZSTD=1/NO_ZSTD=0/' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew reinstall boost --build-from-source

Can confirm that worked for me too! I tried fixing it but couldn't find a solution, so thanks @adelpit !

cogitas3d commented 2 years ago

In some Mac you maybe have this error:

sed: illegal option -- r

So, the solution is replace "-r" to "-E" and it will works!

CodeAunt commented 2 years ago

@cdcseacave Try this to rebuild from source without zstd

brew install boost
sed -i.bak -r 's/NO_ZSTD=1/NO_ZSTD=0/' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew reinstall boost --build-from-source

I got this output after try to rebuild boost:

Last 15 lines from /Users/zeppelin/Library/Logs/Homebrew/boost/03.b2:
                                                                                          ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/math.h:875:46: note: 'cosh' declared here
inline _LIBCPP_INLINE_VISIBILITY float       cosh(float __lcpp_x) _NOEXCEPT       {return ::coshf(__lcpp_x);}
                                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
...failed darwin.compile.c++ bin.v2/libs/wave/build/darwin-13.1.6/release/link-static/visibility-hidden/instantiate_re2c_lexer_str.o...
...skipped <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/threadapi-pthread/visibility-hidden>libboost_wave.a(clean) for lack of <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/visibility-hidden>instantiate_cpp_exprgrammar.o...
...skipped <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/threadapi-pthread/visibility-hidden>libboost_wave.a for lack of <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/visibility-hidden>instantiate_cpp_exprgrammar.o...
...skipped <p/opt/homebrew/Cellar/boost/1.78.0_1/lib>libboost_wave.a for lack of <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/threadapi-pthread/visibility-hidden>libboost_wave.a...
...skipped <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/threadapi-pthread/visibility-hidden>libboost_wave-variant-static.cmake for lack of <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/threadapi-pthread/visibility-hidden>libboost_wave.a...
...skipped <p/opt/homebrew/Cellar/boost/1.78.0_1/lib/cmake/boost_wave-1.78.0>libboost_wave-variant-static.cmake for lack of <pbin.v2/libs/wave/build/darwin-13.1.6/release/link-static/threadapi-pthread/visibility-hidden>libboost_wave-variant-static.cmake...
...failed updating 370 targets...
...skipped 714 targets...
...updated 17541 targets...

READ THIS: https://docs.brew.sh/Troubleshooting

I could not figure out the specific reason...

And the error still exists:

Undefined symbols for architecture arm64: 
"boost::iostreams::zstd::best_speed", referenced from:...

using: Apple clang version 13.1.6 (clang-1316.0.21.2) Target: arm64-apple-darwin21.0.1 Thread model: posix Homebrew 3.4.3

installed boost: boost 1.78.0_1

Could you please help me with this? thanks.

diamondxx commented 2 years ago

@cdcseacave试试这个在没有 zstd 的情况下从源代码重建

brew install boost
sed -i.bak -r 's/NO_ZSTD=1/NO_ZSTD=0/' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew reinstall boost --build-from-source

Thank you for your support, it works!

zhutaoontheway commented 2 years ago

@cdcseacave Try this to rebuild from source without zstd

brew install boost
sed -i.bak -r 's/NO_ZSTD=1/NO_ZSTD=0/' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
brew reinstall boost --build-from-source

It works, thank you so much.