filecoin-project / lotus

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

mac m3 chip make lotus prompt ld: library 'hwloc' not found #12365

Closed gsp-hub closed 3 months ago

gsp-hub commented 3 months ago

Checklist

Lotus component

Lotus Version

lotus version 1.28.1

Repro Steps

1.brew install go bzr jq pkg-config hwloc coreutils

2.curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

3.git clone https://github.com/filecoin-project/lotus.git cd lotus/

  1. make

Describe the Bug

rm -f lotus go build -ldflags="-s -w -X=github.com/filecoin-project/lotus/build.CurrentCommit=+git.34a12db.dirty" -o lotus ./cmd/lotus

github.com/filecoin-project/lotus/cmd/lotus

/opt/homebrew/Cellar/go/1.22.6/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1 ld: warning: ignoring duplicate libraries: '-lSystem', '-lc', '-lhwloc', '-liconv', '-lm', '-lproc', '/Users/spgao/lotus/extern/filecoin-ffi/libfilcrypto.a' ld: library 'hwloc' not found clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [lotus] Error 1

Logging Information

# github.com/filecoin-project/lotus/cmd/lotus
/opt/homebrew/Cellar/go/1.22.6/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1
ld: warning: ignoring duplicate libraries: '-lSystem', '-lc', '-lhwloc', '-liconv', '-lm', '-lproc', '/Users/spgao/lotus/extern/filecoin-ffi/libfilcrypto.a'
ld: library 'hwloc' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gsp-hub commented 3 months ago

My mac installed the required environment once before when nv22, when I cloned the latest lotus again directly and made it, I found this prompt, I tried to find ways to fix it (according to the https://lotus.filecoin.io/lotus/install/macos/ page macOS steps), but they all failed! .

ribasushi commented 3 months ago

@gsp-hub please check you have LIBRARY_PATH=/opt/homebrew/lib set when running the compile.

gsp-hub commented 3 months ago
image

Yes there is no such variable, and when I set it, a new error was reported

rvagg commented 3 months ago

those warnings should be ignorable in most cases

gsp-hub commented 3 months ago

Ok I found it, it's an alert but it doesn't affect the program generation.thanks for your support @rvagg @ribasushi