-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-4611: [C++] Rework CMake logic #3688
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
Conversation
|
This can be tested using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OR (OMPILER
I think you need to references variables with $ in here, not sure why cmake isn't complaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for $ for the variables here. VERSION_LESS works with variable names. Although I hoped that it would be complaining about OMPILER_VERSION.
cpp/Dockerfile.fedora
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: run these in a single layer
kou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I leave some comments but I like this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOUBLE_CONVERSION_LIBRARIES will be better for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used double-conversion_LIBRARIES as this is what double-conversion's CMake targets provides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Ah, *_LIBRARY is better than*_LIBRARIES.)
*_LIBRARY is our rule for specifying the correct target. So I think that we can use our naming rule (XXX_LIBRARY) instead of double-conversion's naming rule here.
But this is a trivial. I don't care with double-conversion_LIBRARY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_target_property(double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES "${DOUBLE_CONVERSION_PREFIX}/include") will be better than this and `include_directories(${double_conversion_INCLUDE_DIRS})".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 (if possible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we set(double-convertion_ROOT $ENV{CONDA_PREFIX}) here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (NOT ${double-conversion_FOUND}) | |
| if(${double-conversion_FOUND}) | |
| double_conversion_config() | |
| else() | |
| build_double_conversion() | |
| endif() |
will be more readable.
a1cd7f8 to
5073288
Compare
|
Please add an entry to the nightly tests too https://github.com/apache/arrow/blob/master/dev/tasks/tests.yml#L21 |
|
@wesm This is currently badly red for me in Travis due to the simple fact that we install all our dependencies for GCC 5.4 into a conda environment but don't activate this conda environment then. I don't think this is the way we should use the packages. I'll have a look tomorrow and will probably add a |
151a8d0 to
186ff04
Compare
e29d996 to
e2ce187
Compare
|
Since we are talking about redoing all the CMake dependency logic, here is a wild idea: one PITA with cmake is that |
e2ce187 to
c8e9f42
Compare
This would definitely simplify the logic a bit more but would also introduce some inconvenience to the user again to get a first running Arrow setup. After juggling around so much with the CMake code, I'd rather keep the logic with the external projects. If we were to separate this out into another project, we would also need to share logic what really needs to be built. |
ad5c1ba to
21e88e6
Compare
|
On Windows, it looks like the wrong libraries are being linked in the toolchain build: According to https://github.com/conda-forge/gtest-feedstock/blob/master/recipe/bld.bat#L88 it should be using |
|
@fsaintjacques Can you post the output of CMake? Please ensure that you have cleaned your build directory first. @wesm Yes, the Windows issue would need some help. I'm still struggling with getting a basic Arrow build working on Windows. We also need to decide on what to do with the Valgrind errors. They look quite confusing to me and I suspect a bit that this due to clang-7 and not our code. My preference at the moment would be to move the Valgrind runs into the conda-forge toolchain job., |
|
Attached cmake.log |
|
@xhochy the second valgrind failure is due unrecognized AVX instruction: https://travis-ci.org/apache/arrow/jobs/502177486#L5353-L5356 This is a valgrind problem, not always reproducible because libc (and I suspect libstc++) will dispatch function implementation at runtime depending on the supported cpu features. The first failure is a failed assertion. Either we upgrade valgrind (ugh), or ignore the 2 tests. |
appveyor.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For debug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will remove before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just vendor it then, I don't think we expose any symbols?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work locally when using dependency AUTO without conda. It seems that find_package(benchmark) "finds" it but
benchmark_FOUND=1benchmark_INCLUDE_DIR=benchmark_LIBRARY=
I'm not sure if this is an issue with libbenchmark-dev cmake's config definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On which system did you have this combination?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu 18.04, with libbenchmark-dev installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add a Dockerfile for this then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found the problem. Empty benchmark_INCLUDE_DIR and benchmark_LIBRARY are expected, we only need the targets benchmark::benchmark and benchmark::benchmark_main. The latter is just not yet available in the version of benchmark. So to support benchmarks on Ubuntu 18.04, we need to compile our own benchmark main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something odd is happening, it uses another build directory downloaded rapidjson:
-- RapidJSON found. Headers: /home/fsaintjacques/src/db/arrow/cpp/flight-build/rapidjson_ep/src/rapidjson_ep-install/include
ac5057f to
a73735c
Compare
bedf17b to
dcb1ce2
Compare
|
Looking at this. Going to see if I can resolve the Windows issue |
|
I don't know what's wrong with the conda-forge *-md.lib libraries. Removing the incorrect GTEST_BUILD_AS_SHARED_LIBRARY flag I get the following linking error It isn't reasonable to block the patch on this issue. Using |
|
I just pushed my changes so you can look at the diff, I think you'll want to squash before merging to make sure you get "credit" (the merge script tie breaks based on the most recent commit for some reason) |
|
@kou Can you have a look at this? |
|
Windows failures are due to #3885, I'm taking care of Plasma on OSX now. |
|
+1, bombs away. I'll look at the ZSTD issue shortly |
|
@xhochy Sorry for not having a look at this! I'll create a pull request when I find something as usual. Thanks for doing this! |
This changes refactors much of our CMake logic to make use of built-in CMake paths and remove custom logic. It also switches to the use of more modern dependency management via CMake targets instead of plain text variables.
This includes the following fixes:
*_ROOTvariables: https://issues.apache.org/jira/browse/ARROW-4383double-conversion<3.1: https://issues.apache.org/jira/browse/ARROW-4617compilersmetapackage to install the correct binutils when using conda, otherwise system binutils to fix https://issues.apache.org/jira/browse/ARROW-4485EXPECT_OKcollision: https://issues.apache.org/jira/browse/ARROW-4760