Skip to content
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

MacOSX M1/M2 support #1605

Closed
oxoocoffee opened this issue Feb 23, 2023 · 22 comments
Closed

MacOSX M1/M2 support #1605

oxoocoffee opened this issue Feb 23, 2023 · 22 comments

Comments

@oxoocoffee
Copy link

Hello

I am just a new user of SDRAngel. Just downloaded the latest "heat map" version and realized it is only x64 version. After installing it should work through an emulator. But when I try to start it I get this message "You can’t open the application “SDRangel” because it may be damaged or incomplete."

I just cloned source and will take a look at it. A quick cmake run produces error

CMake Error at cmake/Modules/DetectArchitecture.cmake:193 (message):
  Flag '-march=native' rejected by compiler.  Please adjust ARCH_OPT option.
Call Stack (most recent call first):
  cmake/Modules/CompilerOptions.cmake:3 (include)
  CMakeLists.txt:570 (include)

I will take a stab at DetectArchitecture.cmake and add a fix. Any other setup/build pointers welcome.

73,

@satdna
Copy link

satdna commented Mar 14, 2023

I have the same problem with compilation on Apple SoC (M2). I will appreciate any help.

@oxoocoffee
Copy link
Author

I will try this weekend if I have some time. Else weekend after I will have time to try

@oxoocoffee
Copy link
Author

oxoocoffee commented Mar 20, 2023

Ok did make a bit of progress. I have Qt6 installed. Also, all additional packages are installed using homebrew.

brew install boost         # 1.81.0_1
brew install opencv      # 4.7.0
brew install codec2      # 1.0.5
brew install hidapi         # 0.13.1

I am not worrying about SDRplay for now. Will look at this later.
What is the list of any additional packages that need to be installed and supported version?
I see FFTW3F, and others. I can not bind them with brew so might have to build it from source and maybe submit bottles to brew.
Can anyone profile links to repost and specific versions I should use?

I can run cmake with the following arguments

cmake  -DENABLE_SDRPLAY=OFF -DCMAKE_MACOSX_RPATH=1 -DENABLE_QT6=1 ..

It did produce this output. Can any developer help me out if the above arguments are correct? I like to get it close as possible to actual release builds.

-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.37.1 (Apple Git-137.1)")
-- SDRangel Version: 7.11.0
-- Build type set to: Release
-- Build for macOS target: local version
-- RPATH support: ON
-- Compiling for 24 bit Rx DSP chain
-- Looking for __x86_64__
-- Looking for __x86_64__ - not found
-- Looking for __i386__
-- Looking for __i386__ - not found
-- Looking for __arm__
-- Looking for __arm__ - not found
-- Looking for __aarch64__
-- Looking for __aarch64__ - found
-- Target architecture: ARM64-native
-- ----------------CMAKE_REQUIRED_FLAGS
-- Looking for __ARM_NEON
-- Looking for __ARM_NEON - found
-- ARM Neon extensions enabled
-- Looking for __AVX512F__
-- Looking for __AVX512F__ - not found
-- Looking for __AVX2__
-- Looking for __AVX2__ - not found
-- Looking for __AVX__
-- Looking for __AVX__ - not found
-- Looking for __SSE4_2__
-- Looking for __SSE4_2__ - not found
-- Looking for __SSE4_1__
-- Looking for __SSE4_1__ - not found
-- Looking for __SSSE3__
-- Looking for __SSSE3__ - not found
-- Looking for __SSE3__
-- Looking for __SSE3__ - not found
-- Looking for __SSE2__
-- Looking for __SSE2__ - not found
-- Interprocedural optimization is disabled for Mac OS
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenGL.framework
-- Found WrapOpenGL: TRUE
-- Found Cups: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/lib/libcups.tbd (found version "2.3.4")
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Looking for iconv
-- Looking for iconv - not found
-- Found iconv library: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/lib/libiconv.tbd
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0")
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (FFTW3F).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindFFTW3F.cmake:6 (INCLUDE)
  CMakeLists.txt:709 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'fftw3f >= 3.0'
--   Found fftw3f , version 3.3.10
-- Found FFTW3F: /opt/homebrew/Cellar/fftw/3.3.10_1/lib/libfftw3f.dylib
-- Found FFTW3F: /opt/homebrew/include, /opt/homebrew/Cellar/fftw/3.3.10_1/lib/libfftw3f.dylib, /opt/homebrew/Cellar/fftw/3.3.10_1/lib/libfftw3f_threads.dylib
-- Checking for module 'libusb-1.0'
--   Found libusb-1.0, version 1.0.26
-- Found libusb-1.0: /opt/homebrew/Cellar/libusb/1.0.26/include/libusb-1.0, /opt/homebrew/lib/libusb-1.0.dylib
-- Found OpenCV: /opt/homebrew/Cellar/opencv/4.7.0_2 (found version "4.7.0") found components: core highgui imgproc imgcodecs videoio
-- Checking for module 'libsigmf'
--   No package 'libsigmf' found
-- libsigmf not found.
-- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/lib/libz.tbd (found version "1.2.11")
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (FAAD).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindFAAD.cmake:2 (INCLUDE)
  CMakeLists.txt:716 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'faad2'
--   No package 'faad2' found
-- FAAD LIBRARY FAAD_LIBRARY-NOTFOUND
-- FAAD INCLUDE DIRS FAAD_INCLUDE_DIR-NOTFOUND
-- Could NOT find FAAD (missing: FAAD_LIBRARY FAAD_INCLUDE_DIR)
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (Codec2).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindCodec2.cmake:2 (INCLUDE)
  CMakeLists.txt:717 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'codec2'
--   Found codec2, version 1.0.5
-- Found Codec2: /opt/homebrew/include, /opt/homebrew/Cellar/codec2/1.0.5/lib/libcodec2.dylib
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (CODEC2)
  does not match the name of the calling package (Codec2).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindCodec2.cmake:36 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:717 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found CODEC2: /opt/homebrew/Cellar/codec2/1.0.5/lib/libcodec2.dylib
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (CM256cc).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindCM256cc.cmake:2 (INCLUDE)
  CMakeLists.txt:718 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'libcm256cc'
--   No package 'libcm256cc' found
-- CM256cc not found
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (CM256CC)
  does not match the name of the calling package (CM256cc).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindCM256cc.cmake:36 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:718 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find CM256CC (missing: CM256CC_LIBRARIES CM256CC_INCLUDE_DIR)
-- Checking for module 'libdsdcc'
--   No package 'libdsdcc' found
-- libdsdcc not found.
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (Sgp4).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindSgp4.cmake:2 (INCLUDE)
  CMakeLists.txt:722 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'sgp4'
--   No package 'sgp4' found
-- SGP4 LIBRARIES SGP4_LIBRARIES-NOTFOUND
-- SGP4 INCLUDE DIRS SGP4_INCLUDE_DIR-NOTFOUND
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (SGP4) does
  not match the name of the calling package (Sgp4).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindSgp4.cmake:26 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:722 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find SGP4 (missing: SGP4_LIBRARIES SGP4_INCLUDE_DIR)
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (AptDec).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindAptDec.cmake:2 (INCLUDE)
  CMakeLists.txt:723 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'apt'
--   No package 'apt' found
-- APT LIBRARIES APT_LIBRARIES-NOTFOUND
-- APT INCLUDE DIRS APT_INCLUDE_DIR-NOTFOUND
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (APT) does
  not match the name of the calling package (AptDec).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindAptDec.cmake:26 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:723 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find APT (missing: APT_LIBRARIES APT_INCLUDE_DIR)
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (LibDAB).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindLibDAB.cmake:2 (INCLUDE)
  CMakeLists.txt:724 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'libdab'
--   No package 'libdab' found
-- libdab not found.
-- Found HIDAPI: /opt/homebrew/include/hidapi  found components: any
-- Checking for module 'libairspy'
--   No package 'libairspy' found
-- libairspy not found.
-- Checking for module 'libairspyhf'
--   No package 'libairspyhf' found
-- libairspyhf not found.
-- Checking for module 'libbladeRF>=2.0'
--   No package 'libbladeRF' found
-- Checking for module 'libhackrf'
--   Found libhackrf, version 0.8
-- Found libhackrf: /opt/homebrew/Cellar/hackrf/2023.01.1/include, /opt/homebrew/Cellar/hackrf/2023.01.1/lib/libhackrf.dylib
-- Could not find Lime Suite
-- Checking for module 'libiio>=0.7'
--   No package 'libiio' found
-- Checking for module 'libmirisdr'
--   No package 'libmirisdr' found
-- libmirisdr not found.
-- Checking for module 'libperseus'
--   No package 'libperseus' found
-- libperseus not found.
-- Checking for module 'librtlsdr'
--   Found librtlsdr, version 0.6.0
-- Found librtlsdr: /opt/homebrew/Cellar/librtlsdr/0.6.0/include, /opt/homebrew/Cellar/librtlsdr/0.6.0/lib/librtlsdr.dylib
-- Checking for one of the modules 'soapysdr>=0.4.0;SoapySDR>=0.4.0'
-- Checking for module 'libxtrx'
--   No package 'libxtrx' found
-- libxtrx not found.
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (UHD).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.26.0/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/Modules/FindUHD.cmake:2 (INCLUDE)
  CMakeLists.txt:773 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Checking for module 'uhd'
--   No package 'uhd' found
-- UHD LIBRARIES UHD_LIBRARIES-NOTFOUND
-- UHD INCLUDE DIRS UHD_INCLUDE_DIR-NOTFOUND
-- Could NOT find UHD (missing: UHD_LIBRARIES UHD_INCLUDE_DIR)
-- Found Opus: /opt/homebrew/include
-- Checking for module 'libavcodec'
--   Found libavcodec, version 59.37.100
-- Checking for module 'libavformat'
--   Found libavformat, version 59.27.100
-- Checking for module 'libavdevice'
--   Found libavdevice, version 59.7.100
-- Checking for module 'libavutil'
--   Found libavutil, version 57.28.100
-- Checking for module 'libavfilter'
--   Found libavfilter, version 8.44.100
-- Checking for module 'libswscale'
--   Found libswscale, version 6.7.100
-- Checking for module 'libpostproc'
--   Found libpostproc, version 56.6.100
-- Checking for module 'libswresample'
--   Found libswresample, version 4.7.100
-- Found FFmpeg: /opt/homebrew/lib/libavcodec.dylib;/opt/homebrew/lib/libavformat.dylib;/opt/homebrew/lib/libavutil.dylib;/opt/homebrew/lib/libswscale.dylib
-- Include demoddatv
-- Found Doxygen: /opt/homebrew/bin/doxygen (found version "1.9.6") found components: doxygen dot
-- added optional 'make dev_docs' for developer documentation generation
-- Found Dot: /opt/homebrew/bin/dot
-- Check for case-sensitive file systems
-- File system is case-sensitive
-- Asking qmake for QT_PLUGINS_DIR and got /opt/Qt/6.4.3/macos/plugins
-- Asking qmake for QT_IMPORTS_DIR and got **Unknown**
-- Asking qmake for QT_QML_DIR and got /opt/Qt/6.4.3/macos/qml
-- Asking qmake for QT_LIBS_DIR and got /opt/Qt/6.4.3/macos/lib
-- CPack generators:
-- Configuring done (5.8s)
-- Generating done (1.2s)
-- Build files have been written to: /Users/rob/projects/github/sdrangel/build

@srcejon
Copy link
Collaborator

srcejon commented Mar 20, 2023

Build instructions are here:

https://github.com/f4exb/sdrangel/wiki/Compile-in-MacOS

I wouldn't recommend using Qt 6, yet. None of the maps will work, amongst other things.

@oxoocoffee
Copy link
Author

oxoocoffee commented Mar 21, 2023

Would it be possible to create a homebrew bottle package? so it can be easily installed with brew?

Also, I am reading the above link you provided. I am assuming the NASM step is not applicable to MacOSX? I see the executables are for x86 MacOSX, so this will not run on M1/M2, not to mention that it will produce Intel code.

nasm: Mach-O universal binary with 2 architectures: [i386:
- Mach-O executable i386] [x86_64]
nasm (for architecture i386):	Mach-O executable i386
nasm (for architecture x86_64):	Mach-O 64-bit executable x86_64

On the other end homebrew installs nasm 2.16.01

oxMBP ➜  bin$ file nasm
nasm: Mach-O 64-bit executable arm64

@satdna
Copy link

satdna commented Mar 28, 2023

I managed to pass successfully the step with cmake without any errors on MBP with M2 Pro with GCC 12.2.0.

But I've stuck with make package with previously used -DENABLE_EXTERNAL_LIBRARIES=ON :
[ 29%] Performing build step for 'hidapi' [ 50%] Building C object src/mac/CMakeFiles/hidapi_darwin.dir/hid.c.o In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDLib.h:31, from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDManager.h:29, from /Users/satdna/Dev/sdrangel/build/external/hidapi/src/hidapi/mac/hid.c:25: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDDevice.h:273:34: error: unknown type name 'dispatch_block_t'; did you mean 'dispatch_io_t'? 273 | dispatch_block_t handler) | ^~~~~~~~~~~~~~~~ | dispatch_io_t In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDLib.h:36: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDQueue.h:294:33: error: unknown type name 'dispatch_block_t'; did you mean 'dispatch_io_t'? 294 | dispatch_block_t handler) | ^~~~~~~~~~~~~~~~ | dispatch_io_t /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDManager.h:292:33: error: unknown type name 'dispatch_block_t'; did you mean 'dispatch_io_t'? 292 | dispatch_block_t handler) | ^~~~~~~~~~~~~~~~ | dispatch_io_t make[5]: *** [src/mac/CMakeFiles/hidapi_darwin.dir/hid.c.o] Error 1 make[4]: *** [src/mac/CMakeFiles/hidapi_darwin.dir/all] Error 2 make[3]: *** [all] Error 2 make[2]: *** [external/hidapi/src/hidapi-stamp/hidapi-build] Error 2 make[1]: *** [external/CMakeFiles/hidapi.dir/all] Error 2 make: *** [all] Error 2

and with -DENABLE_EXTERNAL_LIBRARIES=OFF:
[ 63%] Linking CXX shared library ../../../lib/plugins/libmodatv.dylib Undefined symbols for architecture arm64: "__ZN2cv11getTextSizeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEidiPi", referenced from: __ZN12ATVModSource15mixImageAndTextERN2cv3MatE in atvmodsource.cpp.o "__ZN2cv12VideoCapture4openERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi", referenced from: __ZN12ATVModSource9openVideoERK7QString in atvmodsource.cpp.o "__ZN2cv6imreadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi", referenced from: __ZN12ATVModSource9openImageERK7QString in atvmodsource.cpp.o "__ZN2cv7putTextERKNS_17_InputOutputArrayERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6Point_IiEEidNS_7Scalar_IdEEiib", referenced from: __ZN12ATVModSource15mixImageAndTextERN2cv3MatE in atvmodsource.cpp.o ld: symbol(s) not found for architecture arm64 collect2: error: ld returned 1 exit status make[2]: *** [lib/plugins/libmodatv.dylib] Error 1 make[1]: *** [plugins/channeltx/modatv/CMakeFiles/modatv.dir/all] Error 2 make: *** [all] Error 2

Any ideas to bypass issues?

@srcejon
Copy link
Collaborator

srcejon commented Mar 28, 2023

cmake -DENABLE_FUNCUBE=OFF maybe

@satdna
Copy link

satdna commented Mar 28, 2023

Unfortunately, it was OFF. Full cmake below:

cmake -Wno-dev -DCMAKE_MACOSX_RPATH=1 -DENABLE_RTLSDR=ON -DENABLE_BLADERF=OFF -DENABLE_AIRSPY=OFF -DENABLE_AIRSPYHF=OFF -DENABLE_FUNCUBE=OFF -DENABLE_HACKRF=ON -DENABLE_IIO=OFF -DENABLE_LIMESUITE=OFF -DENABLE_MIRISDR=OFF -DENABLE_PERSEUS=OFF -DENABLE_SDRPLAY=OFF -DENABLE_SOAPYSDR=ON -DENABLE_XTRX=OFF -DENABLE_USRP=OFF -DRX_SAMPLE_24BIT=ON -DCMAKE_INSTALL_PREFIX=/Users/USer/Dev/sdrangel -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=TRUE -DBUNDLE=ON -DENABLE_EXTERNAL_LIBRARIES=ON ..

@satdna
Copy link

satdna commented Apr 6, 2023

I'm trying to bypass this issue:
[ 63%] Linking CXX shared library ../../../lib/plugins/libmodatv.dylib Undefined symbols for architecture arm64: "__ZN2cv11getTextSizeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEidiPi", referenced from: __ZN12ATVModSource15mixImageAndTextERN2cv3MatE in atvmodsource.cpp.o "__ZN2cv12VideoCapture4openERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi", referenced from: __ZN12ATVModSource9openVideoERK7QString in atvmodsource.cpp.o "__ZN2cv6imreadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi", referenced from: __ZN12ATVModSource9openImageERK7QString in atvmodsource.cpp.o "__ZN2cv7putTextERKNS_17_InputOutputArrayERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6Point_IiEEidNS_7Scalar_IdEEiib", referenced from: __ZN12ATVModSource15mixImageAndTextERN2cv3MatE in atvmodsource.cpp.o ld: symbol(s) not found for architecture arm64 collect2: error: ld returned 1 exit status make[2]: *** [lib/plugins/libmodatv.dylib] Error 1 make[1]: *** [plugins/channeltx/modatv/CMakeFiles/modatv.dir/all] Error 2 make: *** [all] Error 2

Is there possibility to bypass compilation of the specific plug-in? modatv in this case?

@srcejon
Copy link
Collaborator

srcejon commented Apr 6, 2023

cmake -DENABLE_CHANNELTX_MODATV=OFF

@satdna
Copy link

satdna commented Apr 8, 2023

Many thanks! Finally I was able to compile the app for M2 without any errors. But one more step is needed.
When I'm starting sdrangel, it's crushing and showing the error:

Exception Type: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes: UNKNOWN_0x32 at 0x00000001000a0000
Exception Codes: 0x0000000000000032, 0x00000001000a0000

Termination Reason: Namespace CODESIGNING, Code 2 Invalid Page

@tko
Copy link

tko commented May 10, 2023

FWIW the following steps seemed to work for me (at least sdrangel starts and few things work)

  1. brew create --set-name sdrangel --cmake https://github.com/f4exb/sdrangel/archive/refs/tags/v7.13.0.tar.gz
  2. add depends_on "qt5"
  3. brew install sdrangel

@satdna
Copy link

satdna commented May 27, 2023

FWIW the following steps seemed to work for me (at least sdrangel starts and few things work)

1. `brew create --set-name sdrangel --cmake https://github.com/f4exb/sdrangel/archive/refs/tags/v7.13.0.tar.gz`

2. add `depends_on "qt5"`

3. `brew install sdrangel`

It's working! Perfect. Many thanks.

@haplm
Copy link

haplm commented Jun 16, 2023

@tko how did you work around the problem with private classes in Qt? I'm getting:
/tmp/sdrangel-20230616-3484-1lmyd8v/sdrangel-7.13.0/sdrbase/util/osndb.cpp:21:10: fatal error: 'QtGui/private/qzipreader_p.h' file not found

@tko
Copy link

tko commented Jun 16, 2023

@haplm I didn't do anything but add the dependency in the cask. The header seems to be where one would expect it to be

❯ brew list qt5|grep qzipr
/opt/homebrew/Cellar/qt@5/5.15.9/lib/QtGui.framework/Versions/5/Headers/5.15.9/QtGui/private/qzipreader_p.h

🤷

@haplm
Copy link

haplm commented Jun 16, 2023

Right, that was a problem with macports also being installed (because I have used that to compile sdrangel). I have happily uninstalled them, which solved this problem.

Unfortunately now it is crashing without any useful hint like this:

[ 56%] Built target inputrtlsdrsrv
make: *** [all] Error 2

I need to figure out what this is

@srcejon
Copy link
Collaborator

srcejon commented Jun 16, 2023

Look back up in the output to find the actual error.

To make it simpler, don't use -j option.

@haplm
Copy link

haplm commented Jun 16, 2023

When one creates homebrew formula, it invokes the build like this:

cmake -S . -B build
cmake --build build

I can start adding compiler arguments after cmake -S . -B build, but adding "-Wno-dev", "-DDEBUG_OUTPUT=ON", "-DENABLE_RTLSDR=ON", "-DENABLE_BLADERF=ON", "-DENABLE_AIRSPY=ON", "-DENABLE_AIRSPYHF=ON", "-DENABLE_FUNCUBE=ON", "-DENABLE_HACKRF=ON", "-DENABLE_IIO=OFF", "-DENABLE_LIMESUITE=ON", "-DENABLE_MIRISDR=ON", "-DENABLE_PERSEUS=ON", "-DENABLE_SDRPLAY=ON", "-DENABLE_SOAPYSDR=OFF", "-DENABLE_XTRX=ON", "-DENABLE_USRP=ON", "-DENABLE_EXTERNAL_LIBRARIES=ON", "-DBUNDLE=ON", "-DRX_SAMPLE_24BIT=ON", "-DCMAKE_BUILD_TYPE=Release" makes it fail even sooner like this:

[ 21%] Completed 'fftw3f'
cd /tmp/sdrangel-20230616-88395-u2v0h7/sdrangel-7.13.0/build/external && /opt/homebrew/Cellar/cmake/3.26.4/bin/cmake -E make_directory /tmp/sdrangel-20230616-88395-u2v0h7/sdrangel-7.13.0/build/external/CMakeFiles
cd /tmp/sdrangel-20230616-88395-u2v0h7/sdrangel-7.13.0/build/external && /opt/homebrew/Cellar/cmake/3.26.4/bin/cmake -E touch /tmp/sdrangel-20230616-88395-u2v0h7/sdrangel-7.13.0/build/external/CMakeFiles/fftw3f-complete
cd /tmp/sdrangel-20230616-88395-u2v0h7/sdrangel-7.13.0/build/external && /opt/homebrew/Cellar/cmake/3.26.4/bin/cmake -E touch /tmp/sdrangel-20230616-88395-u2v0h7/sdrangel-7.13.0/build/external/fftw3f/src/fftw3f-stamp/fftw3f-done
[ 21%] Built target fftw3f
make: *** [all] Error 2

@tko
Copy link

tko commented Jun 16, 2023

The full log for the failed build step should be in the last file in ~/Library/Logs/Homebrew/sdrangel/
If you can't immediately recognize the underlying cause and start working on it you should post the whole log for others to spot the error.

That said I'm not sure this issue is the best place to continue as the issues you seem to facing are more around homebrew and general compilation problems, and with your earlier problems due to macports a lot of it might be just because your system is very different from most.

@haplm
Copy link

haplm commented Jun 16, 2023

Thank you.

I have solved the cryptic errors by turning off parallelisation of the build by uncommenting ENV.deparallelize in the brew Formula.

This uncovered that the issues is caused by zlib

make[5]: *** No rule to make target `zlib', needed by `lib/libopencv_imgcodecs.4.5.5.dylib'.  Stop.
make[4]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [external/opencv/src/opencv-stamp/opencv-build] Error 2
make[1]: *** [external/CMakeFiles/opencv.dir/all] Error 2
make: *** [all] Error 2

I have tried to disable building it "-DBUILD_ZLIB=OFF", but that didn't work.

I agree that there might be an issue with my setup because of the brief period of having macports alongside homebrew, although I have removed macports thoroughly.

@vielmetti
Copy link

using the v7.15.0 release and the home-brew instructions above, I get this

==> cmake -S . -B build
Last 15 lines from /Users/emv/Library/Logs/Homebrew/sdrangel/01.cmake:
  Could not find a package configuration file provided by "Qt5Gamepad" with
  any of the following names:

    Qt5GamepadConfig.cmake
    qt5gamepad-config.cmake

  Add the installation prefix of "Qt5Gamepad" to CMAKE_PREFIX_PATH or set
  "Qt5Gamepad_DIR" to a directory containing one of the above files.  If
  "Qt5Gamepad" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:665 (find_package)


-- Configuring incomplete, errors occurred!

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This issue is going to be closed due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants