kaknikhil commented on a change in pull request #537:
URL: https://github.com/apache/madlib/pull/537#discussion_r569712296



##########
File path: CMakeLists.txt
##########
@@ -57,6 +57,32 @@ if(NOT CMAKE_BUILD_TYPE)
       FORCE)
 endif(NOT CMAKE_BUILD_TYPE)
 
+# The C++11 standard overlaps a lot with older versions of Boost.
+# So before deciding what standard to use for the whole project, we
+#  first detect Boost to see what version is on the system.
+#
+# C++11 is required for recent versions of Boost but will cause problems
+# for older versions of Boost.  Therefore, we detect it here intstead of

Review comment:
       typo in instead

##########
File path: src/CMakeLists.txt
##########
@@ -34,22 +34,28 @@ set(EIGEN_BASE_URL
 # running cmake:
 # "-DBOOST_TAR_SOURCE=/path/to/boost_x_x_x.tar.gz"
 
-set(BOOST_TAR_VERSION "1.61.0")
-set(BOOST_TAR_MD5 874805ba2e2ee415b1877ef3297bf8ad)
-
-string(REPLACE "." "_" _BOOST_TAR_VERSION_UNDERSCORES ${BOOST_TAR_VERSION})
-set(BOOST_TAR "boost_${_BOOST_TAR_VERSION_UNDERSCORES}.tar.gz")
-set(BOOST_URL "${SOURCEFORGE_BASE_URL}/boost/files/${BOOST_TAR}")
+set(BOOST_TR1_TAR_VERSION "1.64.0")   # Most recent version that includes TR1 
(necessary for old C++ compilers)
+set(BOOST_CXX11_TAR_VERSION "1.75.0")  # If CXX11 is enabled, we can use 
latest version of Boost
+set(BOOST_TR1_TAR_MD5 874805ba2e2ee415b1877ef3297bf8ad)
+set(BOOST_CXX11_TAR_MD5 38813f6feb40387dfe90160debd71251)
+
+string(REPLACE "." "_" _BOOST_TR1_TAR_VERSION_UNDERSCORES 
${BOOST_TR1_TAR_VERSION})
+string(REPLACE "." "_" _BOOST_CXX11_TAR_VERSION_UNDERSCORES 
${BOOST_CXX11_TAR_VERSION})
+set(BOOST_TR1_TAR "boost_${_BOOST_TR1_TAR_VERSION_UNDERSCORES}.tar.gz")
+set(BOOST_CXX11_TAR "boost_${_BOOST_CXX11_TAR_VERSION_UNDERSCORES}.tar.gz")
+set(BOOST_TR1_URL "${SOURCEFORGE_BASE_URL}/boost/files/${BOOST_TR1_TAR}")
+set(BOOST_CXX11_URL "${SOURCEFORGE_BASE_URL}/boost/files/${BOOST_CXX11_TAR}")
 
 if(NOT BOOST_TAR_SOURCE)
-    find_file(BOOST_TAR_SOURCE ${BOOST_TAR}
+    find_file(BOOST_TAR_SOURCE ${BOOST_TR1_TAR}
         PATHS ${MAD_THIRD_PARTY}/downloads)
+    if(CXX11)
+        set(BOOST_TAR_SOURCE ${BOOST_TR1_URL})

Review comment:
       shouldn't this be `BOOST_CXX11_URL` and the else should be 
`BOOST_TR1_URL` ?

##########
File path: src/dbal/BoostIntegration/MathToolkit_impl.hpp
##########
@@ -49,22 +49,30 @@ user_domain_error(const char*, const char* inMessage, const 
T& inVal) {
     if (std::isnan(inVal))
         return std::numeric_limits<double>::quiet_NaN();
 
-    // The following line is taken from
-    // 
http://www.boost.org/doc/libs/1_49_0/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html
+#if _GLIBCXX_USE_CXX11_ABI
+    int prec = std::numeric_limits<T>::max_digits10;
+#else
+    // For older C++ standards, max_digits10 was not available so we have to 
convert manually
+    //  
http://www.boost.org/doc/libs/1_49_0/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html
     int prec = 2 + (std::numeric_limits<T>::digits * 30103UL) / 100000UL;
+#endif // _GLIBCXX_USE_CXX11_ABI
 
-    std::string msg = (boost::format(inMessage)
-            % boost::io::group(std::setprecision(prec), inVal)
-        ).str();
+    throw std::domain_error(inMessage);

Review comment:
       do we need to throw the error message here ? aren't we throwing a 
similar error message at the end ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to