Skip to content

Automake build and tests for examples - #72

Merged
fredRos merged 14 commits into
bat:masterfrom
oschulz:example-tests
Sep 19, 2015
Merged

fredRos merged 14 commits into
bat:masterfrom
oschulz:example-tests

Conversation

@oschulz

@oschulz oschulz commented Sep 11, 2015

Copy link
Copy Markdown
Member

Changed the build system for the examples to Automake and added them as Automake tests.

In the process, also fixed rootmap generation on OS-X with ROOT-5, fixed some examples and improved test execution in "test" directory.

This fixes #34.

Note: Built on top of #66 (can't be disentangled without conflicts), so #66 should be accepted before merging this.

Testing is currently disabled for the following examples (they fail/crash, with ROOT-6, possibly also with ROOT-5):

  • advanced/advancedGraphFitter
  • advanced/mvc/constraints
  • advanced/mvc/nuisance
  • advanced/mvc/oneObservable
  • advanced/mvc/PPP (works with ROOT-6, segfault with ROOT-5)
  • advanced/rooInterface

make distcheck has been tested with:

  • Linux:
    • ROOT-5.34.32 and ROOT-6.04.02
    • DISTCHECK_CONFIGURE_FLAGS="--enable-roostats --enable-parallelization --with-cuba=download"
    • make -j8 distcheck
  • OS-X:
    • ROOT-5.34.32 and ROOT-6.04.02
    • DISTCHECK_CONFIGURE_FLAGS="--enable-roostats --with-cuba=download"
    • make -j4 distcheck

All enabled tests pass, except for

  • BCIntegrate.TEST
    • Infrequent failures (segfault) observed on OS-X (ROOT 5).
    • So far, no failures observed on Linux (ROOT-5 and -6) and OS-X (ROOT-6). Doesn't necessarily mean anything.

oschulz and others added 13 commits September 11, 2015 00:35
As Cuba is linked statically, the BAT installation should not refer
to the Cuba path(s) in any way - especially as it may be only
temporary (e.g. when configured with "--with-cuba=download").
"make distcheck" expects file not belonging to the dist to be cleaned
up on "make distclean".
If parallelization is enabled, certain tests that use parallelization
internally should be run sequentially, not in parallel, to avoid
massive performance breakdown.
Transformed header files (using #include "<BAT/...> directives)
are now generated in ".includes/BAT" (analog to .libs) during build and
installed from there.

* More elegant than transforming header files after installation
  with install-data-hook (no longer necessary).

* Makes header available under a PATH ending in "BAT/[header].h", which
  Cling expects when loading the BAT libraries. Required to (e.g.) test
  examples during distcheck (which runs "make check" *before*
  "make install").
Filtering rlibmap output to replace ".so" with ".dylib" on OS-X.

rlibmap seems to use ".so" instead of ".dylib" in it's output when
started with "rlibmap -l SOME_LIB.dylib" (why!?) - this doesn't happen
for "rlibmap -l SOME_LIB.SOME_OTHER_EXTENSION". As a result, automatic
library loading in ROOT-5 fails, as CINT looks for an ".so" instead of
a ".dylib" file.
Testing is currently disabled (tests fail) for:

* advanced/advancedGraphFitter
* advanced/mvc/constraints
* advanced/mvc/nuisance
* advanced/mvc/oneObservable
* advanced/mvc/PPP (works with ROOT-6, segfault with ROOT-5)
* advanced/rooInterface
@oschulz

oschulz commented Sep 11, 2015

Copy link
Copy Markdown
Member Author

The example "advanced/referenceCounting" takes a long time to run, is there some way to cut it down a bit?

@oschulz

oschulz commented Sep 14, 2015

Copy link
Copy Markdown
Member Author

It looks like problems have slipped through testing in recent merges.

With minor exceptions (see above) all example run on the HEAD of this pull request. However, when merged with the current master (98c5b0c), the following tests fail (segfault, ROOT-6 only):

  • basic/efficiencyFitter
  • basic/graphFitter
  • basic/histogramFitter

I did a few more tests, merging with commit 5d3bfc7 instead of master results in the same failures, so the culprit must be on that part of the history. Unfortunately, 5d3bfc7 can't be tested directly, because these examples are are outdated there and don't run. Also, commits preceding 5d3bfc7 can't be merged cleanly with this PR. However, looking at the changes near aaf4ad0, commit 6a44a41 seems a likely cause for these crashes, as it contains major changes to the classes used in the failing examples.

Bad news: This has to be fixed as soon as possible.

Good news: In the future (after this PR, is merged) a make distcheck on Linux and OS-X (with both ROOT-5 and ROOT-6) should catch issues like this.

@fredRos fredRos mentioned this pull request Sep 16, 2015
@fredRos

fredRos commented Sep 16, 2015

Copy link
Copy Markdown
Contributor

It looks like problems have slipped through testing in recent merges.

It even happens in master. On my work machine, interpreted examples ran even though I had already deleted the BAT libraries! Apparently there is some caching within cling. This makes it harder to check if you don't know which library is actually checked. Perhaps you ran into the same problem.

Bad news: This has to be fixed as soon as possible.

The seg faults were easy to fix, please accept #74 first, then rebase your branch.

I looked through your code, seems it was a major pain, thanks for taking this on. The major thing works: I can run make check and the examples are run. Even for out-of-source builds. Great!

But I have some

Suggestions

  1. All examples are built. This further increases the compilation time. Can we not build the examples with make in top directory?
  2. With make check, the examples are run before the unit tests. I'd reverse that in Makefile.am
  3. The examples/README needs to be updated. It should state how we can run all examples, too.
  4. Why are the roostats interface headers always included in
    base/Makefile.am even when the interface is not built? By the way,
    shouldn't we turn this on by default if we detect that roostats is
    available?

@oschulz

oschulz commented Sep 16, 2015

Copy link
Copy Markdown
Member Author

I looked through your code, seems it was a major pain, thanks for taking this on.

Thanks - yes, it was very painful, indeed, especially because things have to run (even in Cling) before installation. That's why this took so long (plus endless testing).

The major thing works: I can run make check and the examples are run. Even for out-of-source builds

I'd actually recommend to always use make distcheck. It always does an out-of-tree build, can also do
post-install tests (which we might want to add at some point).

All examples are built. This further increases the compilation time. Can we not build the examples with make in top directory?

I can look into that, but it probably won't be trivial. On the other hand, the examples compile fairly quick, compared to the rest of BAT.

With make check, the examples are run before the unit tests. I'd reverse that in Makefile.am

Good idea, I'll do that!

@oschulz

oschulz commented Sep 16, 2015

Copy link
Copy Markdown
Member Author

On my work machine, interpreted examples ran even though I had already deleted the BAT libraries! Apparently there is some caching within cling

Are you certain? This would be weird, I'm quite sure that Cling doesn't do any caching (between sessions).

@oschulz

oschulz commented Sep 16, 2015

Copy link
Copy Markdown
Member Author

The seg faults were easy to fix, please accept #74 first, then rebase your branch.

I tested a merge of this PR together with #74, but now the examples

  • advanced/polynomialFit
  • basic/efficiencyFitter
  • basic/graphFitter
  • basic/histogramFitter

fail (segfault), tested with ROOT-6 on Linux.

@fredRos

fredRos commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

I checked and fixed the issues and updated #74 . This was not a new problem but an old that came up with multiple threads and was not correctly fixed in #54. I rebased #74 onto #72 and all activated examples pass with a single thread on linux with root 6.04.02

I checked advancedGraphFitter, one of the skipped examples. It still fails with an error I have seen a few times by now that only comes up with multithreading. It seems to be a root issue. I will turn this into a separate issue.

Another thing we can now tackle is only include the relevant files in examples with make dist. Right now it just takes the entire directory tree. If any examples were run before, the output slip in. The developer release notes warn about this, so it is not a bummer for 1.0 but I'll create another issue.

In conclusion, even though some things don't work yet, we need this in to test many other changes, so I think I can accept the pull request.

fredRos pushed a commit that referenced this pull request Sep 19, 2015
Automake build and tests for examples
@fredRos
fredRos merged commit 054efb2 into bat:master Sep 19, 2015
@oschulz
oschulz deleted the example-tests branch September 20, 2015 10:14
@oschulz

oschulz commented Sep 20, 2015

Copy link
Copy Markdown
Member Author

Hm, something still seems to be wrong: After the merge (master branch at 054efb2) at least the efficiencyFitter example (probably others too) fails on Linux and on OS-X with ROOT-6 (with ROOT-5, all is fine).

Linux:

./autogen.sh && ./configure && DISTCHECK_CONFIGURE_FLAGS="--enable-roostats --enable-parallelization --with-cuba=download" make -j8 distcheck

OS-X:

./autogen.sh && ./configure && DISTCHECK_CONFIGURE_FLAGS="--enable-roostats --with-cuba=download" make -j4 distcheck

I've turned this into a new issue.

@oschulz

oschulz commented Sep 20, 2015

Copy link
Copy Markdown
Member Author

After merging with #74, the problem persists. Failure was only observed consistently on Linux, no longer on OS-X - but due to the nature of segfaults, that doesn't have to mean anything.

@fredRos fredRos mentioned this pull request Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run examples

2 participants