another failure on develop

41 views
Skip to first unread message

Ben Goodrich

unread,
Jun 26, 2013, 9:00:11 AM6/26/13
to stan...@googlegroups.com
Now, there is another failure where the compiler command is messed up. I'd seen this occasionally before but now it seems to always happen. Specifically, even if CC=clang++, it tries to compile with the default CC (g++) but without CFLAGS so thus can't find its headers

make -j1 CC=clang++ O=0 test-unit
...
test
/mcmc/unit_e_metric --gtest_output="xml:test/mcmc/unit_e_metric.xml";
Running main() from gtest_main.cc
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from McmcUnitEMetric
[ RUN      ] McmcUnitEMetric.sample_p
[       OK ] McmcUnitEMetric.sample_p (2 ms)
[----------] 1 test from McmcUnitEMetric (2 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2 ms total)
[  PASSED  ] 1 test.
clang
++ -I src -I lib/eigen_3.1.3 -I lib/boost_1.53.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long   -c -O0 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -Wno-c++11-long-long -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/mcmc/base_hmc_test.cpp -o test/mcmc/base_hmc.o

g
++     src/test/mcmc/models/improper.cpp  -Lbin -lstan -o src/test/mcmc/models/improper
src
/test/mcmc/models/improper.cpp:3:39: fatal error: stan/model/model_header.hpp: No such file or directory
 
#include <stan/model/model_header.hpp>
                                       
^
compilation terminated
.
make
: *** [src/test/mcmc/models/improper] Error 1

Ben

Daniel Lee

unread,
Jun 26, 2013, 10:57:12 AM6/26/13
to stan...@googlegroups.com
Thanks. Can you see what artifacts you have laying around? I'm interested in:
src/test/mcmc/models/improper*

And their timestamps. I need to find a way to recreate this issue consistently, but I haven't.



Ben

--
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/groups/opt_out.
 
 

Ben Goodrich

unread,
Jun 26, 2013, 1:41:34 PM6/26/13
to stan...@googlegroups.com
On Wednesday, June 26, 2013 10:57:12 AM UTC-4, Daniel Lee wrote:
Thanks. Can you see what artifacts you have laying around? I'm interested in:
src/test/mcmc/models/improper*

And their timestamps. I need to find a way to recreate this issue consistently, but I haven't.

goodrich@CYBERPOWERPC:/opt/stan$ ls -l -h src/test/mcmc/models/improper*
-rwxr-xr-x 1 goodrich goodrich 3.0M Jun 26 01:32 src/test/mcmc/models/improper
-rw-r--r-- 1 goodrich goodrich 8.0K Jun 26 08:11 src/test/mcmc/models/improper.cpp
-rw-r--r-- 1 goodrich goodrich   58 Jun  6 21:25 src/test/mcmc/models/improper.stan

Ben

Ben Goodrich

unread,
Jun 26, 2013, 2:32:20 PM6/26/13
to stan...@googlegroups.com

make -d -j1 CC=clang++ O=0 test-unit
...
       
No need to remake target `src/test/mcmc/models/improper.stan'.
       Pruning file `
src/stan/model/model_header.hpp'.
       Pruning file `bin/stanc'
.
     
Finished prerequisites of target file `src/test/mcmc/models/improper.cpp'.
      Prerequisite `
src/test/mcmc/models/improper.stan' is older than target `src/test/mcmc/models/improper.cpp'.
     
Prerequisite `src/stan/model/model_header.hpp' is older than target `src/test/mcmc/models/improper.cpp'.
      Prerequisite `bin/stanc'
is older than target `src/test/mcmc/models/improper.cpp'.
     No need to remake target `
src/test/mcmc/models/improper.cpp'.
    Finished prerequisites of target file `src/test/mcmc/models/improper'
.
   
Prerequisite `src/test/mcmc/models/improper.cpp' is newer than target `src/test/mcmc/models/improper'.
   Must remake target `src/test/mcmc/models/improper'
.
Invoking builtin recipe to update target `src/test/mcmc/models/improper'.

g++     src/test/mcmc/models/improper.cpp  -Lbin -lstan -o src/test/mcmc/models/improper
Putting child 0x69dcb30 (src/test/mcmc/models/improper) PID 23510 on the chain.
Live child 0x69dcb30 (src/test/mcmc/models/improper) PID 23510
Reaping losing child 0x69dcb30 PID 23510
Removing child 0x69dcb30 PID 23510 from chain.

Ben

Marcus Brubaker

unread,
Jun 26, 2013, 5:33:53 PM6/26/13
to stan...@googlegroups.com
Daniel,

The attached simple makefile exhibits this issue.  Adjust it to whatever model you want, run make, interrupt it during compilation and then run make again and you'll see the same behaviour.

Cheers,
Marcus

makefile

Ben Goodrich

unread,
Jun 26, 2013, 5:53:46 PM6/26/13
to stan...@googlegroups.com
No attachment. Google might have eaten it, and if so, try renaming it makefile.txt.

Ben

Marcus Brubaker

unread,
Jun 26, 2013, 11:12:08 PM6/26/13
to stan...@googlegroups.com
Really, they strip out makefiles?  Weird...

Here is a .txt version.

Cheers,
Marcus
makefile.txt

Daniel Lee

unread,
Jun 27, 2013, 2:00:28 PM6/27/13
to stan...@googlegroups.com
Ok. I found the reason it isn't working. For anyone that doesn't care about this stuff, you can check out now. It works fine under Windows.


We need to define a static pattern rule. The issue is that the target has no extension. For example, if the Stan file is normal.stan, then the make target in !win is normal.

The target we defined is:
.PRECIOUS: %.cpp %.o
%$(EXE): %.o bin/libstan.a
@echo ''
@echo '--- Linking C++ model ---'
$(LINK.c) -O$O $(OUTPUT_OPTION) $< $(LDLIBS)

Unfortunately, when $(EXE) is empty, this essentially matches every make target, so make chooses not to use it. It uses the default implicit target instead, which uses $(LINK.cxx), I think. I think by updating the make targets, I might be able to fix this once and for all.


Daniel
> <makefile.txt>

Daniel Lee

unread,
Jun 27, 2013, 3:55:13 PM6/27/13
to stan...@googlegroups.com
Ben and Marcus, I just submitted a pull request that should fix the issue. Could one of you review this pull request?
https://github.com/stan-dev/stan/pull/140


For the makefile sent, replace
%$(EXE): %.o
with
$(patsubst %.stan,%,$(wildcard $(addsuffix .stan,$(MAKECMDGOALS)))) : %$(EXE): %.o

That should make it work. That's a static pattern rule. I've taken the goals, added .stan to the goals, searched for file existence, then stripped the .stan off. Those are the targets we are interested in.


Daniel

Ben Goodrich

unread,
Jun 27, 2013, 5:49:35 PM6/27/13
to stan...@googlegroups.com
On Thursday, June 27, 2013 3:55:13 PM UTC-4, Daniel Lee wrote:
Ben and Marcus, I just submitted a pull request that should fix the issue. Could one of you review this pull request?
https://github.com/stan-dev/stan/pull/140


For the makefile sent, replace
%$(EXE): %.o
with
$(patsubst %.stan,%,$(wildcard $(addsuffix .stan,$(MAKECMDGOALS)))) : %$(EXE): %.o

That should make it work. That's a static pattern rule. I've taken the goals, added .stan to the goals, searched for file existence, then stripped the .stan off. Those are the targets we are interested in.

I am not seeing any difference in behavior:

goodrich@CYBERPOWERPC:/opt/stan$ git branch | grep -F "*"
* feature/makefile_issue
make
-j1 CC=clang++ O=0 test-unit
clang
++ -I src -I lib/eigen_3.1.3 -I lib/boost_1.53.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long   -c -O0 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -Wno-c++11-long-long -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/mcmc/base_hmc_test.cpp -o test/mcmc/base_hmc.o
g
++     src/test/mcmc/models/improper.cpp  -Lbin -lstan -o src/test/mcmc/models/improper
src
/test/mcmc/models/improper.cpp:3:39: fatal error: stan/model/model_header.hpp: No such file or directory
 
#include <stan/model/model_header.hpp>

                                       
^
compilation terminated
.
make
: *** [src/test/mcmc/models/improper] Error 1

Ben

Daniel Lee

unread,
Jun 27, 2013, 6:00:32 PM6/27/13
to stan...@googlegroups.com
Ben, just to isolate, can you run:
make src/test/mcmc/models/improper?

Can you also show the time stamps and files?
$ ls -l -h src/test/mcmc/models/improper*

When I do that I get:
> ls -l -h src/test/mcmc/models/improper*
-rwxr-xr-x 1 daniel staff 4.6M Jun 27 17:57 src/test/mcmc/models/improper
-rw-r--r-- 1 daniel staff 8.0K Jun 27 17:56 src/test/mcmc/models/improper.cpp
-rw-r--r-- 1 daniel staff 76K Jun 27 17:56 src/test/mcmc/models/improper.d
-rw-r--r-- 1 daniel staff 4.5M Jun 27 17:57 src/test/mcmc/models/improper.o
-rw-r--r-- 1 daniel staff 58B Jun 25 15:06 src/test/mcmc/models/improper.stan

I tried it with the time stamps changed so chronologically it was like your setup: improper.stan < improper < improper.cpp. I deleted the other files. Everything seems to be ok on my machine. I just need to find a way to recreate the conditions on your machine.


Daniel

Ben Goodrich

unread,
Jun 27, 2013, 6:06:52 PM6/27/13
to stan...@googlegroups.com
On Thursday, June 27, 2013 6:00:32 PM UTC-4, Daniel Lee wrote:
Ben, just to isolate, can you run:
make src/test/mcmc/models/improper?

It works if I call that directly. Just not when called from test-unit
 
Can you also show the time stamps and files?
$ ls -l -h src/test/mcmc/models/improper*

After the success,

goodrich@CYBERPOWERPC:/opt/stan$ ls -l -h src/test/mcmc/models/improper*
-rwxr-xr-x 1 goodrich goodrich 3.0M Jun 27 18:02 src/test/mcmc/models/improper
-rw-r--r-- 1 goodrich goodrich 8.0K Jun 27 17:02 src/test/mcmc/models/improper.cpp
-rw-r--r-- 1 goodrich goodrich  76K Jun 27 18:02 src/test/mcmc/models/improper.d
-rw-r--r-- 1 goodrich goodrich 6.7M Jun 27 18:02 src/test/mcmc/models/improper.o
-rw-r--r-- 1 goodrich goodrich   58 Jun  6 21:25 src/test/mcmc/models/improper.stan

The improper.cpp file at 17:02 would have been before the most recent failure on test-unit.

If I do another test-unit, it fails later

clang++ -I src -I lib/eigen_3.1.3 -I lib/boost_1.53.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -Wno-unused-function -Wno-uninitialized -Wno-c++11-long-long   -c -O0 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -Wno-c++11-long-long -I lib/gtest_1.6.0/include -I lib/gtest_1.6.0 src/test/gm/command_test.cpp -o test/gm/command.o
clang
++   src/test/gm/model_specs/compiled/domain_fail.o  -Lbin -lstan -o src/test/gm/model_specs/compiled/domain_fail
g
++     src/test/gm/model_specs/compiled/value_fail.cpp  -Lbin -lstan -o src/test/gm/model_specs/compiled/value_fail

and

goodrich@CYBERPOWERPC:/opt/stan$ ls -l -h src/test/gm/model_specs/compiled/value_fail.*
-rw-r--r-- 1 goodrich goodrich 8.0K Jun 27 17:02 src/test/gm/model_specs/compiled/value_fail.cpp
-rw-r--r-- 1 goodrich goodrich    7 Jun  6 21:25 src/test/gm/model_specs/compiled/value_fail.init.R
-rw-r--r-- 1 goodrich goodrich   60 Jun  6 21:25 src/test/gm/model_specs/compiled/value_fail.stan

Ben

Reply all
Reply to author
Forward
0 new messages