0

I'm following the Anchor docs here, but I keep getting this error...

BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2)

I ran ls -al /Users/herbie/.cargo/bin and got this output:

total 239152
drwxr-xr-x  17 herbie  staff       544 31 Jan 16:55 .
drwxr-xr-x   9 herbie  staff       288 13 Dec 11:58 ..
-rwxr-xr-x   1 herbie  staff  12574724 31 Jan 16:49 anchor
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo
-rwxr-xr-x   1 herbie  staff   7578989 14 Dec 14:05 cargo-build-bpf
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo-clippy
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo-fmt
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo-miri
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 clippy-driver
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rls
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rust-gdb
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rust-lldb
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustc
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustdoc
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustfmt
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustup

Haven't found much online, and have never heard of BPF before...

Herbie Vine
  • 1,643
  • 3
  • 17
  • 32

2 Answers2

0

It's unclear when you're getting the error during the installation, but here's a few things to try:

For more reference, BPF is the bytecode format used by on-chain programs with Solana. You can find some more info at the links contained within https://docs.solana.com/developing/on-chain-programs/overview#berkeley-packet-filter-bpf

Jon C
  • 7,019
  • 10
  • 17
  • No luck unfortunately... `➜ test1 anchor build BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2) ➜ test1 solana -V solana-cli 1.9.1 (src:b66e2ae3; feat:4100269022) ➜ test1 cargo build-bpf BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2)` – Herbie Vine Feb 02 '22 at 10:12
0

Try removing the solana cache before running your code. It worked for me. Basically, the BPF SDK hasn't been installed accurately.

rm -rf ~/.cache/solana/*

After deleting the solana cache run. It should download the BPF SDK again

solana build
Damsara Perera
  • 161
  • 2
  • 13