Closed workivan closed 2 years ago
Can you change the include
line in your makefile to
include ~/.local/share/solana/install/active_release/bin/sdk/bpf/c/bpf.mk
and try to build your project again?
@dmakarov, no, changing to the path you suggested leads to the same error
I tried to build solana from sources on two ubuntu machines: on one failed when compiling the 858th package, and on the second (on a clean one) during compilation of the 830th package with the same error
error: linking with
cc
failed: exit status:
I won't post the full stacktrace - it's huge
= note: collect2: fatal error: ld terminated with signal 9 [Killed] compilation terminated.
error: could not compilesolana-watchtower
due to previous error
trying to rebuild didn't help at all :( maybe I didn't install some dependencies not listed in the README.txt ?
Is the machine you're building on a virtual machine? How much RAM does it have? ld terminated with signal 9 [Killed] compilation terminated.
usually means that linker ran out of memory.
@dmakarov 8 gb ((
At least you don't see the error that ld.lld is not found anymore? Maybe you can try to set the environment variable
CARGO_BUILD_JOBS=1
and see if that helps. With this setting the build will be slower, but there will be only one job running at a time and 8G may be sufficient.
@dmakarov, unfortunately, this did not become a solution (( I want to add that RAM is not loaded during compilation of all packages except the latest ones
error that ld.lld is not found I still encounter
@dmakarov, good evening I tried to repeat the installation on windows: 1) successfully installed rust 2) installing solana using the tool also completed without errors, but the deps file is empty again and the attempt to run cargo-build-bpf ends as follows
Solana Rust BPF toolchain is not available on Windows
Can you tell me now, maybe this output is more understandable than the previous error ? waiting for your reply
Solana is not supported to run natively on Windows. Normally people use Windows Subsystem for Linux to run Solana or develop for Solana on Windows. Recently @joncinque made significant efforts to enable the Solana BPF toolchain to run natively on Windows. However it looks like cargo-build-bpf still does not work on Windows. The error that you're seeing is issued here https://github.com/solana-labs/solana/blob/1b46d1d54d275ece517a5525082450186a19e088/sdk/cargo-build-bpf/src/main.rs#L684 which means that cargo-build-bpf is not supposed to be run on Windows.
@joncinque should we remove this check https://github.com/solana-labs/solana/blob/1b46d1d54d275ece517a5525082450186a19e088/sdk/cargo-build-bpf/src/main.rs#L683-L686 and let corgo-build-bpf run natively on Windows?
I have to update #20276 and get that working, then we can certainly have this working for windows!
thank you all for your help, in the end it turned out to solve the problem using the prebuilt version on pure ubuntu 20.04
This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.
Problem
I am trying to build a c-project on Ubuntu 18.04 according to the instructions on the website, but I get an error
[lld] build/main.so ()
/home/ivan/.local/share/solana/solana-release/bin/sdk/bpf/c/bpf.mk:214: recipe for target 'build/main.so' failed
/bin/sh: 1: /home/ivan/.local/share/solana/solana-release/bin/sdk/bpf/c/../dependencies/bpf-tools/llvm/bin/ld.lld: not found
at the same time, the installation was completed successfully and rust was installed tooProposed Solution
my attempts to install llvm, clang and lld were successful but it did not become a solution and the error did not change
my make file
OUT_DIR := build
include ~/.local/share/solana/solana-release/bin/sdk/bpf/c/bpf.mk
Can you help me ?