From 349a9349dc9340188b6f8f764aedeb0387a6d907 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 27 Sep 2020 22:27:24 +0100 Subject: [PATCH 1/8] Updated shared memory sizing for macOS These numbers are sufficient for two WSJT-X instances. --- Darwin/sysctl.conf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Darwin/sysctl.conf b/Darwin/sysctl.conf index 830bba803..4d6cf69e0 100644 --- a/Darwin/sysctl.conf +++ b/Darwin/sysctl.conf @@ -1,6 +1,5 @@ -kern.sysv.shmmax=14680064 +kern.sysv.shmmax=104857600 kern.sysv.shmmin=1 kern.sysv.shmmni=128 kern.sysv.shmseg=32 -kern.sysv.shmall=17920 - +kern.sysv.shmall=25600 From aae93e0d8236724dcda1e6e8d657ccfce38b2af2 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 28 Sep 2020 12:18:44 +0100 Subject: [PATCH 2/8] Qt <5.7 compatibility --- Network/PSKReporter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Network/PSKReporter.cpp b/Network/PSKReporter.cpp index fcdebf2c5..8c8d7948d 100644 --- a/Network/PSKReporter.cpp +++ b/Network/PSKReporter.cpp @@ -145,8 +145,10 @@ public: #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) connect (socket_.get (), &QAbstractSocket::errorOccurred, this, &PSKReporter::impl::handle_socket_error); -#else +#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) connect (socket_.data (), QOverload::of (&QAbstractSocket::error), this, &PSKReporter::impl::handle_socket_error); +#else + connect (socket_.data (), static_cast (&QAbstractSocket::error), this, &PSKReporter::impl::handle_socket_error); #endif // use this for pseudo connection with UDP, allows us to use From fff5644858658ed3e93a0366e6c92cfe20a848f3 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 28 Sep 2020 13:51:14 +0100 Subject: [PATCH 3/8] Configure option for older version of Hamlib caching --- CMakeLists.txt | 1 + Transceiver/HamlibTransceiver.cpp | 8 ++++++-- wsjtx_config.h.in | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f24abbbeb..e7d65cf5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -907,6 +907,7 @@ message (STATUS "hamlib_LIBRARY_DIRS: ${hamlib_LIBRARY_DIRS}") set (CMAKE_REQUIRED_INCLUDES "${hamlib_INCLUDE_DIRS}") set (CMAKE_REQUIRED_LIBRARIES "${hamlib_LIBRARIES}") +check_symbol_exists (CACHE_ALL "hamlib/rig.h" HAVE_HAMLIB_OLD_CACHING) check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING) diff --git a/Transceiver/HamlibTransceiver.cpp b/Transceiver/HamlibTransceiver.cpp index 3923f4c5d..ce7408a04 100644 --- a/Transceiver/HamlibTransceiver.cpp +++ b/Transceiver/HamlibTransceiver.cpp @@ -14,6 +14,10 @@ #include "moc_HamlibTransceiver.cpp" +#if HAVE_HAMLIB_OLD_CACHING +#define HAMLIB_CACHE_ALL CACHE_ALL +#endif + namespace { // Unfortunately bandwidth is conflated with mode, this is probably @@ -606,7 +610,7 @@ int HamlibTransceiver::do_start () } } -#if HAVE_HAMLIB_CACHING +#if HAVE_HAMLIB_CACHING || HAVE_HAMLIB_OLD_CACHING // we must disable Hamlib caching because it lies about frequency // for less than 1 Hz resolution rigs auto orig_cache_timeout = rig_get_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL); @@ -653,7 +657,7 @@ int HamlibTransceiver::do_start () resolution = -1; // best guess } -#if HAVE_HAMLIB_CACHING +#if HAVE_HAMLIB_CACHING || HAVE_HAMLIB_OLD_CACHING // revert Hamlib cache timeout rig_set_cache_timeout_ms (rig_.data (), HAMLIB_CACHE_ALL, orig_cache_timeout); #endif diff --git a/wsjtx_config.h.in b/wsjtx_config.h.in index 0866cf061..7da6a4cdd 100644 --- a/wsjtx_config.h.in +++ b/wsjtx_config.h.in @@ -19,6 +19,7 @@ extern "C" { #cmakedefine PROJECT_SAMPLES_URL "@PROJECT_SAMPLES_URL@" #cmakedefine PROJECT_SUMMARY_DESCRIPTION "@PROJECT_SUMMARY_DESCRIPTION@" +#cmakedefine01 HAVE_HAMLIB_OLD_CACHING #cmakedefine01 HAVE_HAMLIB_CACHING #cmakedefine01 WSJT_SHARED_RUNTIME From 204d63929dab32961364fc876d347611ff79db77 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 29 Sep 2020 12:32:47 +0100 Subject: [PATCH 4/8] Repair a regression with odd/2nd period FT4 decode timestamps Generalized slow mode decode timestamp generation to a common routine. --- widgets/mainwindow.cpp | 31 ++++++++----------------------- widgets/mainwindow.h | 1 - 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 682fb9ad1..7262f2e12 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3019,34 +3019,19 @@ void MainWindow::decode() //decode() if( m_diskData ) { dec_data.params.lapcqonly=false; } - m_msec0=QDateTime::currentMSecsSinceEpoch(); if(!m_dataAvailable or m_TRperiod==0.0) return; ui->DecodeButton->setChecked (true); - if(!dec_data.params.nagain && m_diskData && (m_TRperiod >= 60.0)) { + if(!dec_data.params.nagain && m_diskData && m_TRperiod >= 60.) { dec_data.params.nutc=dec_data.params.nutc/100; } if(dec_data.params.nagain==0 && dec_data.params.newdat==1 && (!m_diskData)) { - qint64 nperiods=now.toMSecsSinceEpoch()/(1000.0*m_TRperiod); - m_dateTimeSeqStart=QDateTime::fromMSecsSinceEpoch(qint64(1000.0*nperiods*m_TRperiod)).toUTC(); - qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; - int imin=ms/60000; - int ihr=imin/60; - imin=imin % 60; - if(m_TRperiod>=60) imin=imin - (imin % (int(m_TRperiod)/60)); - dec_data.params.nutc=100*ihr + imin; - if(m_TRperiod < 60) { - qint64 ms=1000.0*(2.0-m_TRperiod); - if(m_mode=="FST4") ms=1000.0*(6.0-m_TRperiod); - //Adjust for FT8 early decode: - if(m_mode=="FT8" and m_ihsym==m_earlyDecode and !m_diskData) ms+=(m_hsymStop-m_earlyDecode)*288; - if(m_mode=="FT8" and m_ihsym==m_earlyDecode2 and !m_diskData) ms+=(m_hsymStop-m_earlyDecode2)*288; - QDateTime t=QDateTime::currentDateTimeUtc().addMSecs(ms); - ihr=t.toString("hh").toInt(); - imin=t.toString("mm").toInt(); - int isec=t.toString("ss").toInt(); - isec=isec - fmod(double(isec),m_TRperiod); - dec_data.params.nutc=10000*ihr + 100*imin + isec; - } + auto t_start = qt_truncate_date_time_to (QDateTime::currentDateTimeUtc (), m_TRperiod * 1.e3); + auto t = t_start.time (); + dec_data.params.nutc = t.hour () * 100 + t.minute (); + if (m_TRperiod < 60.) + { + dec_data.params.nutc = dec_data.params.nutc * 100 + t.second (); + } } if(m_nPick==1 and !m_diskData) { diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 071ffd90d..8c19c8302 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -401,7 +401,6 @@ private: qint64 m_msErase; qint64 m_secBandChanged; qint64 m_freqMoon; - qint64 m_msec0; qint64 m_fullFoxCallTime; Frequency m_freqNominal; From 22dbe9f14e2d5392ce248c08a7dd06b86ecc1561 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 29 Sep 2020 12:38:15 +0100 Subject: [PATCH 5/8] Move FST4W to the same section as WSPR in the mode pop-up menu --- widgets/mainwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 558fefe06..bf80c09ac 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -2848,7 +2848,6 @@ Yellow when too low Mode - @@ -2860,6 +2859,7 @@ Yellow when too low + From f0bd7634a5268d43c6412ab1a4a62f44a8aad4c8 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 30 Sep 2020 18:43:58 +0100 Subject: [PATCH 6/8] Basic recipe for building the Boost libs Includes building libbacktrace for use with MinGW builds using Boost.stacktrace. --- .gitignore | 1 + doc/building-Boost-libs.txt | 227 ++++++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 doc/building-Boost-libs.txt diff --git a/.gitignore b/.gitignore index 80e3c4b27..8a21e3b72 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ jnq* *.txt *.bak !**/CMakeLists.txt +!**/*.txt __pycache__ cmake-build-debug cmake-build-release diff --git a/doc/building-Boost-libs.txt b/doc/building-Boost-libs.txt new file mode 100644 index 000000000..1c418bfc6 --- /dev/null +++ b/doc/building-Boost-libs.txt @@ -0,0 +1,227 @@ +Linux +===== + +sudo apt install libboost-all-dev + + +macOS +===== + +Download the latest Boost sources from here: boost.org + +Currently v 1.74.0 - https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2 + +cd ~/Downloads +curl -L -O https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2 +mkdir src +cd !$ +tar --bzip2 -xf boost_1_74_0.tar.bz2 +cd boost_1_74_0/tools/build +bootstrap.sh +./b2 toolset=clang --prefix=~/local/boost-build install +cd ../.. +~/local/boost-build/bin/b2 -j8 toolset=clang cflags=-mmacosx-version-min=10.12 \ + cxxflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ + mmflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ + linkflags=-mmacosx-version-min=10.12 \ + architecture=x86 address-model=64 --prefix=~/local/boost install + +That will take a while, once successful (warnings can be ignored) you can clean the build tree to save some space: + +~/local/boost-build/bin/b2 toolset=clang cflags=-mmacosx-version-min=10.12 \ + cxxflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ + mmflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ + linkflags=-mmacosx-version-min=10.12 \ + architecture=x86 address-model=64 --prefix=~/local/boost clean + +All that remains is to reconfigure your WSJT-X build trees to include ~/local/boost in your CMAKE_PREFIX_PATH, maybe something like these (one each for Debug and Release configuration builds and assumes the Macports GCC v7 tool-chain is being used): + +FC=gfortran-mp-7 \ + cmake \ + -D CMAKE_PREFIX_PATH:PATH=~/local/boost\;~/Qt/5.15.0-clang\;~/local/hamlib/release\;/opt/local \ + -D CMAKE_INSTALL_PREFIX=~/local/wsjtx/release \ + -D CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \ + -D CMAKE_BUILD_TYPE=Release \ + -B ~/build/wsjtx-release \ + ~/src/bitbucket.org/k1jt/wsjtx + +FC=gfortran-mp-7 \ + cmake \ + -D CMAKE_PREFIX_PATH:PATH=~/local/boost\;~/Qt/5.15.0-clang\;~/local/hamlib/debug\;/opt/local \ + -D CMAKE_INSTALL_PREFIX=~/local/wsjtx/debug \ + -D CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \ + -D CMAKE_BUILD_TYPE=Debug \ + -B ~/build/wsjtx-debug \ + ~/src/bitbucket.org/k1jt/wsjtx + +Substitute you installed SDK version, Qt version and location, and Hamlib install locations. + + +MS Windows +========== + +Because 32-bit and 64-bit builds are possible and each use different +tool-chains, two separate builds are necessary if both architectures +are required. + +Common steps +------------ + +Download and extract the latest Boost library sources, at the time of +writing that was +https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.7z +. Extract to some convenient location, I use %HOME%\src . + +Download and extract the libbacktrace sources from +https://github.com/ianlancetaylor/libbacktrace as follows. + +cd %HOME%\src +mkdir github.com +cd github.com +mkdir ianlancetaylor +cd ianlancetaylor +git clone git@github.com:ianlancetaylor/libbacktrace.git + +I install third-party tools under the C:\Tools directory, the +following assumes that, adjust to taste. Note that it is OK to install +both 32- and 64-bit builds of Boost to the same path as the library +names are unique per architecture and tool-chain. This saves a lot of +space as the boost header files are quite big, and there's no need to +install multiple copies. + +Create a new file %HOME%\src\boost_1_74_0\project-config.jam with the +following three lines to specify how Boost.Build finds the libbacktrace +library matched to your relevant C++ compliers: + +import toolset ; + +using gcc : : C:\\Qt\\Tools\\mingw730_32\\bin\\g++ : -I"C:\\Tools\\libbacktrace-1.0\\MinGW32\\include" -L"C:\\Tools\\libbacktrace-1.0\\MinGW32\\lib" ; + +using gcc : 8~64 : C:\\Qt\\Tools\\mingw810_64\\bin\\g++ : -I"C:\\Tools\\libbacktrace-1.0\\MinGW64\\include" -L"C:\\Tools\\libbacktrace-1.0\\MinGW64\\lib" ; + +Note that it may need some local adjustment of the C++ compiler +version and path depending on the exact tool-chains from your Qt +installation. Above I am using the Qt v5.12.9 MinGW32 v7 tool-chain +for 32-bit (toolset=gcc), and Qt v5.15.0 MinGW64 v8 tool-chain +for 64-bit (toolchain=gcc-8~64). + +32-bit +------ + +Start an MSys or MSys2 shell with the 32-bit C/C++ tool-chain from +your Qt installation on the PATH environment variable. + +cd ~/src/github.com/ianlancetaylor/libbacktrace +./configure --prefix=/c/Tools/libbacktrace-1.0/MinGW32 +make && make install +make clean + +Start a CMD window suitably configured for use of the 32-bit MinGW +tool-chain bundled with your Qt binary installation. Verify the +correct compiler is in the PATH. i.e. it identifies (g++ --version) as +i686-posix-dwarf-rev0. + +cd %HOME%\src\boost_1_74_0\tools\build +bootstrap.bat +.\b2 --prefix=C:\Tools\boost-build\MinGW32 install +cd ..\.. +C:\Tools\boost-build\MinGW32\bin\b2 -j8 toolset=gcc ^ + --build-dir=%HOME%\build\boost ^ + --build-type=complete --prefix=C:\Tools\boost install + +If all is well you should see the following line about a 1/3 of the +way through the initial configuration steps. + + - libbacktrace builds : yes + +After some time it should complete with something like: + +...failed updating 1574 targets... +...skipped 1112 targets... +...updated 3924 targets... + +warnings can usually be ignored. If successful; you can release some +space by cleaning the build tree: + +C:\Tools\boost-build\MinGW32\bin\b2 toolset=gcc ^ + --build-dir=%HOME%\build\boost ^ + --build-type=complete clean + +64-bit +====== + +Start an MSys or MSys2 shell with the 64-bit C/C++ tool-chain from +your Qt installation on the PATH environment variable. + +cd ~/src/github.com/ianlancetaylor/libbacktrace +./configure --prefix=/c/Tools/libbacktrace-1.0/MinGW64 +make && make install +make clean + +Start a CMD window suitably configured for use of the 64-bit MinGW +tool-chain bundled with your Qt binary installation. Verify the +correct compiler is in the PATH. i.e. it identifies (g++ --version) as +x86_64-posix-seh-rev0. Note the toolchain specified must match your +compilers and the project-config.jam file you created above. With a v7 +64-bit C++ compiler use gcc-7~64, with a v8 64-bit C++ compiler use +gcc-8~64. My example matches my 64-bit Qt v5.15.0 with the bundled +MinGW64 v8.1.0. + +cd %HOME%\src\boost_1_74_0\tools\build +bootstrap.bat +.\b2 --prefix=C:\Tools\boost-build\MinGW64 install +cd ..\.. +C:\Tools\boost-build\MinGW64\bin\b2 -j8 toolset=gcc-8~64 ^ + address-model=64 --build-dir=%HOME%\build\boost ^ + --build-type=complete --prefix=C:\Tools\boost install + +If all is well you should see the following line about a 1/3 of the +way through the initial configuration steps. + + - libbacktrace builds : yes + +After some time it should complete with something like: + +...failed updating 108 targets... +...skipped 32 targets... +...updated 3648 targets... + +warnings can usually be ignored. If successful; you can release some +space by cleaning the build tree: + +C:\Tools\boost-build\MinGW32\bin\b2 toolset=gcc-8~64 ^ + address-model=64 --build-dir=%HOME%\build\boost ^ + --build-type=complete clean + +Setting up WSJT-X builds +------------------------ + +All that remains is to add C:\Tools\boost\ to your 32- and 64-bit +build configurations CMAKE_PREFIX_PATH variables. I use tool-chain +files for my WSJT-X builds on Windows, an extract from my 32-bit Debug +configuration tool-chain file: + +# ... + +set (BOOSTDIR C:/Tools/boost) +set (QTDIR C:/Qt/5.12.9/mingw73_32) +# set (QTDIR C:/Qt/5.15.0/mingw81_32) +set (FFTWDIR C:/Tools/fftw-3.3.5-dll32) +set (HAMLIBDIR C:/test-install/hamlib/mingw32/debug) +set (LIBUSBDIR C:/Tools/libusb-1.0.23) +set (PYTHONDIR C:/Python27) +set (ASCIIDOCDIR C:/Tools/asciidoc-master) + +# where to find required packages +set (CMAKE_PREFIX_PATH ${BOOSTDIR} ${QTDIR} ${FFTWDIR} ${HAMLIBDIR} ${HAMLIBDIR}/bin ${LIBUSBDIR} ${PYTHONDIR} ${ASCIIDOCDIR}) + +# ... + +Run-time Environment +-------------------- + +You will need to add C:\Tools\boost\lib to your PATH environment +variable in order to run installed Debug configurations of WSJT-X, or +to execute build artefacts from a build tree. Installed Release +configurations will move any required DLLs to the installation bin +directory automatically. From 703a643afbdcc5cbc26c7f1e19b1f9c4292ec149 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 1 Oct 2020 19:51:55 +0100 Subject: [PATCH 7/8] Updates after review --- doc/building-Boost-libs.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/building-Boost-libs.txt b/doc/building-Boost-libs.txt index 1c418bfc6..9a1dc5b5c 100644 --- a/doc/building-Boost-libs.txt +++ b/doc/building-Boost-libs.txt @@ -17,14 +17,14 @@ mkdir src cd !$ tar --bzip2 -xf boost_1_74_0.tar.bz2 cd boost_1_74_0/tools/build -bootstrap.sh -./b2 toolset=clang --prefix=~/local/boost-build install +./bootstrap.sh +./b2 toolset=clang --prefix=$HOME/local/boost-build install cd ../.. ~/local/boost-build/bin/b2 -j8 toolset=clang cflags=-mmacosx-version-min=10.12 \ cxxflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ mmflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ linkflags=-mmacosx-version-min=10.12 \ - architecture=x86 address-model=64 --prefix=~/local/boost install + architecture=x86 address-model=64 --prefix=$HOME/local/boost install That will take a while, once successful (warnings can be ignored) you can clean the build tree to save some space: @@ -32,7 +32,7 @@ That will take a while, once successful (warnings can be ignored) you can clean cxxflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ mmflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ linkflags=-mmacosx-version-min=10.12 \ - architecture=x86 address-model=64 --prefix=~/local/boost clean + architecture=x86 address-model=64 --prefix=$HOME/local/boost clean All that remains is to reconfigure your WSJT-X build trees to include ~/local/boost in your CMAKE_PREFIX_PATH, maybe something like these (one each for Debug and Release configuration builds and assumes the Macports GCC v7 tool-chain is being used): From d73c51becae3b768b05b7f940aa5e0630f91a544 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 1 Oct 2020 19:52:31 +0100 Subject: [PATCH 8/8] Exclude Qt debug symbol files from packaging on macOS The Qt team have switched to separate debug symbol files rather than separate debug libraries for plugins. We need to exclude these from packaging as they break the BundleUtilities CMake tools. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7d65cf5b..91f971b5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1703,6 +1703,7 @@ if (NOT is_debug_build) PATTERN "*quick*${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE PATTERN "*webgl*${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE PATTERN "*_debug${CMAKE_SHARED_LIBRARY_SUFFIX}" EXCLUDE + PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}.dSYM" EXCLUDE ) install ( FILES