[cfe-dev] Building libcxx with Ninja

Chris Bieneman via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 18 11:20:38 PDT 2017


Those instructions for building libcxx are a bit out of date and incomplete.

If you are planning to develop and build libcxx you'll need a checkout and build of LLVM. That is required for running libcxx's tests. After you've built LLVM on your system, one of the generated tools is a program called llvm-config. When you run CMake for libcxx you need to set the CMake option "LLVM_CONFIG_PATH" to point to the llvm-config binary, and libcxx's build system should handle the rest. Libcxx is not tightly bound to LLVM, so when developing libcxx you will not need to update the LLVM sources frequently.

If you just want to build and use libcxx, specifying the LLVM_CONFIG_PATH or LLVM_PATH variables are not required, in the absence of an LLVM source and build tree libcxx will disable the testing functionality in the build, but everything else should work.

-Chris

> On Apr 18, 2017, at 8:35 AM, Nico Weber via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Erika: On some Linux distributions, if you want to use the distributions's package manager, you need to install package "ninja-build" since "ninja" is some ancient database iirc. See https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>
> 
> `ninja --help` should print something like this:
> $ ninja --help
> usage: ninja [options] [targets...]
> 
> if targets are unspecified, builds the 'default' target (see manual).
> 
> options:
>   --version  print ninja version ("1.7.2")
> 
>   -C DIR   change to DIR before doing anything else
>   -f FILE  specify input build file [default=build.ninja]
> 
>   -j N     run N jobs in parallel [default=10, derived from CPUs available]
>   -k N     keep going until N jobs fail [default=1]
>   -l N     do not start new jobs if the load average is greater than N
>   -n       dry run (don't run commands but act like they succeeded)
>   -v       show all command lines while building
> 
>   -d MODE  enable debugging (use -d list to list modes)
>   -t TOOL  run a subtool (use -t list to list subtools)
>     terminates toplevel options; further flags are passed to the tool
>   -w FLAG  adjust warnings (use -w list to list warnings)
> 
> On Tue, Apr 18, 2017 at 10:18 AM, Brian Cain via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> Bringing this thread back onto the list, looks like we went off list at some point.
>  
> On Apr 17, 2017 10:51 PM, "Erika Butler" <beneficii at gmail.com <mailto:beneficii at gmail.com>> wrote:
> It's version 2.3 of ninja. This is the latest I could find for Windows.
> 
> I can't find the cmake version, but it was built on April 10, 2017, so I think that's new enough.
> 
> 2017-04-17 20:46 GMT-07:00 Brian Cain <brian.cain at gmail.com <mailto:brian.cain at gmail.com>>:
> Not sure. Are you certain your version of ninja and cmake are new enough?
> 
> On Apr 17, 2017 10:38 PM, "Erika Butler" <beneficii at gmail.com <mailto:beneficii at gmail.com>> wrote:
> I added the Ninja directory to my PATH variable and reopened the admin Command Prompt. I changed CMAKE_MAKE_PROGRAM to this:
> 
> -DCMAKE_MAKE_PROGRAM=ninja
> 
> I executed the command again, Ninja still reported an error, now saying in ninja.exe.log:
> 
> usage: ninja [-h] [-f file [file ...]] [-l lineno [lineno ...]]
>              [-p project [project ...]] [--plugin plugin [plugin ...]]
>              [--loglevel loglevel] [--logfile logfile]
>              [file [file ...]]
> ninja: error: unrecognized arguments: --version
> 
> It seems cmake wants to pass a "--version" argument to its command to open ninja, which causes ninja to complain.
> 
> What can I do?
> 
> 
> My ninja version is 1.3.4 and when I run "ninja --version" it reports "1.3.4".  It does not give this error message.  When I run "ninja --help" it shows something very different from the help message you're showing here.
> 
> https://ninja-build.org/ <https://ninja-build.org/> claims that the latest version available is "The last Ninja release is v1.7.2, released 7 Nov 2016."  But you said you have version 2.3.
> 
> I think that you have another executable called "ninja" in your PATH.  Can you check it?  See if you get different results with binaries from here -- https://github.com/ninja-build/ninja/releases <https://github.com/ninja-build/ninja/releases>
> 
> -Brian
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170418/2b86748a/attachment.html>


More information about the cfe-dev mailing list