Help with Compiling Programs

Status
Not open for further replies.

ScubaJungle

Active Member
Joined
Mar 11, 2020
Messages
618
Location
West Central Florida
I need some help with compiling programs on Windows. I have no experience coding, but I have come across a bunch of programs and tools that I would like to use for my SDR that only are available via source code.

I have downloaded visual studio, but after that I really dont know where to start. All the tutorials assume you know how to get to the point where they begin, which I dont.

One example is this program, called Kalibrate, which automatically calibrates your dongle ppm measurement.

1. I have the source code, and I have visual studio, as well as the commands - but where do I enter the commands, how do I know if I should use C++, python, etc.
2. Do I just paste the code into the compiler and press run? Here is the code provided on the github:
"kal uses the GNU Autoconf system and should be easily built on most *nix platforms. "
-what is the GNU autoconf system, and how do I use it?
jl@thinkfoo:~/src$ cd kal-v0.4.1
jl@thinkfoo:~/src/kal-v0.4.1$ ./bootstrap && CXXFLAGS='-W -Wall -O3' ./configure && make
[...]
jl@thinkfoo:~/src/kal-v0.4.1$ src/kal -h
kalibrate v0.4.1, Copyright (c) 2010, Joshua Lackey

Usage:
GSM Base Station Scan:
kal <-s band indicator> [options]

Clock Offset Calculation:
kal <-f frequency | -c channel> [options]

Where options are:
-s band to scan (GSM850, GSM900, EGSM, DCS, PCS)
-f frequency of nearby GSM base station
-c channel of nearby GSM base station
-b band indicator (GSM850, GSM900, EGSM, DCS, PCS)
-R side A (0) or B (1), defaults to B
-A antenna TX/RX (0) or RX2 (1), defaults to RX2
-g gain as % of range, defaults to 45%
-F FPGA master clock frequency, defaults to 52MHz
-v verbose
-D enable debug messages
-h help
jl@thinkfoo:~/src/kal-v0.4.1$ src/kal -s 850
kal: Scanning for GSM-850 base stations.
GSM-850:
chan: 128 (869.2MHz - 13Hz) power: 9400.80
chan: 131 (869.8MHz + 7Hz) power: 4081.75
chan: 139 (871.4MHz + 10Hz) power: 2936.20
chan: 145 (872.6MHz - 7Hz) power: 33605.48
jl@thinkfoo:~/src/kal-v0.4.1$ src/kal -c 145
kal: Calculating clock frequency offset.
Using GSM-850 channel 145 (872.6MHz)
average [min, max] (range, stddev)
- 1Hz [-8, 7] (14, 3.948722)
overruns: 0
not found: 0

3. Other ones tell you to enter commands such as:

"mkdir build-dir"
"cmake.."
"mkdir [OPTIONS] build-dir [file source]
-what do I enter for [OPTIONS]?
-when entering mkdir, or other commands, I will get an error stating invalid syntax.

So basically, what is a basic outline of the process I can follow, for example:
1. open visual studio
2. open appropriate "protocol"/type of compiler (C++,java,python)
3. enter these commands - ""
4. Press run/make/debug,etc

I can follow the directions once Im at the point of reaching them, but to get to them, what do I do, in terms of what I just listed^

Thanks
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
That's a linux program, that's not going to natively compile on windows, not without some legwork...and it's a8 y/o relatively unsupported program that is written for different operating systems. Do you really need it? What type of dongle are you using, and why do you think you need to calibrate them? This was popular before the TXCO dongles came out and PPM adjustments would be in the 50s to 100s range, now they are traditionally only a handful of points (which can be easily trial-and-errored out).

Click here to read about Cygwin, and compiling programs that are written for linux (&osx) in a windows environment.

This is not for the faint of heart. Installing a development suite to compile and run software non-native to the operating system at hand is not script-kiddie type stuff. You think that the instructions "just get entered", but there is more than just that when it comes to doing what you think is easy.

I'd actually suggest you burn a LiveCD of a linux distribution and run it on hardware than Windows ->Cygwin -> compile -> configure -> run -> hope it works...You're putting two massively large steps in there (cygwin & compilation) that could lead you to weeks of heartache.
 

ScubaJungle

Active Member
Joined
Mar 11, 2020
Messages
618
Location
West Central Florida
That's a linux program, that's not going to natively compile on windows, not without some legwork...and it's a8 y/o relatively unsupported program that is written for different operating systems. Do you really need it? What type of dongle are you using, and why do you think you need to calibrate them? This was popular before the TXCO dongles came out and PPM adjustments would be in the 50s to 100s range, now they are traditionally only a handful of points (which can be easily trial-and-errored out).

Click here to read about Cygwin, and compiling programs that are written for linux (&osx) in a windows environment.

This is not for the faint of heart. Installing a development suite to compile and run software non-native to the operating system at hand is not script-kiddie type stuff. You think that the instructions "just get entered", but there is more than just that when it comes to doing what you think is easy.

I'd actually suggest you burn a LiveCD of a linux distribution and run it on hardware than Windows ->Cygwin -> compile -> configure -> run -> hope it works...You're putting two massively large steps in there (cygwin & compilation) that could lead you to weeks of heartache.
As for that program, no I do not need it. I was just using it as an example/"practice" (I have my dongles calibrated), but I didn't realize all of that, so thanks for pointing that out and saving me trouble. I just finished my semester so I don't need more headaches.

So scratch that idea -
as for Windows-native programs - I know it is not a plug and play type thing by any means, but would it at least be doable without taking a coding course? Assuming the code does not need to be built upon and it is a full source code for a Windows-native program?
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
As for that program, no I do not need it. I was just using it as an example/"practice" (I have my dongles calibrated), but I didn't realize all of that, so thanks for pointing that out and saving me trouble. I just finished my semester so I don't need more headaches.

So scratch that idea -
as for Windows-native programs - I know it is not a plug and play type thing by any means, but would it at least be doable without taking a coding course? Assuming the code does not need to be built upon and it is a full source code for a Windows-native program?

It's doable, but source built software for windows is far less popular than it is on any Linux/Unix system. There's too much to try to cover when compiling a program for different hardware architecture, so compilation takes specifics for that system and builds a program with what it deems "safe" based on what it finds. Windows underlying software architecture is much less open and is very structured (..ehhh) and programs either work, or they dont. Binaries are easier to distribute if the operating system has very delineated rules and formats in place, so binaries on a linux system would be orders of magnitude larger if they had to include every flippin' option for hardware and underlying kernelspace configuration that they might see.

I'd seriously think it'd be a fun time for you to download a Linux LiveCD, burn it, and boot your hardware off it and see how something-other-than Windows sees what you have. Hey, the semester is over...why not?
 

ScubaJungle

Active Member
Joined
Mar 11, 2020
Messages
618
Location
West Central Florida
It's doable, but source built software for windows is far less popular than it is on any Linux/Unix system. There's too much to try to cover when compiling a program for different hardware architecture, so compilation takes specifics for that system and builds a program with what it deems "safe" based on what it finds. Windows underlying software architecture is much less open and is very structured (..ehhh) and programs either work, or they dont. Binaries are easier to distribute if the operating system has very delineated rules and formats in place, so binaries on a linux system would be orders of magnitude larger if they had to include every flippin' option for hardware and underlying kernelspace configuration that they might see.

I'd seriously think it'd be a fun time for you to download a Linux LiveCD, burn it, and boot your hardware off it and see how something-other-than Windows sees what you have. Hey, the semester is over...why not?
Im seeing that now, a majority of the source codes are for Linux. I hadn't really paid much attention since I didn't realize how complicated it was. I've always heard that Linux is more "fun" or, at least has a lot more customization potential, so that makes sense. I think I will give it a shot now that you put it that way, plus, itll open a lot of doors for me if I could even do/understand basic coding. Maybe this is the right place to start. I just got a new laptop too, so I have an old laptop that I can mess around with and not worry about as much.
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
Run the LiveCD on your new laptop first, so you can see how well it f'ing flies on modern hardware. LiveCDs don't write to hardware unless you specifically disable some checks and MAKE them, so you can play with it on your system w/o causing an issue. I'd say play with a live distro on your newer hardware, and then use it on your older hardware to identify hardware IDs that may/or may not have particular issues with certain distros (you'll find that wifi cards can be pains in the asses on certain distros for licensing issues, etc) so you can have a heads-up on what will be coming your way.
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
..and to address your statement, Linux is fun as hell. I've got super lightweight hardware all over the house doing things like I+Q streaming, climate control, plant watering, security video recording, NAS, cold-storage NAS, firewall (ok, that's NetBSD), MAME cabinet, daily driver... and a lot of the not mission critical stuff is repurposed hardware that was stripped down and is running bare bones, and very efficiently...giving me tons of wiggle room.
 

ScubaJungle

Active Member
Joined
Mar 11, 2020
Messages
618
Location
West Central Florida
Cool, that makes me feel better. Could it be run off a USB drive that's formatted to run an .iso (assuming that's the file type?). Not sure if I have any spare cds laying around, but I think I do. I think both will run pretty well, even my old laptop is still pretty modern, its got an 8th gen i5-8xx? (cant remember exactly). The new ones got a 9th gen, i7-9750H though, so it will outperform it for sure.

Wow, that's awesome. That right there is all stuff that I've been wanting to do, especially plant watering and climate control type controls since I keep a lot of tropical fruits.
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
yep. A debian net-install (bare bones off a USB drive that pulls all the goodness off the debian mirror servers) is 200mb. I have a bag of 256mb USB keys that I got donated by a charity (that went out of business and had them all branded), and I use them all the time for that type of thing. Nearly every legit linux distro will have instructions on creating a USB drive / Live Distro (if supported) on their main page.

Start here.

A LiveDVD is going to be anywhere in the DVD size range, so a 8GB USB key will be just fine to start it, but a 16 gb or larger will allow you to mount a section of the USB drive as persistent storage for your /home directory and storage and can allow you a bit of persistence between sessions.

One thing you will quickly learn is that there are about a half a dozen major distros (Debian, Slackware, Fedora, Red Hat, Centos, Arch, Gentoo) and then a bazillion spinoffs or tailored distros that everyone swears by is the new hotness. I will broadly place Ubuntu into that spinoff category as a majority of the traits is has come from debian, and nearly all of it's fundamentals are debian-esque...and many times you will have to read Debian documentation to solve a ubuntu problem. I have testdriven about 40 distros over the last 20 years, started out with slackware when it was on 14 1.44mb floppies and discovered debian right around the v. 3.0 / Sarge distro (all their names for major releases come from Toy Story). I stay with Debian because it's more well developed, more prevalent in the society, and is less likely to be bleeding-edge or a fad (like Kali, yes Kali Linux is a fad). Anything a fringe / offshoot distro can do...the parent does as well.

Look at the graphic on the right side of this page.
 
Last edited:

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
btw, I requested this get moved to the tavern, as it's massively OT for the forum its in.
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
The other thing is, Kalibrate probably won't work anymore as it only worked with older GSM signals.
It will work, GSM-850 is still in use in ITU Region 2, and this program states it supports it. It is more prevalent in rural areas, and not so much in major cities.

I have most recently used the linux kalibrate and found two GSM-850 frequencies in my area for it.
 

ScubaJungle

Active Member
Joined
Mar 11, 2020
Messages
618
Location
West Central Florida
Wow. That map/list is huge.. I knew of Ubuntu and Tails, probably a few others, but I had no idea there were near that many, that's wild. Ubuntu is the only one Ive seen really prevalent. What is the point of creating new distributions, wouldn't it be easier to just build off an already created one to expand the scope and ability? Or is it just that people want to create their own, tailored for their needs? Or maybe Im missing something.
Thanks for the help and advice, Ill update with how it's going.

Thanks for the Windows version. Now Im curious to see if theres any GSM signals in my area.
 

a417

U+0000
Joined
Mar 14, 2004
Messages
4,650
Yeah, look and see how many of them say "Debian-based"...that's one of the reasons I stick with it.

People seem to think there's a need to make something more tailored, or specific to suit their situation.
 
Status
Not open for further replies.
Top