osrf / homebrew-simulation

Homebrew tap for osrf simulation software
Apache License 2.0
54 stars 73 forks source link

gz-harmonic failing to build on macOS arm, due to ogre failure #2478

Open henriquenunez opened 9 months ago

henriquenunez commented 9 months ago

HOMEBREW_VERSION: 4.1.16 ORIGIN: https://github.com/Homebrew/brew HEAD: c0c8a4dd4dd19ec16deb429abd50cdf82ea33b27 Last commit: 5 days ago Core tap JSON: 19 Oct 12:20 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.01KX0mygsH/org.xquartz:0 HOMEBREW_MAKE_JOBS: 8 HOMEBREW_SORBET_RUNTIME: set Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit arm_firestorm_icestorm Clang: 14.0.3 build 1403 Git: 2.39.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Curl: 7.84.0 => /usr/bin/curl macOS: 13.0.1-arm64 CLT: 14.3.1.0.1.1683849156 Xcode: 14.3.1 Rosetta 2: false

Error (I couldnt gist the logs):


Undefined symbols for architecture arm64:
  "_FreeImage_AcquireMemory", referenced from:
      Ogre::FreeImageCodec::encode(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_AllocateT", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_CloseMemory", referenced from:
      Ogre::FreeImageCodec::encode(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::magicNumberToFileExt(char const*, unsigned long) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_ConvertTo24Bits", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_ConvertTo32Bits", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_ConvertToGreyscale", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_DeInitialise", referenced from:
      Ogre::FreeImageCodec::shutdown() in OgreFreeImageCodec.cpp.o
  "_FreeImage_FIFSupportsExportBPP", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_FIFSupportsExportType", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetBPP", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetBits", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetColorType", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetCopyrightMessage", referenced from:
      Ogre::FreeImageCodec::startup() in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetFIFCount", referenced from:
      Ogre::FreeImageCodec::startup() in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetFIFExtensionList", referenced from:
      Ogre::FreeImageCodec::startup() in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetFileTypeFromMemory", referenced from:
      Ogre::FreeImageCodec::magicNumberToFileExt(char const*, unsigned long) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetFormatFromFIF", referenced from:
      Ogre::FreeImageLoadErrorHandler(FREE_IMAGE_FORMAT, char const*) in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::magicNumberToFileExt(char const*, unsigned long) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetGreenMask", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetHeight", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetImageType", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetPitch", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetVersion", referenced from:
      Ogre::FreeImageCodec::startup() in OgreFreeImageCodec.cpp.o
  "_FreeImage_GetWidth", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_Initialise", referenced from:
      Ogre::FreeImageCodec::startup() in OgreFreeImageCodec.cpp.o
  "_FreeImage_IsTransparent", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_LoadFromMemory", referenced from:
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_OpenMemory", referenced from:
      Ogre::FreeImageCodec::encode(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::magicNumberToFileExt(char const*, unsigned long) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_Save", referenced from:
      Ogre::FreeImageCodec::encodeToFile(Ogre::SharedPtr<Ogre::MemoryDataStream>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_SaveToMemory", referenced from:
      Ogre::FreeImageCodec::encode(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
  "_FreeImage_SetOutputMessage", referenced from:
      Ogre::FreeImageCodec::startup() in OgreFreeImageCodec.cpp.o
  "_FreeImage_Unload", referenced from:
      Ogre::FreeImageCodec::encodeBitmap(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::encode(Ogre::SharedPtr<Ogre::MemoryDataStream>&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::encodeToFile(Ogre::SharedPtr<Ogre::MemoryDataStream>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Ogre::SharedPtr<Ogre::Codec::CodecData>&) const in OgreFreeImageCodec.cpp.o
      Ogre::FreeImageCodec::decode(Ogre::SharedPtr<Ogre::DataStream>&) const in OgreFreeImageCodec.cpp.o
  "boost::this_thread::interruption_point()", referenced from:
      boost::condition_variable::wait(boost::unique_lock<boost::mutex>&) in OgreWorkQueue.cpp.o
      void boost::condition_variable_any::wait<boost::unique_lock<boost::recursive_mutex> >(boost::unique_lock<boost::recursive_mutex>&) in OgreDefaultWorkQueueStandard.cpp.o
  "boost::this_thread::disable_interruption::disable_interruption()", referenced from:
      boost::shared_mutex::lock_shared() in OgreWorkQueue.cpp.o
      boost::shared_mutex::lock() in OgreWorkQueue.cpp.o
  "boost::this_thread::disable_interruption::~disable_interruption()", referenced from:
      boost::shared_mutex::lock_shared() in OgreWorkQueue.cpp.o
      boost::shared_mutex::lock() in OgreWorkQueue.cpp.o
  "boost::detail::get_tss_data(void const*)", referenced from:
      boost::thread_specific_ptr<Ogre::MaterialSerializer>::reset(Ogre::MaterialSerializer*) in OgreMaterialManager.cpp.o
      boost::thread_specific_ptr<Ogre::ScriptCompiler>::reset(Ogre::ScriptCompiler*) in OgreScriptCompiler.cpp.o
      Ogre::ScriptCompilerManager::registerCustomWordId(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in OgreScriptCompiler.cpp.o
      Ogre::ScriptCompilerManager::parseScript(Ogre::SharedPtr<Ogre::DataStream>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in OgreScriptCompiler.cpp.o
  "boost::detail::set_tss_data(void const*, void (*)(void (*)(void*), void*), void (*)(void*), void*, bool)", referenced from:
      Ogre::MaterialManager::MaterialManager() in OgreMaterialManager.cpp.o
      boost::thread_specific_ptr<Ogre::MaterialSerializer>::reset(Ogre::MaterialSerializer*) in OgreMaterialManager.cpp.o
      Ogre::MaterialManager::~MaterialManager() in OgreMaterialManager.cpp.o
      Ogre::ScriptCompilerManager::ScriptCompilerManager() in OgreScriptCompiler.cpp.o
      boost::thread_specific_ptr<Ogre::ScriptCompiler>::reset(Ogre::ScriptCompiler*) in OgreScriptCompiler.cpp.o
      Ogre::ScriptCompilerManager::~ScriptCompilerManager() in OgreScriptCompiler.cpp.o
  "boost::detail::thread_data_base::~thread_data_base()", referenced from:
      boost::detail::thread_data<Ogre::DefaultWorkQueueBase::WorkerFunc>::~thread_data() in OgreDefaultWorkQueueStandard.cpp.o
      boost::detail::thread_data<Ogre::DefaultWorkQueueBase::WorkerFunc>::~thread_data() in OgreDefaultWorkQueueStandard.cpp.o
  "boost::detail::get_current_thread_data()", referenced from:
      boost::detail::interruption_checker::interruption_checker(_opaque_pthread_mutex_t*, _opaque_pthread_cond_t*) in OgreWorkQueue.cpp.o
      boost::detail::interruption_checker::interruption_checker(_opaque_pthread_mutex_t*, _opaque_pthread_cond_t*) in OgreDefaultWorkQueueStandard.cpp.o
  "boost::thread::join_noexcept()", referenced from:
      Ogre::DefaultWorkQueue::shutdown() in OgreDefaultWorkQueueStandard.cpp.o
  "boost::thread::native_handle()", referenced from:
      Ogre::DefaultWorkQueue::shutdown() in OgreDefaultWorkQueueStandard.cpp.o
  "boost::thread::hardware_concurrency()", referenced from:
      Ogre::Root::Root(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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in OgreRoot.cpp.o
  "boost::thread::start_thread_noexcept()", referenced from:
      boost::thread::start_thread() in OgreDefaultWorkQueueStandard.cpp.o
  "boost::thread::detach()", referenced from:
      boost::thread::~thread() in OgreDefaultWorkQueueStandard.cpp.o
  "typeinfo for boost::detail::thread_data_base", referenced from:
      typeinfo for boost::detail::thread_data<Ogre::DefaultWorkQueueBase::WorkerFunc> in OgreDefaultWorkQueueStandard.cpp.o
  "vtable for boost::detail::thread_data_base", referenced from:
      boost::detail::thread_data_base::thread_data_base() in OgreDefaultWorkQueueStandard.cpp.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "_zzip_dir_close", referenced from:
      Ogre::ZipArchive::unload() in OgreZip.cpp.o
  "_zzip_dir_open_ext_io", referenced from:
      Ogre::ZipArchive::load() in OgreZip.cpp.o
  "_zzip_dir_read", referenced from:
      Ogre::ZipArchive::load() in OgreZip.cpp.o
  "_zzip_dir_stat", referenced from:
      Ogre::ZipArchive::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const in OgreZip.cpp.o
  "_zzip_dirhandle", referenced from:
      Ogre::ZipDataStream::read(void*, unsigned long) in OgreZip.cpp.o
  "_zzip_error", referenced from:
      Ogre::ZipArchive::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const in OgreZip.cpp.o
  "_zzip_file_close", referenced from:
      Ogre::ZipDataStream::~ZipDataStream() in OgreZip.cpp.o
      Ogre::ZipDataStream::close() in OgreZip.cpp.o
  "_zzip_file_open", referenced from:
      Ogre::ZipArchive::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const in OgreZip.cpp.o
  "_zzip_file_read", referenced from:
      Ogre::ZipDataStream::read(void*, unsigned long) in OgreZip.cpp.o
  "_zzip_seek", referenced from:
      Ogre::ZipDataStream::skip(long) in OgreZip.cpp.o
      Ogre::ZipDataStream::seek(unsigned long) in OgreZip.cpp.o
  "_zzip_strerror_of", referenced from:
      Ogre::ZipDataStream::read(void*, unsigned long) in OgreZip.cpp.o
  "_zzip_tell", referenced from:
      Ogre::ZipDataStream::tell() const in OgreZip.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/macosx/libOgreMain.1.9.0.dylib] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2

I tried changing the -DCMAKE_OSX_ARCHITECTURES flag to arm64 instead of the default x86-64, but no success with that. I also saw a couple other issues with trouble building on apple silicon, but they seemed unrelated.

scpeters commented 8 months ago

Maybe you can try without ogre1.9? Does it work if you comment out the following line?

https://github.com/osrf/homebrew-simulation/blob/master/Formula/gz-rendering8.rb#L26

rlrs commented 6 months ago

Ogre2.3 also fails. On my side it seems to be a Freetype issue:

/tmp/ogre2.3-20240103-59973-jivofc/ogre-next-2.3.1/Components/Overlay/src/OgreFont.cpp:48:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^~~~~~~~~~~~
1 error generated.
make[2]: *** [Components/Overlay/CMakeFiles/OgreOverlay.dir/src/OgreFont.cpp.o] Error 1

...

[ 94%] Built target RenderSystem_GL3Plus
make: *** [all] Error 2

HOMEBREW_VERSION: 4.2.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: 705d2564ddfb9c915ee9425dd9ed408bfac61005
Last commit: 2 days ago
Core tap JSON: 03 Jan 10:26 UTC
Core cask tap JSON: 03 Jan 10:26 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.JcsNn6Qqu3/org.xquartz:0
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_BOOTSNAP: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.2.1-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: 15.1
Rosetta 2: false

However, I do have freetype installed:

$ brew link freetype
Warning: Already linked: /opt/homebrew/Cellar/freetype/2.13.2
piaosn commented 3 months ago

I had the same issue when I try to install gz-garden.

"_zzip_file_read", referenced from: Ogre::ZipDataStream::read(void, unsigned long) in OgreZip.cpp.o "_zzip_seek", referenced from: Ogre::ZipDataStream::skip(long) in OgreZip.cpp.o Ogre::ZipDataStream::seek(unsigned long) in OgreZip.cpp.o "_zzip_strerror_of", referenced from: Ogre::ZipDataStream::read(void, unsigned long) in OgreZip.cpp.o "_zzip_tell", referenced from: Ogre::ZipDataStream::tell() const in OgreZip.cpp.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [lib/macosx/libOgreMain.1.9.0.dylib] Error 1 make[1]: [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2 make: *** [all] Error 2

The same result with both x86_64 and arm64.

However, the installation was successful when I used iTerm2 with Rosetta 2 enabled.

henriquenunez commented 3 months ago

I had the same issue when I try to install gz-garden.

"_zzip_file_read", referenced from: Ogre::ZipDataStream::read(void, unsigned long) in OgreZip.cpp.o "_zzip_seek", referenced from: Ogre::ZipDataStream::skip(long) in OgreZip.cpp.o Ogre::ZipDataStream::seek(unsigned long) in OgreZip.cpp.o "_zzip_strerror_of", referenced from: Ogre::ZipDataStream::read(void, unsigned long) in OgreZip.cpp.o "_zzip_tell", referenced from: Ogre::ZipDataStream::tell() const in OgreZip.cpp.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [lib/macosx/libOgreMain.1.9.0.dylib] Error 1 make[1]: [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2 make: *** [all] Error 2

The same result with both x86_64 and arm64.

However, the installation was successful when I used iTerm2 with Rosetta 2 enabled.

But I guess we want to unlock full native speed specially when simulating, don't we?

If you think performance was not impaired too much, lmk and I will try this way!