NanoVNA-QT icon indicating copy to clipboard operation
NanoVNA-QT copied to clipboard

MacOS macports build fails on Big Sur 11.1 (eigen3 build failure)

Open m-stefanski opened this issue 3 years ago • 23 comments

Using

sudo port install NanoVNA-QT

build fails with error

Error: Failed to configure eigen3: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_eigen3/eigen3/main.log for details.

which in result points to:

clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.1' in main.log

macports_log.txt main.log

m-stefanski avatar Jan 10 '21 14:01 m-stefanski

can you open a ticket to trac.macports.org with the same information? thank you

ra1nb0w avatar May 01 '21 14:05 ra1nb0w

Any updates on this?

0xCoto avatar Sep 27 '21 04:09 0xCoto

We did an update from May 1. Do you receive the same error?

ra1nb0w avatar Sep 27 '21 16:09 ra1nb0w

@ra1nb0w I ran sudo port install NanoVNA-QT and it throws a checksum error.

0xCoto avatar Sep 27 '21 17:09 0xCoto

Can you post the error and the main.log? thank you

ra1nb0w avatar Sep 28 '21 05:09 ra1nb0w

or you can re-try to build NanoVNA-QT since I committed a fix

ra1nb0w avatar Sep 28 '21 10:09 ra1nb0w

Coto@cotos-mbp ~ % sudo port install NanoVNA-QT
--->  Computing dependencies for NanoVNA-QT
--->  Fetching archive for NanoVNA-QT
--->  Attempting to fetch NanoVNA-QT-20200507_0.darwin_19.x86_64.tbz2 from https://fra.de.packages.macports.org/NanoVNA-QT
--->  Attempting to fetch NanoVNA-QT-20200507_0.darwin_19.x86_64.tbz2 from https://packages.macports.org/NanoVNA-QT
--->  Attempting to fetch NanoVNA-QT-20200507_0.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/NanoVNA-QT
--->  Building NanoVNA-QT
Error: Failed to build NanoVNA-QT: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_NanoVNA-QT/NanoVNA-QT/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port NanoVNA-QT failed

I've attached main.log:

main.log

0xCoto avatar Sep 28 '21 23:09 0xCoto

@ra1nb0w I also tried to build, but again no .app is created and the .dmg is empty. What I ran/output: build_attempt.txt

EDIT: Also, the brew installation seems OK as well:

Coto@cotos-mbp NetworkOptimizer % brew install automake libtool make eigen fftw
Warning: automake 1.16.4 is already installed and up-to-date.
To reinstall 1.16.4, run:
  brew reinstall automake
Warning: libtool 2.4.6_4 is already installed and up-to-date.
To reinstall 2.4.6_4, run:
  brew reinstall libtool
Warning: make 4.3 is already installed and up-to-date.
To reinstall 4.3, run:
  brew reinstall make
Warning: eigen 3.4.0_1 is already installed and up-to-date.
To reinstall 3.4.0_1, run:
  brew reinstall eigen
Warning: fftw 3.3.10 is already installed and up-to-date.
To reinstall 3.3.10, run:
  brew reinstall fftw

0xCoto avatar Sep 28 '21 23:09 0xCoto

you need to sudo port sync sudo port install nanovna-qt

if you have homebrew installed into /usr/local you can have trouble to build software correctly.

ra1nb0w avatar Sep 29 '21 05:09 ra1nb0w

@ra1nb0w Thanks for your response, but it still fails:

Coto@cotos-mbp ~ % sudo port sync
Password:
--->  Updating the ports tree
Coto@cotos-mbp ~ % sudo port install nanovna-qt
Password:
Portfile changed since last build; discarding previous state.
Warning: cltversion: The Command Line Tools are installed, but MacPorts cannot determine the version.
Warning: cltversion: For a possible fix, please see: https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt
Warning: cltversion: The Command Line Tools are installed, but MacPorts cannot determine the version.
Warning: cltversion: For a possible fix, please see: https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt
--->  Computing dependencies for libxavna
--->  Fetching archive for libxavna
--->  Attempting to fetch libxavna-20200507_1.darwin_19.x86_64.tbz2 from https://fra.de.packages.macports.org/libxavna
--->  Attempting to fetch libxavna-20200507_1.darwin_19.x86_64.tbz2 from https://packages.macports.org/libxavna
--->  Attempting to fetch libxavna-20200507_1.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/libxavna
--->  Fetching distfiles for libxavna
--->  Verifying checksums for libxavna
Error: Checksum (rmd160) mismatch for NanoVNA-QT-20200507.tar.gz
Error: Checksum (sha256) mismatch for NanoVNA-QT-20200507.tar.gz
Error: Checksum (size) mismatch for NanoVNA-QT-20200507.tar.gz
Error: Failed to checksum libxavna: Unable to verify file checksums
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_NanoVNA-QT/libxavna/main.log for details.
Error: Unable to execute port: upgrade libxavna failed

As for where it is installed:

Coto@cotos-mbp ~ % which brew
/usr/local/bin/brew

0xCoto avatar Oct 06 '21 03:10 0xCoto

Seems a stealth update from upstream. try with

sudo port clean --dist
sudo port sync
sudo port install nanovna-qt

now should be correctly in sync the checksum.

thank you for testing

ra1nb0w avatar Oct 06 '21 06:10 ra1nb0w

It finally worked, thank you very much for your help! :)

0xCoto avatar Oct 06 '21 23:10 0xCoto

good! @m-stefanski still fail to build?

ra1nb0w avatar Oct 07 '21 05:10 ra1nb0w

@ra1nb0w While I'm on it, is it possible to interface with NanoVNA-QT through the command line or with some sort of scripting? My goal is to automate the capture of s2p data every few seconds.

(Also: is it possible to get NanoVNA-QT working on a Raspberry Pi? I don't think they can run AppImages...)

0xCoto avatar Oct 08 '21 22:10 0xCoto

to access nanovna v2 from command line you need to write code in c/c++, see https://github.com/nanovna-v2/NanoVNA-QT/tree/master/libxavna

raspberry: yes, you can compile and install nanovna-qt in the same way or use appimages

ra1nb0w avatar Oct 09 '21 06:10 ra1nb0w

I get this when running make on the C++ code shown in the readme:

fatal error: 'xavna/xavna_cpp.H' file not found
#include <xavna/xavna_cpp.H>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [testt] Error 1

Where exactly is this xavna directory located containing the xavna_cpp.H file?

Edit: I found it's in the include folder, but I'm a bit confused (as a C/C++ non-expert) how I could execute the example(?) code shown in the readme. :)

Essentially my goal is to:

  1. Connect to the NanoVNA device
  2. Set the frequency range (start frequency, step frequency, number of points)
  3. Read data (ideally export to sNp)
  4. Disconnect from device

Hopefully this isn't super hard to achieve with the API? (apologies for the likely dumb questions - I'm clearly a beginner 😅 )

0xCoto avatar Oct 10 '21 20:10 0xCoto

  • use lover .h to avoid problem with case-sensitive file system
  • you need to include the header/library paths cc -l/opt/local/include -L/opt/local/lib your_test.c

ra1nb0w avatar Oct 11 '21 05:10 ra1nb0w

I replaced the first line of the .c code snippet given in the readme with #include "include/xavna.h" and ran cc -l/opt/local/include -L/opt/local/lib test_api.c:

Coto@cotos-mbp libxavna % cc -l/opt/local/include -L/opt/local/lib test_api.c
In file included from test_api.c:1:
./include/xavna.h:3:8: error: expected identifier or '('
extern "C" {
       ^
test_api.c:8:2: error: unknown type name 'bool'
        bool xavna_is_tr(void* dev);
        ^
test_api.c:16:78: error: C does not support default arguments
        int xavna_set_params(void* dev, int freq_khz, int atten, int port, int nWait=20);
                                                                                    ^~~
3 errors generated.

Thanks for your patience

0xCoto avatar Oct 11 '21 06:10 0xCoto

xavna.h is not a valid C header for many reasons:

  • extern "C" is only valid on C++
  • bool doesn't exist in C until C99 with stdbool.h
  • C does not support default arguments
  • must use 'struct' tag to refer to type 'autoSweepDataPoint'

you probably need to use C++ as the entire nanovna-qt interface.

anyway, to get the entire header files install the update available in macports.

ra1nb0w avatar Oct 11 '21 06:10 ra1nb0w

another way to comunicate with nanovna2 is to use python, see https://github.com/nanovna-v2/NanoVNA2-firmware/tree/master/python https://github.com/nanovna-v2/NanoVNA2-firmware/pull/75

ra1nb0w avatar Oct 11 '21 15:10 ra1nb0w

@ra1nb0w Wow, I had no idea this existed. The only one I had spotted is this (https://github.com/ttrftech/NanoVNA/tree/master/python), which is very similar but does not support the V2 model. But your link did the trick!

I've managed to completely wrap all my utilities around this now and everything works well, thank you very very much! 😃

0xCoto avatar Oct 12 '21 01:10 0xCoto

@ra1nb0w One more thing in case you've got any ideas: I've managed to get everything working and I'm able to output touchstone files, plot them etc., but I see that the |S21| values disagree between the NanoVNA alone (i.e. not connected to python/a computer) and the ones the python script is measuring.

My understanding is that once I calibrate the device (SOLT) and connect it to the computer, the python interface does not seem to pick up the latest calibration on file. Is there a simple way to either load the latest calibration on file or manually re-run the SOLT calibration again through python, or do I write something up and save each state (OPEN, SHORT, LOAD, THRU) as a separate sNp file and apply the calibration locally?

0xCoto avatar Dec 18 '21 11:12 0xCoto

I don't know since I always calibrate the range that I need before measure any values or at least I save the calibration data in a file and I will recall it when I need it. I think that the python library should have something that you can take and use in your code.

ra1nb0w avatar Dec 18 '21 11:12 ra1nb0w