From 5a1945f7798fe7fd4603615931423b96a931bcd7 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 17 Jan 2024 07:07:24 +0100 Subject: [PATCH 1/7] allow running code on older macos version (test) --- .github/workflows/build_all.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index d958835e..3654b8f0 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -85,7 +85,7 @@ jobs: path: ${{runner.workspace}}/sdrpp_windows_x64.zip build_macos: - runs-on: macos-11 + runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -100,29 +100,29 @@ jobs: run: brew install pkg-config libusb fftw glfw airspy airspyhf portaudio hackrf libbladerf codec2 zstd autoconf automake libtool && pip3 install mako - name: Install volk - run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - name: Install SDRplay API run: wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg && sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target / - name: Install libiio - run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - name: Install libad9361 - run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - name: Install LimeSuite - run: git clone https://github.com/myriadrf/LimeSuite && cd LimeSuite && mkdir builddir && cd builddir && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + run: git clone https://github.com/myriadrf/LimeSuite && cd LimeSuite && mkdir builddir && cd builddir && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - name: Install libperseus run: git clone https://github.com/Microtelecom/libperseus-sdr && cd libperseus-sdr && autoreconf -i && ./configure --prefix=/usr/local && make && make install && cd .. - name: Install more recent librtlsdr - run: git clone https://github.com/osmocom/rtl-sdr && cd rtl-sdr && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 LIBRARY_PATH=$(pkg-config --libs-only-L libusb-1.0 | sed 's/\-L//') && sudo make install && cd ../../ + run: git clone https://github.com/osmocom/rtl-sdr && cd rtl-sdr && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 LIBRARY_PATH=$(pkg-config --libs-only-L libusb-1.0 | sed 's/\-L//') && sudo make install && cd ../../ - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release + run: cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release - name: Build working-directory: ${{runner.workspace}}/build From eabb842b6beaea7064eb93706d19d4f0348cd198 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 19 Jan 2024 19:11:01 +0100 Subject: [PATCH 2/7] switched MacOS CI to debug mode --- .github/workflows/build_all.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 3654b8f0..178b93f8 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -122,7 +122,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release + run: cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release - name: Build working-directory: ${{runner.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index a9c67193..e5cce405 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ if (${CMAKE_BUILD_TYPE} MATCHES "Debug") if (MSVC) set(SDRPP_COMPILER_FLAGS /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) + set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup -fsanitize=address) else () set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17) endif () From fd5813df6dd339bdf0c3bea88a9322edd0aac95c Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 19 Jan 2024 19:43:31 +0100 Subject: [PATCH 3/7] testing something silly --- macos/bundle_utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macos/bundle_utils.sh b/macos/bundle_utils.sh index a14a1dd0..1cbaa531 100644 --- a/macos/bundle_utils.sh +++ b/macos/bundle_utils.sh @@ -10,7 +10,7 @@ bundle_is_not_to_be_installed() { # NOTE: Customize this list to exclude libraries you don't want copied into the bundle if [ "$1" = "libsdrpp_core.dylib" ]; then echo 1; fi if [ "$1" = "OpenGL" ]; then echo 1; fi - if [ "$1" = "libc++.1.dylib" ]; then echo 1; fi + # if [ "$1" = "libc++.1.dylib" ]; then echo 1; fi if [ "$1" = "libSystem.B.dylib" ]; then echo 1; fi if [ "$1" = "Cocoa" ]; then echo 1; fi if [ "$1" = "IOKit" ]; then echo 1; fi From 5e299d9d2302544f7fee63d1ec5ca103fe50bd55 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 19 Jan 2024 20:01:05 +0100 Subject: [PATCH 4/7] testing something silly 2 --- macos/bundle_utils.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/macos/bundle_utils.sh b/macos/bundle_utils.sh index 1cbaa531..937f8279 100644 --- a/macos/bundle_utils.sh +++ b/macos/bundle_utils.sh @@ -10,7 +10,6 @@ bundle_is_not_to_be_installed() { # NOTE: Customize this list to exclude libraries you don't want copied into the bundle if [ "$1" = "libsdrpp_core.dylib" ]; then echo 1; fi if [ "$1" = "OpenGL" ]; then echo 1; fi - # if [ "$1" = "libc++.1.dylib" ]; then echo 1; fi if [ "$1" = "libSystem.B.dylib" ]; then echo 1; fi if [ "$1" = "Cocoa" ]; then echo 1; fi if [ "$1" = "IOKit" ]; then echo 1; fi @@ -22,7 +21,6 @@ bundle_is_not_to_be_installed() { if [ "$1" = "CoreAudio" ]; then echo 1; fi if [ "$1" = "AudioToolbox" ]; then echo 1; fi if [ "$1" = "AudioUnit" ]; then echo 1; fi - if [ "$1" = "libobjc.A.dylib" ]; then echo 1; fi if [ "$1" = "CFNetwork" ]; then echo 1; fi if [ "$1" = "SystemConfiguration" ]; then echo 1; fi if [ "$1" = "Security" ]; then echo 1; fi From 5e195a0d439486ad3cc1890616de15c7471728d7 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 19 Jan 2024 20:53:25 +0100 Subject: [PATCH 5/7] testing something for macos (do not use this CI build) --- macos/bundle_utils.sh | 2 ++ src/main.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/macos/bundle_utils.sh b/macos/bundle_utils.sh index 937f8279..a14a1dd0 100644 --- a/macos/bundle_utils.sh +++ b/macos/bundle_utils.sh @@ -10,6 +10,7 @@ bundle_is_not_to_be_installed() { # NOTE: Customize this list to exclude libraries you don't want copied into the bundle if [ "$1" = "libsdrpp_core.dylib" ]; then echo 1; fi if [ "$1" = "OpenGL" ]; then echo 1; fi + if [ "$1" = "libc++.1.dylib" ]; then echo 1; fi if [ "$1" = "libSystem.B.dylib" ]; then echo 1; fi if [ "$1" = "Cocoa" ]; then echo 1; fi if [ "$1" = "IOKit" ]; then echo 1; fi @@ -21,6 +22,7 @@ bundle_is_not_to_be_installed() { if [ "$1" = "CoreAudio" ]; then echo 1; fi if [ "$1" = "AudioToolbox" ]; then echo 1; fi if [ "$1" = "AudioUnit" ]; then echo 1; fi + if [ "$1" = "libobjc.A.dylib" ]; then echo 1; fi if [ "$1" = "CFNetwork" ]; then echo 1; fi if [ "$1" = "SystemConfiguration" ]; then echo 1; fi if [ "$1" = "Security" ]; then echo 1; fi diff --git a/src/main.cpp b/src/main.cpp index 9fc1638c..5e6e1838 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,30 @@ #include #include +#include + +extern char **environ; + +int main(int argc, char* argv[], char* envp[]) { + FILE* dump = fopen("/Users/ryzerth/dump.txt", "wb"); + + char buf[1024]; + fprintf(dump, "Working directory: %s\n\n", getcwd(buf, 1023)); + + fprintf(dump, "Arguments:\n"); + fprintf(dump, "----------\n"); + for (int i = 0; i < argc; i++) { + fprintf(dump, "%d: '%s'\n", i, argv[i]); + } + fprintf(dump, "\n"); + + fprintf(dump, "Environment Variables:\n"); + fprintf(dump, "----------\n"); + for (char** env = environ; *env; env++) { + fprintf(dump, "%s\n", *env); + } + fprintf(dump, "\n"); + + fclose(dump); -int main(int argc, char* argv[]) { return sdrpp_main(argc, argv); } \ No newline at end of file From 854ed89b824928201b5aa72d1497575000be377f Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 22 Jan 2024 20:30:53 +0100 Subject: [PATCH 6/7] prepare for merge back --- .github/workflows/build_all.yml | 2 +- CMakeLists.txt | 2 +- src/main.cpp | 24 ------------------------ 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 178b93f8..3654b8f0 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -122,7 +122,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release + run: cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_AUDIO_SOURCE=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release - name: Build working-directory: ${{runner.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index e5cce405..a9c67193 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ if (${CMAKE_BUILD_TYPE} MATCHES "Debug") if (MSVC) set(SDRPP_COMPILER_FLAGS /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup -fsanitize=address) + set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17) endif () diff --git a/src/main.cpp b/src/main.cpp index 5e6e1838..7bc9d13d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,30 +1,6 @@ #include #include -#include - -extern char **environ; int main(int argc, char* argv[], char* envp[]) { - FILE* dump = fopen("/Users/ryzerth/dump.txt", "wb"); - - char buf[1024]; - fprintf(dump, "Working directory: %s\n\n", getcwd(buf, 1023)); - - fprintf(dump, "Arguments:\n"); - fprintf(dump, "----------\n"); - for (int i = 0; i < argc; i++) { - fprintf(dump, "%d: '%s'\n", i, argv[i]); - } - fprintf(dump, "\n"); - - fprintf(dump, "Environment Variables:\n"); - fprintf(dump, "----------\n"); - for (char** env = environ; *env; env++) { - fprintf(dump, "%s\n", *env); - } - fprintf(dump, "\n"); - - fclose(dump); - return sdrpp_main(argc, argv); } \ No newline at end of file From 4b77d8c395c2794641434d60496f0288be4afb90 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 22 Jan 2024 20:31:18 +0100 Subject: [PATCH 7/7] prepare for merge back part 2, electric boogaloo --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 7bc9d13d..9fc1638c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ #include #include -int main(int argc, char* argv[], char* envp[]) { +int main(int argc, char* argv[]) { return sdrpp_main(argc, argv); } \ No newline at end of file