{"id":410,"date":"2023-06-02T12:33:19","date_gmt":"2023-06-02T17:33:19","guid":{"rendered":"https:\/\/www.aa5sh.com\/?page_id=410"},"modified":"2024-10-25T13:04:54","modified_gmt":"2024-10-25T18:04:54","slug":"notes-on-building-jtdx-for-mac","status":"publish","type":"page","link":"https:\/\/www.aa5sh.com\/?page_id=410","title":{"rendered":"Notes on building JTDX for Mac"},"content":{"rendered":"\n<p>Building from Source on Apple Mac<\/p>\n\n\n\n<p>=================================<\/p>\n\n\n\n<p>You&nbsp; will need&nbsp; Xcode, MacPorts, HomeBrew, CMake&nbsp; and, Qt. &nbsp; The Xcode&nbsp; install<\/p>\n\n\n\n<p>instructions are included in the MacPorts documentation.<\/p>\n\n\n\n<p>Xcode<\/p>\n\n\n\n<p>&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>There are two parts to install Xcode one is just to install from the Mac AppStore.&nbsp; Then also from&nbsp;<\/p>\n\n\n\n<p>the command line from the MacPorts website to install needed Xcode utils run the following command<\/p>\n\n\n\n<p>$ xcode-select &#8211;install<\/p>\n\n\n\n<p>You will need to agree to the Xcode license agreement by issuing the following command:<\/p>\n\n\n\n<p>$ sudo xcodebuild -license<\/p>\n\n\n\n<p>HomeBrew<\/p>\n\n\n\n<p>&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>Install Homebrew with the following command.<\/p>\n\n\n\n<p>$ \/bin\/bash -c &#8220;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)&#8221;<\/p>\n\n\n\n<p>$ (echo; echo &#8216;eval &#8220;$(\/usr\/local\/bin\/brew shellenv)&#8221;&#8216;) &gt;&gt; \/Users\/michaelmorgan\/.zprofile<\/p>\n\n\n\n<p>$ eval &#8220;$(\/usr\/local\/bin\/brew shellenv)&#8221;<\/p>\n\n\n\n<p>Then install the following:<\/p>\n\n\n\n<p>$ brew install gcc@9<\/p>\n\n\n\n<p>MacPorts<\/p>\n\n\n\n<p>&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p>Install MacPorts from instructions here:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.macports.org\/install.php\n<\/div><\/figure>\n\n\n\n<p>The ports that need to be installed are:<\/p>\n\n\n\n<p>$ sudo port install autoconf<\/p>\n\n\n\n<p>$ sudo port install automake<\/p>\n\n\n\n<p>$ sudo port install libtool<\/p>\n\n\n\n<p>$ sudo port install pkgconfig<\/p>\n\n\n\n<p>$ sudo port install texinfo<\/p>\n\n\n\n<p>$ sudo port install fftw-3-single +gcc9<\/p>\n\n\n\n<p>$ sudo port install asciidoc<\/p>\n\n\n\n<p>$ sudo port install asciidoctor<\/p>\n\n\n\n<p>$ sudo port install libusb-devel<\/p>\n\n\n\n<p>$ sudo port install boost<\/p>\n\n\n\n<p>$ sudo port install qt5<\/p>\n\n\n\n<p>$ sudo port install qt5-qtmultimedia<\/p>\n\n\n\n<p>$ sudo port install qt5-qtwebsockets<\/p>\n\n\n\n<p>Hamlib<\/p>\n\n\n\n<p>&#8212;&#8212;<\/p>\n\n\n\n<p>First fetch hamlib from the repository, in this case my fork of Hamlib<\/p>\n\n\n\n<p>3 until the official repository has all the fixes we need:<\/p>\n\n\n\n<p>$ mkdir -p ~\/hamlib-prefix\/build<\/p>\n\n\n\n<p>$ cd ~\/hamlib-prefix<\/p>\n\n\n\n<p>$ git clone git:\/\/git.code.sf.net\/p\/jtdx\/hamlib src<\/p>\n\n\n\n<p>$ cd src<\/p>\n\n\n\n<p>$ .\/bootstrap<\/p>\n\n\n\n<p>To build:<\/p>\n\n\n\n<p>$ cd ~\/hamlib-prefix\/build<\/p>\n\n\n\n<p>$ ..\/src\/configure \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;enable-shared \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;disable-static \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;disable-winradio \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;prefix=$HOME\/hamlib-prefix \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;without-readline \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;without-indi \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; &#8211;without-cxx-binding \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; CFLAGS=&#8221;-g -O2 -mmacosx-version-min=10.13 -I\/opt\/local\/include&#8221; \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; LIBUSB_LIBS=&#8221;-L\/opt\/local\/lib -lusb-1.0&#8243;<\/p>\n\n\n\n<p>$ make<\/p>\n\n\n\n<p>$ make install-strip<\/p>\n\n\n\n<p>The &nbsp; above&nbsp; commands &nbsp; will&nbsp; build &nbsp; hamlib&nbsp; and &nbsp; install&nbsp; it &nbsp; into<\/p>\n\n\n\n<p>~\/hamlib-prefix. If `make install-strip` fails, try `make install`.<\/p>\n\n\n\n<p>CMake<\/p>\n\n\n\n<p>&#8212;&#8211;<\/p>\n\n\n\n<p>Download the latest CMake universal 64-bit DMG from<\/p>\n\n\n\n<p>http:\/\/www.cmake.org\/download\/&nbsp; open the&nbsp; DMG then&nbsp; drag and&nbsp; drop the<\/p>\n\n\n\n<p>application bundle onto the supplied \/Applications link.<\/p>\n\n\n\n<p>To&nbsp; complete&nbsp; the&nbsp; install&nbsp; process&nbsp; you need&nbsp; to&nbsp; run&nbsp; the&nbsp; CMake-gui<\/p>\n\n\n\n<p>application as root from a terminal shell as follows:<\/p>\n\n\n\n<p>$ sudo &#8220;\/Applications\/CMake.app\/Contents\/MacOS\/cmake&#8221; &#8211;install<\/p>\n\n\n\n<p>JTDX<\/p>\n\n\n\n<p>&#8212;&#8212;<\/p>\n\n\n\n<p>First fetch the source from the repository:<\/p>\n\n\n\n<p>$ mkdir -p ~\/jtdx-prefix\/build<\/p>\n\n\n\n<p>$ cd ~\/jtdx-prefix<\/p>\n\n\n\n<p>$ git clone git:\/\/git.code.sf.net\/p\/jtdx\/code src<\/p>\n\n\n\n<p>$ cd ~\/jtdx-prefix\/build<\/p>\n\n\n\n<p>For my Intel Mac:<\/p>\n\n\n\n<p>$ FC=\/usr\/local\/Cellar\/gcc@9\/9.5.0\/bin\/gfortran-9 \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; cmake \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; -D CMAKE_PREFIX_PATH=&#8221;\/opt\/local\/libexec\/qt5;~\/hamlib-prefix;\/opt\/local&#8221; \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; -D CMAKE_INSTALL_PREFIX=~\/jtdx-prefix \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; -D CMAKE_OSX_SYSROOT=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX13.sdk \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; ~\/jtdx-prefix\/src<\/p>\n\n\n\n<p>For my M1 Mac:<\/p>\n\n\n\n<p>FC=gfortran \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; cmake \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; -D CMAKE_PREFIX_PATH=&#8221;\/opt\/local\/libexec\/qt5;~\/hamlib-prefix;\/opt\/local&#8221; \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; -D CMAKE_INSTALL_PREFIX=~\/jtdx-prefix \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; -D CMAKE_OSX_SYSROOT=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX13.sdk \\<\/p>\n\n\n\n<p>&nbsp;&nbsp; ~\/jtdx-prefix\/src<\/p>\n\n\n\n<p>Substitute the&nbsp; Mac OS X SDK&nbsp; version you have installed&nbsp; in the above<\/p>\n\n\n\n<p>command if you have a different version from 10.15.<\/p>\n\n\n\n<p>Also make sure you have the path to right Fortran in the first line above.<\/p>\n\n\n\n<p>The CMAKE_PREFIX_PATH variable specifies where CMake should look first<\/p>\n\n\n\n<p>for other packages, the two&nbsp; elements may be different depending where<\/p>\n\n\n\n<p>you have installed Qt and what version you have (~\/local\/qt-macx-clang<\/p>\n\n\n\n<p>if&nbsp; you have&nbsp; built&nbsp; Qt from&nbsp; sources&nbsp; as described&nbsp; above&nbsp; in the&nbsp; Qt<\/p>\n\n\n\n<p>section) and where you installed&nbsp; Hamlib (i.e.&nbsp; the &#8211;prefix configure<\/p>\n\n\n\n<p>option above in the Hamlib section).<\/p>\n\n\n\n<p>If you already have the fftw3-dev&nbsp; package installed on your system it<\/p>\n\n\n\n<p>may well get selected in preference to&nbsp; the one you built above in the<\/p>\n\n\n\n<p>MacPorts installation.&nbsp; It is&nbsp; unlikely that&nbsp; a prior&nbsp; installation of<\/p>\n\n\n\n<p>libfftw3f is&nbsp; correctly configured&nbsp; for use in&nbsp; a JTDX&nbsp; package, the<\/p>\n\n\n\n<p>CMAKE_PREFIX_PATH above&nbsp; is augmented&nbsp; with the&nbsp; MacPorts installation<\/p>\n\n\n\n<p>location&nbsp; (\/opt\/local)&nbsp; to&nbsp; ensure&nbsp; the&nbsp; correct&nbsp; libfftw3f.dylib&nbsp; and<\/p>\n\n\n\n<p>headers are located.<\/p>\n\n\n\n<p>To build:<\/p>\n\n\n\n<p>$ cmake &#8211;build .<\/p>\n\n\n\n<p>$ cmake &#8211;build . &#8211;target install<\/p>\n\n\n\n<p>$ cmake &#8211;build . &#8211;target package &#8212; -kj<\/p>\n\n\n\n<p>sudo mkdir gcc-devel<\/p>\n\n\n\n<p>sudo ln \/opt\/homebrew\/lib\/gcc\/12\/libquadmath.0.dylib \/opt\/local\/lib\/gcc-devel\/libquadmath.0.dylib<\/p>\n\n\n\n<p>sudo ln \/opt\/homebrew\/lib\/gcc\/12\/libgcc_s.1.1.dylib \/opt\/local\/lib\/gcc-devel\/libgcc_s.1.1.dylib<\/p>\n\n\n\n<p>which installs the JTDX application bundle into ~\/jtdx-prefix<\/p>\n\n\n\n<p>Updating and Rebuilding Hamlib<\/p>\n\n\n\n<p>==============================<\/p>\n\n\n\n<p>From&nbsp; time&nbsp; to time&nbsp; new&nbsp; fixes&nbsp; will be&nbsp; pushed&nbsp; to&nbsp; the Hamlib&nbsp; fork<\/p>\n\n\n\n<p>repository integration branch. To pick them up type:<\/p>\n\n\n\n<p>$ cd ~\/hamlib-prefix\/src<\/p>\n\n\n\n<p>$ git pull<\/p>\n\n\n\n<p>To rebuild hamlib with the changed sources:<\/p>\n\n\n\n<p>$ cd ~\/hamlib-prefix\/build<\/p>\n\n\n\n<p>$ make<\/p>\n\n\n\n<p>$ make install-strip<\/p>\n\n\n\n<p>Updating and Rebuilding JTDX<\/p>\n\n\n\n<p>==============================<\/p>\n\n\n\n<p>To update to the latest sources type:<\/p>\n\n\n\n<p>$ cd ~\/jtdx-prefix\/src<\/p>\n\n\n\n<p>$ git pull<\/p>\n\n\n\n<p>$ cd ~\/jtdx-prefix\/build<\/p>\n\n\n\n<p>$ cmake &#8211;build .<\/p>\n\n\n\n<p>$ cmake &#8211;build . &#8211;target install<\/p>\n\n\n\n<p>codesign -s &#8220;Mac Developer: charles morgan (G89EBN4PSS)&#8221; &#8211;deep -f ~\/jtdx-prefix\/jtdx.app\/<\/p>\n\n\n\n<p>M1 Mac Notes<\/p>\n\n\n\n<p>For WSJTX<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/folabs.com\/building-wsjt-x-apple-m1.html\n<\/div><\/figure>\n\n\n\n<p>cd ~<\/p>\n\n\n\n<p>git clone git@github.com:iains\/gcc-darwin-arm64.git<\/p>\n\n\n\n<p>cd gcc-darwin-arm64<\/p>\n\n\n\n<p>mkdir build<\/p>\n\n\n\n<p>cd build<\/p>\n\n\n\n<p>..\/configure &#8211;build=aarch64-apple-darwin21 &#8211;disable-nls &#8211;enable-checking=release &#8211;enable-languages=c,c++,objc,obj-c++,fortran &#8211;program-suffix=-10 &#8211;with-gmp=\/opt\/homebrew\/opt\/gmp &#8211;with-mpfr=\/opt\/homebrew\/opt\/mpfr &#8211;with-mpc=\/opt\/homebrew\/opt\/libmpc &#8211;with-isl=\/opt\/homebrew\/opt\/isl &#8211;with-system-zlib &#8211;disable-multilib &#8211;with-native-system-header-dir=\/usr\/include &#8211;disable-darwin-at-rpath &#8211;with-sysroot=\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX.sdk<\/p>\n\n\n\n<p>make<\/p>\n\n\n\n<p>sudo make install<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building from Source on Apple Mac ================================= You&nbsp; will need&nbsp; Xcode, MacPorts, HomeBrew, CMake&nbsp; and, Qt. &nbsp; The Xcode&nbsp; install instructions are included in the MacPorts documentation. Xcode &#8212;&#8212;&#8211; There are two parts to install Xcode one is just to install from the Mac AppStore.&nbsp; Then also from&nbsp; the command line from the MacPorts website &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.aa5sh.com\/?page_id=410\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Notes on building JTDX for Mac&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":72,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inspiro_hide_title":false,"footnotes":""},"class_list":["post-410","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/pages\/410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=410"}],"version-history":[{"count":1,"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/pages\/410\/revisions"}],"predecessor-version":[{"id":411,"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/pages\/410\/revisions\/411"}],"up":[{"embeddable":true,"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=\/wp\/v2\/pages\/72"}],"wp:attachment":[{"href":"https:\/\/www.aa5sh.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}