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

Use configure_file() to configure version only #4974

Merged
merged 3 commits into from
Oct 23, 2019

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Oct 23, 2019

@hcho3 This keeps most of your clean up, but added back the intrin detection code in order to avoid writing build_config.h in include directory. After this, only version upgrade can change that file.

@hcho3
Copy link
Collaborator

hcho3 commented Oct 23, 2019

@trivialfis If the goal is to avoid polluting the include directory, can we apply something like dmlc/dmlc-core#551?

@hcho3
Copy link
Collaborator

hcho3 commented Oct 23, 2019

After this, only version upgrade can change that file

We should formally enforce this, rather than making it an unwritten convention. Perhaps create a separate config step just for the version (version_config.h)? The reason is that we may want to configure more things in the future.

Let me think of something and get back to you.

@trivialfis
Copy link
Member Author

@hcho3 Good point.

@hcho3
Copy link
Collaborator

hcho3 commented Oct 23, 2019

Let me try incorporating ideas from dmlc/dmlc-core#551 and dmlc/dmlc-core#566 and get back to you.

@trivialfis
Copy link
Member Author

@hcho3 I removed the build_config.h completely and moved those macros into base.h since that's where most of our macros defined, also previously base.h includes build_config.h.

I also added a version_config.h that does only configuring version information.

@hcho3 hcho3 changed the title Avoid writing build_config.h Use configure_file() to configure version only Oct 23, 2019
src/common/hist_util.cc Show resolved Hide resolved
src/data/data.cc Show resolved Hide resolved
Copy link
Collaborator

@hcho3 hcho3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point about the "include only what you need" principle. At best, you'd get an error like "XGBOOST_VER_MAJOR symbol not found" and you'll be reminded to include xgboost/version_config.h.

@hcho3
Copy link
Collaborator

hcho3 commented Oct 23, 2019

Note: Should we need to use configure_file() for other things in the future, we should try to apply lessons learned from dmlc/dmlc-core#551 and dmlc/dmlc-core#566.

@trivialfis
Copy link
Member Author

@hcho3 Agreed. until we can remove those makefiles, your method works better.

@hcho3
Copy link
Collaborator

hcho3 commented Oct 23, 2019

Will merge once tests pass.

@codecov-io
Copy link

codecov-io commented Oct 23, 2019

Codecov Report

Merging #4974 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4974   +/-   ##
=======================================
  Coverage   71.82%   71.82%           
=======================================
  Files          11       11           
  Lines        2300     2300           
=======================================
  Hits         1652     1652           
  Misses        648      648

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b1715d...3ff0c00. Read the comment docs.

@hcho3 hcho3 merged commit f24be2e into dmlc:master Oct 23, 2019
@trivialfis trivialfis deleted the cmake-config branch October 23, 2019 06:49
@trivialfis
Copy link
Member Author

@hcho3 Thanks for the help. ;-)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants