Commit a1db5073990f3ae8abfb9443067d7824d100f746

Authored by Josh Cardenzana
2 parents bb9410c7 e77d88fa

Merge branch 'devel' of https://cta-gitlab.irap.omp.eu/ctools/ctools into 1982-a…

…dd-phase-info-ctphase
ChangeLog
1   -2017-04-04
  1 +2017-04-05
2 2  
3 3 * Version 1.3.0 released
4 4 ========================
5 5  
  6 + Copy cscripts into bin directory instead of creating a symbolic links (#1987)
  7 + If code originates from Git, always compile the Python bindings (#1985)
6 8 Raise exception instead of exiting with return code in Python tests (#1983)
7 9 Support of map cubes lying outside RoI in ctobssim
8 10 Support energy boundary FITS file in ctmapcube (#1978)
... ...
1 1 New Features and Important Changes in ctools 1.3.0.dev1
2 2  
3   -4 April 2017
  3 +5 April 2017
4 4  
5 5  
6 6 Introduction
... ... @@ -15,6 +15,16 @@ The Python unit tests now raise exceptions instead of exiting with a non-
15 15 zero return code so that the user is not thrown out of Python after calling
16 16 ctools.test() and cscripts.test() (#1983).
17 17  
  18 +If the code originates from the Git repository the configuration now switches
  19 +to developer mode which implies that the Python bindings are always built.
  20 +This solves the problem that occured for developers that could not get rid
  21 +of existing Python wrappers, even if they modified the Python interface
  22 +(#1985).
  23 +
  24 +The cscripts are now copied into the bin directory upon installation instead
  25 +of creating symbolic links. This avoids problems on some VM file systems on
  26 +which creation of symbolic links does not work (#1987).
  27 +
18 28  
19 29 Python interface
20 30 ----------------
... ...
configure.ac
1 1 #############################################################################
2 2 # Configuration for ctools - tools for science analysis of CTA data #
3 3 # ------------------------------------------------------------------------- #
4   -# Copyright (C) 2011-2016 Juergen Knoedlseder #
  4 +# Copyright (C) 2011-2017 Juergen Knoedlseder #
5 5 # ------------------------------------------------------------------------- #
6 6 # #
7 7 # This program is free software: you can redistribute it and/or modify #
... ... @@ -608,9 +608,10 @@ AC_C_INLINE
608 608 # Python binding requires Python and either the files tools_wrap.cpp and #
609 609 # tools.py or swig to create these files. The following conditionals are #
610 610 # set: #
611   -# WITH_PYTHON - Python bindings will be built #
612   -# HAVE_SWIG - swig is available #
613   -# HAVE_WRAPPERS - wrappers are available #
  611 +# WITH_PYTHON - Python bindings will be built #
  612 +# HAVE_SWIG - swig is available #
  613 +# HAVE_WRAPPERS - wrappers are available #
  614 +# BUILD_WRAPPERS - build the Python wrappers #
614 615 #############################################################################
615 616 # Initialise flags
616 617 enable_python="no"
... ... @@ -620,6 +621,12 @@ has_swig="no"
620 621 has_wrappers="no"
621 622 build_wrappers="no"
622 623  
  624 +# Check if the code is a git clone. In that case the systems switches to
  625 +# developer mode which forces building of the Python interface with SWIG.
  626 +AC_CHECK_FILE([.git/HEAD],
  627 + [from_git=yes;build_wrappers="yes"],
  628 + [from_git=no])
  629 +
623 630 # Python binding enabled?
624 631 AC_ARG_ENABLE([python-binding],
625 632 AS_HELP_STRING([--enable-python-binding],
... ... @@ -1065,21 +1072,36 @@ else
1065 1072 echo " - GammaLib support (no) no gammalib library found"
1066 1073 fi
1067 1074  
  1075 +# Dump developer configuration
  1076 +if test "x$from_git" = "xyes"; then
  1077 + echo " * Developer configuration (yes)"
  1078 +else
  1079 + echo " * End user configuration (yes)"
  1080 +fi
  1081 +
1068 1082 # Dump Python binding information
1069 1083 if test "x$ac_enable_python_binding" = "xyes"; then
1070 1084 if test "x$has_python" = "xyes"; then
1071 1085 if test "x$has_python_h" = "xyes"; then
1072   - if test "x$has_wrappers" = "xyes"; then
1073   - if test "x$has_swig" = "xyes"; then
1074   - echo " * Make Python binding (yes) use swig for updates"
  1086 + if test "x$build_wrappers" = "xyes"; then
  1087 + if test "x$has_wrappers" = "xyes"; then
  1088 + if test "x$has_swig" = "xyes"; then
  1089 + echo " * Make Python binding (yes) use swig for updates"
  1090 + else
  1091 + echo " * Make Python binding (yes) use wrappers"
  1092 + fi
1075 1093 else
1076   - echo " * Make Python binding (yes) use wrappers"
  1094 + if test "x$has_swig" = "xyes"; then
  1095 + echo " * Make Python binding (yes) use swig for building"
  1096 + else
  1097 + echo " - Make Python binding (no) swig required to build wrappers"
  1098 + fi
1077 1099 fi
1078 1100 else
1079   - if test "x$has_swig" = "xyes"; then
1080   - echo " * Make Python binding (yes) use swig for building"
  1101 + if test "x$has_wrappers" = "xyes"; then
  1102 + echo " - Make Python binding (yes) use existing wrappers"
1081 1103 else
1082   - echo " - Make Python binding (no) swig required to build wrappers"
  1104 + echo " - Make Python binding (no) wrappers not found"
1083 1105 fi
1084 1106 fi
1085 1107 else
... ...
cscripts/Makefile.am
... ... @@ -223,7 +223,7 @@ EXTRA_DIST = $(binscripts) $(pythonscripts) $(parfiles) \
223 223 $(testscripts) $(testdata) $(testiactdata) \
224 224 $(testiactevents)
225 225  
226   -# Add install hook rule to create symbolic links for cscripts
  226 +# Add install hook rule to copy cscripts without .py into the bindir
227 227 install-data-hook:
228 228 @binlist='$(binscripts)';\
229 229 for p in $$binlist; do \
... ... @@ -232,11 +232,11 @@ install-data-hook:
232 232 @linklist='$(linkscripts)';\
233 233 for p in $$linklist; do \
234 234 rm -rf "$(DESTDIR)$(bindir)/$$p"; \
235   - ln -s "$(DESTDIR)$(pyexecdir)/cscripts/$$p.py" "$(DESTDIR)$(bindir)/$$p"; \
236   - chmod +x "$(DESTDIR)$(pyexecdir)/cscripts/$$p.py"; \
  235 + cp "$(DESTDIR)$(pyexecdir)/cscripts/$$p.py" "$(DESTDIR)$(bindir)/$$p"; \
  236 + chmod +x "$(DESTDIR)$(bindir)/$$p"; \
237 237 done
238 238  
239   -# Uninstall hook rule to remove the symbolic links for cscripts
  239 +# Uninstall hook rule to remove the cscripts from the bindir
240 240 uninstall-hook:
241 241 @linklist='$(linkscripts)';\
242 242 for p in $$linklist; do \
... ...