Skip to content
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

Enable tests in build #113

Merged
merged 12 commits into from
Mar 23, 2018
Merged

Enable tests in build #113

merged 12 commits into from
Mar 23, 2018

Conversation

Zaharid
Copy link
Contributor

@Zaharid Zaharid commented Feb 28, 2018

This implements some but not all of the points in #95. In order to be able to merge it, we require a low precision theory that we can use it tests. Currently, it predictably fails with:

  [utils] error: Could not open /home/zah/anaconda3/conda-bld/
  nnpdf_1519818938025/
  _test_env_placehold_placehold_placehold_placehold_placehold_placehold_placeh-
  old_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl-
  acehold_placehold_placehold_placehold_placehold_place/share/NNPDF/data/
  theory_53/fastkernel/FK_NMC.dat

It is also missing enabling coverage reports, but that's out of scope here.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 1, 2018

@nhartland, could you produce one theory with low precision and a couple of experiments? Then we can download it during the testing phase and use it to check fktables and whatnot.

@nhartland
Copy link
Member

How big would be acceptable? We already have theory 162 which is super-low precision, but it includes all sets. It's coming in at 125 Mb/

@nhartland
Copy link
Member

As opposed to the usual ~5 GB.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 6, 2018

Could we have a subset of that with a couple of experiments? In any case 125Mb is less than some conda packages, so it's probably fine.

@nhartland
Copy link
Member

We can do, but I'm lazy and adding theories is a pain.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 6, 2018

Let's try with 162 and see how long takes for travis to kick as out.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 8, 2018

Great, getting two different build failures on linux and mac. I really have no patience for understanding how linking in mac works but it is really annoying me how absurd it is.

https://travis-ci.com/NNPDF/nnpdf/jobs/113751056
https://gitlab.cern.ch/NNPDF/nnpdf/-/jobs/1112656

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 8, 2018

This now works on linux (albeit it is somewhat absurd to run tests in release mode). @nhartland I would appreciate some help with the Mac failure, which looks frankly nonsensical.

@Zaharid Zaharid closed this Mar 8, 2018
@Zaharid Zaharid reopened this Mar 8, 2018
@nhartland
Copy link
Member

This error?
dyld: Symbol not found: _cblas_dgemv ?

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 8, 2018

Yes. Also, apparently I haven't fixed travis so it refuses to build anything....

@nhartland
Copy link
Member

What is the deal with travls? I keep getting emails saying we're running out of trials. Is this something we'll need to pay for at some point?

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 8, 2018

Apparently I have it for free, but the repo must belong to me. I though it would be enough to put my credentials.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 8, 2018

I have set up travis on my fork. I have also sent an email asking if we could have it for NNPDF. For now a solution would be:

git remote set-url origin --push --add git@github.com:Zaharid/nnpdf.git

which causes to push both to the NNPDF and to my repository, while pulling is always from NNPDF. This is not ideal since e.g. we don't get the flag in the PR.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 8, 2018

The build of the test keeps failing:

https://travis-ci.com/Zaharid/nnpdf/builds/67740102?utm_source=email&utm_medium=notification

I suppose some permutation of the options here would fix it:

https://cmake.org/Wiki/CMake_RPATH_handling

but I have ran out of patience.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 12, 2018

Travis is working now, so it would be good to have it do something useful!

@scarrazza
Copy link
Member

Did they reply to your email?

@Zaharid Zaharid added urgent help wanted Extra attention is needed labels Mar 15, 2018
@nhartland
Copy link
Member

nhartland commented Mar 15, 2018 via email

@nhartland
Copy link
Member

So I'm not even sure how to reproduce this error let alone try and resolve it.
Do I set up a conda dev env and try to install this branch to it? Which part is failing?

I can't see the travis output for the nnpdf version in your repo:

https://travis-ci.com/Zaharid/nnpdf/builds/67740102?utm_source=email&utm_medium=notification

because I don't have access to it

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 21, 2018

On the travis logs, there is:

+LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/travis/miniconda3/conda-bld/nnpdf_1521626381535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib -L/Users/travis/miniconda3/conda-bld/nnpdf_1521626381535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib

In particular, -dead_strip_dylibs looks like a candidate to be causing the trouble.

@nhartland
Copy link
Member

Haha yes indeed. I'll try just overwriting LDFLAGS without that.

@nhartland
Copy link
Member

So now there is a different error. I don't know if overwriting the LDFLAGS without that flag has fixed the problem or if we've just covered it up with another problem, but let's be optimistic!

The error now is an rpath one which I suspect would be fixed by installing the tests before running them (if that makes sense?). You've set SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) in the cmake conf, which should setup the rpaths correctly upon installation. This seems to work for the normal binaries after all.

@Zaharid Zaharid force-pushed the tests branch 2 times, most recently from 5db2a30 to 457557d Compare March 21, 2018 16:43
@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 21, 2018 via email

@nhartland
Copy link
Member

Are these flags pretty much hard coded into conda then, not something we can trivially remove from some config? Overwriting the LDFLAGS is probably asking for trouble further down the line.

Maybe something as simple as running LDFLAGS through sed and cutting out that one flag would be marginally more robust.

@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 22, 2018

I was going to do the sed thing.

@Zaharid Zaharid changed the title [WIP] Enable tests in build Enable tests in build Mar 22, 2018
@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 22, 2018

So my understanding of the issue with Mac and conda is the following:

  • In order to link to something that is not in the default search paths, you need to pass the rpath argument to the linker with the path where that library is located. Conda does this by default, but Makefiles need to by mindful of the environment variables.

  • In addition conda passes the -dead_strip_dylibs which breaks everything for reason I don't understand or care for particularly. We should strip this path from the conda environment. The most straight forward way is to just remove it with sed.

@nhartland, can you get a working dev environment with that information?

This makes self testing easier.
Set up the requirement environment to:

 - Be able to test validphys with pytest.
 - Be able to compile and run the catch test, with all the debug flags
   enabled.

This has the added benefit of testing that the debug build actually
works.
Apparently these are not defined and we want to have the undefined
check.
This requires updating all the regression tables with the new theory.
We also put all the tests in a file so that we have clear control over
the order. In particular we want python test first so that we download
theories and pdfs.
One of the many useless missfeatures of setuptools is that it doesn't
copy all of the files by default.
I am only half sure this is a good idea...
If it compiles the library maybe it will compile the tests?
@Zaharid
Copy link
Contributor Author

Zaharid commented Mar 23, 2018

I'd like to merge this because it is annoying to write tests that depend on it otherwise.

Copy link
Member

@nhartland nhartland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sorry, obviously fine by me. I'll see if I can finally resolve #98.

@Zaharid Zaharid merged commit 14c63c7 into master Mar 23, 2018
@nhartland nhartland deleted the tests branch April 3, 2018 17:54
voisey pushed a commit that referenced this pull request Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants