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

Dynamic Linking #1842

Merged
merged 2 commits into from
Feb 17, 2015
Merged

Dynamic Linking #1842

merged 2 commits into from
Feb 17, 2015

Conversation

shelhamer
Copy link
Member

Link the tools, tests, examples and pycaffe dynamically, drop the static tests, and set rpath so everything works within the caffe dir. This should reduce the build size and prepares for the Python layer in #1703.

Thoughts:

  • resolving LINKFLAGS, LDFLAGS, and DYNAMIC_LDFLAGS could be a good idea.
  • is the origin rpath worth it? I suppose it is to make everything work out of the box.
  • matcaffe is still static -- I don't know anything about mex linking and there isn't a MATLAB layer to motivate it (yet)

@longjon should surely check this.

No need to independently test static and dynamic linking.
@longjon
Copy link
Contributor

longjon commented Feb 17, 2015

@shelhamer I've updated this:

  • DYNAMIC_LDFLAGS serves no purpose when rpath has to be set explicitly anyway, so get rid of it.
  • Set rpath everywhere it's needed, so Travis passes now.
  • Make DYNAMIC_NAME an order dependency.
  • Add the appropriate incantations for OS X. This builds and "runs" for me, but make pytest crashes on my machine. I think this is a personal configuration problem, so you may wish to try with your own OS X setup.

@shelhamer
Copy link
Member Author

Sweet -- this checks out for me on OS X and a linux machine. Thanks Jon!

shelhamer added a commit that referenced this pull request Feb 17, 2015
@shelhamer shelhamer merged commit 3ff0ddf into BVLC:dev Feb 17, 2015
@shelhamer shelhamer deleted the dynamic-linking branch February 17, 2015 06:39
@shelhamer
Copy link
Member Author

Fixed rpath for examples in 5c81243.

@jeffdonahue
Copy link
Contributor

Just wanted to say this is awesome, thanks for doing this @shelhamer & @longjon. Changing core code and doing an incremental build with make -j everything is now practically instant since the tests aren't rebuilt, and the build dir with both debug and release builds is <500 MB now (rather than ~2 GB).

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

Successfully merging this pull request may close these issues.

3 participants