lkj_corr_test.cpp failing?

54 views
Skip to first unread message

Joshua N Pritikin

unread,
Mar 9, 2015, 12:06:37 PM3/9/15
to stan...@googlegroups.com
65179cd722bbca8b

joshua@tailwind:/opt/cmdstan/stan$ make test/unit/math/fwd/mat/prob/lkj_corr
g++ -I src -isystem lib/eigen_3.2.2 -isystem lib/boost_1.55.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fmax-errors=1 -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/gtest_1.7.0/include -isystem lib/gtest_1.7.0 src/test/unit/math/fwd/mat/prob/lkj_corr_test.cpp -o test/unit/math/fwd/mat/prob/lkj_corr.o
src/test/unit/math/fwd/mat/prob/lkj_corr_test.cpp:8:53: fatal error: stan/math/fwd/mat/fun/eigen_numtraits.hpp: No such file or directory
#include <stan/math/fwd/mat/fun/eigen_numtraits.hpp>
^
compilation terminated.
make/tests:22: recipe for target 'test/unit/math/fwd/mat/prob/lkj_corr.o' failed
make: *** [test/unit/math/fwd/mat/prob/lkj_corr.o] Error 1

Isn't the 'develop' branch always suppose to be 100% passing?

--
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

Daniel Lee

unread,
Mar 9, 2015, 12:11:47 PM3/9/15
to stan...@googlegroups.com
Yes, develop is always supposed to be passing.

1) I don't know why it's passing. It's running fine on my machine, but it shouldn't. I've just compiled it under clang++ and g++ and it passes.
2) the include should be capitialized. I have no idea why it's not and how this passes. What OS are you on?


Daniel



--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Lee

unread,
Mar 9, 2015, 12:16:02 PM3/9/15
to stan...@googlegroups.com
WTF??? Mac OS X's file system is not case sensitive by default???

Jiqiang Guo

unread,
Mar 9, 2015, 12:27:56 PM3/9/15
to stan...@googlegroups.com
On Mon, Mar 09, 2015 at 12:15:59PM -0400, Daniel Lee wrote:
> WTF??? Mac OS X's file system is not case sensitive by default???
Yes. We had this problem before.

Joshua N Pritikin

unread,
Mar 9, 2015, 12:28:33 PM3/9/15
to stan...@googlegroups.com
On Mon, Mar 09, 2015 at 12:15:59PM -0400, Daniel Lee wrote:
> WTF??? Mac OS X's file system is not case sensitive by default???

I've run into this before. It's amazing that Apple is still in business
with their lax attitude about case sensitivity. :-)

Michael Betancourt

unread,
Mar 9, 2015, 12:40:10 PM3/9/15
to stan...@googlegroups.com
http://en.wikipedia.org/wiki/HFS_Plus

This issue was heavily argued in the old days of OS X,
and Apple seems none the worse for it...

Joshua N Pritikin

unread,
Mar 9, 2015, 2:45:03 PM3/9/15
to stan...@googlegroups.com
On Mon, Mar 09, 2015 at 12:06:32PM -0400, Joshua N Pritikin wrote:
> 65179cd722bbca8b
>
> joshua@tailwind:/opt/cmdstan/stan$ make test/unit/math/fwd/mat/prob/lkj_corr
> g++ -I src -isystem lib/eigen_3.2.2 -isystem lib/boost_1.55.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fmax-errors=1 -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/gtest_1.7.0/include -isystem lib/gtest_1.7.0 src/test/unit/math/fwd/mat/prob/lkj_corr_test.cpp -o test/unit/math/fwd/mat/prob/lkj_corr.o
> src/test/unit/math/fwd/mat/prob/lkj_corr_test.cpp:8:53: fatal error: stan/math/fwd/mat/fun/eigen_numtraits.hpp: No such file or directory
> #include <stan/math/fwd/mat/fun/eigen_numtraits.hpp>
> ^
> compilation terminated.
> make/tests:22: recipe for target 'test/unit/math/fwd/mat/prob/lkj_corr.o' failed
> make: *** [test/unit/math/fwd/mat/prob/lkj_corr.o] Error 1

After fixing the case of eigen_numtraints, now this test fails,

make test/unit/math/mix/mat/prob/lkj_corr

Daniel Lee

unread,
Mar 9, 2015, 2:46:12 PM3/9/15
to stan...@googlegroups.com
how does it fail?

Joshua N Pritikin

unread,
Mar 9, 2015, 2:52:55 PM3/9/15
to stan...@googlegroups.com
On Mon, Mar 09, 2015 at 02:46:10PM -0400, Daniel Lee wrote:
> how does it fail?

joshua@tailwind:/opt/cmdstan/stan$ make test/unit/math/mix/mat/prob/lkj_corr
g++ -I src -isystem lib/eigen_3.2.2 -isystem lib/boost_1.55.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -fmax-errors=1 -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/gtest_1.7.0/include -isystem lib/gtest_1.7.0 src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp -o test/unit/math/mix/mat/prob/lkj_corr.o
In file included from src/stan/math/prim/mat/fun/positive_ordered_free.hpp:5:0,
from src/stan/math/prim/mat/prob/lkj_corr_log.hpp:38,
from src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp:37:
src/stan/math/prim/mat/err/check_positive_ordered.hpp: In function ‘bool stan::math::check_positive_ordered(const char*, const char*, const Eigen::Matrix<Scalar, -1, 1>&)’:
src/stan/math/prim/mat/err/check_positive_ordered.hpp:39:67: warning: typedef ‘size_type’ locally defined but not used [-Wunused-local-typedefs]
typedef typename index_type<Matrix<T_y, Dynamic, 1> >::type size_type;
^
In file included from lib/boost_1.55.0/boost/math/tools/promotion.hpp:29:0,
from lib/boost_1.55.0/boost/math/special_functions/detail/round_fwd.hpp:12,
from lib/boost_1.55.0/boost/math/special_functions/math_fwd.hpp:26,
from lib/boost_1.55.0/boost/math/special_functions/fpclassify.hpp:19,
from src/stan/math/fwd/core/fvar.hpp:5,
from src/stan/math/fwd/core.hpp:4,
from src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp:7:
lib/boost_1.55.0/boost/type_traits/is_convertible.hpp: In instantiation of ‘const bool boost::detail::is_convertible_basic_impl<__float128, stan::agrad::var>::value’:
lib/boost_1.55.0/boost/type_traits/is_convertible.hpp:354:5: required from ‘const bool boost::detail::is_convertible_impl<__float128, stan::agrad::var>::value’
lib/boost_1.55.0/boost/type_traits/is_convertible.hpp:480:1: required from ‘struct boost::is_convertible<__float128, stan::agrad::var>’
lib/boost_1.55.0/boost/mpl/aux_/nested_type_wknd.hpp:26:31: required from ‘struct boost::mpl::aux::nested_type_wknd<boost::is_convertible<__float128, stan::agrad::var> >’
lib/boost_1.55.0/boost/mpl/aux_/preprocessed/gcc/and.hpp:48:8: required from ‘struct boost::mpl::and_<boost::is_convertible<__float128, stan::agrad::var>, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >’
lib/boost_1.55.0/boost/mpl/if.hpp:67:11: required from ‘struct boost::mpl::if_<boost::mpl::and_<boost::is_convertible<__float128, stan::agrad::var>, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, mpl_::int_<5>, mpl_::int_<4> >’
lib/boost_1.55.0/boost/math/constants/constants.hpp:104:15: [ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
lib/boost_1.55.0/boost/math/special_functions/digamma.hpp:377:58: required from ‘T boost::math::detail::digamma_imp(T, const Tag*, const Policy&) [with T = stan::agrad::var; Tag = mpl_::int_<53>; Policy = boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’
lib/boost_1.55.0/boost/math/special_functions/digamma.hpp:466:43: required from ‘typename boost::math::tools::promote_args<T>::type boost::math::digamma(T, const Policy&) [with T = stan::agrad::var; Policy = boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>; typename boost::math::tools::promote_args<T>::type = stan::agrad::var]’
lib/boost_1.55.0/boost/math/special_functions/digamma.hpp:473:42: required from ‘typename boost::math::tools::promote_args<T>::type boost::math::digamma(T) [with T = stan::agrad::var; typename boost::math::tools::promote_args<T>::type = stan::agrad::var]’
src/stan/math/fwd/scal/fun/lgamma.hpp:18:59: required from ‘stan::agrad::fvar<T> stan::agrad::lgamma(const stan::agrad::fvar<T>&) [with T = stan::agrad::var]’
src/stan/math/prim/mat/prob/lkj_corr_log.hpp:76:49: required from ‘T_shape stan::prob::do_lkj_constant(const T_shape&, const unsigned int&) [with T_shape = stan::agrad::fvar<stan::agrad::var>]’
src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp:56:51: required from here
lib/boost_1.55.0/boost/type_traits/is_convertible.hpp:146:64: error: conversion from ‘__float128’ to ‘stan::agrad::var’ is ambiguous
sizeof( boost::detail::checker<To>::_m_check(_m_from, 0) )
^
compilation terminated due to -fmax-errors=1.
make/tests:22: recipe for target 'test/unit/math/mix/mat/prob/lkj_corr.o' failed
make: *** [test/unit/math/mix/mat/prob/lkj_corr.o] Error 1

Ben Goodrich

unread,
Mar 9, 2015, 3:14:47 PM3/9/15
to stan...@googlegroups.com
That probably would be fixed if you pull in Bob's changes from develop into your branch.

Ben Goodrich

unread,
Mar 9, 2015, 3:26:02 PM3/9/15
to stan...@googlegroups.com
It was already merged into develop, so you can do something like:

git pull origin develop

Ben

On Mon, Mar 9, 2015 at 3:24 PM, Joshua N Pritikin <jpri...@pobox.com> wrote:
On Mon, Mar 09, 2015 at 12:14:47PM -0700, Ben Goodrich wrote:
>    That probably would be fixed if you pull in Bob's changes from develop
>    into your branch.

Sounds good. Where can I find Bob's tree?

Ben Goodrich

unread,
Mar 9, 2015, 3:54:15 PM3/9/15
to stan...@googlegroups.com
No, that is essentially up-to-date. But that test doesn't fail for me here once I correct the capitalization of Eigen_NumTraits.

Ben

On Mon, Mar 9, 2015 at 3:34 PM, Joshua N Pritikin <jpri...@pobox.com> wrote:
On Mon, Mar 09, 2015 at 03:26:02PM -0400, Ben Goodrich wrote:
>    It was already merged into develop, so you can do something like:
>    git pull origin develop

I pulled again. I have 65179cd722bbca8bdbbf7 = develop

Do you have something newer?


>    On Mon, Mar 9, 2015 at 3:24 PM, Joshua N Pritikin
>    --
>    You received this message because you are subscribed to the Google
>    Groups "stan development mailing list" group.
>    To unsubscribe from this group and stop receiving emails from it, send
>    an email to [2]stan-dev+u...@googlegroups.com.
>    For more options, visit [3]https://groups.google.com/d/optout.
>
> References
>
>    1. mailto:jpri...@pobox.com
>    2. mailto:stan-dev+u...@googlegroups.com
>    3. https://groups.google.com/d/optout

Joshua N Pritikin

unread,
Mar 9, 2015, 4:06:53 PM3/9/15
to stan...@googlegroups.com
On Mon, Mar 09, 2015 at 03:54:14PM -0400, Ben Goodrich wrote:
> No, that is essentially up-to-date. But that test doesn't fail for me
> here once I correct the capitalization of Eigen_NumTraits.

OK, then something fishy is going on. I re-tried,

make clean-all
make test/unit/math/mix/mat/prob/lkj_corr

and it fails with the same error.

> On Mon, Mar 9, 2015 at 3:34 PM, Joshua N Pritikin
> <[1]jpri...@pobox.com> wrote:
>
> On Mon, Mar 09, 2015 at 03:26:02PM -0400, Ben Goodrich wrote:
> > It was already merged into develop, so you can do something
> like:
> > git pull origin develop
> I pulled again. I have 65179cd722bbca8bdbbf7 = develop
> Do you have something newer?
> > On Mon, Mar 9, 2015 at 3:24 PM, Joshua N Pritikin
>

Jiqiang Guo

unread,
Mar 9, 2015, 4:11:38 PM3/9/15
to stan...@googlegroups.com
It fails for me too with gcc 4.9.2 on linux

 ./runTests.py -j4 src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp 

Jiqiang 

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Lee

unread,
Mar 9, 2015, 4:14:27 PM3/9/15
to stan...@googlegroups.com
Does it still fail if you add this to the top of lkj_corr_test.cpp?
#include <stan/prim/mat/fun/typedefs.hpp>

I don't think that's the right fix, but if it is able to compile with that include, then we'll need to figure out how to get the right fix in.


Daniel

Jiqiang Guo

unread,
Mar 9, 2015, 4:21:37 PM3/9/15
to stan...@googlegroups.com
no. 

It passes with clang++ on linux with and without adding #include <stan/prim/mat/fun/typedefs.hpp>

Jiqiang 

Jiqiang Guo

unread,
Mar 9, 2015, 4:26:49 PM3/9/15
to stan...@googlegroups.com
Attached is the output. 
a.log

Joshua N Pritikin

unread,
Mar 9, 2015, 4:40:38 PM3/9/15
to stan...@googlegroups.com
On Mon, Mar 09, 2015 at 04:14:24PM -0400, Daniel Lee wrote:
> Does it still fail if you add this to the top of lkj_corr_test.cpp?
> #include <stan/prim/mat/fun/typedefs.hpp>
> I don't think that's the right fix, but if it is able to compile with
> that include, then we'll need to figure out how to get the right fix
> in.

I assume you mean this,

diff --git a/src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp b/src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp
index 3113ccd..5f76975 100644
--- a/src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp
+++ b/src/test/unit/math/mix/mat/prob/lkj_corr_test.cpp
@@ -1,3 +1,4 @@
+#include <stan/math/prim/mat/fun/typedefs.hpp>
#include <stan/math/prim/mat/meta/get.hpp>
#include <stan/math/prim/mat/meta/length.hpp>
#include <stan/math/prim/mat/meta/is_vector.hpp>

It still fails with,

lib/boost_1.55.0/boost/type_traits/is_convertible.hpp:146:64: error: conversion from ‘__float128’ to ‘stan::agrad::var’ is ambiguous
sizeof( boost::detail::checker<To>::_m_check(_m_from, 0) )

Daniel Lee

unread,
Mar 9, 2015, 4:42:19 PM3/9/15
to stan...@googlegroups.com
yup... that's what I meant. I was hoping it was that easy...

I'm trying to log into cunix (columbia's unix cluster), but they only have gcc 4.2.

Ben Goodrich

unread,
Mar 9, 2015, 5:54:27 PM3/9/15
to stan...@googlegroups.com
Cunix is worthless. You have to log into Yeti. I am also seeing the failure with g++-4.9 but not clang++-3.6.

Ben
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.

Bob Carpenter

unread,
Mar 9, 2015, 6:56:17 PM3/9/15
to stan...@googlegroups.com
Is this the only test that's failing? If so, we can
probably workaround the way it's coded. I might have
changed something in lkj_corr along the way.

I'd work on it now, but I'm heading off to give
another Stan talk at another uni right now.

- Bob

Bob Carpenter

unread,
Mar 9, 2015, 6:56:17 PM3/9/15
to stan...@googlegroups.com

> On Mar 10, 2015, at 7:40 AM, Joshua N Pritikin <jpri...@pobox.com> wrote:
>
> ...

> It still fails with,
>
> lib/boost_1.55.0/boost/type_traits/is_convertible.hpp:146:64: error: conversion from ‘__float128’ to ‘stan::agrad::var’ is ambiguous
> sizeof( boost::detail::checker<To>::_m_check(_m_from, 0) )

That looks like a long double issue ("float" + "128" being my clue).
See:

http://en.wikipedia.org/wiki/Long_double

I don't think this would be a new issue from my var constructor
merge because it should have the same typedefs as before.

- Bob

Bob Carpenter

unread,
Mar 9, 2015, 7:17:17 PM3/9/15
to stan...@googlegroups.com
Sorry for all the fragmented mail. I just read that link and see this:

As of gcc 4.3, a quadruple precision is also supported on x86, but as
the nonstandard type __float128 rather than long double.

Damn that GCC. I thought only Microsoft went off the rails like this.

Has anyone tried updating Eigen to see what the behvior is?

Or does anyone know how to test for GCC >= 4.3 and include
a definition for long double?

I can't get the enable_if stuff to work on Windows generally
enough, but we may have to go back to trying this route.

C++ is just a nightmare with all this non-standard crap flying
around.

- Bob

Bob Carpenter

unread,
Mar 9, 2015, 7:21:17 PM3/9/15
to stan...@googlegroups.com
One more time. If we could test for the relevant GCC with some
kind of flag, we should be able to add

#ifdef __STUPID_GCC_TRICKS__
var(__float128 x) : vi_(new vari(static_cast<double>(x))) { }
#endif

That should solve the problem. This would've broken in the
earlier version, too, I believe.

- Bob

> On Mar 10, 2015, at 9:55 AM, Bob Carpenter <ca...@alias-i.com> wrote:
>
>

Ben Goodrich

unread,
Mar 9, 2015, 7:24:02 PM3/9/15
to stan...@googlegroups.com
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.

Bob Carpenter

unread,
Mar 10, 2015, 4:08:16 AM3/10/15
to stan...@googlegroups.com
Is this something we need to do before the next release?

If so, can you try it on your machine Ben? I was confused
by all the options linked through there. Should we have
some kind of prereq for introducing __float128?

- Bob
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.

Bob Carpenter

unread,
Mar 10, 2015, 4:09:18 AM3/10/15
to stan...@googlegroups.com
I added that link to the other link I had of cross-platform options
here:

https://github.com/stan-dev/stan/wiki/Compiler-and-OS-Detection-Macros-for-Cpp

- Bob

> On Mar 10, 2015, at 10:24 AM, Ben Goodrich <goodri...@gmail.com> wrote:
>
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.

Bob Carpenter

unread,
Mar 10, 2015, 7:34:17 AM3/10/15
to stan...@googlegroups.com
Jonathan:

Would you mind dropping this into src/stan/math/rev/core/var.hpp
and see if it compiles:

var(__float128 x) : vi_(new vari(static_cast<double>(x))) { }

If so, we'll work on getting the #ifdef GCC 4.3 or greater into
place to wrap it (I'm still not sure what the preferred way of
doing that is.) Who knew that GCC had the same cowboy mentality
as Windows!

Also, if you could somehow turn off libquadmath, that would
probably work, too. I see it being brought in with this:

boost_1.55.0/boost/multiprecision/float128.hpp:#include <quadmath.h>
boost_1.55.0/boost/multiprecision/float128.hpp: int v = quadmath_snprintf (buf, 100, format.c_str(), digits, m_value);
boost_1.55.0/boost/multiprecision/float128.hpp: v = quadmath_snprintf (&buf2[0], v_max + 3, format.c_str(), digits, m_value);

Oddly, I don't see any other library file in boost
that includes it, so I'm not sure how it's getting into
our code.

Thanks,

- Bob

Joshua N Pritikin

unread,
Mar 10, 2015, 7:45:58 AM3/10/15
to stan...@googlegroups.com
On Tue, Mar 10, 2015 at 10:33:18PM +1100, Bob Carpenter wrote:
> Would you mind dropping this into src/stan/math/rev/core/var.hpp
> and see if it compiles:
>
> var(__float128 x) : vi_(new vari(static_cast<double>(x))) { }

Yeah, that works.

diff --git a/src/stan/math/rev/core/var.hpp b/src/stan/math/rev/core/var.hpp
index 5ed6b85..1b08cac 100644
--- a/src/stan/math/rev/core/var.hpp
+++ b/src/stan/math/rev/core/var.hpp
@@ -100,6 +100,8 @@ namespace stan {
*/
var(long double x) : vi_(new vari(x)) { }

+ var(__float128 x) : vi_(new vari(static_cast<double>(x))) { }
+
/**
* Construct a variable from the specified arithmetic argument
* by constructing a new <code>vari</code> with the argument


> If so, we'll work on getting the #ifdef GCC 4.3 or greater into
> place to wrap it (I'm still not sure what the preferred way of
> doing that is.) Who knew that GCC had the same cowboy mentality
> as Windows!

Reply all
Reply to author
Forward
0 new messages