[Cs-dev] CMake
Date | 2010-07-23 15:43 |
From | Steven Yi |
Subject | [Cs-dev] CMake |
Hi All, Does anyone know much about CMake to know if it'd be feasible to use for Csound? (I think I heard Michael mentioning he has quite some experience with it.) The reason it is appealing to me at the moment is that it can generate project files for IDE's like XCode, Eclipse, etc. This would certainly make debugging and profiling a much simpler task (for me at least!). Anyone have any thoughts about it? Thanks! steven ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2010-07-23 17:05 |
From | Michael Gogins |
Subject | Re: [Cs-dev] CMake |
I have experience with many build systems including Microsoft project files, CodeBlocks project files, make, gmake, qmake, Ant, CMake, bjam, scons. It is an advantage of CMake that it creates project files, this is what we do where I work. I have also built directly using CMake at work.However, I prefer scons because I find it easier to create,. maintain, and use builds, especially across platforms. I have not found that I need actually need project files to debug or profile Csound. What is your specific situation? Regards, Mike On Fri, Jul 23, 2010 at 10:43 AM, Steven Yi |
Date | 2010-07-23 18:06 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Hi Michael, For myself, when I worked on Csound in the past, I would use Eclipse as a simple code editor just for syntax-highlighting, but would compile and use gdb and gprof from the commandline. I don't particularly enjoy doing gdb from the commandline and setting up things for gprof was always a pain, so I rarely used it. I use IDE's pretty much for all of my job work (Eclipse and XCode) and my personal projects (mostly Netbeans these days, for blue and RubyOnRails projects). Having a full project for Eclipse would be nice to take advantage of the entire CDT tools there. If I was working on Mac, I'd probably want to use XCode. Regardless, I find I simply work faster with IDE's than without. Having CTest support also looks interesting to me, though I am still reading up on CMake/CTest. As a sidenote, the current Sconstruct file has gotten a bit unruly in my opinion. There's some practices in the file that I think need to change, specifically the whole build by enabling a flag rather than automatically building if all dependencies are met. I'd also prefer if all of the source were organized under a src folder, all intermediary build artifacts were built into a build folder (object files, etc.), and all final build artifacts put into a dist folder. This kind of organization is a common setup in projects I see today across programming languages and build environments. I do like how SConstruct2 has used SConscript files to better modularize the project's build system. Is that being maintained today? Thanks! steven On Fri, Jul 23, 2010 at 12:05 PM, Michael Gogins |
Date | 2010-07-23 18:35 |
From | Michael Gogins |
Subject | Re: [Cs-dev] CMake |
Nobody is maintaining SConstruct2 as far as I know. In my opinion, it was a mistake. It would have been much better if the head version SConstruct had simply been incrementally improved. I believe that, as is all too often the case in software engineering, once something has been worked on for a while it has so much work invested in it that it becomes very difficult to just redo it from scratch -- but then the people who start the new project typically don't really see that until it's too late. I have seen this several times at work, to the tune of millions of dollars a pop. You are right about the unruliness of the current SConstruct. This needs to be fixed. One way to fix it is to introduce internal 'builder' functions along the lines of the ones that already exist in SCons itself. These would just be Python functions like makeCommand, makeObject, makeSharedObject, makeSharedLibrary, makePythonExtension, makeLuaExtension, etc. that would have sub-builders or cases for the different platforms and take a target name, location, and set of sources. We are sort of a quarter of the way already in that we have something more or less like this for certain types of targets. This can of course be done incrementally -- both by target, and by platform. I agree in principle with your directory suggestions as well but I'm not sure they are worth the trouble of changing CVS around. It is possible to get SCons to build in separate directories, to copy sources there, etc. For the same reason as with SConstruct2, I think changing to CMake might well be a mistake. Of course, if a CMake system suddenly turned up that was better than the SConstruct, I would adopt it. But it would have to build all the major targets, do the install, and work on all 3 major platforms first. I know that CMake works fine on Windows, Linux, and Solaris, but what about OS X? Regards, Mike On Fri, Jul 23, 2010 at 1:06 PM, Steven Yi |
Date | 2010-07-23 18:45 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Re: OSX, I can't say much as I'm just reading up on CMake now. I read the article about KDE's transition to CMake and how it worked for different Linux distros, then worked on OSX, and then on Windows, and found that encouraging, considering KDE is orders of magnitude bigger and more complex a project than Csound is. Again, the use of IDE's is the main reason why I'm interested in CMake. If that wasn't a goal, I'd be fine to stick with SCons and just fix it up. I'm going out of town this weekend (actually to NYC, perhaps we can have brunch together if you're in town! I'll email you off list), but will start experimenting with a CMake build next week as a sort of research task. Thanks! steven On Fri, Jul 23, 2010 at 1:35 PM, Michael Gogins |
Date | 2010-07-23 18:55 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] CMake |
portmidi uses CMake, but I agree with Michael Gogins, i would not like to change now. Why don't you ask the Scons developers to add an Eclipse target? They already support visual studio. Victor On 23 Jul 2010, at 18:45, Steven Yi wrote: > Re: OSX, I can't say much as I'm just reading up on CMake now. I read > the article about KDE's transition to CMake and how it worked for > different Linux distros, then worked on OSX, and then on Windows, and > found that encouraging, considering KDE is orders of magnitude bigger > and more complex a project than Csound is. > > Again, the use of IDE's is the main reason why I'm interested in > CMake. If that wasn't a goal, I'd be fine to stick with SCons and > just fix it up. > > I'm going out of town this weekend (actually to NYC, perhaps we can > have brunch together if you're in town! I'll email you off list), but > will start experimenting with a CMake build next week as a sort of > research task. > > Thanks! > steven > > On Fri, Jul 23, 2010 at 1:35 PM, Michael Gogins > |
Date | 2010-07-23 18:57 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] CMake |
By the way: http://www.scons.org/wiki/IDEIntegration#head-479b0cf4e01c9fea275a1cdb398b73515e6fce7d On 23 Jul 2010, at 18:45, Steven Yi wrote: > Re: OSX, I can't say much as I'm just reading up on CMake now. I read > the article about KDE's transition to CMake and how it worked for > different Linux distros, then worked on OSX, and then on Windows, and > found that encouraging, considering KDE is orders of magnitude bigger > and more complex a project than Csound is. > > Again, the use of IDE's is the main reason why I'm interested in > CMake. If that wasn't a goal, I'd be fine to stick with SCons and > just fix it up. > > I'm going out of town this weekend (actually to NYC, perhaps we can > have brunch together if you're in town! I'll email you off list), but > will start experimenting with a CMake build next week as a sort of > research task. > > Thanks! > steven > > On Fri, Jul 23, 2010 at 1:35 PM, Michael Gogins > |
Date | 2010-07-23 18:59 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
I tried this plugin many years ago when it first came out and it was very immature and did not work at all. It has gone unmaintained since then, so it's not an option. Regardless, I'm interested to give it a try with CMake. If it works out and can be a drop-in replacement that works everywhere, great, if not, no big deal, as I'm interested to learn CMake anyways. :) On Fri, Jul 23, 2010 at 1:57 PM, Victor Lazzarini |
Date | 2010-07-23 21:15 |
From | andy fillebrown |
Subject | Re: [Cs-dev] CMake |
I am also interested in learning CMake and will be willing to help with a CMake build for Csound if it means I can use it in an IDE. Currently, I'm using a minimal dependency qmake build, which I'm in the process of cleaning up to make available. It's only meant for Windows, but it works well with the QtCreator IDE, which is fantastic, imo. Regardless, I've spent a lot of time looking over the SConstruct in recent weeks which may prove beneficial if the build system is switched to CMake. Cheers, ~ andy.f On Fri, Jul 23, 2010 at 1:59 PM, Steven Yi |
Date | 2010-07-29 17:46 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] CMake |
Attachments | signature.asc None None |
On 23/07/10 13:06, Steven Yi wrote: > As a sidenote, the current Sconstruct file has gotten a bit unruly in > my opinion. There's some practices in the file that I think need to > change, specifically the whole build by enabling a flag rather than > automatically building if all dependencies are met. Well, a while ago I argued in favor of precisely this behaviour, as it makes it easier for packagers to be deterministic about automated package builds on uncontrolled (by the maintainer) machines, like it happens in the debian buildd network. In fact, in SContruct2 I made it an error to pass buildSomething=1 and not have the headers installed instead of silently not building the something, precisely for this reason. > I'd also prefer > if all of the source were organized under a src folder, all > intermediary build artifacts were built into a build folder (object > files, etc.), and all final build artifacts put into a dist folder. > This kind of organization is a common setup in projects I see today > across programming languages and build environments. > > I do like how SConstruct2 has used SConscript files to better > modularize the project's build system. Is that being maintained > today? Unfortunately not. I started it as a project to modularize SConstruct and make it easier for packagers such as myself to build csound, but I clearly could not keep up with it. First, I got complicated by university taking away most of my time. Also, at some point I asked for testing, and the fact that scons puts the result files in the SConscript directory was not well received (particularly because it places the plugins, the shared lib and the csound executable in different locations, making it hard for csound development). And I could not figure out how to tweak that in scons. As for the CMake suggestion, I did that a while ago when I was first taking over csound packaging in debian. I hate scons so much that my first approach at packaging csound was to replace the build system (hah, rookie mistake :p). I even mailed this list with a proof-of-concept build system (incomplete, but working), but it was not well received at the time, due to the fact that scons is working, and a cmake implementation is not (yet). That is when I tried making SContruct a sane piece of code by copying it over as SConstruct2 and slowly moving things away into SConscript files, since it seemed a faster way to get a fully functional build script, but I failed for the above reasons. For what it is worth, I fully support moving away from scons and into cmake. I can even try helping out. -- Saludos, Felipe Sateler |
Date | 2010-07-29 18:21 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Hi Felipe, Andy Fillebrown and I have started working with CMake but we're both still learning it. It'd be nice to get your involvement. I setup a private repository on bitbucket.org (uses mercurial for source control) so that Andy and I can work on this until it's ready for more general testing. If you're interested (or anyone else), sign up on bitbucket.org and email me your username and I will add it to the read/write access control list. Thanks! steven On Thu, Jul 29, 2010 at 12:46 PM, Felipe Sateler |
Date | 2010-07-29 18:42 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] CMake |
The only problem I see with this is that while CMake might be better I'm not sure whether I look forward to having to learn it in order to work in Csound development. I would prefer to keep using scons which I know fairly well by now. Victor On 29 Jul 2010, at 18:21, Steven Yi wrote: > Hi Felipe, > > Andy Fillebrown and I have started working with CMake but we're both > still learning it. It'd be nice to get your involvement. I setup a > private repository on bitbucket.org (uses mercurial for source > control) so that Andy and I can work on this until it's ready for more > general testing. If you're interested (or anyone else), sign up on > bitbucket.org and email me your username and I will add it to the > read/write access control list. > > Thanks! > steven > > > On Thu, Jul 29, 2010 at 12:46 PM, Felipe Sateler > |
Date | 2010-07-29 18:46 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] CMake |
Attachments | signature.asc None None |
My account is fsateler. I have never used mercurial, but I regularly use git. I suspect both are similar, but I might need some handholding at first. How do I checkout your private repository? On 29/07/10 13:21, Steven Yi wrote: > Hi Felipe, > > Andy Fillebrown and I have started working with CMake but we're both > still learning it. It'd be nice to get your involvement. I setup a > private repository on bitbucket.org (uses mercurial for source > control) so that Andy and I can work on this until it's ready for more > general testing. If you're interested (or anyone else), sign up on > bitbucket.org and email me your username and I will add it to the > read/write access control list. > > Thanks! > steven > > > On Thu, Jul 29, 2010 at 12:46 PM, Felipe Sateler |
Date | 2010-07-29 18:49 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
I've added you on bitbucket.org and will email you offlist the site info. Thanks! On Thu, Jul 29, 2010 at 1:46 PM, Felipe Sateler |
Date | 2010-07-29 22:21 |
From | john ffitch |
Subject | Re: [Cs-dev] CMake |
>>>>> "Victor" == Victor Lazzarini |
Date | 2010-07-29 23:15 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Well, I'm certainly not interested to do work that's not necessary as much as anyone else. However the interest to look at CMake is because SCons is not at all capable of doing what I'm interested in for IDE Integration. If Scons could do it, then I wouldn't even bother with this. It seems there is interest beyond just me as well. We'll give it a try and see how it turns out. On Thu, Jul 29, 2010 at 1:42 PM, Victor Lazzarini |
Date | 2010-07-29 23:25 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] CMake |
But the real question is: are we talking here about substituting scons and thus requiring some of us to learn a different build system? I'm not sure I like that idea. Victor On 29 Jul 2010, at 23:15, Steven Yi wrote: > Well, I'm certainly not interested to do work that's not necessary as > much as anyone else. However the interest to look at CMake is because > SCons is not at all capable of doing what I'm interested in for IDE > Integration. If Scons could do it, then I wouldn't even bother with > this. > > It seems there is interest beyond just me as well. We'll give it a > try and see how it turns out. > > > On Thu, Jul 29, 2010 at 1:42 PM, Victor Lazzarini > |
Date | 2010-07-29 23:40 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Well, I imagine that's a possibility. I figure it won't hurt to at least take a look and give it a try; who knows, maybe you'll find it interesting too. :) First we have to get it working, then from there we can look at something functional and evaluate from there. On 7/29/10, Victor Lazzarini |
Date | 2010-07-30 00:52 |
From | Michael Gogins |
Subject | Re: [Cs-dev] CMake |
I repeat, you do not need a complete build system in order to have a project to enable easy debugging. You can create a project specifically for debugging instead. This is true in all IDEs that I have used. If you do get CMake working for everything and it is roughly as easy to use and maintain as SCons, however, I would support a change. But please re-read the previous paragraph. Regards, Mike On Thu, Jul 29, 2010 at 10:40 PM, Steven Yi |
Date | 2010-07-30 01:21 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Yes, I'm well aware that a project can be setup to debug. I've tried doing so in Eclipse and Netbeans and felt doing so was not satisfactory. Considering I'm often on a number of machines with different OS's, being able to use a tool like CMake to create projects for IDE's is much preferred than trying to hand setup these projects. If it works and can work with multiple IDE's and we don't have to maintain separate projects, all the better. Note: beyond debugging, I am interested in the IDE being able to fully work with the code. (Refactoring tools, class browsers, source code linking, auto-suggest, etc.) I never found much luck in trying to do this by hand. My early impression is that beyond IDE project file generation, the encouragement of out-of-source builds will be extremely useful. It will allow easily building float or double, debug or release in parallel as they can all be built to separate folders. This solves another big annoyance of having multiple copies of CVS checked out to maintain a debug and release build. Anyways, these are all interests and notes at this point. I'll be continuing to research to see how it all works out. On 7/29/10, Michael Gogins |
Date | 2010-07-30 04:22 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Just a sidenote, I was able to compile libcsound and the csound executable just now with CMake via Eclipse. Of course, there's still quite a bit to do, but I'm finding it encouraging. I also found information on CPack (http://www.cmake.org/Wiki/CMake:CPackPackageGenerators) which supports building NSIS installers, OSX Packagemaker, RPM, DEB, and various archive formats. On Thu, Jul 29, 2010 at 8:21 PM, Steven Yi |
Date | 2010-07-30 20:48 |
From | Michael Gogins |
Subject | Re: [Cs-dev] CMake |
Well, I wouldn't spend my time doing this, but if you get it to work, I can see the advantages. Good luck! I hope you will be testing on all 3 platforms as you go along. Best, Mike On Thu, Jul 29, 2010 at 11:22 PM, Steven Yi |
Date | 2010-07-30 21:43 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
Yes, we're testing on platforms as we can. Felipe just got a build working on Linux and I just tried building with XCode on OSX (project generated correctly, but I need to add some of the preprocessor symbols that the source is expecting, should be fixed up tonight). One other benefit I'm finding is that building with CMake generated Makefiles seems to run a lot faster than building with SCons. I haven't taken any metrics, but just from testing it seems to be the case. On Fri, Jul 30, 2010 at 3:48 PM, Michael Gogins |
Date | 2010-07-30 22:27 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] CMake |
But the major problem I see is all of us having to learn CMake, yet another language. I'm not really keen on this, as it will not make any difference to my workflow (for instance, I don't use IDEs). I don't have any problems with a parallel CMake project, but I don't think I will vote on a leaving scons (if it comes to a vote). Victor On 30 Jul 2010, at 21:43, Steven Yi wrote: > Yes, we're testing on platforms as we can. Felipe just got a build > working on Linux and I just tried building with XCode on OSX (project > generated correctly, but I need to add some of the preprocessor > symbols that the source is expecting, should be fixed up tonight). > > One other benefit I'm finding is that building with CMake generated > Makefiles seems to run a lot faster than building with SCons. I > haven't taken any metrics, but just from testing it seems to be the > case. > > On Fri, Jul 30, 2010 at 3:48 PM, Michael Gogins > |
Date | 2010-07-30 22:33 |
From | Michael Gogins |
Subject | Re: [Cs-dev] CMake |
An alternative is for the people like Steven who want an IDE system for Csound to contribute a builder that will do that for SCons. I have no idea how hard that is - but I am pretty sure that creating a complete CMake build system for Csound that really builds everything on all platforms is pretty hard. Regards, Mike On Fri, Jul 30, 2010 at 5:27 PM, Victor Lazzarini |
Date | 2010-07-31 00:14 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] CMake |
Attachments | signature.asc None None |
The speed difference will most likely decrease as we add the tests for the different optional dependencies. Rebuilds, however, should be much faster with cmake than with scons. As for contributing a builder to scons... Last time I looked into contributing something to scons (actually, I was looking at somebody else contributing), they are really short on manpower, so what they really wanted was more people to maintain the software instead of a new feature that none of the current devs used. On 30/07/10 16:43, Steven Yi wrote: > Yes, we're testing on platforms as we can. Felipe just got a build > working on Linux and I just tried building with XCode on OSX (project > generated correctly, but I need to add some of the preprocessor > symbols that the source is expecting, should be fixed up tonight). > > One other benefit I'm finding is that building with CMake generated > Makefiles seems to run a lot faster than building with SCons. I > haven't taken any metrics, but just from testing it seems to be the > case. > > On Fri, Jul 30, 2010 at 3:48 PM, Michael Gogins > |
Date | 2010-07-31 00:22 |
From | Steven Yi |
Subject | Re: [Cs-dev] CMake |
That's fine and I think it's better to be a little conservative about this until it gets to a point where you can test it out see if you like it yourself. If it ends up being very useful to me and not used by others, I will likely maintain it for my own usage and keep it up to date in parallel. But I'd just ask to give it some time and wait to reserve judgement until you have a chance to check it out. Just as a status, with the current basic Cmake build, libcsound and csound are now compiling on OSX, Windows, and Linux. I was able to create Eclipse, XCode, and commandline Makefile builds from the CMake file. I have not tested CodeBlocks generation but my assumption at this point is that it would work fine as the issues have been more about platforms rather than IDE's. On Fri, Jul 30, 2010 at 5:27 PM, Victor Lazzarini |