Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile generated dependency files infinitely #668

Closed
seantalts opened this issue Jan 6, 2019 · 10 comments
Closed

Makefile generated dependency files infinitely #668

seantalts opened this issue Jan 6, 2019 · 10 comments
Assignees
Milestone

Comments

@seantalts
Copy link
Member

seantalts commented Jan 6, 2019

I might have something set up wrong with the submodules, but figured I'd post the discussion here as an issue in case we figure it out and it's helpful to others.

I'm seeing endless loops of lines like:

clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare      -O3 -I src -I stan/src -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.66.0 -I stan/lib/stan_math/lib/sundials_3.1.0/include    -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION     -c -MT bin/cmdstan/lang/grammars/block_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d -MM -E -MG -MP -MF stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d stan/src/stan/lang/grammars/block_var_decls_grammar_inst.cpp

Where these -MM etc flags indicate that we're generating dependency files.

I'd expect to not see these lines go by more than once, and to eventually be able to build stanc etc.

Current Version:

develop all the way down

@seantalts seantalts added this to the 2.18.1++ milestone Jan 6, 2019
@seantalts
Copy link
Member Author

Okay, I think I figured it out. Here's what I did:

  1. Turn off dependency generation by commenting out the following line in the main cmdstan makefile:
    -include $(MATH)make/dependencies
  2. Try a make build again, see that I get this error:
stan/lib/stan_math/lib/boost_1.66.0/boost/config/detail/posix_features.hpp:18:15: fatal error: 
      'unistd.h' file not found
#     include <unistd.h>
  1. Realize (through googling) that my recent Mac OS restore operation must have messed with the system files that Xcode installs, and reinstall xcode command line tools with xcode-select --install.

And now it works. Maybe this will help someone in the future.

@syclik
Copy link
Member

syclik commented Jan 7, 2019

Thanks for hunting that down and reporting back.

Yes, each dependency is included as a target. What this allows is for files to be moved / removed and it'll continue to work. Without this, when a file is removed, targets would fail to build, often without a good message. With this, there are some weird conditions where it'll go into the behavior you described, but I haven't pinpointed where that is yet. (It shouldn't really be in a weird infinite loop, but somehow it is.)

Thanks. If you see it again, let me know.

@bob-carpenter
Copy link
Contributor

Do I need to keep that dependency generation edited out? Is it not flushed with clean-all?

@bob-carpenter bob-carpenter reopened this Mar 27, 2019
@bob-carpenter
Copy link
Contributor

The xcode install doesn't do anything for me.

~/cmdstan-2.18.1$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

@bob-carpenter
Copy link
Contributor

I do not see -include $(MATH)make/dependencies in the makefile from 2.18.1, but it's in the latest. I'm getting this same problem with 2.18.1, which I installed to get around the current develop not working for me. But now 2.18.1 is also broken.

@syclik
Copy link
Member

syclik commented Mar 27, 2019

@bob-carpenter, is this something you're seeing now? What git hashes are your CmdStan, Stan, and Math at now?

@bob-carpenter
Copy link
Contributor

I checked out a binary version of 2.18.1 so it'd work, so no hashes other than the release. But it ran into the same problem without the math dependencies thing that @seantalts mentioned above.

I'm not sure how to get the hash for my current branch. As usual, I don't understand even simple answers on Git stackoverflow.

But here's what it looks like when I check out develop and run make stan-update:

cmdstan: develop
stan: 4d7605b...
math: 1a641ff...

@bob-carpenter
Copy link
Contributor

The main issue for my problem is: #682

@seantalts just commented that he had the same problem (though I don't see that here), so I reopened this one, too.

@syclik
Copy link
Member

syclik commented Mar 27, 2019 via email

@mitzimorris
Copy link
Member

closing - current makefile changed to avoid circular dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants