From a8324fd7de8b48b6c25cdec6a9e7028f14caeb41 Mon Sep 17 00:00:00 2001 From: Michael Bentley Date: Thu, 10 Oct 2019 16:18:12 -0600 Subject: [PATCH] Set double to be the default for all compilation modes --- CMakeLists.txt | 2 +- configure.ac | 26 ++++++++++++++++---------- doc/compile-and-install.rst | 8 ++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35bf430..33da199 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ option(BUILD_DOCUMENTATION "Build the documentation" OFF) option(BUILD_SHARED_LIBS "Build libccd as a shared library" ON) option(ENABLE_DOUBLE_PRECISION - "Enable double precision computations instead of single precision" OFF) + "Enable double precision computations instead of single precision" ON) # Option for some bundle-like build system in order not to expose # any FCL binary symbols in their public ABI diff --git a/configure.ac b/configure.ac index abd80c2..5d71485 100644 --- a/configure.ac +++ b/configure.ac @@ -30,17 +30,23 @@ AC_FUNC_FORK AC_FUNC_REALLOC AC_CHECK_FUNCS([clock_gettime]) -use_double=no AC_ARG_ENABLE(double-precision, - AS_HELP_STRING([--enable-double-precision], - [enable double precision computations instead of single precision]), - [use_double=yes]) -if test $use_double = no -then - AC_DEFINE([CCD_SINGLE], [], [use single precision]) -else - AC_DEFINE([CCD_DOUBLE], [], [use double precision]) -fi + AS_HELP_STRING([--disable-double-precision], + [use single precision instead of double preicision])) +AS_IF([test "x$enable_double_precision" == "xno"], + [AC_DEFINE([CCD_SINGLE], [], [use single precision])], + [AC_DEFINE([CCD_DOUBLE], [], [use double precision])]) +#use_double=no +#AC_ARG_ENABLE(double-precision, +# AS_HELP_STRING([--enable-double-precision], +# [enable double precision computations instead of single precision]), +# [use_double=yes]) +#if test $use_double = no +#then +# AC_DEFINE([CCD_SINGLE], [], [use single precision]) +#else +# AC_DEFINE([CCD_DOUBLE], [], [use double precision]) +#fi AC_CONFIG_FILES([Makefile diff --git a/doc/compile-and-install.rst b/doc/compile-and-install.rst index 274ec64..f72edb8 100644 --- a/doc/compile-and-install.rst +++ b/doc/compile-and-install.rst @@ -56,8 +56,8 @@ Run make and make install: $ make && make install configure script can change the way libccd is compiled and installed, most -significant option is ``--enable-double-precision`` which enables double -precision (single is default in this case). +significant option is ``--disable-double-precision`` which enables single +precision (double is default in this case). 3. Using CMake --------------- @@ -88,12 +88,12 @@ Other build tools may be using by specifying a different generator. For example: > cmake -G "Visual Studio 14 2015" .. -To compile using double precision, set the ``ENABLE_DOUBLE_PRECISION`` option: +To compile using single precision, set the ``ENABLE_DOUBLE_PRECISION`` option to ``OFF``: .. code-block:: bash $ mkdir build && cd build - $ cmake -G "Unix Makefiles" -DENABLE_DOUBLE_PRECISION=ON .. + $ cmake -G "Unix Makefiles" -DENABLE_DOUBLE_PRECISION=OFF .. $ make && make install To build libccd as a shared library, set the ``BUILD_SHARED_LIBS`` option: