-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmake build #97
Cmake build #97
Conversation
@@ -19,7 +19,7 @@ int main() { | |||
} | |||
timer.stop(); | |||
double flops = 10.0*512*512*512*2; | |||
double seconds = timer.elapsedSeconds(); | |||
double seconds = timer.elapsed(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for this? (I'm assuming that elapsed() is more standard and more likely to work on modern compilers?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well my compiler g++ 8.2.1 complained. I didi it mechanically to allow the test to compile. I must say I was even thinking it was a change internal to blitz (I though it had its own timer class)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.... looks like it was just a bug, and nobody had bothered to compile benchmarks/iter.cpp
, which depends on Blitz's timer.h
.
Could we ditch timer.h
and use std::chrono
from C++11? In general, anything that we can get rid of in favor of now-standard C++ features is good (as long as it doesn't change the API; that is for later).
https://en.cppreference.com/w/cpp/chrono
As I said before... I don't care to maintain pre-C++11 compatibility going forward. We can go ahead and change the code along with the build system, as long as it doesn't change the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 1
See my comment from this morning, I even believe that we can suppress the library (or at least most of its required uses for non debugging purposes) by using constexpr... Not sure whether suppressing the need for the library counts as an API change (people can always link with a non-necessary library)...
Wow... that's quite a tour de force. But now I'm getting cold feet because it's 112 new files. I was hoping for something simpler. (I did a CMake build for Blitz in a proprietary setting for Windows, using far fewer files. Unfortunately, I cannot access or share that build. Then again, the build I made was a lot more minimal, just enough to get it working on Windows without re-generating code that someone else had already generated). Overall, the mantra should be simplify, simplify. SOme things I can see right now I would want to remove:
|
I just had a fast reading of your comments. I totally agree that it's more complicated than necessary nowadays. Please remember, that this was done years ago, at that time I wanted to provide the same functionality as with autotools. I just spent half an hour to separate this from other changes... As for the goals of:
I totally agree with that (I would even go further and use #pragma once everywhere instead of include guards...). Then I'm not sure about the best strategy as doing all the work before merging might delay it for a while. I'll try to do some of the simple simplifications quickly, but my time is counted, and I'm unsure I can do all of your requests in the limited time I have. Can we find some middle ground ?
I'll try to provide the initial cleanup over the week-end... |
I totally agree with that (I would even go further and use #pragma once
everywhere instead of include guards...)
AFAIK, #pragma once is not standard. I would prefer we just stick with the
C++11 standard, avoid using extensions.
. Then I'm not sure about the best strategy as doing all the work before
merging might delay it for a while.
I'm not sure either. I can see arguments on both sides:
a) Merge now because it works, and it doesn't conflict with / change any
existing files
b) Merge later because what we have now isn't what we eventually want.
Now that I put it that way, I'd lean toward merging now. Even if the
CMake build is totally broken (which I assume it is not), the merge STILL
won't affect anything else. I think I'll be comfortable merging once the
integration tests build and run successfully with CMake. ( @slayoo can you
do this or tell us how to?)
I'll try do some of the simple simplifications quickly, but my time is
counted, and I'm unsure I can do all of your requests in the limited time I
have. Can we find some middle ground ?
- I'll make some initial cleanup and some of the suggested changes
(the simplest ones).
- We merge, so that the work remains synchronized with other changes
and we can gather comments from users. Eventually, the testers can be
extended to include a cmake build.
- We do the remaining changes incrementally (and actually it would be
nice to make them in both autotools and cmake world simultaneously).
I'll try to provide the initial cleanup over the week-end...
OK let's just stick with simple clean-up. Get rid of commented-out
autotools code and the (one) vestigal file, make the doc/ directory
optional or disable it, and (if there's time) move single-use macros into
the file where they are used. Does that work?
|
….am). Made documentation building an option.
OK. I think I did the required changes...
|
@papadop Thanks for your work on this; I'm really excited for how much simpler Blitz++ can get once the CMake configuration is ready to replace autotools. I assume that is the plan?
edit: Sorry, used to rst |
will try this week to add Travis and Appveyor entries to this PR so the cmake build is tested during CI on Linux, OSX and Windows |
Awesome!
…On Sun, Mar 3, 2019 at 3:48 PM Sylwester Arabas ***@***.***> wrote:
will try this week to add Travis and Appveyor entries to this PR so the
cmake build is tested during CI on Linux, OSX and Windows
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#97 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB1cd4IbDWPwlLo4Q6T_xlEtWhcCoHWsks5vTDUzgaJpZM4bFK09>
.
|
Hi, just a "thumbs up" for cmake support! Is this currently still being considered? For what its worth, I agree with @citibeth that merging sooner is better than merging later, and iterative improvements can be made when more people use/test the cmake support. |
….am). Made documentation building an option.
apologies for the delay and thanks for the reminder. |
trying to use also CMake on travis (+ merge with master)
Rebased on latest master and added option for doc
As for squash, I have no experience with it. I would have say "why" if there was many pure cmake related commits, but given that most commits are only for pure travis debugging, why not... |
OK. That leaves the argument of taking time to get some feedback for the cmake build. Not that I want to insist on keeping the autotools build, just to make sure that people can fallback on the most used build in case something goes wrong. Plus I want to take time to verify that no autotools change creeped in after my cmake work (which was a while ago) and is not taken into account with the cmake build. So let's keep the autotools build for now, and have the following strategy (if everyone agrees with it):
But, we need to agree on the plan and on a calendar !!! |
Also, for the record, I've added an item mentioning your CMake contribution here: https://github.com/blitzpp/blitz/wiki/Credits |
|
||
if (TEXI2PDF) | ||
if (TEXI2PDF AND PDFLATEX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is what we need. To be clear, here is how these things SHOULD work: There should be a CMake option (looks like DOCS) that turns on generation of documentation. If that option is not set, then no docs are generated. If the option IS set, then docs will be generated. If the option is set and the required programs for generating docs do not exist (pdflatex
and texi2pdf
), then CMake should generate an error. It should NOT "automagically" decide whether or not to generate docs depending on whether it can find the required programs. That will cause people unending grief ("I set DOCS but docs weren't generated"), and is against best practices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I totally agree. This is a stop gap to allow compilation on travis MacOs which does not have latex and for which I do not know just like that how to install latex (+ the numerous latex packages which are needed). And I do not want to stop all documentation generation on MacOs just because of that (which would have been easier). Hence this hack.
I want to avoid adding too many documentation options, but I also want documentation building to be better tested.
I think we can revisit the problem later and just open an issue asking an enhancement for the time being.
@@ -66,8 +66,10 @@ endif() | |||
find_program(TEXI2PDF texi2pdf | |||
${CYGWIN_INSTALL_PATH}/bin /bin /usr/bin /usr/local/bin /sbin) | |||
mark_as_advanced(TEXI2PDF) | |||
find_program(PDFLATEX pdflatex | |||
${CYGWIN_INSTALL_PATH}/bin /bin /usr/bin /usr/local/bin /sbin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. But it's not only pdflatex, it's fonts, packages, and problems with doxygen versions which generate bad latex... Believe me it's a can of worms I spent almost two days to dissect... and the public travis interface (without debugging) is a pain...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid "automagically" configuring a feature depending on whether required dependencies for that feature can be found.
Again, can we have an issue asking for such enhancements... As said above, the problem is much more complicated than only testing for pdflatex (in theory any other latex implementation could work too)... The cmake build already does much more testing than the autotools one. This is a net improvement. Let's already merge that and and create issues (not PR, sorry) for tracking required further enhancements. |
@papadop Looks like the easiest way to get docs built will be to figure out the correct dependencies (including versions); and then make a Spack package for it, that will build all the correct versions of Doxygen, etc. At that point I'm happy with a single documentation CMake option that either builds everything or nothing. As long as the Spack build knows how to build all the required dependencies, then we at least have a way to generate docs that doesn't require humans to go to a lot of installation effort just to build docs for one package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will leave fixing doc generation for later.
@slayoo If you can check this over and ensure it works with Travis, I'm happy to merge. Before removing Autotools and Visual Studio, I want to make sure this works on Windows. CMake can generate VS builds. But the CMake files need to be tweaked differently to enable Windows functionality; at least in my experience. |
Re Doxygen, I'm a bit puzzled - IIUC this has nothing to do with the "good old blitz docs" that can be generated into the pdf. It would be great to have the travis script upload somewhere the generated docs, and it's worth the effort, but of course there is no reason to wait for it in context of this PR - just created a separate issue: #122 |
Re Windows: currently (i.e. with the branch behind this PR), CMake generates VS project files on Windows and compilation under VS is executed, no test execution happens, I've added an issue for it: #126 |
@citibeth any opinion on merge vs. squash-and-merge? @lutorm, @pguio any objections against merging it as is and continue development of further enhancements in separate branches? I'm trying to go through all the comments above and create separate issues for the discussed features, I'll also try out the CMake build on my machine this evening and report back |
On Mon, May 6, 2019 at 11:41 AM Sylwester Arabas ***@***.***> wrote:
@citibeth <https://github.com/citibeth> any opinion on merge vs.
squash-and-merge?
Squash-and-merge is normally preferred.
|
@Trophime, @tillea - if I'm not mistaken, you're listed as Blitz++ packagers in Debian. This PR includes initial version of CMake build scripts for Blitz++ intended as a replacement for autotools scripts. All thanks to @papadop! We're in need of testing it and getting feedback from packagers - if possible, please test and report feedback. thanks! |
I've noticed that repeating "make check-testsuite" repeats compilation, while one would expect only the test execution to repeat (as there was no code change)? Is it intentional? |
Does this hold true after a second, third and fourth time? I've seen that on complex projects, cmake can take one or two iterations until the cache does not change anymore. |
yes, reproduced a few times with various intervals (but just on one machine) |
not sure if that matters, but in the generated install_manifest.txt file, the bzconfig.h entry is listed twice, which results in an error message when uninstalling:
|
Sounds to me like a big.
…On Tue, May 7, 2019 at 17:08 Sylwester Arabas ***@***.***> wrote:
not sure if that matters, but in the generated install_manifest.txt file,
the bzconfig.h entry is listed twice, which results in an error message
when uninstalling:
$ sudo xargs rm < install_manifest.txt
rm: cannot remove '/usr/include/blitz/bzconfig.h': No such file or directory
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#97 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOVY57TDEV3IDWK4EWTYNTPUHVVNANCNFSM4GYUVU6Q>
.
|
Thanks to @papadop and all! |
Here is a cmake build for blitz. Minimally tested on linux (but I have in the past compiled on MacOS and Windows, so I have good hopes). There are probably some polishing to be done (notably make test which does not build dependencies and the hao-he benchmark which does not compile due to the removal of vector.h), but most of the functionality is there.
To use it:
This PR also contains a trivial correction for iter.cpp (elapsedSeconds->elapsed) which was needed to make teh test pass. check-testsuite and check-examples pass. check-benchmarks currently fails due to the hao-he test. I do not know whether we have to correct the test or remove it. So I left it untouched for now.