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

[BUG] Building from source fails as deps are not found #12081

Closed
ccoulombe opened this issue Nov 6, 2022 · 6 comments
Closed

[BUG] Building from source fails as deps are not found #12081

ccoulombe opened this issue Nov 6, 2022 · 6 comments
Assignees
Labels
0 - Backlog In queue waiting for assignment bug Something isn't working CMake CMake build issue

Comments

@ccoulombe
Copy link

First, 👏 great work into making cudf and other RAPIDSAI libraries more easy to build from source!!! A lot of work has been put into it.
This is the continuity of #2770.

Describe the bug

Building v22.12 from source fails as some dependencies are missing or not included properly.

  1. Linking fails from internal linker error.
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld.gold: error: /home/coulombc/cudf/cpp/build/fatbin.ld: SECTIONS seen after other input files; try -T/--script
/cvmfs/soft.computecanada.ca/gentoo/2020/usr/x86_64-pc-linux-gnu/binutils-bin/2.33.1/ld.gold: internal error in write_sections, at /cvmfs/soft.computecanada.ca/gentoo/2020/var/tmp/portage/sys-devel/binutils-2.33.1-r1/work/binutils-2.33.1/gold/reloc.cc:790
  1. dlpack is fetched and used for libcudf but fails for the python bindings.
/home/coulombc/cudf/python/cudf/_skbuild/linux-x86_64-3.10/cmake-build/cudf/_lib/interop.cxx:893:10: fatal error: dlpack/dlpack.h: No such file or directory
  893 | #include "dlpack/dlpack.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

Steps/Code to reproduce bug

export CPATH=$CPATH:$RMM_ROOT/include
git clone --recursive https://github.com/rapidsai/cudf.git && cd cudf
PARALLEL_LEVEL=16 bash build.sh |& tee build.out

Expected behavior
Succeeds to build cudf from source, and not using conda!

Environment overview (please complete the following information)

  • Environment location: bare metal, centos
  • Method of cuDF install: source

Solutions

  1. I can overcome the internal failure by building with --cmake-args=\"-DCMAKE_SHARED_LINKER_FLAGS=\'-fuse-ld=bfd\'\"
  2. I can insall dlpack centrally and therefore it is found and included.
    But since it is pulled and used when building libcudf, the CMakeLists.txt for the python binding of cudf should re-use it.
@ccoulombe ccoulombe added Needs Triage Need team to review and classify bug Something isn't working labels Nov 6, 2022
@ccoulombe ccoulombe changed the title [BUG] Building from source fails as deps are not fetched [BUG] Building from source fails as deps are not found Nov 6, 2022
@GregoryKimball
Copy link
Contributor

Thank you @ccoulombe for raising a new issue here. It looks like you have a workaround for now, but there may be an improvement we can make. @robertmaynard when you get a few spare cycles, would you please share your thoughts?

@GregoryKimball GregoryKimball added 0 - Backlog In queue waiting for assignment CMake CMake build issue and removed Needs Triage Need team to review and classify labels Nov 14, 2022
@robertmaynard robertmaynard self-assigned this Nov 14, 2022
@robertmaynard
Copy link
Contributor

Linking fails from internal linker error.

It looks like you are running into this requirement for ld.gold ( https://sourceware.org/legacy-ml/binutils/2013-08/msg00044.html ) where the linker script need to be the first things past to the linker. For libcudf we pass no other link options so the fatbin.ld should be passed before any object files. My feeling is that some env variable of your machine is inserting extra link options.

It would be helpful to see your full libcudf.so link line to verify this. But if your environment is injecting flags, you will be forced to not use ld.gold :(

@robertmaynard
Copy link
Contributor

I have opened #12139 to fix the dlpack issue, it would be great if you could verify that this fix works for you.

rapids-bot bot pushed a commit that referenced this issue Nov 17, 2022
As brought up in #12081 it is possible to have python build failures due to no include paths to dlpack being provided. This fixes the issue by ensure that the DLPACK_INCLUDE_DIR is propagated down to the interop target.

We don't run into this issue with conda, since the dlpack headers are inside the conda include dir which is already being provided to the compiler.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #12139
@ccoulombe
Copy link
Author

@robertmaynard Will do and report back!

@ccoulombe
Copy link
Author

It works, but instead of reusing the already pulled dependency when the c++ part was built, it pulls it again

-- CPM: adding package dlpack@0.5 (v0.5)

@robertmaynard
Copy link
Contributor

It works, but instead of reusing the already pulled dependency when the c++ part was built, it pulls it again

-- CPM: adding package dlpack@0.5 (v0.5)

Good to hear that it works.

As for re-use of the existing dlpack, I am planning on correcting this for 23.02 but since it requires more CMake work it wasn't eligible for 22.02 given where we are in the release cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog In queue waiting for assignment bug Something isn't working CMake CMake build issue
Projects
None yet
Development

No branches or pull requests

3 participants