-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble building on OS X / M1 Pro #58
Comments
Doing some googling, cmake looks up to date.
Setting this doesn't help:
|
Thanks for pointing these issues: I rarely have users compiling for OSX , and the cmake is a bit too much 'hardcoded'. In this part of the CMakeList.txt you should be able to change the part causing problems:
I would very much appreciate help for a more robust cmake for OSX (e.g. testing architecture) but only has one old MBP to work with... Thanks for your help! |
Thanks! It's building with diff --git a/CMakeLists.txt b/CMakeLists.txt
index f200d85..0f1b873 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,7 @@ if(UNIX)
# the RPATH to be used when installing
set(CMAKE_SKIP_RPATH TRUE)
set(OpenGL_DIR /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/)
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
+ set(CMAKE_OSX_ARCHITECTURES "arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
# CPACK
@@ -69,7 +69,7 @@ if(UNIX)
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
# find icu4c in OSX (pretty well hidden...)
- set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig")
+ set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig")
else()
add_definitions(-DLINUX) |
Reading your link and doing some googling but setting it to these doesn't work for me:
|
The build encounters a bug when using
@brunoherbelin shared one breadcrumb:
I will poke at that more soon. |
I see in the release
There is pretty much nothing in my bulit app
EDIT:
|
Aha, more progress updating paths diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5d2926a..113e370 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -205,25 +205,25 @@ IF(APPLE)
install(DIRECTORY "${PKG_GSTREAMER_BASE_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "${PKG_GSTREAMER_BAD_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-plugins-good/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-plugins-ugly/1.18.4_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-libav/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-good/1.20.3_2/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-ugly/1.20.3_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-libav/1.20.3/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
# install locally recompiled & installed gst-plugins (because not included in brew package)
- install(FILES "/usr/local/lib/gstreamer-1.0/libgstapplemedia.dylib"
- "/usr/local/lib/gstreamer-1.0/libgstde265.dylib"
- "/usr/local/lib/gstreamer-1.0/libgstx265.dylib"
- DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
+ # install(FILES "/usr/local/lib/gstreamer-1.0/libgstapplemedia.dylib"
+ # "/usr/local/lib/gstreamer-1.0/libgstde265.dylib"
+ # "/usr/local/lib/gstreamer-1.0/libgstx265.dylib"
+ # DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
# install frei0r plugins (dependencies of gstreamer-1.0/libgstfrei0r.dylib plugin)
- install(FILES "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/lissajous0r.so"
- "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/rgbnoise.so"
+ install(FILES "/opt/homebrew/Cellar/frei0r/1.8.0/lib/frei0r-1/lissajous0r.so"
+ "/opt/homebrew/Cellar/frei0r/1.8.0/lib/frei0r-1/rgbnoise.so"
DESTINATION "${plugin_dest_dir}/frei0r-1" COMPONENT Runtime)
# ICU DATA LIB GST dependency : undocumented and hacked here : seems to work
# install(FILES "${ICU_LINK_LIBRARIES}" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
- install(FILES "/usr/local/Cellar/icu4c/69.1/lib/libicudata.69.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
+ install(FILES "/opt/homebrew/Cellar/icu4c/71.1/lib/libicudata.71.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
message(STATUS "install ${ICU_LINK_LIBRARIES} from ${ICU_LIBRARY_DIRS}")
# package runtime fixup bundle New error
EDIT: this goes away with |
Getting closer but crashing
|
Here is what I did to compile the
The problem is that Build GST plugins bad (downloaded source) Fix for OSX 10.13
Install in local system
NB: To restore Homebrew Gst-plugins-bad: |
Thanks, i'll play with that next. Here are my questions / todo items:
|
I do see
However I don't see But I also don't see these two after building |
I feel like I'm close with the following diff in cmake config: diff --git a/CMakeLists.txt b/CMakeLists.txt
index f200d85..1a9f158 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,7 @@ if(UNIX)
# the RPATH to be used when installing
set(CMAKE_SKIP_RPATH TRUE)
set(OpenGL_DIR /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/)
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
+ set(CMAKE_OSX_ARCHITECTURES "arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
# CPACK
@@ -69,8 +69,7 @@ if(UNIX)
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
# find icu4c in OSX (pretty well hidden...)
- set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig")
-
+ set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/opt/homebrew/opt/icu4c/lib/pkgconfig")
else()
add_definitions(-DLINUX) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5d2926a..e557003 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -205,25 +205,20 @@ IF(APPLE)
install(DIRECTORY "${PKG_GSTREAMER_BASE_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "${PKG_GSTREAMER_BAD_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-plugins-good/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-plugins-ugly/1.18.4_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-libav/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
-
- # install locally recompiled & installed gst-plugins (because not included in brew package)
- install(FILES "/usr/local/lib/gstreamer-1.0/libgstapplemedia.dylib"
- "/usr/local/lib/gstreamer-1.0/libgstde265.dylib"
- "/usr/local/lib/gstreamer-1.0/libgstx265.dylib"
- DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-good/1.20.3_2/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-ugly/1.20.3_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-bad/1.20.3_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-libav/1.20.3/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
# install frei0r plugins (dependencies of gstreamer-1.0/libgstfrei0r.dylib plugin)
- install(FILES "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/lissajous0r.so"
- "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/rgbnoise.so"
+ install(FILES "/opt/homebrew/Cellar/frei0r/1.8.0/lib/frei0r-1/lissajous0r.so"
+ "/opt/homebrew/Cellar/frei0r/1.8.0/lib/frei0r-1/rgbnoise.so"
DESTINATION "${plugin_dest_dir}/frei0r-1" COMPONENT Runtime)
# ICU DATA LIB GST dependency : undocumented and hacked here : seems to work
# install(FILES "${ICU_LINK_LIBRARIES}" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
- install(FILES "/usr/local/Cellar/icu4c/69.1/lib/libicudata.69.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
+ install(FILES "/opt/homebrew/Cellar/icu4c/71.1/lib/libicudata.71.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
message(STATUS "install ${ICU_LINK_LIBRARIES} from ${ICU_LIBRARY_DIRS}")
# package runtime fixup bundle
@@ -238,9 +233,9 @@ IF(APPLE)
COMPONENT Runtime
)
- set(APPLE_CODESIGN_IDENTITY "" CACHE STRING "")
- string(LENGTH "${APPLE_CODESIGN_IDENTITY}" APPLE_CODESIGN_IDENTITY_LENGHT)
- if( ${APPLE_CODESIGN_IDENTITY_LENGHT} LESS 40 )
+ set(APPLE_CODESIGN_IDENTITY "<REDACTED>")
+ string(LENGTH "${APPLE_CODESIGN_IDENTITY}" APPLE_CODESIGN_IDENTITY_LENGTH)
+ if( ${APPLE_CODESIGN_IDENTITY_LENGTH} LESS 40 )
message(STATUS "Not signing bundle. Specify APPLE_CODESIGN_IDENTITY to cmake before running cpack to sign")
else()
install(CODE " Configure finds everything as long as homebrew paths / versions are correct: $ cmake -DCMAKE_BUILD_TYPE=Release ..
-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
-----------------------------------------------------------------------------
* GLib - GTK general-purpose utility library
* GObject - GTK object-oriented framework
* GStreamer - Open Source Multiplatform Multimedia Framework
* GStreamerPluginsBase - GStreamer app library
* GStreamerPluginsBase - GStreamer audio library
* GStreamerPluginsBase - GStreamer video library
* GStreamerPluginsBase - GStreamer pbutils library
* GStreamerPluginsBase - GStreamer opengl library
* ICU - International Components for Unicode
* glfw3 - Open Source multi-platform library for OpenGL
-----------------------------------------------------------------------------
-- Congratulations! All external packages have been found.
-----------------------------------------------------------------------------
-- Including 'GLAD' Open source multi-language OpenGL loader https://glad.dav1d.de -- /Users/noah/src/vimix/ext/glad/include
-- Compiling 'Dear ImGui' from https://github.com/ocornut/imgui.git -- /Users/noah/src/vimix/ext/imgui
-- Compiling 'ImGuiColorTextEdit' from https://github.com/BalazsJako/ImGuiColorTextEdit -- /Users/noah/src/vimix/ext/ImGuiColorTextEdit
-- Compiling 'OSCPack' from http://www.rossbencina.com/code/oscpack -- /Users/noah/src/vimix/ext/OSCPack
-- Using 'CMakeRC ' from https://github.com/vector-of-bool/cmrc.git -- /usr/share/cmake;/Users/noah/src/vimix/cmake/modules.
-- install gst-plugins /opt/homebrew/Cellar/gstreamer/1.20.4/lib/gstreamer-1.0
-- install gst-plugins-base /opt/homebrew/Cellar/gst-plugins-base/1.20.3/lib/gstreamer-1.0
-- Checking for module 'gstreamer-plugins-bad-1.0'
-- Found gstreamer-plugins-bad-1.0, version 1.20.3
-- install gst-plugins-bad /opt/homebrew/Cellar/gst-plugins-bad/1.20.3_1/lib/gstreamer-1.0
-- install gst-plugin-scanner /opt/homebrew/Cellar/gstreamer/1.20.4/libexec/gstreamer-1.0/gst-plugin-scanner
-- install /opt/homebrew/Cellar/icu4c/71.1/lib/libicuio.dylib;/opt/homebrew/Cellar/icu4c/71.1/lib/libicui18n.dylib;/opt/homebrew/Cellar/icu4c/71.1/lib/libicuuc.dylib;/opt/homebrew/Cellar/icu4c/71.1/lib/libicudata.dylib from /opt/homebrew/Cellar/icu4c/71.1/lib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/noah/src/vimix/vimix-build Build builds:
Pack makes an installers and signs as long as I hard code an identity from
Then I install this, but it crashes on launch. Note I've been messing around with the bundle identifier wondering if that needs to line up with my signing identity. I do have an Apple Developer account and various certificates but have no idea how manual signing works.
|
In console I see
|
Probably need to sign every dylib and binary: |
Holy cow I got something working!! By uncommenting more fixup stuff: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5d2926a..318eefd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -205,25 +205,20 @@ IF(APPLE)
install(DIRECTORY "${PKG_GSTREAMER_BASE_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
install(DIRECTORY "${PKG_GSTREAMER_BAD_PLUGIN_DIR}" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-plugins-good/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-plugins-ugly/1.18.4_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
- install(DIRECTORY "/usr/local/Cellar/gst-libav/1.18.4/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
-
- # install locally recompiled & installed gst-plugins (because not included in brew package)
- install(FILES "/usr/local/lib/gstreamer-1.0/libgstapplemedia.dylib"
- "/usr/local/lib/gstreamer-1.0/libgstde265.dylib"
- "/usr/local/lib/gstreamer-1.0/libgstx265.dylib"
- DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-good/1.20.3_2/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-ugly/1.20.3_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-plugins-bad/1.20.3_1/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
+ install(DIRECTORY "/opt/homebrew/Cellar/gst-libav/1.20.3/lib/gstreamer-1.0" DESTINATION "${plugin_dest_dir}" COMPONENT Runtime)
# install frei0r plugins (dependencies of gstreamer-1.0/libgstfrei0r.dylib plugin)
- install(FILES "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/lissajous0r.so"
- "/usr/local/Cellar/frei0r/1.7.0/lib/frei0r-1/rgbnoise.so"
+ install(FILES "/opt/homebrew/Cellar/frei0r/1.8.0/lib/frei0r-1/lissajous0r.so"
+ "/opt/homebrew/Cellar/frei0r/1.8.0/lib/frei0r-1/rgbnoise.so"
DESTINATION "${plugin_dest_dir}/frei0r-1" COMPONENT Runtime)
# ICU DATA LIB GST dependency : undocumented and hacked here : seems to work
# install(FILES "${ICU_LINK_LIBRARIES}" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" COMPONENT Runtime)
- install(FILES "/usr/local/Cellar/icu4c/69.1/lib/libicudata.69.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
+ install(FILES "/opt/homebrew/Cellar/icu4c/71.1/lib/libicudata.71.1.dylib" DESTINATION "${plugin_dest_dir}/gstreamer-1.0" RENAME "libicudata.69.dylib" COMPONENT Runtime)
message(STATUS "install ${ICU_LINK_LIBRARIES} from ${ICU_LIBRARY_DIRS}")
# package runtime fixup bundle
@@ -238,9 +233,9 @@ IF(APPLE)
COMPONENT Runtime
)
- set(APPLE_CODESIGN_IDENTITY "" CACHE STRING "")
- string(LENGTH "${APPLE_CODESIGN_IDENTITY}" APPLE_CODESIGN_IDENTITY_LENGHT)
- if( ${APPLE_CODESIGN_IDENTITY_LENGHT} LESS 40 )
+ set(APPLE_CODESIGN_IDENTITY "9B6580623287FF9060A4EDD94E641D23C9CD570F")
+ string(LENGTH "${APPLE_CODESIGN_IDENTITY}" APPLE_CODESIGN_IDENTITY_LENGTH)
+ if( ${APPLE_CODESIGN_IDENTITY_LENGTH} LESS 40 )
message(STATUS "Not signing bundle. Specify APPLE_CODESIGN_IDENTITY to cmake before running cpack to sign")
else()
install(CODE "
@@ -254,14 +249,14 @@ IF(APPLE)
)
endif()
-# # package runtime fixup bundle and codesign
-# set(BUNDLE_NAME "vimix.app")
-# set(BUNDLE_LIBS_DIR "${plugin_dest_dir}/gstreamer-1.0")
-# set(BUNDLE_DIRS "${ICU_LIBRARY_DIRS}")
-# set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
+ # package runtime fixup bundle and codesign
+ set(BUNDLE_NAME "vimix.app")
+ set(BUNDLE_LIBS_DIR "${plugin_dest_dir}/gstreamer-1.0")
+ set(BUNDLE_DIRS "${ICU_LIBRARY_DIRS}")
+ set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/osx/entitlements.plist")
-# configure_file(cmake/modules/BundleInstall.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" @ONLY)
-# install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" COMPONENT Runtime)
+ configure_file("${CMAKE_SOURCE_DIR}/cmake/modules/BundleInstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" @ONLY)
+ install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/BundleInstall.cmake" COMPONENT Runtime)
ELSE(APPLE) A lot of gstreamer stuff including camera capture works! However screen recording still doesn't work :(
|
One thing that is weird is that the app is always asking for OS Permission to record the screen, even though I've given it. Edit: it stopped prompting but still having problems. |
These work with my homebrew install, so still something inside
|
Youhou ! Well done ! Nota Bene: you do not have to build the bundle to run vimix (i.e. run cpack) : after build, the vimix binary itself can be launched. This may explain why you have to instances (one is the program after compilation, the other is the bundle). But This is a very important and good news for vimix: the gst plugin for applemedia works under recent OSX with M2 !! excellent! Thanks for sharing the CMakeLists that works for you : I could use this as inspiration for making things more generic. |
Hi guys, |
Thanks for your interest: I will investigate to build on OSX Sonoma for M1-3 computers : for now indeed, only the binaries built for OSX 11 are available (https://github.com/brunoherbelin/vimix/releases) |
Update: The recent update should fix the problem with compiling on OSX with Apple Silicon. |
Following the docs I'm having some trouble. Hopefully can get it sorted and contribute some docs improvements.
First I get an error on
icu
stuff:This goes away by following hints in the
icu4c
package:Next I get an error at the end of build when linking, perhaps due to M1 mac?
Full error output:
The text was updated successfully, but these errors were encountered: