Changeset 2103


Ignore:
Timestamp:
Nov 6, 2009, 1:40:26 PM (12 years ago)
Author:
Peter
Message:

merging patch release 0.5.5 into trunk. Delta 0.5.5 - 0.5.4

Location:
trunk
Files:
10 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r2089 r2103  
    1717  A complete list of closed tickets can be found here [[br]]
    1818  http://dev.thep.lu.se/yat/query?status=closed&milestone=yat+0.6
     19
     20Version 0.5.5 (released 5 November 2009)
     21
     22  - SVM::predict is calculated as geometric distance (issue #542)
     23  - detection of GSL is improved (issue #558)
     24
     25  A complete list of closed tickets can be found here [[br]]
     26  http://dev.thep.lu.se/yat/query?status=closed&milestone=yat+0.5.5
    1927
    2028Version 0.5.4 (released 12 June 2009)
  • trunk/build_support/svn_support.am

    r2056 r2103  
    6565    exit 1;; \
    6666  esac
    67   @date=`date -u "+%d %B %Y"` &&\
     67  @date=`date -u "+%e %B %Y"` &&\
    6868  case `sed 15q $(srcdir)/NEWS` in \
    6969  *"$$date"*);; \
  • trunk/configure.ac

    r2088 r2103  
    113113   dx_enable_ps=$dx_enable_dvi
    114114   ACLTX_PROG_DVIPS([dx_enable_ps=no])
     115   AS_IF([test "x$dx_enable_ps" != xno], [
     116     YAT_PROG_DVIPS_PSPICTURE([], [dx_enable_ps=no
     117                                   AC_MSG_NOTICE([ps generation turned off])])
     118   ])
    115119  ]
    116120)
     
    124128AC_CONFIG_FILES([test/documentation_test.sh],
    125129                [chmod +x test/documentation_test.sh])
    126 
    127 # Save user-defined environment settings for later restoration
    128 APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
    129 APR_SAVE_THE_ENVIRONMENT(CXXFLAGS)
    130 APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
    131 APR_SAVE_THE_ENVIRONMENT(LIBS)
    132 
    133 # Checks for libraries.
    134 AC_MSG_NOTICE([checking for libraries])
    135 AC_CHECK_LIBM
    136 
    137 # find library implementing BLAS C API, or use gslcblas
    138 YAT_LIB_CBLAS([YAT_CBLAS_LIB=$CBLAS_LIB], [YAT_CBLAS_LIB=-lgslcblas])
    139 
    140 # GNU Scientific Library, GSL http://www.gnu.org/software/gsl/, checks
    141 # Including AX_PATH_GSL macro from gsl.m4 distributed by GSL
    142 gsl_version="1.8"
    143 AC_SUBST(gsl_version)
    144 gsl_ok=yes
    145 YAT_CHECK_GSL([$gsl_version],[gsl_ok=yes],[gsl_ok=no])
    146 
    147 # Boost http://www.boost.org
    148 boost_version=1.33
    149 AC_SUBST(boost_version)
    150 AX_BOOST_BASE(["$boost_version"])
    151 boost_version_check=$succeeded;
    152 YAT_CPP_ADD_FLAG([CPPFLAGS], [$BOOST_CPPFLAGS])
    153 
    154 #support for large files
    155 AC_SYS_LARGEFILE
    156 if test "$enable_largefile" = "no"; then
    157   AC_DEFINE([YAT_LFS_DISABLED], 1,
    158             [defined to 1 if large file support is disabled])
    159 fi
    160 
    161 # we use prefix INTERNAL_ for variables that are solely needed for
    162 # building yat, i.e., they are not needed for a user of yat and are
    163 # not propagated to yat-config or yat.m4.
    164 YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wall -pedantic])
    165 YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DHAVE_INLINE=1])
    166 AC_ARG_ENABLE([debug],
    167   [AS_HELP_STRING([--enable-debug],[turn on debug options and code])])
    168 if test "${enable_debug}" = "yes" ; then
    169   YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DYAT_DEBUG=1])
    170   YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-g -O])
    171 else
    172   # avoid defining GSL_RANGE_CHECK_OFF if GSL_RANGE_CHECK is already defined
    173   AX_C_IFDEF([GSL_RANGE_CHECK],[],
    174              [YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DGSL_RANGE_CHECK_OFF])] )
    175   YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DNDEBUG])
    176   YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-O3])
    177 fi
    178 
    179 AC_ARG_ENABLE([svn-support],
    180               [AS_HELP_STRING([--enable-svn-support],
    181                               [enable svn support - used by yat maintainer])])
    182 
    183 if test "x$enable_svn-support" = "xyes"; then
    184   svn_error_msg="svn support cannot be enabled:"
    185   AS_IF([test "x$MD5" = "xno"],
    186         [AC_MSG_ERROR([$svn_error_msg tool to create md5 file not found])])
    187 
    188   AC_CHECK_FILE([$srcdir/.svn], ,
    189                 AC_MSG_ERROR([$svn_error_msg `$srcdir' is not an svn wc.]))
    190 fi
    191 AM_CONDITIONAL([ENABLE_SVN_SUPPORT], [test "x$enable_svn_support" = "xyes"])
    192 
    193130
    194131# check for quiet_NaN support in OS
     
    261198                  [AC_MSG_RESULT([no])] )
    262199
     200# Save user-defined environment settings for later restoration
     201APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
     202APR_SAVE_THE_ENVIRONMENT(CXXFLAGS)
     203APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
     204APR_SAVE_THE_ENVIRONMENT(LIBS)
     205
     206# Checks for libraries.
     207AC_MSG_NOTICE([checking for libraries])
     208AC_CHECK_LIBM
     209
     210# find library implementing BLAS C API, or use gslcblas
     211YAT_LIB_CBLAS([YAT_CBLAS_LIB=$CBLAS_LIB], [YAT_CBLAS_LIB=-lgslcblas])
     212
     213# GNU Scientific Library, GSL http://www.gnu.org/software/gsl/, checks
     214# Including AX_PATH_GSL macro from gsl.m4 distributed by GSL
     215gsl_version="1.8"
     216AC_SUBST(gsl_version)
     217gsl_ok=yes
     218YAT_CHECK_GSL([$gsl_version],[gsl_ok=yes],[gsl_ok=no])
     219
     220# Boost http://www.boost.org
     221boost_version=1.33
     222AC_SUBST(boost_version)
     223AX_BOOST_BASE(["$boost_version"])
     224boost_version_check=$succeeded;
     225YAT_CPP_ADD_FLAG([CPPFLAGS], [$BOOST_CPPFLAGS])
     226
     227#support for large files
     228AC_SYS_LARGEFILE
     229if test "$enable_largefile" = "no"; then
     230  AC_DEFINE([YAT_LFS_DISABLED], 1,
     231            [defined to 1 if large file support is disabled])
     232fi
     233
     234# we use prefix INTERNAL_ for variables that are solely needed for
     235# building yat, i.e., they are not needed for a user of yat and are
     236# not propagated to yat-config or yat.m4.
     237YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wall -pedantic])
     238YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DHAVE_INLINE=1])
     239AC_ARG_ENABLE([debug],
     240  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])])
     241if test "${enable_debug}" = "yes" ; then
     242  YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DYAT_DEBUG=1])
     243  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-g -O])
     244else
     245  # avoid defining GSL_RANGE_CHECK_OFF if GSL_RANGE_CHECK is already defined
     246  AX_C_IFDEF([GSL_RANGE_CHECK],[],
     247             [YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DGSL_RANGE_CHECK_OFF])] )
     248  YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DNDEBUG])
     249  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-O3])
     250fi
     251
     252# some versions of boost uses long long - turn off compiler warnings
     253# with -Wno-long-long
     254yat_save_CXXFLAGS=$CXXFLAGS
     255# use -pedantic and friends in CXXFLAGS temporarily
     256CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
     257# turn warnings into errors
     258YAT_CXX_ADD_FLAG([CXXFLAGS], [-Werror])
     259AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
     260  [
     261    @%:@include <boost/iterator/transform_iterator.hpp>
     262    @%:@include <cmath>
     263    @%:@include <functional>
     264    @%:@include <vector>
     265  ],[
     266      using namespace boost;
     267      typedef std::pointer_to_unary_function<double, double> F;
     268      std::vector<double> vec;
     269      transform_iterator<F, std::vector<double>::iterator>
     270        i(vec.begin(), std::ptr_fun(fabs));
     271  ])],
     272[],
     273[YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-Wno-long-long])])
     274# restore CXXFLAGS
     275CXXFLAGS=$yat_save_CXXFLAGS
     276
     277AC_ARG_ENABLE([svn-support],
     278              [AS_HELP_STRING([--enable-svn-support],
     279                              [enable svn support - used by yat maintainer])])
     280
     281if test "x$enable_svn-support" = "xyes"; then
     282  svn_error_msg="svn support cannot be enabled:"
     283  AS_IF([test "x$MD5" = "xno"],
     284        [AC_MSG_ERROR([$svn_error_msg tool to create md5 file not found])])
     285
     286  AC_CHECK_FILE([$srcdir/.svn], ,
     287                AC_MSG_ERROR([$svn_error_msg `$srcdir' is not an svn wc.]))
     288fi
     289AM_CONDITIONAL([ENABLE_SVN_SUPPORT], [test "x$enable_svn_support" = "xyes"])
     290
     291
    263292# yat specific settings
    264293YAT_LIBNAME="yat"
  • trunk/doc/Makefile.am

    r2082 r2103  
    66# Copyright (C) 2005 Peter Johansson
    77# Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
     8# Copyright (C) 2009 Peter Johansson
    89#
    910# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2526DOXYGEN_FILES = $(srcdir)/build_tool.doxygen \
    2627$(builddir)/first_page.doxygen \
     28$(srcdir)/footer.html \
    2729$(srcdir)/namespaces.doxygen \
    2830$(srcdir)/concepts.doxygen \
  • trunk/doc/doxygen.config.in

    r1905 r2103  
    479479# standard footer.
    480480
    481 HTML_FOOTER            =
     481HTML_FOOTER            = @srcdir@/footer.html
    482482
    483483# The HTML_STYLESHEET tag can be used to specify a user defined cascading
  • trunk/m4/gsl.m4

    r1954 r2103  
    99AC_ARG_WITH(gsl-exec-prefix,[  --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional)],
    1010            gsl_exec_prefix="$withval", gsl_exec_prefix="")
    11 AC_ARG_ENABLE(gsltest, [  --disable-gsltest       Do not try to compile and run a test GSL program],
    12         , enable_gsltest=yes)
    1311
    1412  if test "x${GSL_CONFIG+set}" != xset ; then
     
    2725  if test "$GSL_CONFIG" = "no" ; then
    2826    no_gsl=yes
     27    AC_MSG_RESULT([no])
     28    AC_MSG_WARN([
     29       The gsl-config script installed by GSL could not be found
     30       If GSL was installed in PREFIX, make sure PREFIX/bin is in
     31       your path, or set the GSL_CONFIG environment variable to the
     32       full path to gsl-config.
     33    ])
    2934  else
    3035    GSL_CFLAGS=`$GSL_CONFIG --cflags`
    3136    GSL_LIBS=`$GSL_CONFIG --libs`
     37    ac_save_LIBS="$LIBS"
     38    CXXFLAGS="$CXXFLAGS $GSL_CFLAGS"
     39    LIBS="$GSL_LIBS $LIBS"
     40    AC_LINK_IFELSE([AC_LANG_PROGRAM(, [return 0])],,[no_gsl=yes]) 
     41    LIBS="$ac_save_LIBS"
     42  fi
    3243
    33     gsl_major_version=`$GSL_CONFIG --version | \
    34            sed 's/^\([[0-9]]*\).*/\1/'`
    35     if test "x${gsl_major_version}" = "x" ; then
    36        gsl_major_version=0
    37     fi
     44  if test "x$no_gsl" = xyes ; then
     45    AC_MSG_RESULT([no])
     46    AC_MSG_WARN([
     47     The test program failed to compile or link. See the config.log
     48     for the exact error that occured. This usually means GSL was
     49     incorrectly installed or that you have moved GSL since it was
     50     installed. In the latter case, you may want to edit the
     51     gsl-config script: $GSL_CONFIG.
     52    ])
     53  else
     54    ac_gsl_version=`$GSL_CONFIG --version`
     55    AX_COMPARE_VERSION([$ac_gsl_version], [ge], [$min_gsl_version],,[no_gsl=yes])
     56    AC_MSG_RESULT([$ac_gsl_version])
     57    if test "x$no_gsl" = xyes ; then
     58      AC_MSG_WARN([
     59       gsl-config --version returned $ac_gsl_version, but the minimum
     60       version of GSL required is $min_gsl_version. If gsl-config is
     61       correct, then it is best to upgrade to the required version. If
     62       gsl-config was wrong, set the environment variable GSL_CONFIG to
     63       point to the correct copy of gsl-config, and remove the file
     64       config.cache before re-running configure. 
     65      ])
     66    fi
     67  fi
    3868
    39     gsl_minor_version=`$GSL_CONFIG --version | \
    40            sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\2/'`
    41     if test "x${gsl_minor_version}" = "x" ; then
    42        gsl_minor_version=0
    43     fi
    44 
    45     gsl_micro_version=`$GSL_CONFIG --version | \
    46            sed 's/^\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\).*/\3/'`
    47     if test "x${gsl_micro_version}" = "x" ; then
    48        gsl_micro_version=0
    49     fi
    50 
    51     if test "x$enable_gsltest" = "xyes" ; then
    52       ac_save_CFLAGS="$CFLAGS"
    53       ac_save_LIBS="$LIBS"
    54       CFLAGS="$CFLAGS $GSL_CFLAGS"
    55       LIBS="$GSL_LIBS $LIBS"
    56 
    57       rm -f conf.gsltest
    58       AC_TRY_RUN([
    59 #include <stdio.h>
    60 #include <stdlib.h>
    61 #include <string.h>
    62 
    63 char* my_strdup (const char *str);
    64 
    65 char*
    66 my_strdup (const char *str)
    67 {
    68   char *new_str;
    69  
    70   if (str)
    71     {
    72       new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
    73       strcpy (new_str, str);
    74     }
    75   else
    76     new_str = NULL;
    77  
    78   return new_str;
    79 }
    80 
    81 int main (void)
    82 {
    83   int major = 0, minor = 0, micro = 0;
    84   int n;
    85   char *tmp_version;
    86 
    87   system ("touch conf.gsltest");
    88 
    89   /* HP/UX 9 (%@#!) writes to sscanf strings */
    90   tmp_version = my_strdup("$min_gsl_version");
    91 
    92   n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) ;
    93 
    94   if (n != 2 && n != 3) {
    95      printf("%s, bad version string\n", "$min_gsl_version");
    96      exit(1);
    97    }
    98 
    99    if (($gsl_major_version > major) ||
    100       (($gsl_major_version == major) && ($gsl_minor_version > minor)) ||
    101       (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro)))
    102     {
    103       exit(0);
    104     }
    105   else
    106     {
    107       printf("\n*** 'gsl-config --version' returned %d.%d.%d, but the minimum version\n", $gsl_major_version, $gsl_minor_version, $gsl_micro_version);
    108       printf("*** of GSL required is %d.%d.%d. If gsl-config is correct, then it is\n", major, minor, micro);
    109       printf("*** best to upgrade to the required version.\n");
    110       printf("*** If gsl-config was wrong, set the environment variable GSL_CONFIG\n");
    111       printf("*** to point to the correct copy of gsl-config, and remove the file\n");
    112       printf("*** config.cache before re-running configure\n");
    113       exit(1);
    114     }
    115 }
    116 
    117 ],, no_gsl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
    118        CFLAGS="$ac_save_CFLAGS"
    119        LIBS="$ac_save_LIBS"
    120      fi
    121   fi
    12269  if test "x$no_gsl" = x ; then
    123      AC_MSG_RESULT(yes)
    12470     ifelse([$2], , :, [$2])     
    12571  else
    126      AC_MSG_RESULT(no)
    127      if test "$GSL_CONFIG" = "no" ; then
    128        echo "*** The gsl-config script installed by GSL could not be found"
    129        echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in"
    130        echo "*** your path, or set the GSL_CONFIG environment variable to the"
    131        echo "*** full path to gsl-config."
    132      else
    133        if test -f conf.gsltest ; then
    134         :
    135        else
    136           echo "*** Could not run GSL test program, checking why..."
    137           CFLAGS="$CFLAGS $GSL_CFLAGS"
    138           LIBS="$GSL_LIBS $LIBS"
    139           AC_TRY_LINK([
    140 #include <stdio.h>
    141 ],      [ return 0; ],
    142         [ echo "*** The test program compiled, but did not run. This usually means"
    143           echo "*** that the run-time linker is not finding GSL or finding the wrong"
    144           echo "*** version of GSL. If it is not finding GSL, you'll need to set your"
    145           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
    146           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
    147           echo "*** is required on your system"
    148     echo "***"
    149           echo "*** If you have an old version installed, it is best to remove it, although"
    150           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
    151         [ echo "*** The test program failed to compile or link. See the file config.log for the"
    152           echo "*** exact error that occured. This usually means GSL was incorrectly installed"
    153           echo "*** or that you have moved GSL since it was installed. In the latter case, you"
    154           echo "*** may want to edit the gsl-config script: $GSL_CONFIG" ])
    155           CFLAGS="$ac_save_CFLAGS"
    156           LIBS="$ac_save_LIBS"
    157        fi
    158      fi
    159 #     GSL_CFLAGS=""
    160 #     GSL_LIBS=""
    16172     ifelse([$3], , :, [$3])
    16273  fi
    16374  AC_SUBST(GSL_CFLAGS)
    16475  AC_SUBST(GSL_LIBS)
    165   rm -f conf.gsltest
    16676])
    16777
  • trunk/m4/gsl_license.txt

    r1785 r2103  
    11We have copied gsl.m4 (CVS revision 1.11) from the GNU Scientific
    2 Library, GSL http://www.gnu.org/software/gsl/. No modification is made
    3 to the file.
     2Library, GSL http://www.gnu.org/software/gsl/. The file has been
     3modified to suit our needs; the exact modifications can be traced
     4using the source code revision system.
    45
    56GSL is distributed under the GNU General License v3,
  • trunk/m4/version.m4

    r1998 r2103  
    5858# yat-0.5.3  2:2:0
    5959# yat-0.5.4  2:3:0
     60# yat-0.5.5  2:4:0
    6061#
    6162# *Accidently, the libtool number was not updated for yat 0.5
  • trunk/yat/classifier/SVM.cc

    r1863 r2103  
    9090        margin_ += 2*alpha_(i)*target(i)*kernel_mod(i,j)*alpha_(j)*target(j);
    9191    }
     92    margin_ = std::sqrt(margin_);
    9293  }
    9394
  • trunk/yat/normalizer/qQuantileNormalizer.cc

    r1813 r2103  
    9696        std::stringstream ss;
    9797        ss << "yat::normalizer::qQuantileNormalizer: relative weight too "
    98            << "large in\n";
     98           << "large. See qQuantileNormalizer constructor documentation "
     99           << "for details on weights.\n";
    99100        throw std::runtime_error(ss.str());
    100101      }
Note: See TracChangeset for help on using the changeset viewer.