You are correct, sir. Everything works much better if I run CMake and Ninja from a "developer command prompt." I displayed the path and almost fell off my chair laughing. The road to hell is paved with environment variable entries. Two questions. 1. Building with Visual Studio created build/release/bin. Building with Ninja created build/bin (no release directory). Does that make sense? (I have -DCMAKE_BUILD_TYPE=Release on the cmake command.) 2. The first build attempt failed because the existing TableGen Language Reference has multiple instances of the production 'SimpleValue', which produces warnings from Sphinx. I fixed that by adding -DSPHINX_WARNINGS_AS_ERRORS:BOOL=OFF to the cmake command. Does the official build do that, too? I searched all the CMakeLists files but didn't find any use of that option. At 8/8/2020 09:48 PM, David Blaikie wrote:>On Sat, Aug 8, 2020 at 5:27 PM Paul C. Anagnostopoulos ><paul at windfall.com> wrote: >> >> Sigh. I ask for your indulgence yet again. >> >> I installed Ninja and deleted my old build tree. When I run CMake now, I'm told that it can't find the compilers and assembler. So, of course, I need to put a compiler toolset on my path. I tried MinGW but was instantly reminded that it doesn't have localtime_s. So I tried to find the Visual Studio binaries and located four different directories. I added what I thought was the correct one to my path. CMake found the compiler, but it failed to compile CMake's test. > >I /think/ you're probably best using a Visual Studio shell - I /think/ >you want to use a command prompt like this: >https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs >that sets up everything right in the PATH. > >> >> Is anyone running Ninja with Visual Studio who might have a suggestion? I can't find anything in "Building LLVM with CMake." I've attached the CMake output below.
On Sun, Aug 9, 2020 at 8:03 AM Paul C. Anagnostopoulos <paul at windfall.com> wrote:> > You are correct, sir. Everything works much better if I run CMake and Ninja from a "developer command prompt." I displayed the path and almost fell off my chair laughing. The road to hell is paved with environment variable entries. > > Two questions. > > 1. Building with Visual Studio created build/release/bin. Building with Ninja created build/bin (no release directory). Does that make sense? (I have -DCMAKE_BUILD_TYPE=Release on the cmake command.)sounds plausible to me that different build systems may require or prefer different layouts - though I have no specific knowledge> 2. The first build attempt failed because the existing TableGen Language Reference has multiple instances of the production 'SimpleValue', which produces warnings from Sphinx. I fixed that by adding -DSPHINX_WARNINGS_AS_ERRORS:BOOL=OFF to the cmake command. Does the official build do that, too? I searched all the CMakeLists files but didn't find any use of that option.Not sure. I guess some buildbots probably build with it on/I've certainly seen some folks commit follow-up/cleanup patches to try to keep the Sphinx warning-clean.> > > At 8/8/2020 09:48 PM, David Blaikie wrote: > >On Sat, Aug 8, 2020 at 5:27 PM Paul C. Anagnostopoulos > ><paul at windfall.com> wrote: > >> > >> Sigh. I ask for your indulgence yet again. > >> > >> I installed Ninja and deleted my old build tree. When I run CMake now, I'm told that it can't find the compilers and assembler. So, of course, I need to put a compiler toolset on my path. I tried MinGW but was instantly reminded that it doesn't have localtime_s. So I tried to find the Visual Studio binaries and located four different directories. I added what I thought was the correct one to my path. CMake found the compiler, but it failed to compile CMake's test. > > > >I /think/ you're probably best using a Visual Studio shell - I /think/ > >you want to use a command prompt like this: > >https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs > >that sets up everything right in the PATH. > > > >> > >> Is anyone running Ninja with Visual Studio who might have a suggestion? I can't find anything in "Building LLVM with CMake." I've attached the CMake output below. >
On Sun, Aug 9, 2020 at 11:04 AM Paul C. Anagnostopoulos via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > 2. The first build attempt failed because the existing TableGen Language Reference has multiple instances of the production 'SimpleValue', which produces warnings from Sphinx. I fixed that by adding -DSPHINX_WARNINGS_AS_ERRORS:BOOL=OFF to the cmake command. Does the official build do that, too? I searched all the CMakeLists files but didn't find any use of that option. >I ran into the same issue (on Ubuntu) and already filed an issue: https://bugs.llvm.org/show_bug.cgi?id=47062
On 09/08/2020 16:00, Paul C. Anagnostopoulos via llvm-dev wrote:> > 1. Building with Visual Studio created build/release/bin. Building with Ninja created build/bin (no release directory). Does that make sense? (I have -DCMAKE_BUILD_TYPE=Release on the cmake command.) >Yes. CMake's Visual Studio generators are multiconfig, which means that you specify the build type (Release vs Debug etc) when _building_. Ninja, by default, is single-config (i.e. you specify build type when _configuring_ with CMake). You can check your generator via CMake's GENERETOR_IS_MULTICONFIG (https://cmake.org/cmake/help/v3.18/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html). Also, recently CMake added support for multi-config builds for Ninja: https://cmake.org/cmake/help/v3.18/generator/Ninja%20Multi-Config.html -Andrzej
I have separate build directories Ninja Debug and Ninja Release and another "build" directory for Visual Studio. I build in a Ninja directory. I never build in Visual Studio. My Visual Studio directory is exclusively for project and solution files to make navigating through the code work well in the IDE. To debug in Visual Studio, I open the project properties for the executable I want to debug and point at the appropriate executable in one of the Ninja directories. Occasionally, it's worth regenerating the VS projects and solutions to account for new, moved, and removed files. But then you have to remember to update the project properties again. I have a stupid batch file that lets me (re)create any of my build directories and runs Cmake with the appropriate generators. A "Visual Studio command prompt" is just a normal command prompt that has executed `vcvarsall.bat`. That batch file adds a ridiculous number of things to PATH and other environment variables--almost certainly more than is necessary--but I haven't bothered to figure which bits can be eliminated. I made two shortcuts for launching command prompts that set up their environment (which includes calling vcvarsall.bat) for one particular type of build. So my general pattern is to browse and edit in Visual Studio, save all, run ninja in one of my customized command prompts, debug in Visual Studio, repeat. I have yet another command prompt set up for git. There are probably lots of ways to handle LLVM on Windows with Visual Studio. Some of those may be better than mine, but mine has worked well for me for a while. On Mon, Aug 10, 2020 at 3:05 AM Andrzej Warzynski via llvm-dev < llvm-dev at lists.llvm.org> wrote:> > > On 09/08/2020 16:00, Paul C. Anagnostopoulos via llvm-dev wrote: > > > > > 1. Building with Visual Studio created build/release/bin. Building with > Ninja created build/bin (no release directory). Does that make sense? (I > have -DCMAKE_BUILD_TYPE=Release on the cmake command.) > > > > Yes. CMake's Visual Studio generators are multiconfig, which means that > you specify the build type (Release vs Debug etc) when _building_. > Ninja, by default, is single-config (i.e. you specify build type when > _configuring_ with CMake). > > You can check your generator via CMake's GENERETOR_IS_MULTICONFIG > ( > https://cmake.org/cmake/help/v3.18/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html). > > Also, recently CMake added support for multi-config builds for Ninja: > https://cmake.org/cmake/help/v3.18/generator/Ninja%20Multi-Config.html > > -Andrzej > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200810/e1eef5e0/attachment.html>