[
https://issues.apache.org/jira/browse/MADLIB-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858435#comment-15858435
]
Jess Balint commented on MADLIB-1025:
-------------------------------------
Some casting clears it up:
{code:java}
diff --git a/src/modules/elastic_net/elastic_net_optimizer_igd.hpp
b/src/modules/elastic_net/elastic_net_optimizer_igd.hpp
index d75006e0..4c49206b 100644
--- a/src/modules/elastic_net/elastic_net_optimizer_igd.hpp
+++ b/src/modules/elastic_net/elastic_net_optimizer_igd.hpp
@@ -66,7 +66,7 @@ AnyType Igd<Model>::igd_transition (AnyType& args, const
Allocator& inAllocator)
state.ymean = args[10].getAs<double>();
// dual vector theta
state.theta.setZero();
- state.p = 2 * log(state.dimension);
+ state.p = 2 * log((double) state.dimension);
state.lambda = lambda;
state.q = state.p / (state.p - 1);
link_fn(state.theta, state.coef, state.p);
diff --git a/src/modules/recursive_partitioning/DT_impl.hpp
b/src/modules/recursive_partitioning/DT_impl.hpp
index f622f946..ce1ed412 100644
--- a/src/modules/recursive_partitioning/DT_impl.hpp
+++ b/src/modules/recursive_partitioning/DT_impl.hpp
@@ -127,7 +127,7 @@ DecisionTree<Container>::bind(ByteStream_type& inStream) {
size_t n_labels = 0;
size_t max_surrogates = 0;
if (!tree_depth.isNull()) {
- n_nodes = static_cast<size_t>(pow(2, tree_depth) - 1);
+ n_nodes = static_cast<size_t>(pow(2, (int) tree_depth) - 1);
// for classification n_labels = n_y_labels + 1 since the last element
// is the count of actual (unweighted) tuples landing on a node
// for regression, n_y_labels is same as REGRESS_N_STATS
@@ -173,7 +173,7 @@ inline
DecisionTree<Container>&
DecisionTree<Container>::incrementInPlace() {
// back up current tree
- size_t n_orig_nodes = static_cast<size_t>(pow(2, tree_depth) - 1);
+ size_t n_orig_nodes = static_cast<size_t>(pow(2, (int) tree_depth) - 1);
DecisionTree<Container> orig = DecisionTree<Container>();
orig.rebind(tree_depth, n_y_labels, max_n_surr, is_regression);
orig.copy(*this);
{code}
> MADlib does not compile with gcc 6.2
> ------------------------------------
>
> Key: MADLIB-1025
> URL: https://issues.apache.org/jira/browse/MADLIB-1025
> Project: Apache MADlib
> Issue Type: Bug
> Reporter: Rahul Iyer
> Assignee: Nandish Jayaram
> Priority: Minor
> Fix For: v2.0
>
>
> Compiling with gcc 6.2.0 gives the below error.
> {code}
> [ 84%] Building CXX object
> src/ports/postgres/9.5/CMakeFiles/madlib_postgresql_9_5.dir/__/__/__/modules/elastic_net/elastic_net_gaussian_fista.cpp.o
> In file included from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/modules/elastic_net/elastic_net_binomial_igd.cpp:5:0:
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/modules/elastic_net/elastic_net_optimizer_igd.hpp:
> In static member function 'static madlib::dbconnector::postgres::AnyType
> madlib::modules::elastic_net::Igd<
> Model>::igd_transition(madlib::dbconnector::postgres::AnyType&, const
> madlib::dbconnector::postgres::Allocator&)':
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/modules/elastic_net/elastic_net_optimizer_igd.hpp:69:46:
> error: call of overloaded
> 'log(madlib::modules::HandleTraits<madlib::dbconnector::postgres::MutableAr
> rayHandle<double> >::ReferenceToUInt32&)' is ambiguous
> state.p = 2 * log(state.dimension);
> ^
> In file included from
> /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/cmath:45:0,
> from /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/math.h:36,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/ports/postgres/dbconnector/../../../../methods/svec/src/pg_gp/SparseData.h:24,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/ports/postgres/dbconnector/../../../../methods/svec/src/pg_gp/sparse_vector.h:10,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/ports/postgres/dbconnector/dbconnector.hpp:39,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/modules/elastic_net/elastic_net_binomial_igd.cpp:2:
> /usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed/math.h:402:15:
> note: candidate: double log(double)
> extern double log(double);
> ^~~
> In file included from
> /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/math.h:36:0,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/ports/postgres/dbconnector/../../../../methods/svec/src/pg_gp/SparseData.h:24,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/ports/postgres/dbconnector/../../../../methods/svec/src/pg_gp/sparse_vector.h:10,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/ports/postgres/dbconnector/dbconnector.hpp:39,
> from
> /var/folders/rm/g9tb1s_53wb86s5_nrsdbxph0000gn/T/tmp8WXq3S/madlib-1.9.1/src/modules/elastic_net/elastic_net_binomial_igd.cpp:2:
> /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/cmath:365:3: note: candidate:
> long double std::log(long double)
> log(long double __x)
> ^~~
> /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/cmath:361:3: note: candidate:
> float std::log(float)
> log(float __x)
> ^~~
> make[3]: ***
> [src/ports/postgres/9.5/CMakeFiles/madlib_postgresql_9_5.dir/__/__/__/modules/elastic_net/elastic_net_binomial_igd.cpp.o]
> Error 1
> make[3]: *** Waiting for unfinished jobs....
> make[2]: ***
> [src/ports/postgres/9.5/CMakeFiles/madlib_postgresql_9_5.dir/all] Error 2
> make[1]: *** [all] Error 2
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)