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

Enable the users to disable optional dependencies #1074

Closed
wants to merge 8 commits into from
Closed

Enable the users to disable optional dependencies #1074

wants to merge 8 commits into from

Conversation

kloudkl
Copy link
Contributor

@kloudkl kloudkl commented Sep 12, 2014

OpenCV has a lot of options for the optional libraries. Some of the newly added dependencies of Caffe are not needed by all the users and should be made optional during the building process.

This PR adds make and CMake flags and guarding macros for those components. They are especially useful for a lean deployment. But they are still enabled by default to keep the building behavior consistent.

@niuzhiheng
Copy link
Contributor

Thumb up for this feature. Great!

@longjon
Copy link
Contributor

longjon commented Sep 12, 2014

The nice thing about not having too many build options is that building Caffe is a guarantee that you can run all the examples and any Caffe-based code that others may share with you.

Having said that, I see no harm in having non-default options that disable unneeded functionality. Furthermore, we already need this capability for cuDNN, and we'll need it again for #1020, so it's a good idea to do it now in a uniform way.

How should Travis handle these different build options? I don't know what the limits on a build matrix are, but it seems we don't want our testing to be exponential in the number of options. Should we just turn on all options for testing?

Is there a reason for using WITH_ for the Makefile options and HAVE_ for the preprocessor variables?

@shelhamer
Copy link
Member

Agreed that default should be to include everything for interoperability but non-default switches are helpful and should be standardized.

I'm ok with Travis checking the current build matrix of make / cmake and gpu / cpu-only. The rest are custom builds to me.

I'd vote for USE_ flags throughout.

@kloudkl
Copy link
Contributor Author

kloudkl commented Oct 13, 2014

@kmatzen #1238.

@Nerei
Copy link

Nerei commented Jan 22, 2015

Issue #1738
PR #1667

WITH_ doesn't mean HAVE_. Former is a wish, latter is the reality. Sometimes the user's desire, can't be fulfilled due to various reasons (ex. dependency not found, incompatible configurations or versions, etc). So having WITH_ and HAVE_ is a good practice.

It doesn't matter whether to use WITH_ or USE_. Use any of them for your preference.

@shelhamer
Copy link
Member

Closing since the dev branch is deprecated. Please send PRs to master. See also #2523.

@shelhamer shelhamer closed this Aug 26, 2015
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.

5 participants