Commit f9a11c3d0fb0acb0b424d1a684580c0481e76d0f

Authored by Jürgen Knödlseder
1 parent 4314a78b

Resolve Python test problem on El Capitan (#1563).

ChangeLog
1 -2015-11-06 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 1 +2015-11-19 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2
3 * Version 1.0.0 released 3 * Version 1.0.0 released
4 ======================== 4 ========================
5 5
6 - Implement handling of stacked data in csspec (#1566). 6 + Implement handling of stacked data in csspec (#1566)
  7 + Resolve Python test problem on El Capitan (#1563)
7 8
8 9
9 2015-10-31 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 10 2015-10-31 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
@@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.0.0 @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.0.0
2 2
3 Author(s) : Juergen Knoedlseder 3 Author(s) : Juergen Knoedlseder
4 4
5 -6 November 2015 5 +19 November 2015
6 6
7 7
8 1. Introduction 8 1. Introduction
@@ -14,7 +14,10 @@ version 1.0.0 or above. @@ -14,7 +14,10 @@ version 1.0.0 or above.
14 14
15 2. Configuration 15 2. Configuration
16 ----------------- 16 -----------------
17 -None 17 +A special post processing of the Python module libraries has been added for
  18 +Mac OS X 10.11 and higher (El Capitan). This post processing is a replacement for
  19 +setting DYLD_LIBRARY_PATH during unit testing since the environment variable is
  20 +ignored in certain circumstances by El Capitan.
18 21
19 22
20 3. Python interface 23 3. Python interface
configure.ac
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 ############################################################################# 29 #############################################################################
30 # Initialisation # 30 # Initialisation #
31 ############################################################################# 31 #############################################################################
32 -AC_INIT([ctools], [0.10.0], [jurgen.knodlseder@irap.omp.eu], [ctools]) 32 +AC_INIT([ctools], [1.0.0], [jurgen.knodlseder@irap.omp.eu], [ctools])
33 AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp]) 33 AC_CONFIG_SRCDIR([src/ctselect/ctselect.cpp])
34 AC_CONFIG_MACRO_DIR([m4]) 34 AC_CONFIG_MACRO_DIR([m4])
35 #AM_INIT_AUTOMAKE([gnu no-dependencies]) 35 #AM_INIT_AUTOMAKE([gnu no-dependencies])
@@ -71,19 +71,42 @@ AC_CANONICAL_HOST @@ -71,19 +71,42 @@ AC_CANONICAL_HOST
71 # # 71 # #
72 # A special kluge was added for Mac OS X >=10.7. As Apple switched to clang # 72 # A special kluge was added for Mac OS X >=10.7. As Apple switched to clang #
73 # we search from this version on for the clang compiler. # 73 # we search from this version on for the clang compiler. #
  74 +# #
  75 +# We also signal whether Mac OS X >=10.11 (El Capitan). #
74 ############################################################################# 76 #############################################################################
  77 +# Set default Mac OS X version flags
  78 +osx_lion=no
  79 +osx_el_capitan=no
75 80
76 # Set default compiler lists 81 # Set default compiler lists
77 cxx_list="g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++" 82 cxx_list="g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++"
78 cc_list="gcc cc cl.exe clang" 83 cc_list="gcc cc cl.exe clang"
79 84
80 -# Check if we have Mac OS X >= 10.7 85 +# Check if we have Mac OS X >= 10.7 and >= 10.11
81 if test `uname -s` = "Darwin"; then 86 if test `uname -s` = "Darwin"; then
82 - if test `sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'` '>' 10.6; then 87 + version=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/' | sed -e 's/\.//g'`
  88 + if [ test $version -ge 107 ]; then
83 cxx_list="clang++ g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC" 89 cxx_list="clang++ g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC"
84 cc_list="clang gcc cc cl.exe" 90 cc_list="clang gcc cc cl.exe"
  91 + osx_lion=yes
  92 + fi
  93 + if [ test $version -ge 1011 ]; then
  94 + osx_el_capitan=yes
85 fi 95 fi
86 fi 96 fi
  97 +AC_MSG_CHECKING([for Mac OS X >= 10.7])
  98 +if [test "x$osx_lion" = "xyes"]; then
  99 + AC_MSG_RESULT(yes)
  100 +else
  101 + AC_MSG_RESULT(no)
  102 +fi
  103 +AC_MSG_CHECKING([for Mac OS X >= 10.11])
  104 +if [test "x$osx_el_capitan" = "xyes"]; then
  105 + AC_MSG_RESULT(yes)
  106 +else
  107 + AC_MSG_RESULT(no)
  108 +fi
  109 +AM_CONDITIONAL(IS_ELCAPITAN, test "x$osx_el_capitan" = "xyes")
87 110
88 # Our language is C++ 111 # Our language is C++
89 AC_LANG(C++) 112 AC_LANG(C++)
ctools.pc.in
@@ -6,9 +6,9 @@ includedir=${prefix}/include @@ -6,9 +6,9 @@ includedir=${prefix}/include
6 Name: ctools 6 Name: ctools
7 Description: CTA science analysis tools 7 Description: CTA science analysis tools
8 URL: http://cta.irap.omp.eu/ctools 8 URL: http://cta.irap.omp.eu/ctools
9 -Version: 0.10.0 9 +Version: 1.0.0
10 Requires: 10 Requires:
11 -Requires.private: gammalib >= 0.11.0 11 +Requires.private: gammalib >= 1.0.0
12 Conflicts: 12 Conflicts:
13 Cflags: -I${includedir}/ctools @OPENMP_CXXFLAGS@ 13 Cflags: -I${includedir}/ctools @OPENMP_CXXFLAGS@
14 Libs: -L${libdir} -lctools 14 Libs: -L${libdir} -lctools
doc/Doxyfile
@@ -32,7 +32,7 @@ PROJECT_NAME = ctools @@ -32,7 +32,7 @@ PROJECT_NAME = ctools
32 # This could be handy for archiving the generated documentation or 32 # This could be handy for archiving the generated documentation or
33 # if some version control system is used. 33 # if some version control system is used.
34 34
35 -PROJECT_NUMBER = 0.10.0 35 +PROJECT_NUMBER = 1.0.0
36 36
37 # Using the PROJECT_BRIEF tag one can provide an optional one line description 37 # Using the PROJECT_BRIEF tag one can provide an optional one line description
38 # for a project that appears at the top of each page and should give viewer 38 # for a project that appears at the top of each page and should give viewer
doc/source/conf.py
@@ -66,10 +66,10 @@ copyright = u&#39;2014-2015, ctools developers&#39; @@ -66,10 +66,10 @@ copyright = u&#39;2014-2015, ctools developers&#39;
66 # built documents. 66 # built documents.
67 # 67 #
68 # The short X.Y version. 68 # The short X.Y version.
69 -version = '0.10' 69 +version = '1.0'
70 70
71 # The full version, including alpha/beta/rc tags. 71 # The full version, including alpha/beta/rc tags.
72 -release = '0.10.0' 72 +release = '1.0.0'
73 73
74 # The language for content autogenerated by Sphinx. Refer to documentation 74 # The language for content autogenerated by Sphinx. Refer to documentation
75 # for a list of supported languages. 75 # for a list of supported languages.
pyext/Makefile.am
@@ -94,6 +94,15 @@ all-local: build @@ -94,6 +94,15 @@ all-local: build
94 # this. 94 # this.
95 build: ctools/tools_wrap.cpp ctools/tools.py 95 build: ctools/tools_wrap.cpp ctools/tools.py
96 $(PYTHON) setup.py build 96 $(PYTHON) setup.py build
  97 +if IS_ELCAPITAN
  98 + for f in build/ctools/ctools/_*.so; do \
  99 + echo "Post process module "$$f; \
  100 + install_name_tool -change $(libdir)/libctools.0.dylib @rpath/libctools.0.dylib $$f; \
  101 + install_name_tool -change $(libdir)/libgamma.0.dylib @rpath/libgamma.0.dylib $$f; \
  102 + install_name_tool -add_rpath $(libdir) $$f; \
  103 + install_name_tool -add_rpath $(abs_top_srcdir)/src/.libs $$f; \
  104 + done
  105 +endif
97 106
98 install-exec-local: 107 install-exec-local:
99 $(PYTHON) setup.py install --prefix=$(prefix) 108 $(PYTHON) setup.py install --prefix=$(prefix)
pyext/setup.py.in
@@ -114,6 +114,10 @@ else: @@ -114,6 +114,10 @@ else:
114 extra_compile_args = [] 114 extra_compile_args = []
115 extra_link_args = [] 115 extra_link_args = []
116 116
  117 +# Optionally add link flag for El Capitan post-processing of modules
  118 +if '@IS_ELCAPITAN_TRUE@' != '#':
  119 + extra_link_args.append('-headerpad_max_install_names')
  120 +
117 # Setup 121 # Setup
118 setup(name='@PACKAGE_NAME@', 122 setup(name='@PACKAGE_NAME@',
119 version='@PACKAGE_VERSION@', 123 version='@PACKAGE_VERSION@',