Building libcxx with Ninja

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Building libcxx with Ninja

Robinson, Paul via cfe-dev
I'm trying to build libcxx with Ninja, but I don't understand what this is supposed to be:

 -DLLVM_PATH=/path/to/llvm/tree

I found that here:


What LLVM directory can I find the LLVM tree in? I'm using Windows 10.

Thanks

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building libcxx with Ninja

Robinson, Paul via cfe-dev
I believe LLVM_PATH should point to the llvm/ directory at the root of the repository.  The section you're citing is listed as "It is sometimes beneficial to build outside of the LLVM tree."  Are you sure you want to do that?

The "natural" organization (if there is such a thing) is to put the llvm repo at the source root, and store libcxx and/or libcxxabi in llvm/projects/.  If this is the case you don't need to specify LLVM_PATH.  If you followed the steps in "Getting Started" http://libcxx.llvm.org/docs/BuildingLibcxx.html#getting-started then in step 4 where you would've done "make cxx" you can do "ninja cxx" instead.




On Mon, Apr 17, 2017 at 7:43 PM, Erika Butler via cfe-dev <[hidden email]> wrote:
I'm trying to build libcxx with Ninja, but I don't understand what this is supposed to be:

 -DLLVM_PATH=/path/to/llvm/tree

I found that here:


What LLVM directory can I find the LLVM tree in? I'm using Windows 10.

Thanks

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




--
-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building libcxx with Ninja

Robinson, Paul via cfe-dev
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" <[hidden email]> 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 <[hidden email]>:
Not sure. Are you certain your version of ninja and cmake are new enough?

On Apr 17, 2017 10:38 PM, "Erika Butler" <[hidden email]> 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/ 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

-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building libcxx with Ninja

Robinson, Paul via cfe-dev
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

`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 <[hidden email]> 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" <[hidden email]> 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 <[hidden email]>:
Not sure. Are you certain your version of ninja and cmake are new enough?

On Apr 17, 2017 10:38 PM, "Erika Butler" <[hidden email]> 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/ 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

-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building libcxx with Ninja

Robinson, Paul via cfe-dev
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 <[hidden email]> 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

`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 <[hidden email]> 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" <[hidden email]> 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 <[hidden email]>:
Not sure. Are you certain your version of ninja and cmake are new enough?

On Apr 17, 2017 10:38 PM, "Erika Butler" <[hidden email]> 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/ 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

-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building libcxx with Ninja

Robinson, Paul via cfe-dev

On Apr 18, 2017, at 11:20 AM, Chris Bieneman via cfe-dev <[hidden email]> wrote:

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.


It is checking out libc++ and lit (`svn checkout http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit`), then run cmake, and the tests can be ran with `python path/to/lit/lit.py -v --show-xfail --show-unsupported $WORKSPACE/build/test`

I have a patch in review to run the tests against a pre-built libc++.

— 
Mehdi



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 <[hidden email]> 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

`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 <[hidden email]> 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" <[hidden email]> 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 <[hidden email]>:
Not sure. Are you certain your version of ninja and cmake are new enough?

On Apr 17, 2017 10:38 PM, "Erika Butler" <[hidden email]> 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/ 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

-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building libcxx with Ninja

Robinson, Paul via cfe-dev
In reply to this post by Robinson, Paul via cfe-dev
On Tue, Apr 18, 2017 at 5:35 PM, Nico Weber via cfe-dev
<[hidden email]> 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

... or a Python IDE : http://ninja-ide.org/

Csaba
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...