Commit 10672298d83e4f500e2066d097e9bf397e3818be

Authored by Jürgen Knödlseder
2 parents 702932ca 99d95816

Merge branch 'master' into devel

Conflicts:
	configure.ac
	ctools.pc.in
	doc/html/download.html

Resolved conflicts.
ChangeLog
  1 +2012-09-18 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
  2 +
  3 + * Bug fix version 0.5.1 released
  4 + ================================
  5 +
  6 + clang++ compiler precedence is only taken for Mac OS X >= 10.7
  7 + Omit Python checks if Python bindings are disabled
  8 + Enhance OpenMP configuration on Darwin
  9 + Export MACOSX_DEPLOYMENT_TARGET only for --enable-universalsdk
  10 + Improve Python bindings configuration
  11 + Add TEST_ENV_DIR to load library path
  12 +
1 2012-09-14 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 13 2012-09-14 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 14
3 * Version 0.5.0 released 15 * Version 0.5.0 released
1 -New Features and Important Changes in ctools 00-05-00 1 +New Features and Important Changes in ctools 00-05-01
2 2
3 Author(s) : Juergen Knoedlseder 3 Author(s) : Juergen Knoedlseder
4 4
5 -September 14th, 2012 5 +September 18th, 2012
6 6
7 7
8 1. Introduction 8 1. Introduction
@@ -13,9 +13,42 @@ important changes made since the last release of ctools. @@ -13,9 +13,42 @@ important changes made since the last release of ctools.
13 13
14 2. Configuration 14 2. Configuration
15 ----------------- 15 -----------------
16 -Added OpenMP support to allow for code parallelization. If available,  
17 -OpenMP is enabled by default. OpenMP support may be disabled using  
18 -the --disable-openmp flag. 16 +The clang++ compiler takes now only precedence over the g++ compiler
  17 +if the system on which compilation is performed is Mac OS X 10.7 or
  18 +later.
  19 +
  20 +If Python bindings are disabled we omit now all the Python related
  21 +checks during configuration. This includes detection of the Python
  22 +executable, detection of the swig executable, and the checks for the
  23 +presence of the Python wrapper files.
  24 +
  25 +The Apple gcc compiler requires the gomp_thread_attr global to be
  26 +defined when OpenMP functions are called without having any OpenMP
  27 +section in the code. This specific requirement is now detected in
  28 +the configure script using some dedicated test code, and the compile
  29 +definition HAVE_OPENMP_DARWIN_KLUGE is set that allows inclusion of
  30 +the appropriate code when needed.
  31 +
  32 +Furthermore, the OPENMP_LIB_LDFLAGS is not set to -lgomp on Darwin
  33 +anymore as this appears not to be needed.
  34 +
  35 +The MACOSX_DEPLOYMENT_TARGET environment variable is now only exported
  36 +when the --enable-universalsdk option is specified. This solved problems
  37 +related to uncatched exceptions in unit tests. Possibly, these uncatched
  38 +exceptions were due to weak linking, a feature that exists since Mac OS
  39 +X version 10.2. By not exporting MACOSX_DEPLOYMENT_TARGET, Mac OS X
  40 +version 10.1 is assumed.
  41 +
  42 +The Python bindings configuration has been improved to handle also
  43 +the MacPorts gcc compiler on Mac OS X. Static linking during unit
  44 +testing has been removed as this is no longer needed (don't ask me why).
  45 +The double compilation for unit check has also be removed. A static
  46 +link is used instead that allows adding of the wrapper directory to
  47 +the PYTHONPATH.
  48 +
  49 +The TEST_ENV_DIR environment variable is also added to the load
  50 +library path in the GammaLib setup script. This ensures the correct
  51 +loading of shared libraries in non-standard locations.
19 52
20 53
21 3. Python interface 54 3. Python interface
@@ -25,15 +58,7 @@ None @@ -25,15 +58,7 @@ None
25 58
26 4. ctobssim - CTA observation simulation 59 4. ctobssim - CTA observation simulation
27 ---------------------------------------- 60 ----------------------------------------
28 -If several observations are processed at once, ctobssim now outputs  
29 -an observation definition XML file and separate FITS files for each  
30 -observation. The filenames of the FITS files will be written to the  
31 -observation definition file.  
32 -  
33 -The executable now also benefits from OpenMP support, allowing for  
34 -parallelized simulation of events in the presence of multiple  
35 -processor cores.  
36 - 61 +None
37 62
38 5. ctselect - CTA event selection 63 5. ctselect - CTA event selection
39 --------------------------------- 64 ---------------------------------
@@ -47,11 +72,7 @@ None @@ -47,11 +72,7 @@ None
47 72
48 7. ctlike - CTA maximum likelihood fitting 73 7. ctlike - CTA maximum likelihood fitting
49 ------------------------------------------ 74 ------------------------------------------
50 -ctlike computes now the total number of observed events and dumps  
51 -them in the log file just before it dumps the number of predicted  
52 -events. It also computes the difference between observed and  
53 -predicted events so that the difference is immediately visible.  
54 - 75 +None
55 76
56 8. ctskymap - CTA sky mapping 77 8. ctskymap - CTA sky mapping
57 ----------------------------- 78 -----------------------------
1 ctools information 1 ctools information
2 ================== 2 ==================
3 -Version: 00-05-00 (Septemner 14th, 2012) 3 +Version: 00-05-01 (September 18th, 2012)
4 Author: Juergen Knodlseder (jurgen.knodlseder@irap.omp.eu) 4 Author: Juergen Knodlseder (jurgen.knodlseder@irap.omp.eu)
5 -GammaLib dependency: 00-06-00 5 +GammaLib dependency: 00-06-02
6 6
7 7
8 License information 8 License information
configure.ac
@@ -66,10 +66,27 @@ AC_CANONICAL_HOST @@ -66,10 +66,27 @@ AC_CANONICAL_HOST
66 ############################################################################# 66 #############################################################################
67 # Check for valid C++ compiler. This has to come before the check for # 67 # Check for valid C++ compiler. This has to come before the check for #
68 # header files, otherwise we won't detect if the C++ compiler is missing. # 68 # header files, otherwise we won't detect if the C++ compiler is missing. #
  69 +# #
  70 +# A special kluge was added for Mac OS X >=10.7. As Apple switched to clang #
  71 +# we search from this version on for the clang compiler. #
69 ############################################################################# 72 #############################################################################
  73 +
  74 +# Set default compiler lists
  75 +cxx_list="g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++"
  76 +cc_list="gcc cc cl.exe clang"
  77 +
  78 +# Check if we have Mac OS X >= 10.7
  79 +if test `uname -s` = "Darwin"; then
  80 + if test `sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'` '>' 10.6; then
  81 + cxx_list="clang++ g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC"
  82 + cc_list="clang gcc cc cl.exe"
  83 + fi
  84 +fi
  85 +
  86 +# Our language is C++
70 AC_LANG(C++) 87 AC_LANG(C++)
71 -AC_PROG_CXX([g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])  
72 -AC_PROG_CC([gcc cc cl.exe clang]) 88 +AC_PROG_CXX($cxx_list)
  89 +AC_PROG_CC($cc_list)
73 90
74 91
75 ############################################################################# 92 #############################################################################
@@ -354,16 +371,17 @@ yes) @@ -354,16 +371,17 @@ yes)
354 ;; 371 ;;
355 esac 372 esac
356 373
357 - # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the  
358 - # environment with a value that is the same as what we'll use  
359 - # in the Makefile to ensure that we'll get the same compiler  
360 - # environment during configure and build time.  
361 - MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"  
362 - export MACOSX_DEPLOYMENT_TARGET  
363 - EXPORT_MACOSX_DEPLOYMENT_TARGET=''  
364 -  
365 # Set compile, link and pre-processor flags dependent on architecture 374 # Set compile, link and pre-processor flags dependent on architecture
366 if test "${enable_universalsdk}"; then 375 if test "${enable_universalsdk}"; then
  376 +
  377 + # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
  378 + # environment with a value that is the same as what we'll use
  379 + # in the Makefile to ensure that we'll get the same compiler
  380 + # environment during configure and build time.
  381 + MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
  382 + export MACOSX_DEPLOYMENT_TARGET
  383 + EXPORT_MACOSX_DEPLOYMENT_TARGET=''
  384 +
367 UNIVERSAL_ARCH_FLAGS="" 385 UNIVERSAL_ARCH_FLAGS=""
368 if test "$UNIVERSAL_ARCHS" = "32-bit" ; then 386 if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
369 UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" 387 UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
@@ -525,106 +543,107 @@ AC_ARG_ENABLE([python-binding], @@ -525,106 +543,107 @@ AC_ARG_ENABLE([python-binding],
525 if test "x$ac_enable_python_binding" = "xno"; then 543 if test "x$ac_enable_python_binding" = "xno"; then
526 AC_MSG_NOTICE([Python binding for ctools will not be built]) 544 AC_MSG_NOTICE([Python binding for ctools will not be built])
527 AC_MSG_NOTICE([Enable Python binding module building with --enable-python-binding]) 545 AC_MSG_NOTICE([Enable Python binding module building with --enable-python-binding])
528 -fi  
529 -  
530 -# Do we have Python and Python.h?  
531 -AM_PATH_PYTHON([2.2],  
532 - [has_python="yes"],  
533 - [AC_MSG_WARN([Python >= 2.2 not found. Python >= 2.2 is required to build python binding. Python can be obtained from http://www.python.org])])  
534 -  
535 -# It would really be weired if Python has not been found, as barely every system has Python. Maybe  
536 -# it was not found because the autoconf is so old, and in an early version of the AM_PATH_PYTHON  
537 -# there were no [Action-if-found] and [Action-if-not-found] arguments, hence $has_python is possibly  
538 -# badly set. However, the Python executable and version should be set correctly, and we can test  
539 -# for this to see whether Python is really there or not.  
540 -if test "x$has_python" = "xno"; then  
541 - AM_PYTHON_CHECK_VERSION([$PYTHON], [${PYTHON_VERSION}],  
542 - [has_python="yes"  
543 - AC_MSG_NOTICE([Wow! You're running a pretty old system. Found Python nevertheless:-)])],  
544 - [AC_MSG_WARN([Python not found.])])  
545 -fi  
546 -  
547 -# If we have Python then verify the presence of the header and set some flags  
548 -if test "x$has_python" = "xyes"; then 546 +else
549 547
550 - # Set opening and closing symbols to make setup.py compatible for versions 2 and 3  
551 - if test ${PYTHON_VERSION} '<' 3; then  
552 - PYTHON_OPEN=" "  
553 - PYTHON_CLOSE=""  
554 - else  
555 - PYTHON_OPEN="("  
556 - PYTHON_CLOSE=")"  
557 - fi  
558 - AC_SUBST(PYTHON_OPEN)  
559 - AC_SUBST(PYTHON_CLOSE)  
560 -  
561 - # Do we have distutils?  
562 - AC_MSG_CHECKING([for the distutils Python package])  
563 - ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`  
564 - if test -z "$ac_distutils_result"; then  
565 - AC_MSG_RESULT([yes])  
566 - else  
567 - AC_MSG_RESULT([no]) 548 + # Do we have Python and Python.h?
  549 + AM_PATH_PYTHON([2.2],
  550 + [has_python="yes"],
  551 + [AC_MSG_WARN([Python >= 2.2 not found. Python >= 2.2 is required to build python binding. Python can be obtained from http://www.python.org])])
  552 +
  553 + # It would really be weired if Python has not been found, as barely every system has Python. Maybe
  554 + # it was not found because the autoconf is so old, and in an early version of the AM_PATH_PYTHON
  555 + # there were no [Action-if-found] and [Action-if-not-found] arguments, hence $has_python is possibly
  556 + # badly set. However, the Python executable and version should be set correctly, and we can test
  557 + # for this to see whether Python is really there or not.
  558 + if test "x$has_python" = "xno"; then
  559 + AM_PYTHON_CHECK_VERSION([$PYTHON], [${PYTHON_VERSION}],
  560 + [has_python="yes"
  561 + AC_MSG_NOTICE([Wow! You're running a pretty old system. Found Python nevertheless:-)])],
  562 + [AC_MSG_WARN([Python not found.])])
568 fi 563 fi
569 564
570 - # If we have distutils then get python path from distutils ...  
571 - if test -z "$ac_distutils_result"; then  
572 - AC_MSG_CHECKING([for Python include path]) 565 + # If we have Python then verify the presence of the header and set some flags
  566 + if test "x$has_python" = "xyes"; then
  567 +
  568 + # Set opening and closing symbols to make setup.py compatible for versions 2 and 3
573 if test ${PYTHON_VERSION} '<' 3; then 569 if test ${PYTHON_VERSION} '<' 3; then
574 - python_path=`$PYTHON -c "import distutils.sysconfig; \  
575 - print distutils.sysconfig.get_python_inc();"` 570 + PYTHON_OPEN=" "
  571 + PYTHON_CLOSE=""
576 else 572 else
577 - python_path=`$PYTHON -c "import distutils.sysconfig; \  
578 - print(distutils.sysconfig.get_python_inc());"`  
579 - fi  
580 - if test -n "${python_path}"; then  
581 - AC_CHECK_HEADERS($python_path/Python.h, [has_python_h="yes"], [has_python_h="no"])  
582 - python_path="-I$python_path" 573 + PYTHON_OPEN="("
  574 + PYTHON_CLOSE=")"
  575 + fi
  576 + AC_SUBST(PYTHON_OPEN)
  577 + AC_SUBST(PYTHON_CLOSE)
  578 +
  579 + # Do we have distutils?
  580 + AC_MSG_CHECKING([for the distutils Python package])
  581 + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
  582 + if test -z "$ac_distutils_result"; then
  583 + AC_MSG_RESULT([yes])
  584 + else
  585 + AC_MSG_RESULT([no])
583 fi 586 fi
584 - PYTHON_CPPFLAGS=$python_path  
585 - CPPFLAGS="${CPPFLAGS} ${python_path}"  
586 - AC_SUBST([PYTHON_CPPFLAGS])  
587 587
588 - # ... otherwise check for includes relative to exectuable (obsolete?)  
589 - else 588 + # If we have distutils then get python path from distutils ...
  589 + if test -z "$ac_distutils_result"; then
  590 + if test ${PYTHON_VERSION} '<' 3; then
  591 + python_path=`$PYTHON -c "import distutils.sysconfig; \
  592 + print distutils.sysconfig.get_python_inc();"`
  593 + else
  594 + python_path=`$PYTHON -c "import distutils.sysconfig; \
  595 + print(distutils.sysconfig.get_python_inc());"`
  596 + fi
  597 + if test -n "${python_path}"; then
  598 + AC_CHECK_HEADERS($python_path/Python.h, [has_python_h="yes"], [has_python_h="no"])
  599 + python_path="-I$python_path"
  600 + fi
  601 + PYTHON_CPPFLAGS=$python_path
  602 + CPPFLAGS="${CPPFLAGS} ${python_path}"
  603 + AC_SUBST([PYTHON_CPPFLAGS])
  604 +
  605 + # ... otherwise check for includes relative to exectuable (obsolete?)
  606 + else
590 607
591 - # Determine include path for python  
592 - AC_PATH_PROG(PY_INCLUDE, python)  
593 - PY_INCLUDE=`echo $PY_INCLUDE | sed -e "s/bin/include/"`  
594 - PY_INCLUDE="$PY_INCLUDE$PYTHON_VERSION" 608 + # Determine include path for python
  609 + AC_PATH_PROG(PY_INCLUDE, python)
  610 + PY_INCLUDE=`echo $PY_INCLUDE | sed -e "s/bin/include/"`
  611 + PY_INCLUDE="$PY_INCLUDE$PYTHON_VERSION"
595 612
596 - # Check if we have Python.h  
597 - AC_CHECK_HEADERS($PY_INCLUDE/Python.h, [has_python_h="yes"], [has_python_h="no"]) 613 + # Check if we have Python.h
  614 + AC_CHECK_HEADERS($PY_INCLUDE/Python.h, [has_python_h="yes"], [has_python_h="no"])
598 615
599 - # Signal any problem  
600 - if test "x$has_python_h" = "xno"; then  
601 - AC_MSG_WARN([No Python header file "$PY_INCLUDE/Python.h" found. Please install appropriate Python development package.]) 616 + # Signal any problem
  617 + if test "x$has_python_h" = "xno"; then
  618 + AC_MSG_WARN([No Python header file "$PY_INCLUDE/Python.h" found. Please install appropriate Python development package.])
  619 + fi
602 fi 620 fi
603 - fi  
604 621
605 -fi 622 + fi
606 623
607 -# Do we have swig?  
608 -AC_PATH_PROG([SWIG], [swig])  
609 -if test "$SWIG"; then  
610 - has_swig="yes"  
611 -fi  
612 -AM_CONDITIONAL(HAVE_SWIG, test "x$has_swig" = "xyes") 624 + # Do we have swig?
  625 + AC_PATH_PROG([SWIG], [swig])
  626 + if test "$SWIG"; then
  627 + has_swig="yes"
  628 + fi
613 629
614 -# Do we have wrappers (ctools_wrap.cpp and ctools.py)?  
615 -has_wrappers="yes"  
616 -AC_CHECK_FILES([pyext/ctools_wrap.cpp pyext/ctools.py],,  
617 - [has_wrappers="no"])  
618 -if test "x$has_wrappers" = "xno"; then  
619 - AC_MSG_WARN([Python wrapper missing. Requires swig for wrapper generation.])  
620 -fi 630 + # Do we have wrappers (ctools_wrap.cpp and ctools.py)?
  631 + has_wrappers="yes"
  632 + AC_CHECK_FILES([pyext/ctools_wrap.cpp pyext/ctools.py],,
  633 + [has_wrappers="no"])
  634 + if test "x$has_wrappers" = "xno"; then
  635 + AC_MSG_WARN([Python wrapper missing. Requires swig for wrapper generation.])
  636 + fi
621 637
622 -# Signal if Python is enabled  
623 -if test "x$ac_enable_python_binding" = "xyes" -a "x$has_python" = "xyes" -a "x$has_python_h" = "xyes"; then  
624 - if test "x$has_swig" = "xyes" -o "x$has_wrappers" = "xyes"; then  
625 - enable_python="yes" 638 + # Signal if Python is enabled
  639 + if test "x$ac_enable_python_binding" = "xyes" -a "x$has_python" = "xyes" -a "x$has_python_h" = "xyes"; then
  640 + if test "x$has_swig" = "xyes" -o "x$has_wrappers" = "xyes"; then
  641 + enable_python="yes"
  642 + fi
626 fi 643 fi
  644 +
627 fi 645 fi
  646 +AM_CONDITIONAL(HAVE_SWIG, test "x$has_swig" = "xyes")
628 AM_CONDITIONAL(WITH_PYTHON, test "x$enable_python" = "xyes") 647 AM_CONDITIONAL(WITH_PYTHON, test "x$enable_python" = "xyes")
629 648
630 # Set Python environment 649 # Set Python environment
@@ -723,6 +742,7 @@ fi @@ -723,6 +742,7 @@ fi
723 # Initialise OpenMP availability 742 # Initialise OpenMP availability
724 openmp_ok=no 743 openmp_ok=no
725 gammalib_with_openmp=no 744 gammalib_with_openmp=no
  745 +darwin_kluge=no
726 746
727 # Detect if GammaLib has been compiled with OpenMP 747 # Detect if GammaLib has been compiled with OpenMP
728 AC_MSG_CHECKING(whether GammaLib has been compiled with OpenMP) 748 AC_MSG_CHECKING(whether GammaLib has been compiled with OpenMP)
@@ -736,9 +756,6 @@ if test &quot;x$ac_cv_prog_cxx_openmp&quot; != &quot;xunsupported&quot; &amp;&amp; test &quot;x$ac_cv_prog_cxx_op @@ -736,9 +756,6 @@ if test &quot;x$ac_cv_prog_cxx_openmp&quot; != &quot;xunsupported&quot; &amp;&amp; test &quot;x$ac_cv_prog_cxx_op
736 openmp_ok=yes 756 openmp_ok=yes
737 fi 757 fi
738 758
739 -# Signal actual test  
740 -AC_MSG_CHECKING(whether to enable OpenMP)  
741 -  
742 # If OpenMP is available 759 # If OpenMP is available
743 if test "x$openmp_ok" = "xyes"; then 760 if test "x$openmp_ok" = "xyes"; then
744 761
@@ -758,12 +775,34 @@ if test &quot;x$openmp_ok&quot; = &quot;xyes&quot;; then @@ -758,12 +775,34 @@ if test &quot;x$openmp_ok&quot; = &quot;xyes&quot;; then
758 LDFLAGS=$SAVED_LDFLAGS 775 LDFLAGS=$SAVED_LDFLAGS
759 fi 776 fi
760 777
  778 + # Special Darwin test to see whether OpenMP compiles without adding the
  779 + # gomp_thread_attr global or whether we need to add this global.
  780 + if test "$ac_sys_system" = "Darwin"; then
  781 + AC_MSG_CHECKING(whether we need to add gomp_thread_attr)
  782 + SAVED_CXXFLAGS=$CXXFLAGS
  783 + CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
  784 + AC_TRY_RUN(AC_LANG_PROGRAM([#include <omp.h>],
  785 + [omp_set_num_threads(1);]),
  786 + [AC_MSG_RESULT(no)],
  787 + [AC_TRY_RUN(AC_LANG_PROGRAM([#include <omp.h>;
  788 + #include <pthread.h>;
  789 + pthread_attr_t gomp_thread_attr;],
  790 + [omp_set_num_threads(1);]),
  791 + [AC_MSG_RESULT(yes)
  792 + darwin_kluge="yes"
  793 + AC_DEFINE([HAVE_OPENMP_DARWIN_KLUGE], [1], [Define if OpenMP Darwin kluge is needed])],
  794 + [AC_MSG_RESULT(no)
  795 + AC_MSG_WARN([Do not manage to compile OpenMP.])])])
  796 + CXXFLAGS=$SAVED_CXXFLAGS
  797 + fi
  798 +
761 # If gammalib is compiled with OpenMP, ctools must also be compiled with 799 # If gammalib is compiled with OpenMP, ctools must also be compiled with
762 # openmp 800 # openmp
763 if test "x$gammalib_with_openmp" = "xyes"; then 801 if test "x$gammalib_with_openmp" = "xyes"; then
764 enable_openmp="yes" 802 enable_openmp="yes"
765 else 803 else
766 # ... otherwise, we use it optionally 804 # ... otherwise, we use it optionally
  805 + AC_MSG_CHECKING(whether to enable OpenMP)
767 AC_ARG_ENABLE([openmp], 806 AC_ARG_ENABLE([openmp],
768 AS_HELP_STRING([--enable-openmp], 807 AS_HELP_STRING([--enable-openmp],
769 [turn on OpenMP support [default=yes]]), 808 [turn on OpenMP support [default=yes]]),
@@ -786,13 +825,13 @@ AC_SUBST(OPENMP_CXXFLAGS) @@ -786,13 +825,13 @@ AC_SUBST(OPENMP_CXXFLAGS)
786 825
787 # Set system specific settings 826 # Set system specific settings
788 OPENMP_LIB_LDFLAGS= 827 OPENMP_LIB_LDFLAGS=
789 -if test "x$enable_openmp" = "xyes"; then  
790 - case $ac_sys_system/$ac_sys_release in  
791 - Darwin/*)  
792 - OPENMP_LIB_LDFLAGS=-lgomp  
793 - ;;  
794 - esac  
795 -fi 828 +#if test "x$enable_openmp" = "xyes"; then
  829 +# case $ac_sys_system/$ac_sys_release in
  830 +# Darwin/*)
  831 +# OPENMP_LIB_LDFLAGS=-lgomp
  832 +# ;;
  833 +# esac
  834 +#fi
796 AC_SUBST(OPENMP_LIB_LDFLAGS) 835 AC_SUBST(OPENMP_LIB_LDFLAGS)
797 836
798 # Signal if ctools cannot be compiled as gammalibe requires OpenMP but ctools 837 # Signal if ctools cannot be compiled as gammalibe requires OpenMP but ctools
@@ -861,26 +900,6 @@ if test &quot;x$has_gammalib&quot; = &quot;xyes&quot;; then @@ -861,26 +900,6 @@ if test &quot;x$has_gammalib&quot; = &quot;xyes&quot;; then
861 else 900 else
862 echo " - GammaLib support (no) no gammalib library found" 901 echo " - GammaLib support (no) no gammalib library found"
863 fi 902 fi
864 -if test "x$has_python" = "xyes"; then  
865 - echo " * Python (yes)"  
866 -else  
867 - echo " - Python (no)"  
868 -fi  
869 -if test "x$has_python_h" = "xyes"; then  
870 - echo " * Python.h (yes)"  
871 -else  
872 - echo " - Python.h (no)"  
873 -fi  
874 -if test "x$has_swig" = "xyes"; then  
875 - echo " * swig (yes)"  
876 -else  
877 - echo " - swig (no)"  
878 -fi  
879 -if test "x$has_wrappers" = "xyes"; then  
880 - echo " * Python wrappers (yes)"  
881 -else  
882 - echo " - Python wrappers (no)"  
883 -fi  
884 903
885 # Dump Python binding information 904 # Dump Python binding information
886 if test "x$ac_enable_python_binding" = "xyes"; then 905 if test "x$ac_enable_python_binding" = "xyes"; then
@@ -905,6 +924,26 @@ if test &quot;x$ac_enable_python_binding&quot; = &quot;xyes&quot;; then @@ -905,6 +924,26 @@ if test &quot;x$ac_enable_python_binding&quot; = &quot;xyes&quot;; then
905 else 924 else
906 echo " - Make Python binding (no) Python not installed" 925 echo " - Make Python binding (no) Python not installed"
907 fi 926 fi
  927 + if test "x$has_python" = "xyes"; then
  928 + echo " * Python (yes)"
  929 + else
  930 + echo " - Python (no)"
  931 + fi
  932 + if test "x$has_python_h" = "xyes"; then
  933 + echo " * Python.h (yes)"
  934 + else
  935 + echo " - Python.h (no)"
  936 + fi
  937 + if test "x$has_swig" = "xyes"; then
  938 + echo " * swig (yes)"
  939 + else
  940 + echo " - swig (no)"
  941 + fi
  942 + if test "x$has_wrappers" = "xyes"; then
  943 + echo " * Python wrappers (yes)"
  944 + else
  945 + echo " - Python wrappers (no)"
  946 + fi
908 else 947 else
909 echo " - Make Python binding (no)" 948 echo " - Make Python binding (no)"
910 fi 949 fi
ctools.pc.in
@@ -8,7 +8,7 @@ Description: CTA science analysis tools @@ -8,7 +8,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.6.0 9 Version: 0.6.0
10 Requires: 10 Requires:
11 -Requires.private: GammaLib >= 0.6.0 11 +Requires.private: GammaLib >= 0.6.2
12 Conflicts: 12 Conflicts:
13 Cflags: -I${includedir}/ctools 13 Cflags: -I${includedir}/ctools
14 Libs: -L${libdir} -lctools 14 Libs: -L${libdir} -lctools
doc/html/download.html
@@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
7 <body> 7 <body>
8 <p class="Header">Download</p> 8 <p class="Header">Download</p>
9 <p style="padding-top: 0pt; text-align: left;" class="Body"> 9 <p style="padding-top: 0pt; text-align: left;" class="Body">
10 -The latest ctools release is <span style="font-family: Courier New,Courier,monospace;">ctools-00-05-00</span>  
11 -(14 September 2012).</p> 10 +The latest ctools release is <span style="font-family: Courier New,Courier,monospace;">ctools-00-05-01</span>
  11 +(18 September 2012).</p>
12 <br> 12 <br>
13 <br> 13 <br>
14 <p class="Header">Latest release</p> 14 <p class="Header">Latest release</p>
@@ -23,6 +23,11 @@ and gammalib versions.&lt;/p&gt; @@ -23,6 +23,11 @@ and gammalib versions.&lt;/p&gt;
23 <td>Mac OS X package</td> 23 <td>Mac OS X package</td>
24 </tr> 24 </tr>
25 <tr class="Body" style="text-align: center;"> 25 <tr class="Body" style="text-align: center;">
  26 +<td><a href="releases/ctools/ctools-00-05-01.tar.gz">00-05-01</a></td>
  27 +<td><a href="releases/gammalib/gammalib-00-06-02.tar.gz">00-06-02</a></td>
  28 +<td><a href="releases/ctools/ctools-00-05-01-macosx10.3.dmg">ctools-00-05-01-macosx10.3.dmg</a></td>
  29 +</tr>
  30 +<tr class="Body" style="text-align: center;">
26 <td><a href="releases/ctools/ctools-00-05-00.tar.gz">00-05-00</a></td> 31 <td><a href="releases/ctools/ctools-00-05-00.tar.gz">00-05-00</a></td>
27 <td><a href="releases/gammalib/gammalib-00-06-01.tar.gz">00-06-01</a></td> 32 <td><a href="releases/gammalib/gammalib-00-06-01.tar.gz">00-06-01</a></td>
28 <td><a href="releases/ctools/ctools-00-05-00-macosx10.3.dmg">ctools-00-05-00-macosx10.3.dmg</a></td> 33 <td><a href="releases/ctools/ctools-00-05-00-macosx10.3.dmg">ctools-00-05-00-macosx10.3.dmg</a></td>
@@ -77,6 +82,6 @@ and gammalib versions.&lt;/p&gt; @@ -77,6 +82,6 @@ and gammalib versions.&lt;/p&gt;
77 <br> 82 <br>
78 <hr size="1"> 83 <hr size="1">
79 <p class="Body">Last updated by: J&uuml;rgen 84 <p class="Body">Last updated by: J&uuml;rgen
80 -Kn&ouml;dlseder (15 September 2012) 85 +Kn&ouml;dlseder (18 September 2012)
81 </p> 86 </p>
82 </body></html> 87 </body></html>
83 \ No newline at end of file 88 \ No newline at end of file
pyext/Makefile.am
1 ############################################################################# 1 #############################################################################
2 # Makefile for ctools Python extension module # 2 # Makefile for ctools Python extension module #
3 # ------------------------------------------------------------------------- # 3 # ------------------------------------------------------------------------- #
4 -# Copyright (C) 2011 Jurgen Knodlseder # 4 +# Copyright (C) 2011-2012 Juergen Knoedlseder #
5 # ------------------------------------------------------------------------- # 5 # ------------------------------------------------------------------------- #
6 # # 6 # #
7 # This program is free software: you can redistribute it and/or modify # 7 # This program is free software: you can redistribute it and/or modify #
@@ -53,14 +53,6 @@ all-local: build @@ -53,14 +53,6 @@ all-local: build
53 build: ctools_wrap.cpp ctools.py 53 build: ctools_wrap.cpp ctools.py
54 $(PYTHON) setup.py build 54 $(PYTHON) setup.py build
55 55
56 -# If 'make check' is invoked we build the extension modules inplace, so that  
57 -# putting the 'pyext' directory in the PYTHONPATH allows importing the gammalib  
58 -# module. We also catch this special build in the setup script to force static  
59 -# linking with libgamma, which will allow a successful 'make check' on systems  
60 -# (such as Mac OS X) that have fixed shared library paths.  
61 -check-local:  
62 - $(PYTHON) setup.py build_ext --inplace  
63 -  
64 install-exec-local: 56 install-exec-local:
65 $(PYTHON) setup.py install --prefix=$(prefix) 57 $(PYTHON) setup.py install --prefix=$(prefix)
66 58
pyext/setup.py.in
@@ -25,13 +25,6 @@ import glob @@ -25,13 +25,6 @@ import glob
25 import os 25 import os
26 import sys 26 import sys
27 27
28 -# Detect execution mode  
29 -is_unit_test = False  
30 -if (len(sys.argv) >= 3):  
31 - if (sys.argv[2] == '--inplace'):  
32 - print@PYTHON_OPEN@"This build is for unit testing."@PYTHON_CLOSE@  
33 - is_unit_test = True  
34 -  
35 # Darwin MacPorts kluge: Remove -L/opt/local/lib path from LDSHARED as this 28 # Darwin MacPorts kluge: Remove -L/opt/local/lib path from LDSHARED as this
36 # overrides the GammaLib settings. Otherwise, MacPorts libraries would be 29 # overrides the GammaLib settings. Otherwise, MacPorts libraries would be
37 # used instead of the libraries selected by GammaLib 30 # used instead of the libraries selected by GammaLib
@@ -50,43 +43,17 @@ if sys.platform.lower().startswith(&quot;darwin&quot;): @@ -50,43 +43,17 @@ if sys.platform.lower().startswith(&quot;darwin&quot;):
50 else: 43 else:
51 ldshared_rm += option + ' ' 44 ldshared_rm += option + ' '
52 if (len(ldshared_rm) > 0): 45 if (len(ldshared_rm) > 0):
53 - print@PYTHON_OPEN@"Removed following option(s) from LDSHARED: "+ldshared_rm@PYTHON_CLOSE@ 46 + sys.stdout.write("Removed following option(s) from LDSHARED: "+ldshared_rm+"\n");
54 47
55 # Set LDSHARED 48 # Set LDSHARED
56 cvars['LDSHARED'] = ldshared_new 49 cvars['LDSHARED'] = ldshared_new
57 50
58 -# Set ctools library name. If we're about to make the test build then  
59 -# create a symbolic link to the static library to enforce static linking.  
60 -# This is required on some system (such as Mac OS X) to avoid problems  
61 -# with finding the shared library during unit testing.  
62 -libcta='ctools'  
63 -#if is_unit_test:  
64 -if sys.platform.lower().startswith("darwin") and is_unit_test:  
65 -  
66 - # Remove any existing symbolic link to libctools.a. This will  
67 - # prevent any exception in creating the symbolic link due to  
68 - # an already existing link.  
69 - try:  
70 - os.remove('../src/.libs/libctools_python.a')  
71 - print@PYTHON_OPEN@"Removed ../src/.libs/libctools_python.a"@PYTHON_CLOSE@  
72 - except:  
73 - pass  
74 -  
75 - # Now create a symbolic link and set the library name to this  
76 - # symbolic link  
77 - try:  
78 - os.symlink('libctools.a', '../src/.libs/libctools_python.a')  
79 - print@PYTHON_OPEN@"Created ../src/.libs/libctools_python.a"@PYTHON_CLOSE@  
80 - libcta='ctools_python'  
81 - except:  
82 - print@PYTHON_OPEN@"WARNING: Failed to create symbolic link to static library. Link dynamically."@PYTHON_CLOSE@  
83 -  
84 # Set default include directories and data files 51 # Set default include directories and data files
85 include_dirs = ['@prefix@/include/gammalib'] 52 include_dirs = ['@prefix@/include/gammalib']
86 install_files = glob.glob('@top_srcdir@/pyext/*.i') 53 install_files = glob.glob('@top_srcdir@/pyext/*.i')
87 library_dirs = ['../src/.libs'] 54 library_dirs = ['../src/.libs']
88 runtime_library_dirs = ['../src/.libs'] 55 runtime_library_dirs = ['../src/.libs']
89 -libraries = [libcta,'gamma'] 56 +libraries = ['ctools','gamma']
90 57
91 # Add install directory to runtime library path 58 # Add install directory to runtime library path
92 if os.path.exists('@prefix@/lib'): 59 if os.path.exists('@prefix@/lib'):
@@ -126,11 +93,8 @@ for extra_include_dir in extra_include_dirs: @@ -126,11 +93,8 @@ for extra_include_dir in extra_include_dirs:
126 if len(dir) > 0: 93 if len(dir) > 0:
127 include_dirs.append(dir) 94 include_dirs.append(dir)
128 95
129 -# Set data files to install. Do not install data files in unit testing mode.  
130 -if is_unit_test:  
131 - data_files=[]  
132 -else:  
133 - data_files=[('@prefix@/share/ctools/swig', install_files)] 96 +# Set data files to install.
  97 +data_files=[('@prefix@/share/ctools/swig', install_files)]
134 98
135 # Optionally enable OpenMP 99 # Optionally enable OpenMP
136 if '@OPENMP_TRUE@' != '#': 100 if '@OPENMP_TRUE@' != '#':
@@ -160,3 +124,19 @@ setup(name=&#39;@PACKAGE_NAME@&#39;, @@ -160,3 +124,19 @@ setup(name=&#39;@PACKAGE_NAME@&#39;,
160 long_description="CTA science analysis tools", 124 long_description="CTA science analysis tools",
161 platforms=["Linux", "Solaris", "Mac OS-X", "Unix", "BSD"], 125 platforms=["Linux", "Solaris", "Mac OS-X", "Unix", "BSD"],
162 ) 126 )
  127 +
  128 +# Post-processing. A symbolic link is created to the directory containing the
  129 +# shared wrapper libraries so that we can add this directory to the PYTHONPATH
  130 +# for testing.
  131 +try:
  132 + os.chdir('build')
  133 + os.remove('ctools')
  134 + sys.stdout.write("Removed symbolic link build/ctools.\n")
  135 +except:
  136 + pass
  137 +try:
  138 + path = glob.glob('lib.*')
  139 + os.symlink(path[0], 'ctools')
  140 + sys.stdout.write("Created symbolic link build/ctools.\n")
  141 +except:
  142 + sys.stdout.write("WARNING: Failed to create symbolic link build/ctools.\n")
src/ctools-setup.in
@@ -29,7 +29,7 @@ fi @@ -29,7 +29,7 @@ fi
29 prefix="@prefix@" 29 prefix="@prefix@"
30 exec_prefix="@exec_prefix@" 30 exec_prefix="@exec_prefix@"
31 ctools_bin="@bindir@" 31 ctools_bin="@bindir@"
32 -ctools_lib="@libdir@" 32 +ctools_lib="@libdir@@TEST_ENV_DIR@"
33 uname_system=`uname` 33 uname_system=`uname`
34 python_dir="@pythondir@" 34 python_dir="@pythondir@"
35 python_exec_dir="@pyexecdir@" 35 python_exec_dir="@pyexecdir@"
test/Makefile.am
@@ -8,11 +8,10 @@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@ @@ -8,11 +8,10 @@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
8 if WITH_PYTHON 8 if WITH_PYTHON
9 TEST_CSCRIPTS = test_cscripts.sh 9 TEST_CSCRIPTS = test_cscripts.sh
10 TEST_PYTHON_SCRIPT = test_python.py 10 TEST_PYTHON_SCRIPT = test_python.py
11 - TEST_PYTHON_ENV = PYTHONPATH=$(top_builddir)/pyext:$(top_builddir)/scripts:$(pythondir):$(pyexecdir):$(PYTHONPATH) 11 + TEST_PYTHON_ENV = PYTHONPATH=$(top_builddir)/pyext:$(top_builddir)/pyext/build/ctools:$(top_builddir)/scripts:$(pythondir):$(pyexecdir):$(PYTHONPATH)
12 endif 12 endif
13 13
14 # Set test environment 14 # Set test environment
15 -#TESTS_ENVIRONMENT = $(TEST_PYTHON_ENV)  
16 TESTS_ENVIRONMENT = @RUNSHARED@=$(top_builddir)/src/.libs$(TEST_ENV_DIR):$(LIBDIR_GAMMALIB):$(@RUNSHARED@) \ 15 TESTS_ENVIRONMENT = @RUNSHARED@=$(top_builddir)/src/.libs$(TEST_ENV_DIR):$(LIBDIR_GAMMALIB):$(@RUNSHARED@) \
17 $(TEST_PYTHON_ENV) 16 $(TEST_PYTHON_ENV)
18 17