libnonius / nonius

A C++ micro-benchmarking framework
https://nonius.io
Creative Commons Zero v1.0 Universal
358 stars 47 forks source link

Fix example includes #22

Closed gnzlbg closed 9 years ago

gnzlbg commented 9 years ago

As it was before one had to put the include/ and include/nonius directories in the path.

Now one only has to put the include/ directory in the path.

rmartinho commented 9 years ago

Sorry, no, this doesn't work. The nonius.h++ header in the source tree is not what the examples are supposed to use. They use the single header form, which ends up in dist/ after running ninja examples. (that one is generated from nonius_single.h++)

(Ugh, didn't mean to merge this; that was quite the fat-fingering)

gnzlbg commented 9 years ago

Maybe I am missing something but how do you run ninja without a build.ninja file?

EDIT: I see, I need to run ./tools/bootstrap.py, it fails for me because in MacOSX there is no gcc toolchain but clang toolchain and clang doesn't use -pthread.

EDIT 2: I added a clang toolchain but now I cannot specify the path of the std library. Kind of wish this used cmake or anything portable.

Is there a reason why the library cannot be header only? Or at least use CMake (or auto-tools, or anything portable) as a configuration/build system?

rmartinho commented 9 years ago

It is header-only. It's just that I prefer to distribute it as a single header, but I don't want to do development as a single header. So there's a script that packs everything into one header, and that's what the examples expect, as they're supposed to be like what the user would write (though the order is terrible since the advanced ones come first, oops). The single header can be found in the releases page, or generated by ninja header (requires only python).

All the other stuff in the build system is meant only for helping with development (tests and examples need building because they're programs).

(FWIW, I'm currently setting up a build server for building almost all possible configurations of compiler version/boost version and that means I will indeed make some changes to the build system to support all that stuff)

gnzlbg commented 9 years ago

ninja header works without problems! Thanks!

Maybe you could add this bit of information to the Readme.md or the guide?

rmartinho commented 9 years ago

Yeah, that's a good point. I need to expand the readme a bit with basic info.