desihub / desitest

Testing coordination for DESI code
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

update specex #39

Closed marcelo-alvarez closed 2 years ago

marcelo-alvarez commented 2 years ago

Adds code to automatically update master branch of specex using python setup.py clean install --prefix ./code consistent with current tagged and master versions of specex being located in the code subdirectory of the specex package.

Please review and merge.

marcelo-alvarez commented 2 years ago

@sbailey I have tested the latest commit, which uses python setup.py build_ext --inplace, and specex is updated correctly. Additionally the most recent commit of specex/master ensures that the PYTHONPATH is set correctly. As is apparently the case with fiberassign, the desiInstall "branches/master" install doesn't actually compile the C++ code, but it does get compiled in the daily update. Compilation only occurs for any given update if a modification has been made to the C++ code (I verified this by running touch on one of the C++ files and then running python setup.py build_ext --inplace and only that particular file was compiled). A manual update with a clean installation would be the easiest way to proceed if a change is made that requires re-compilation of C++ code that itself has not been modified (such as a change to the compilation process itself like changing compile flags or adding/removing source files) using something like python setup.py clean install build_ext --inplace. This takes about 30 seconds.

You can verify these changes work with the following commands (e.g., in a test desiconda environment in a separate area):

# assuming specex/master not already installed, otherwise comment out next line
desiInstall -r $DESICONDA/.. specex branches/master

# uncomment next three lines to do it the long way and actually test 
# this desitest mod
# desiInstall -r $DESICONDA/.. desitest branches/update_specex
# module load desitest/update_specex
# python -c "from desitest.nersc import update; update(logdir='$logdir')" 

# comment next line to do it the long way; the line below does the same update as 
# now happens in this PR
cd $DESICONDA/../code/specex/master; git pull; python setup.py build_ext --inplace

# check to make sure that the specex shared object library exists and is found 
# in PYTHONPATH
module unload specex; module load specex/master 
python -c "from specex import _libspecex; print(_libspecex.__file__)"

Please review and merge if appropriate.