 Our next talk will be modernizing distribution of SDR tools and libraries with Conan, who I know from being a kid reading about him. And Brennan has come all the way from the US to explain how he's going to make this all better for us. Yeah, this is the back story of that barbarian. So, yeah, thank you all. So, how many of you actually know either the Conan he was referring to or the Conan that I might be referring to? Okay, we're getting somewhere. So the other name for this talk is, what does CMake have to do with SNR? It's a question that I find that I ask myself many times when I'm actually just trying to use these tools that we work on. We talked about that hack fest. It seems like CMake was also a topic of the hack fest in various ways. I think we should make it less of a topic. So, sit down. Gonna play with some software to find radios. Very exciting. Gonna build one of these in my backyard, hook it up, see some things, right? You say I can view images of the Earth from space. That's exciting. I just need to put some stuff together. Put some stuff together. We just need to download some applications, right? Well, maybe not. So we'll just build it. Also easy, right? Clone it, CMake, and not quite right. So I don't think this is really where we were trying to go, nor the rabbit hole that people wanted to get to. So maybe there's an easier way to solve this problem. And there is. The easier way. Images of the Earth. It's pretty fast. No CMake required. But maybe we want to still do this ourselves a little bit. So I want to talk a little bit about Conan, which is an open source CC++ package manager. This isn't replacing CMake. It's not replacing any of your favorite tools. You can use Ninja or whatever it is you want to use. But rather than having the tools tell us what we don't have, what if we let the tools give us those things? And so when we look at what's going on here, what do we want to do when it comes to packaging? We want to create explicit dependency graphs. So it's not run CMake, have it tell us what we don't have, try again, have it still tell us what we don't have, on and on and on. Track what configured features. Some of these libraries are very large in terms of what they can do. We don't always want to configure every single feature of our radio just to do one simple stream of, I don't know, FM signals or something like that. We also don't want to always be building every single one of our dependencies over and over and over again, just because we changed one line of code somewhere. Or say we're now using a newer version of OpenCV or something like that. I don't know why I need to rebuild OpenCV for my Windows machine. If anybody's tried that, it's a lot of fun. Having been part of GNU radio, you see there's always this question about, well, does it build on Mac? What's the status of this piece here? Does it build on Windows? Does it build on Linux? All of these pieces. These are not the problems that we should have to be thinking about so much. We should just be saying, these are the building blocks. They come together. How do we package that up? And also, we end up in a situation too where we have people that are using older systems. They're afraid to upgrade it for whatever reason. They have too many things that just barely work, glued together. And so we end up being tied to really old system libraries. We see this with the QT stuff. We see it in other places as well. We're holding ourselves back in developing our applications based on system libraries that we're hoping people have installed and working in a smart way. So with Conan, what we do is we actually start to be more descriptive about how this whole piece works. So here, packaging up something, live AEC, and we put some information about what it is, some settings that we want to be able to configure about this package. So the OS, the compiler, the build type, the architecture we're building out, where we're going to go get the data. We're going to use CMake here. So it's kind of the same. We're going to configure CMake so that we can do our build. We're going to package it up and then do a CMake install. And then we're going to collect information about the libraries that got installed as part of this. So CMake interfaces really well with Conan so we can extract a lot of this information. You can also manually describe everything that's in here. Along the way, you can add additional flags, so options. So when you say, I want this library, I want it compiled with these certain feature flags enabled, these become parts of the metadata that describe the package that you're looking for. Then we want to consume it. We have some kind of boilerplate that we pull up here to leverage some of the infrastructure that Conan is giving us. So in CMake, it's now able to get access to where all the find package, we generate all the find packages for the pieces that are needed. It's also going to sandbox a lot of this stuff off to the side so it needs special information about the linking. So it takes care of all of that up here. And then when we go to actually do this linking, we'll say, okay, I need this libAC in my application. We just say, pull in the Conan package for this piece. It's not going to pull in your system one. It's going to pull in the one that's linked into the Conan dependencies that you already have over there. Then we go and we build this. So we do a Conan create this library at this version. It spit out a whole bunch of stuff. I didn't think you wanted to see all of the lines of the build happening. And at the end, we see that we package this binary application that comes with it, the license, the header files, as well as the library here. And we created a revision and a package hash that it's used to be able to identify this is exactly the package for this configuration that we wanted to use. And this is now stored in some mysterious location on your computer that you don't worry about. Off to the side. Don't touch it. It's there. If you will, well, no, if you touch it, we'll make you build it again. But like I was saying, so we can go change some stuff. So we talked about whether, like we had those architecture-specific things, but we also say build type. We want to build this in debug mode now, too. We want to build it with shared or static libraries. These are all options that can be applied on here. The recipes know how to use these options and then build you exactly what you're looking for. And so when we do that, these are the settings that came out of it. So you see that I'm building for macOS. This is the compiler version I'm using as part of GC, or I guess this is a ceiling, Apple ceiling. But you get all these different things. So if I'm building on a Linux machine, I might have a configuration that's using GCC or ceiling, not Apple ceiling, get all these different variations. We're able to keep track of all of that and make sure we're referencing exactly what it is that we want. And then we can take this other library, Poco. I don't know if people really were C, C++. Poco is kind of a library that helps do a bunch of common tasks. But we see this dependency graph that's being built here, where we have Zlib, which is required by OpenSSL. And that OpenSSL is required by Coco. And so if I specify options on Poco that I want everything to be built in debug mode, it's able to go through and make sure it pulls in the correct versions of all these. And all of these are actually already published in a public kind of registry or center. And so I can change these common flags and immediately get the packages for all of these already pre-built. I don't have to go and rebuild it with that flag. So now let's do a quick little demo here. So what we're going to do, is anybody here familiar with something called Go's tools? The Go's satellites? Okay, that was what I was referring to in the beginning. It started, I think, out of someone's experiment that they were working on to say, hey, can I pull down the images and the data and everything off of these NOAA satellites? It doesn't require very much hardware. It's very accessible, and I think it's actually kind of a fun piece to do. But there are a bunch of dependencies, and their way of solving the dependency problem is they just vended all of the libraries, so you just pull everything down and build off old packages. So instead, what I did is I built the actual dependencies for these. And so let me just... We'll pull up this Conan file that I have here. So we kind of had this stuff we were talking about before about whether, like, informate metadata about it. We're going to be using CMake Generator. Is this big enough for people? I can make it a little bigger if it's... We're good? We're going to pull in our CMake wrapper that we need. We're going to say, you know, FPIC is not valid for Windows, so that's not an option that will be available for that platform, where we're getting our tools. We're going to apply patches. You frequently are going to have to apply patches when you're doing this to make sure that it's referring to the Conan packages, not the system packages. So it'll apply the patches for all of that, just by how we're going to do the building, the packaging, and the library pieces that are here. I believe this is everything. I'll put it here. I just realized that I was not looking at the one that I meant. This was an underlying library, not the actual one. I'll just pull the other one up really quick. So that was one of the low-level dependencies. This is one of the higher-level dependents. So this is the actual application. What I wanted to point out here is here's where we're actually specifying all of the libraries that are part of this, so we make sure that they're all available. So we have this projection library, Proj4, Proj now I think is what it's called, RTLSDR, a common JSON parser, this SZIP style library, work error correction libraries, Tomol, Anomessage, OpenCV, all of these things. So, if we go and build this, make sure I go into that, goes tools, make sure I grab the right version number for this, because it's not versioned well. Conan, create this, oops, it goes tools, do this, I believe we need this. All right. So it is, what did I do right now? Oh, I told you to build everything. I probably actually didn't want to do that. It's actually now, I just told it, I should have told it to do build only the missing ones. I told it to force build everything, but you'll notice I'm actually building all of the dependencies in that entire dependency graph, including everything for OpenCV even right now. And this is assuming there's nothing on my machine. I don't have to worry about any of these things. So I'm building that entire dependency graph for all these applications. So I'm getting the most recent versions of all of this stuff. At the end of this, we'll go through and finish this piece up. We'll see how fast this goes. See, OpenCV builds here. I might change this just to do missing, so you guys don't watch my screen go forever. All right. Are you involved? Calling build on ghost tools. Now we're just building that one application, which we didn't have a valid configuration for. It should be done quite soon. Yeah. I mean, if you have multiple recipes, multiple programs that all depend on the same library, will it build multiple copies of that library? No, it will reuse them. It will reuse them. And I will show an example of this. Okay, so this thing just all went, rebuilt, ran a couple of tests against the package. So the package is now available. And I can see that if I go Conan search ghost tools. I don't know how to use this keyboard. I apologize. So we see that this recipe does exist right here. And so you asked, so if I do Conan, info for this package, graph equals step.html. So I'm going to generate the dependency graph for that package. And we see the full dependency graph real. That's easy to see. Let's see here. So we see our original, this is our application actually right here. And all of those dependencies and the versions of all of those. But you asked about things that require multiples of the same. So open cv over here, we can see a bunch of things are using libz. And so in this case, they're all referring to this same configuration of libz over here with this package id that's associated with it. And so that's where this becomes more powerful because it'll make sure to always be pointing at that same package. So what we did at this point is just fill up a folder in your system, Conan data and here's all of the sorry if this is maybe people can see it. These are all those libraries that got built. So these are like hidden off into your system with all the revisions and everything that are there. And now if I go to a little working directory right here I can now do Conan install goes tools oops, I copied the whole thing here and then I'm going to use a generator to deploy. So now what happened is I effectively just installed all the dependencies that were already pre-built in this location for me. So here's all of my libraries that were part of this all of their libraries. Everything is linked to the proper things inside of here. And so if I look in goes tools then I see those applications that were built there all using the dependencies I wanted. The dash here. Let me pick up the satellite signal with this non-existent antenna right here. It will not pick it up, I promise that. What did I do? Oh, thank you. It's like I'm guessing at the arguments here, but I thought they were. Alright. So I found my tuner and it's now not finding the signal that we're looking for. But it is running through there, it's using all of those libraries that we just built through that entire process. So that's kind of the core piece of it. We took this thing, built it all I've never built anything on a Mac before with C up until a week ago. So it was basically the same. I built the library on my Linux machine and then I did it on the Mac. And so that's one of the nice features there is that ability to create your recipes, specify all the platforms and then kind of make sure you don't get your CMake get into the weeds about the platforms that it's supporting. You just say these are the packages I want. So I got the pieces that we need. So we saw here that it was actually reading off of this RTL-SDR here, but I also was running Forgive me, I'll have to look at my notes here. We can go scan the FM bands here. So I'm just using the RTL-SDR. I installed the same packages over here. It's gathering some data there. We can go open and we can see some FM band that we are able to pick up a little bit better than that satellite. So it's working, it's real. And I can get these same exact things. I'm over here in my this Docker container that I have running Fedora. And I'm going to pull that same piece just for the RTL-SDR. It won't find the hardware this time. But you can see the application is running and it didn't have to rebuild anything. It pulled all these down from the existing package feeds. So I didn't have to have a compiler available to me to use this in this case. So kind of one last thing that I wanted to mention as part of this is this comes a little bit. My company supports Conan. Conan is actually part of my company, but we have now a new service that we're doing for the open source called Conan Center. We had Conan Center before, but now we have an automated build system that's tied to it. So if you publish your recipes into this repository you will then get your recipes built for Mac, Windows and Linux in a bunch of different configurations. So if it's a C++ project it will be built in about 160 different configurations made all available. So that's multiple versions of Windows Visual Studio that's multiple versions of whatever Mac is using, different GCC versions. It's not a CI system for testing your packages, but it can give you some insights and is my package actually building on Windows. That's, I know, for me a struggle. So that's there. And so we can take one quick look over here at like Zlib for instance is available inside of Conan Center and you can see there's 18 different Windows builds, 52 Linux builds and 12 macOS builds as well. So one of the reasons that I came to talk about this here is that I see on the mailing list the people who are complaining about I just want to build this, I don't care whether it's 3.7 or 3.8, I just want to do my project. Why are you making my life hard? There's a little bit of back and forth on there about everything and I know a bunch of people have been doing some really good work about, especially if we're going to radio packaging up for Debian and Fedora and Ubuntu multiple versions of it so that people can use it but you're still relying on these system libraries so still I feel like holding ourselves back in certain cases on this and especially when we look at the out of tree modules and stuff like that if we're able to actually package those things up in a smart way I think that this is a way that we could avoid this whole Pi Bombs custom system and save us a bunch of headache so I'm interested in exploring down that path if anybody else is interested so I'd love to see that come together and then one last thing, if this has sparked your interest in actually solving dependencies, not just talking about them there is a conference for this called Conan Days in Madrid in March, so if you want to hang out with the barbarians and learn about packaging there's a discount code and we'd be happy to talk about it more we have a bunch of people who are using this in industry as well as open source so any questions from people? I think you were talking about Flatpak so my understanding of Flatpak is that it's this kind of yeah he's asking about Flatpak versus Conan in terms of is it a base system image that you're layering to kind of it's not really a container but containerize your application, your files it's very different because here all it's doing is just changing how everything is linked together and keeping track of that structure so it's much lighter in a way but it also is more complex because of that so yeah, so let's see here where did I put this? here, right here so these are those options that I was talking about so see how I have here shared equals true so this is one of the most common features is shared versus static and being able to flip that flag on you can change that for you can either say globally for my build for my product or everything shared but you can also specify at a dependency level as well if you want yeah can you repeat the first part? a work? Volk, no, not yet this is something that I think is one of the the first things that I would like to see so one thing, so the question was we have LibVolk inside of Conan Center, we do not right now but it would be rather trivial to get in there the one thing I will say about something like LibVolk is you're normally targeting as many of your processors features as possible and so with that you need to specify so there's some stuff that's missing here you can create profiles that represent these with additional compiler flags that you want you could just say hey figure out what's on my machine but that's where the post your own copy of the package and your registry which you can do if you want to get all of the support from all the intrinsics and everything like that that are enabled so that was the first one and then you said there was a second half so if you package everything so that you're pointed at all of the all of your fines are using the correct and your target linkings are using the Conan package feature you will not be using any of your system libraries I want to be clear here you can start doing Conan without doing that if you can use your system ones Mr. Open Embedded over here is not happy those people using Ubuntu 14.04 so you can mix and match whatever you want but the ideal situation is you should be making it so that all the dependencies are packaged up you're running close on time but so there are defaults it will look at your local machine and generate a default profile for you so I'm building on a Mac so a lot of these features have been established here but you can build additional configuration profiles so this is where it's nice having the Conan center piece because I can see those configurations that were built for and I'm short on time here so or over so so you can see I just picked one of the random configurations that was built for Zlib so this one it was building version 8 for Linux and some other flags and stuff so this is one of Conan center has like I said for C++ something like 120 I think different build configurations that it will build against that cover kind of the common cases but you can I mean people use this also for building for Android, NDK and stuff like that so you can tweak those things as you wish to build and not every recipe will build on all these configurations like some of them you say this does not build in Windows maybe the developer just doesn't support Windows as something they're building so then you won't have those configurations