Open cconcolato opened 11 months ago
We are working to ensure that the IAMF decoder supports MacOS. The IAMF decoder has dependent libraries that need to be checked and are being checked.
Does this build on MacOS now? We still should update the README.
Does this build on MacOS now? We still should update the README. Yes, in #65 , it has fixed MacOS compile error, and I have updated README in #75
Re-opening this because we should make sure it builds in CI with standard features. At least it should build with both binaural libraries and any supported codecs.
I have been trying to build with codecs and renderers on MacOs and wanted to just share some tips and troubles.
I was able to build without binaural renders but with AAC/Flac/Opus codecs with the following technique
$ brew install cmake opus fdk-aac flac
cd libiamf/code/dep_codecs/lib/
rm *
cd ..
$ cp /opt/homebrew/opt/flac/lib/* ./dep_codecs/lib/
$ cp /opt/homebrew/opt/fdk-aac/lib/* ./dep_codecs/lib/
$ cp /opt/homebrew/opt/opus/lib/* ./dep_codecs/lib/
$ cmake -DCMAKE_INSTALL_PREFIX=${PWD}/build_libs -DMULTICHANNEL_BINAURALIZER=OFF -DHOA_BINAURALIZER=OFF .
$ make
$ make install
Make iamfdec
$ cd test/tools/iamfdec
$ cmake -DCMAKE_INSTALL_PREFIX=${PWD}/../../../build_libs -DMULTICHANNEL_BINAURALIZER=OFF -DHOA_BINAURALIZER=OFF .
$ make
For code/dep_external/src/binaural/build.sh:
set -e
so the script exits on errorgit clone -b visr --single-branch https://github.com/ebu/bear.git rd-audio-visr-public-master
brew install boost
, so could just encourage that then use CMake's find_package(Boost
-DBUILD_PYTHON_BINDINGS=ON
was changed to -DBUILD_PYTHON_BINDINGS=OFF
for both VISR and BEAR builds then things are much simpler (no python dependencies) and the pybind section could be removed.Ignoring code/dep_external/src/binaural/build.sh, I was able to build Resonance and Bear with dependencies with this technique:
$ brew install cmake opus fdk-aac flac boost
Create a folders for builds and for repo clones
$ cd ~
$ mkdir -p libiamf_deps/bear
$ export CMAKE_INSTALL_PREFIX=$PWD/libiamf_deps/bear/
$ export CMAKE_PREFIX_PATH=$PWD/libiamf_deps/bear/
$ mkdir github_clones && cd github_clones
Starting with VISR
$ git clone -b visr --single-branch https://github.com/ebu/bear.git visr
$ cd visr
$ cmake -B build . -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_DOCUMENTATION=OFF -DBUILD_AUDIOINTERFACES_PORTAUDIO=OFF -DBUILD_USE_SNDFILE_LIBRARY=OFF
$ cmake --build build -t install
Cloning BEAR
$ cd ~/github_clones
$ git clone https://github.com/ebu/bear.git
$ cd bear
$ git submodule update --init --recursive
$ cd visr_bear
In visr_bear/CMakeLists.txt, I had to remove this section as there were build errors in the unit tests
if(BEAR_UNIT_TESTS)
include(CTest)
add_subdirectory(test)
endif()
Build BEAR
cmake -B build . -DBUILD_PYTHON_BINDINGS=OFF
cmake --build build -t install
Resonance
cd ~
mkdir -p libiamf_deps/resonance/
export CMAKE_INSTALL_PREFIX=$PWD/libiamf_deps/resonance/
export CMAKE_PREFIX_PATH=$PWD/libiamf_deps/resonance/
cd ~/github_clones
git clone https://github.com/resonance-audio/resonance-audio
cd resonance-audio
./third_party/clone_core_deps.sh
I then had to update the C++ version for Resonance because of the newer version of xsimd that uses C++14 features. So in CMakeLists.txt change
set(CMAKE_CXX_STANDARD 11)
to
set(CMAKE_CXX_STANDARD 17)
(14 probably works too)
Build Resonance
$ ./build.sh -t=RESONANCE_AUDIO_API -p=Release
And then I got stuck building iamf2bear.
$ cd ~/github_clones
$ git clone https://github.com/AOMediaCodec/libiamf
$ cd1 libiamf/code
$ cd dep_codecs/lib/
$ rm *
$ cd ../..
$ cd ~
$ export CMAKE_INSTALL_PREFIX=$PWD/libiamf_deps/bear/
$ cd github_clones/libiamf/code/dep_external/src/binaural/iamf2bear/
$ cmake .
$ make
For some reason make was not resolving the includes properly despite these lines in code/dep_external/src/binaural/iamf2bear/CMakeLists.txt
set(CODEC_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
include_directories(
${CODEC_INCLUDE_DIR}
)
And I ran out of enthusiasm.
I hope this helps someone else trying to build or helps make changes to the build.sh.
@trevorknight Thanks for your great efforts to compile externals, actually, we have made some changes to build.sh at local side, to let it work more efficiently. Now it it works under linux with only one step. We will try macOS as well.
Okay, great! Looking forward to seeing it
@trevorknight Thanks for your valuable suggestions again, it help me a lot prepare the PR. Bear depends on too many other libraries, I need to make some modification. I have submitted #110 to make the binaural compile more efficient, I will share the steps.
Compile dep_codecs. $ cd dep_codecs $ ./build.sh
Compile dep_external(binaural libraries)
Please install boost firstly, please refer to dep_external/src/binaural/README.md in PR #110
Because of network issue, default.tf downloading maybe failed, but it dose not affect the building, so pleaes remove 'set -e' in build.sh
$ cd dep_external/src/binaural/
$ ./build.sh
Compile libiamf $ cd code $ ./build.sh
I hope this change could help you, if are there any issue, please feel free to let me know. I'd always like to hear your opinions.
Thanks
I don't know why the previous PR #110 is merged after PR111 is merged, but the patch seems be covered by PR111, so I create another #112
Okay, I'll give it another try and let you know! Thank you very much
I tried compiling on MacOS and couldn't get it to work, some error about
io.h
not being found. Is MacOS supported? I suggest adding supported platforms explicitly to the README.