Difficulty Installing NLopt for VNA Cal Kit Design - Page 1
Forum section: electronics / projects

author: PerArdua
author_rank: Regular Contributor
timestamp: December 17, 2020, 06:46:35 pm
content: I'm attempting to create my own VNA Cal kit, along with coefficients. I've come across this site (https://www.qsl.net/in3otd/electronics/VNA_calkit/calkit.html) which details a script for GNU Octave which can be used to calculate coefficients when given an .s1p file. However, I'm having real difficulty installing/compiling nlopt on my win 7 machine. I have little to no experience of doing this kind of computer installation/compilation, so I could be missing something obvious, but any feedback would be appreciated.I have GNU Octave working in my C:\Program Files\GNU Octave\Octave-6.1.0 directory. I can open Octave, etc.Next step is to include the library nlopt. To do this for my Win 7 PC I tried following the instructions here:https://nlopt.readthedocs.io/en/latest/NLopt_on_Windows/, specifically the Octave Plugin section. I've downloaded NLopt.v2.6.1.i686-w64-mingw32, and have put the libnlopt.dll, libnlopt.dll.a, and nlopt_optimize_oct.cc in the directory I created at C:\Users\ABC\Downloads\NLopt.v2.6.1.i686-w64-mingw32.tar\NLopt.v2.6.1.i686-w64-mingw32\nlopt.I then go to cmd, navigate to that directory and use mkoctfile -lnlopt --output nlopt_optimize.oct nlopt_optimize-oct.cc but I get two errors:g++: error: File\GNU: No such file or directoryg++: error: Octave\Octave-6.1.0\mingw64\/include: No such file or directoryThis is where I have no clue what is going wrong. Am I okay trying to execute this command in a dir other than the Octave-6.1.0 directory? Am I missing some other software?Any advice would be appreciate, if you would like additional information, please let me know and I would be happy to provide.Regards,PA

author: hendorog
author_rank: Super Contributor
timestamp: December 17, 2020, 07:24:25 pm
content: It will be out of date by now, but here is a guide I wrote:https://www.eevblog.com/forum/rf-microwave/vna-cal-kit-modelling-script-install-guide/msg1438778/#msg1438778

author: PerArdua
author_rank: Regular Contributor
timestamp: December 17, 2020, 08:10:45 pm
content: Thank you hendorog, I think it's compiled now. However, I'm having trouble getting the script to run. I use the line:Code:function calkit_model('fopen.s1p', 'OPEN')for the attached .s1p file (.txt to let me attach it here). However, I get the following error:Code:error: parse error near line 52 of file E:\Electronics\VNA Cal kit\calkit_model.minvalid parameter list>>> function calkit_model('fopen.s1p', 'OPEN')Any ideas where I could've gone wrong?

author: hendorog
author_rank: Super Contributor
timestamp: December 17, 2020, 08:34:24 pm
content: Quote from: PerArdua on December 17, 2020, 08:10:45 pmIf I've understood you correctly then you are trying to call the function using this line?Code:function calkit_model('fopen.s1p', 'OPEN')Instead you call the function like this:Code:calkit_model('fopen.s1p', 'OPEN')Hopefully its just that. Cheers.

author: PerArdua
author_rank: Regular Contributor
timestamp: December 17, 2020, 08:51:51 pm
content: Ah I see thank you hendorog - I was using this incorrectly. I uninstalled everything and tried going through your pdf a second time - however, when I get to "compile the Octave plugin" using:Code:mkoctfile -Inlopt-2.4.2\api -Inlopt-2.4.2\octave -L. -lnlopt-0 --output nlopt_optimize.oct nlopt_optimize-oct.ccI get the same g++ errors, as per the attached image. What am I doing wrong?

author: hendorog
author_rank: Super Contributor
timestamp: December 17, 2020, 09:00:17 pm
content: Quote from: PerArdua on December 17, 2020, 08:51:51 pmShort answer:Install it to C:\Octave- that way you avoid all of the cross platform issues about long path names with spaces in them.Long answer:Spaces in path names - and special characters in path names (i.e. Program Files and GNU Octave) cause problems when using command line tools. They need to be surrounded in quotes and/or escaped. Unless you know what you are doing, save yourself the time, pain and hassle and just stuff it in a simple short directory instead.

author: PerArdua
author_rank: Regular Contributor
timestamp: December 17, 2020, 11:38:54 pm
content: That was the issue, thanks again.Will probably update later with measurement results in the RF section.

author: hendorog
author_rank: Super Contributor
timestamp: December 18, 2020, 01:20:42 am
content: No problemLooking forward to see what you end up with. There was a fair old discussion about this in the below thread - buried though so it will take a while to wade through:https://www.eevblog.com/forum/testgear/kirkby-calibration-kit-alternatives/

author: PerArdua
author_rank: Regular Contributor
timestamp: December 18, 2020, 01:31:27 am
content: Yeah, I've been reading through that - very interesting. I think I'll make a new thread to move away from just talking about Kirkby's kit though.To be honest, I'm a bit disappointed with the cals at the moment, but it is early days and I suspect I am not properly understanding the modelling.