filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.25k forks source link

ld: library not found for -lhwloc clang: error: linker command failed with exit code 1 (use -v to see invocation) #7829

Closed AllanOricil closed 2 years ago

AllanOricil commented 2 years ago

Checklist

Lotus component

Lotus Version

zsh: command not found: lotus...

Describe the Bug

sudo make lotus   zsh  0  19:33:44  rm -f lotus go build -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.dd20829db" -o lotus ./cmd/lotus go: downloading github.com/ipfs/go-datastore v0.5.1 go: downloading github.com/filecoin-project/go-data-transfer v1.12.0 go: downloading github.com/filecoin-project/go-fil-markets v1.13.5 go: downloading github.com/filecoin-project/specs-storage v0.1.1-0.20211213202648-f14267c929ff go: downloading github.com/libp2p/go-libp2p-core v0.13.0 go: downloading github.com/libp2p/go-libp2p-pubsub v0.6.0 go: downloading github.com/ipld/go-car v0.3.3 go: downloading github.com/libp2p/go-libp2p-kad-dht v0.15.0 go: downloading go.opentelemetry.io/otel v1.2.0 go: downloading github.com/filecoin-project/go-commp-utils v0.1.3 go: downloading golang.org/x/sys v0.0.0-20211209171907-798191bca915 go: downloading github.com/ipfs/go-blockservice v0.2.1 go: downloading github.com/ipfs/go-ipfs-exchange-offline v0.1.1 go: downloading github.com/ipfs/go-merkledag v0.5.1 go: downloading github.com/filecoin-project/go-statestore v0.2.0 go: downloading github.com/ipfs/go-graphsync v0.11.0 go: downloading github.com/ipfs/go-ipfs-exchange-interface v0.1.0 go: downloading github.com/dgraph-io/badger/v2 v2.2007.3 go: downloading github.com/ipfs/go-ds-badger2 v0.1.2 go: downloading github.com/ipfs/go-ds-leveldb v0.5.0 go: downloading github.com/ipfs/go-ds-measure v0.2.0 go: downloading github.com/libp2p/go-libp2p v0.17.0 go: downloading github.com/filecoin-project/dagstore v0.4.4 go: downloading github.com/filecoin-project/go-storedcounter v0.1.0 go: downloading github.com/ipfs/go-bitswap v0.5.1 go: downloading github.com/ipfs/go-ipfs-blockstore v1.1.2 go: downloading github.com/raulk/go-watchdog v1.2.0 go: downloading github.com/ipld/go-car/v2 v2.1.1 go: downloading github.com/ipld/go-ipld-prime v0.14.3 go: downloading github.com/ipld/go-ipld-selector-text-lite v0.0.1 go: downloading github.com/libp2p/go-libp2p-discovery v0.6.0 go: downloading github.com/libp2p/go-msgio v0.1.0 go: downloading github.com/libp2p/go-libp2p-peerstore v0.6.0 go: downloading go.opentelemetry.io/otel/trace v1.2.0 go: downloading go.opentelemetry.io/otel/metric v0.25.0 go: downloading go.opentelemetry.io/otel/sdk/export/metric v0.25.0 go: downloading github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff go: downloading github.com/ipfs/go-ipfs-ds-help v1.1.0 go: downloading github.com/libp2p/go-libp2p-swarm v0.9.0 go: downloading github.com/ipfs/go-ipfs-routing v0.2.1 go: downloading github.com/libp2p/go-libp2p-connmgr v0.3.0 go: downloading github.com/libp2p/go-libp2p-noise v0.3.0 go: downloading github.com/libp2p/go-libp2p-quic-transport v0.15.2 go: downloading github.com/libp2p/go-libp2p-tls v0.3.1 go: downloading github.com/libp2p/go-libp2p-yamux v0.7.0 go: downloading github.com/ipfs/go-ipld-legacy v0.1.1 go: downloading github.com/drand/drand v1.3.0 go: downloading github.com/drand/kyber v1.1.7 go: downloading github.com/dgraph-io/ristretto v0.1.0 go: downloading golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 go: downloading github.com/ipfs/go-peertaskqueue v0.7.0 go: downloading github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61 go: downloading github.com/libp2p/go-libp2p-asn-util v0.1.0 go: downloading github.com/ipfs/go-filestore v1.1.0 go: downloading github.com/libp2p/go-libp2p-autonat v0.7.0 go: downloading github.com/libp2p/go-libp2p-nat v0.1.0 go: downloading github.com/libp2p/go-tcp-transport v0.4.0 go: downloading github.com/benbjohnson/clock v1.2.0 go: downloading golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b go: downloading github.com/lucas-clemente/quic-go v0.24.0 go: downloading github.com/libp2p/go-yamux/v2 v2.3.0 go: downloading github.com/golang/glog v1.0.0 go: downloading github.com/libp2p/go-libp2p-testing v0.6.0 go: downloading lukechampine.com/blake3 v1.1.7 go: downloading github.com/libp2p/go-conn-security-multistream v0.3.0 go: downloading github.com/libp2p/go-libp2p-blankhost v0.3.0 go: downloading github.com/libp2p/go-libp2p-transport-upgrader v0.6.0 go: downloading github.com/libp2p/go-nat v0.1.0 go: downloading github.com/libp2p/go-reuseport v0.1.0 go: downloading github.com/libp2p/go-reuseport-transport v0.1.0 go: downloading github.com/marten-seemann/qtls-go1-17 v0.1.0

github.com/filecoin-project/filecoin-ffi/generated

ld: library not found for -lhwloc clang: error: linker command failed with exit code 1 (use -v to see invocation)

github.com/zondax/hid

In file included from ../go/pkg/mod/github.com/zondax/hid@v0.9.0/hid_enabled.go:38: ../go/pkg/mod/github.com/zondax/hid@v0.9.0/hidapi/mac/hid.c:693:34: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here make: *** [lotus] Error 2

Logging Information

can't even install

Repo Steps

follow these M1 steps

https://lotus.filecoin.io/docs/set-up/lotus-lite/#m1-based-macs

or

these steps: https://lotu.sh/docs/set-up/install/#m1-based-cpus

Additional information:

go version go1.17.5 darwin/arm64

cargo 1.57.0 (b2e52d7ca 2021-10-21)

rustup 1.24.3 (ce5817a94 2021-05-31) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: The currently active rustc version is `rustc 1.57.0 (f1edd0429 2021-11-29)

Nothing that I do works. Forum suggestion pointed me to this link https://lotus.filecoin.io/docs/set-up/lotus-lite/#m1-based-macs and it failed.

Reiers commented 2 years ago

Hi @AllanOricil - Thanks for the report.

I have already reproduce the solution to the issue - and I built Lotus successfully with the small change in hid.c

You can find the solution in another open ticket: https://github.com/filecoin-project/lotus/issues/7597

We are aware of the issue - and working on a fix.

rm -f lotus
go build  -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.e05fdf892" -o lotus ./cmd/lotus
rm -f lotus-miner
go build  -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.e05fdf892" -o lotus-miner ./cmd/lotus-miner
rm -f lotus-worker
go build  -ldflags="-X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.e05fdf892" -o lotus-worker ./cmd/lotus-seal-worker
Caution: you have an existing lotus binary in your PATH. This may cause problems if you don't run 'sudo make install'

reiers@MacBook-Pro lotus % sudo make install

install -C ./lotus /usr/local/bin/lotus
install -C ./lotus-miner /usr/local/bin/lotus-miner
install -C ./lotus-worker /usr/local/bin/lotus-worker

reiers@MacBook-Pro lotus % lotus -v lotus version 1.13.2-rc4+mainnet+git.e05fdf892

Reproduced solution on machine:

MacBook Pro (16-inch, 2021)
Apple M1 Max
64 GB RAM

Also like I told you in the other ticket, remember to: rustup-init and source $HOME/.cargo/env before the build.

Closing this one, since there are already a issue open on topic. Thanks again for the report !