weld-project / weld

High-performance runtime for data analytics applications
https://www.weld.rs
BSD 3-Clause "New" or "Revised" License
2.99k stars 258 forks source link

"cargo build --release" fails when running in Ubuntu 18.04 (bionic) #475

Closed ManuelMourato25 closed 5 years ago

ManuelMourato25 commented 5 years ago

When I try to run cargo build --release in my Ubuntu 18.04 (bionic) machine, it fails with the following error:

note: /usr/bin/ld: /home/manuel.mourato/gitlab/weld/target/release/deps/libweld-a1558a4817c2a071.rlib(llvmext.o): 
relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; 
recompile with -fPIC
          /usr/bin/ld: final link failed: Nonrepresentable section on output
          collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile `hdrgen`.

Caused by:
  process didn't exit successfully: 
`rustc --edition=2018 --crate-name hdrgen weld-hdrgen/src/main.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=c4dba0c8de6b65f7 -C extra-filename=-c4dba0c8de6b65f7 --out-dir /home/manuel.mourato/gitlab/weld/target/release/deps -L dependency=/home/manuel.mourato/gitlab/weld/target/release/deps --extern clap=/home/manuel.mourato/gitlab/weld/target/release/deps/libclap-125a20206ea136e1.rlib --extern code_builder=/home/manuel.mourato/gitlab/weld/target/release/deps/libcode_builder-bd1cc3750b4dfebe.rlib --extern weld=/home/manuel.mourato/gitlab/weld/target/release/deps/libweld-a1558a4817c2a071.rlib -C link-args=-Wl,-export-dynamic -L native=/home/manuel.mourato/gitlab/weld/target/release/build/weld-4da72c158b0e6cc6/out -L native=/home/manuel.mourato/gitlab/weld/target/release/build/llvm-sys-f168621b3f5d91c9/out -L native=/usr/lib/llvm-8/lib` (exit code: 1)

I tried adding -C relocation-model=pic to the command above, but it did not work.

Here are some specifications:

$ rustc --version
rustc 1.36.0
$llvm-config --version
8.0.0

I am missing something, or is this a bug? Thank you.

Max-Meldrum commented 5 years ago

You need LLVM 6.0.

try the following:

$ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - $ sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-6.0 main" $ sudo apt update && sudo apt install clang-6.0 $ sudo ln -s /usr/bin/llvm-config-6.0 /usr/local/bin/llvm-config $ sudo apt-get install -y zlib1g-dev

ManuelMourato25 commented 5 years ago

It was indeed the llvm version. Thank you.