Re: [cmake-developers] [CMake] Visual Studio - Ninja Generator
James Johnston wrote: >> > it would be useful to have Visual Studio available as an "Extra" CMake >> > generator. For example, specification of "Visual Studio 2015 - Ninja" >> >> This functionality sounds reasonable but the name of the extra/generator >> pair looks funny when spelled out that way. We should consider having >> another way to specify the extra generator. > > This name is consistent with the other extra generators: ... however the design is not. The 'extra generators' do their generation after the 'real' makefile or ninja generator. Your proposal seems to be something different design-wise. From what I understand, you are proposing something which would need to do different things during the 'real' generate. In terms of name though, it might not matter that IDE and non-IDE 'extra' generators are implemented in completely different ways. > But I agree it is just confusing at this point. Maybe this format could > be deprecated in favor of a new cmake.exe switch to specify an extra > generator. Perhaps. It seems Xcode+Ninja could also be a valid pairing. Thanks, Steve. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [cmake-developers] [CMake] Visual Studio - Ninja Generator
> -Original Message- > From: cmake-developers [mailto:cmake-developers-boun...@cmake.org] > On Behalf Of Brad King > Sent: Wednesday, September 09, 2015 15:00 > To: cmake-developers@cmake.org > Subject: Re: [cmake-developers] [CMake] Visual Studio - > Ninja Generator > > On 09/02/2015 03:34 PM, James Johnston wrote: > > useful if the Visual Studio generators in CMake were refactored > > somewhat > > Even without the C# motivation I think factoring out a "MSBuild" generator > infrastructure internally will be useful. Currently we call it "VS 10" > because it happened to be the first version to use MSBuild project files. > Are you proposing to have some kind of internal object model for the > MSBuild project files to separate their construction from the actual > generation? Right, something like that. Another motivation: if somebody ever wanted to write a generator for Embarcadero C++ Builder projects... guess what format the project files are in... MSBuild... this otherwise has nothing to do with VStudio... Again, not something I'm working on right now but just putting some ideas out there. :) > > > it would be useful to have Visual Studio available as an "Extra" CMake > > generator. For example, specification of "Visual Studio 2015 - Ninja" > > This functionality sounds reasonable but the name of the extra/generator > pair looks funny when spelled out that way. We should consider having > another way to specify the extra generator. This name is consistent with the other extra generators: http://www.cmake.org/cmake/help/v3.3/manual/cmake-generators.7.html#id12 "[Extra] generator names have the form - ." But I agree it is just confusing at this point. Maybe this format could be deprecated in favor of a new cmake.exe switch to specify an extra generator. Best regards, James Johnston -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [cmake-developers] [CMake] Visual Studio - Ninja Generator
On 09/02/2015 03:34 PM, James Johnston wrote: > useful if the Visual Studio generators in CMake were refactored somewhat Even without the C# motivation I think factoring out a "MSBuild" generator infrastructure internally will be useful. Currently we call it "VS 10" because it happened to be the first version to use MSBuild project files. Are you proposing to have some kind of internal object model for the MSBuild project files to separate their construction from the actual generation? > it would be useful to have Visual Studio available as an "Extra" CMake > generator. For example, specification of "Visual Studio 2015 - Ninja" This functionality sounds reasonable but the name of the extra/generator pair looks funny when spelled out that way. We should consider having another way to specify the extra generator. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [CMake] Visual Studio - Ninja Generator
Hi, The problem with /MP in cl.exe, /CGTHREADS in link.exe, and /MAXCPUCOUNT in msbuild.exe is they don't communicate with each other, potentially leading to massive over/undersubscription of the system. I would love it if Microsoft could get this mishmash cleaned up somehow so they can all communicate and not oversubscribe the system. (Out-of-the-box, Visual C++ ought to have this straightened out). In theory it would be faster than Ninja because the /MP switch reduces forking overhead and fixed overhead initialization cl.exe by batch building. In the meantime, Ninja seems faster in practice, because it can properly avoid oversubscription with building individual C++ files and entire projects in parallel (whereas cl.exe and msbuild.exe cannot). (One problem with link.exe /CGTHREADS though is that Ninja needs to be told how many threads link.exe will actually use, so that Ninja doesn't oversubscribe. I'm not aware of a way to make Ninja do that though. You can use pools to restrict to one link at a time, but moderate oversubscription will still happen with the concurrent cl.exe instances.) Best regards, James Johnston From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Hendrik Sattler Sent: Monday, August 31, 2015 15:49 To: Guillaume Dumont; cmake@cmake.org Subject: Re: [CMake] Visual Studio - Ninja Generator Hi, did you really enable parallel compiling in VS with /MP24 or the like? Note that using devenv to build uses the number from the IDE user settings but using msbuild needs a command line option. Else just create a custom target that calls cmake for ninja and afterwards ninja itself in yet another build tree. you can limit the creation of that target to if(MSVC_IDE). HS Am 31. August 2015 16:35:01 MESZ, schrieb Guillaume Dumont <dumont.guilla...@gmail.com>: Hi all, I would like to know what kind of effort would it take to generate a Visual Studio generator that bypasses the normal MSBuild build and uses Ninja instead. I have been working on different projects which build much faster with ninja than MSBuild (several orders of magnitude on a machine with 24 cores). Still I like to use the Visual Studio environment to use the debugger. Using ninja is especially useful for projects with a lot of CUDA files which are built sequentially for every target using MSVS. I would like to contribute but I don't really know where to start and if such an effort already exists. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Visual Studio - Ninja Generator
h C# project - even when using non-VS generators like Ninja. The Ninja build rule for a C# project would just be to invoke MSBuild.exe and build that one project. (Only generate projects, not solutions.) But this requires the ability for a CMake language to invoke the MSBuild-generating code inside CMake to spit out a Visual Studio project for each C# target. Benefit: now CMake doesn't reimplement undocumented behavior of Microsoft's MSBuild targets; we just use them directly as a black box. Best regards, James Johnston From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Guillaume Dumont Sent: Monday, August 31, 2015 16:49 To: Gonzalo Cc: cmake@cmake.org Subject: Re: [CMake] Visual Studio - Ninja Generator @Hendrik Sattler I have not experimented with the /MP flag that much, but this won't solve my problem when the project contains a lot of CUDA files. The /MP flag as not effect there. Yes I could indeed create a custom build target and create additional build trees to build using ninja in there but this is suboptimal in my opinion. @Gonzalo Yes this is precisely what I do but then you only get the ninja build files. No solution for debugging etc. My question is more about the difficulty of creating a new generator that makes the use of ninja as transparent as possible to the user instead of writing custom CMake code to do this in my own projects. On Mon, Aug 31, 2015 at 12:29 PM, Gonzalo <ggarr...@gmail.com> wrote: s it has changed names a couple of times). That shoul -- Guillaume Dumont = dumont.guilla...@gmail.com -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [cmake-developers] [CMake] Visual Studio - Ninja Generator
h C# project - even when using non-VS generators like Ninja. The Ninja build rule for a C# project would just be to invoke MSBuild.exe and build that one project. (Only generate projects, not solutions.) But this requires the ability for a CMake language to invoke the MSBuild-generating code inside CMake to spit out a Visual Studio project for each C# target. Benefit: now CMake doesn't reimplement undocumented behavior of Microsoft's MSBuild targets; we just use them directly as a black box. Best regards, James Johnston From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Guillaume Dumont Sent: Monday, August 31, 2015 16:49 To: Gonzalo Cc: cm...@cmake.org Subject: Re: [CMake] Visual Studio - Ninja Generator @Hendrik Sattler I have not experimented with the /MP flag that much, but this won't solve my problem when the project contains a lot of CUDA files. The /MP flag as not effect there. Yes I could indeed create a custom build target and create additional build trees to build using ninja in there but this is suboptimal in my opinion. @Gonzalo Yes this is precisely what I do but then you only get the ninja build files. No solution for debugging etc. My question is more about the difficulty of creating a new generator that makes the use of ninja as transparent as possible to the user instead of writing custom CMake code to do this in my own projects. On Mon, Aug 31, 2015 at 12:29 PM, Gonzalo <ggarr...@gmail.com> wrote: s it has changed names a couple of times). That shoul -- Guillaume Dumont = dumont.guilla...@gmail.com -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [CMake] Visual Studio - Ninja Generator
Hi, did you really enable parallel compiling in VS with /MP24 or the like? Note that using devenv to build uses the number from the IDE user settings but using msbuild needs a command line option. Else just create a custom target that calls cmake for ninja and afterwards ninja itself in yet another build tree. you can limit the creation of that target to if(MSVC_IDE). HS Am 31. August 2015 16:35:01 MESZ, schrieb Guillaume Dumont: >Hi all, > >I would like to know what kind of effort would it take to generate a >Visual >Studio generator that bypasses the normal MSBuild build and uses Ninja >instead. I have been working on different projects which build much >faster >with ninja than MSBuild (several orders of magnitude on a machine with >24 >cores). Still I like to use the Visual Studio environment to use the >debugger. Using ninja is especially useful for projects with a lot of >CUDA >files which are built sequentially for every target using MSVS. > >I would like to contribute but I don't really know where to start and >if >such an effort already exists. > >-- >Guillaume Dumont >= >dumont.guilla...@gmail.com > > > > >-- > >Powered by www.kitware.com > >Please keep messages on-topic and check the CMake FAQ at: >http://www.cmake.org/Wiki/CMake_FAQ > >Kitware offers various services to support the CMake community. For >more information on each offering, please visit: > >CMake Support: http://cmake.org/cmake/help/support.html >CMake Consulting: http://cmake.org/cmake/help/consulting.html >CMake Training Courses: http://cmake.org/cmake/help/training.html > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/cmake -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Visual Studio - Ninja Generator
El 31/08/15 a las 11:35, Guillaume Dumont escribió: Hi all, Using ninja is especially useful for projects with a lot of CUDA files which are built sequentially for every target using MSVS. I would like to contribute but I don't really know where to start and if such an effort already exists. Hi, Guillaume. Currently cmake offers support for Ninja Makefiles. You need to set up your build environment by running the microsoft setenv.bat file (or whatever is called in your version of msdev, as it has changed names a couple of times). That should allow cmake to find the proper compiler. Then, if you specify: $ cd $ mkdir ninja_build $ cd ninja_build $ cmake .. -G Ninja You will get ninja files for your project. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Visual Studio - Ninja Generator
@Hendrik Sattler I have not experimented with the /MP flag that much, but this won't solve my problem when the project contains a lot of CUDA files. The /MP flag as not effect there. Yes I could indeed create a custom build target and create additional build trees to build using ninja in there but this is suboptimal in my opinion. @Gonzalo Yes this is precisely what I do but then you only get the ninja build files. No solution for debugging etc. My question is more about the difficulty of creating a new generator that makes the use of ninja as transparent as possible to the user instead of writing custom CMake code to do this in my own projects. On Mon, Aug 31, 2015 at 12:29 PM, Gonzalowrote: > s it has changed names a couple of times). That shoul -- Guillaume Dumont = dumont.guilla...@gmail.com -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] Visual Studio - Ninja Generator
Hi all, I would like to know what kind of effort would it take to generate a Visual Studio generator that bypasses the normal MSBuild build and uses Ninja instead. I have been working on different projects which build much faster with ninja than MSBuild (several orders of magnitude on a machine with 24 cores). Still I like to use the Visual Studio environment to use the debugger. Using ninja is especially useful for projects with a lot of CUDA files which are built sequentially for every target using MSVS. I would like to contribute but I don't really know where to start and if such an effort already exists. -- Guillaume Dumont = dumont.guilla...@gmail.com -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake