-
Notifications
You must be signed in to change notification settings - Fork 29
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
Unify #71
Conversation
Codecov Report
@@ Coverage Diff @@
## master #71 +/- ##
==========================================
+ Coverage 55.51% 57.17% +1.65%
==========================================
Files 2 2
Lines 1632 1548 -84
==========================================
- Hits 906 885 -21
+ Misses 726 663 -63
Continue to review full report at Codecov.
|
5e7d5d7
to
b640671
Compare
yay it builds -.- |
ok sarcasm aside, that |
4d6ddef
to
0b21b01
Compare
sigh, waiting for https://www.traviscistatus.com/incidents/j772csl6n49j |
great about |
Before you do lots more work on the actual "unification" can we discuss the plan? I'm not sure how it fits with what we had in mind for the VM, docker etc. Probably no time on Friday. next tcon? |
590d3be
to
40b31f0
Compare
@KrisThielemans turns out it was just travis lying, still 20min/build. Odd, since I get a much quicker build when I use regarding python/pip (esp. on Mac): travis-ci/travis-ci#2312, pypa/pip#3813, pypa/pip#1668 |
d3460c2
to
611d257
Compare
sounds like another python version mixup. |
still failing on mac though, even with tests using |
yes. In the log we see the conflict:
we currently use -DPYTHON_LIBRARY=$(python-config --prefix)/lib/libpython2.7.dylib -DPYTHON_INCLUDE_DIR=$(python-config --prefix)/include/python2.7" but that isn't good (enough). According to the CMake doc, we need to do find_package(PythonInterp)
find_package(PythonLibs) which we do here. But then overriding the above variables is probably confusing. Might be better to override |
ah yes, but why do we override this on |
the internet is full of reports by people struggling with CMake and Python on OSX. We got it to work with that particular combination, but that was because we didn't test the python executables from within CMake (and were (un)lucky to pick up the matching python when running the test from the script). Possibly @bathomas and @rijobro can comment. They recently struggled quite a lot as well. |
- libfftw3-dev | ||
- python-dev | ||
- python3-dev | ||
- python-tk |
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.
why include this? We don't need it as far as I know
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 definitely need -dev
and -tk
, arguably not for both python
and python3
(depending on the build matrix) but
- it's neater to put both here rather than require
sudo
toapt-get
the appropriate version - it's a quick download/install
- it doesn't affect
osx
What about the other dependencies, such as root-system-bin
? Are they really all required? I just copied from the SuperBuild
.
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.
agree to install both python2 and 3 here. still mystified about -tk
as I've never had to install this before (maybe it was there).
yes, get rid of root-system-bin
. Could be used to enable ROOT support for STIR, but then it'd need other packages as well (and is sure to let to other compilation problems, so we won't do this now).
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.
ok, building without root-system-bin
now. python-tk
is needed (https://travis-ci.org/CCPPETMR/SIRF/jobs/315938695) and would have been installed back when we had language: python
. We need language: cpp
now in order to get ccache
to work (which is evidently much more important than caching pip
)
let me know if you think anything else can be removed. it's about 1:30min to apt-get things at the moment.
- popd | ||
# get pip | ||
- curl -0 https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
- python$PYMVER get-pip.py --user |
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.
no guarantee that this python will be the one found by cmake. would have to enforce it in the cmake call by setting PYTHON_EXECUTABLE
. For STIR, I did it the other way round: first run CMake, then use whatever python it found.
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.
just tried (https://travis-ci.org/CCPPETMR/SIRF/builds/318679147), but it's going to fail (osx
) since the libs and executable versions are still mismatched, don't want to look into getting them to match (2.7.10 bin, 2.7.14 lib) - anyone else have any ideas?
|
||
@author: Evgueni Ovtchinnikov | ||
{licence} |
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.
this is clearly cleaner. However, it means the license info isn't actually inside the file. I don't think this is according to Apache 2 instructions (and it assumes the file will not be distributed on its own).
Not very important for these tests of course, but I think best to keep as-was (feel free to argue!)
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.
- lawyers need to talk to programmers more to understand that "requiring" paragraphs of licence text per-file is insane, irrespective of standaloneness
- making "reasonable efforts" per-file (such as this new version) is legally sufficient, regardless of whether that contradicts what any licence text says
- this file does actually need and contain the licence text via the
import
. Runningpydoc
/help()
on this would show the full licence text - because of the above dependency, this file could not work standalone without deliberate modification to remove any reference to licence, which would be clearly illegal
- "requiring" paragraphs of licence text per-file is insane
- see above
- decent programmers do not do avoidable duplication. decent lawyers do not do avoidable repetition.
codacy
doesn't like code duplication. Even as it stands, this PR fixes some, but not all the duplication - see 1, 5 and 6
Happy to hear any counter arguments!
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.
:-) seems you have strong opinions! I'm ok with this in these test files only. nowhere else though. sorry.
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.
groan
.travis.yml
Outdated
@@ -125,6 +127,10 @@ before_install: | |||
pushd $HOME/Library/Python/$PYMVER*/bin | |||
export PATH="$PWD:$PATH" | |||
popd | |||
# fix CMake variables | |||
export BUILD_FLAGS="$BUILD_FLAGS -DPYTHON_LIBRARY=$(python-config --prefix)/lib/libpython2.7.dylib" |
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 happens if you just don't set PYTHON_LIBRARY
etc, only PYTHON_EXECUTABLE
?
regarding dependencies, could list only relevant boost packages (they are in the |
- travis - PYMVER - SuperBuild: PYVER - MAKEFLAGS="-j 2" - rename *_TESTS -> *_PYTHON_TESTS - use PYTHON_EXECUTABLE
also remove root-system-bin
- remove all KEM recon until the end - make neighbourhood=3 in all the cells except where we need to change it - remove repetition of reconstruction: reuse image reconstructed in previous cell - use 21 subsets and 2 full iterations
Making the notebook faster SyneRBI#71:
continued from #69:
SIRF-SuperBuild:system-build
$(SIRF_)PYTHON_EXECUTABLE
adding PYTHON_EXECUTABLE to env_ccppetmr.*? SIRF-SuperBuild#60PyThreadState_Get
)fixUSE_SYSTEM_HDF5=OFF
travis
(python
/pip
)ccache
make
) ~16min -> under 1min (:1st_place_medal: min)closes SyneRBI/SIRF-SuperBuild#39
Ambitious
SIRF-SuperBuild/docker/*.sh
scriptsSIRF/.travis.yml
SIRF-SuperBuild/.travis.yml
VM