Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on ARM64 Mac #59569

Closed
ccampbell opened this issue Jan 29, 2021 · 8 comments
Closed

Build fails on ARM64 Mac #59569

ccampbell opened this issue Jan 29, 2021 · 8 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner

Comments

@ccampbell
Copy link

Describe the problem

Trying to build from source on an ARM64 Mac with M1 chip fails with this error:

duplicate symbol 'vtable for geos::noding::BasicSegmentString' in:
    CMakeFiles/geos.dir/src/inlines.cpp.o
    CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o
duplicate symbol 'typeinfo name for geos::noding::BasicSegmentString' in:
    CMakeFiles/geos.dir/src/inlines.cpp.o
    CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o
duplicate symbol 'typeinfo for geos::noding::BasicSegmentString' in:
    CMakeFiles/geos.dir/src/inlines.cpp.o
    CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o
ld: 3 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To Reproduce

curl https://binaries.cockroachdb.com/cockroach-v20.2.4.src.tgz | tar -xJ
cd cockroach-v20.2.4
make build

Expected behavior
The build succeeds

Additional data / screenshots
The issue itself seems to be with the geos submodule/fork

It looks like it may be fixed here: libgeos/geos#365

Environment:

  • 20.2.4
  • MacOS 11
@ccampbell ccampbell added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jan 29, 2021
@blathers-crl
Copy link

blathers-crl bot commented Jan 29, 2021

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I was unable to automatically find someone to ping.

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner labels Jan 29, 2021
@ccampbell
Copy link
Author

Seems like rocksdb is also failing to build:

-- Build files have been written to: cockroach/cockroach-v20.2.4/native/arm64-apple-darwin20.1.0/rocksdb
Scanning dependencies of target build_version
[  0%] Building CXX object CMakeFiles/build_version.dir/build_version.cc.o
clang: error: the clang compiler does not support '-march=native'
make[5]: *** [CMakeFiles/build_version.dir/build_version.cc.o] Error 1
make[4]: *** [CMakeFiles/build_version.dir/all] Error 2
make[3]: *** [CMakeFiles/rocksdb.dir/rule] Error 2
make[2]: *** [rocksdb] Error 2
make[1]: *** [cockroach/cockroach-v20.2.4/native/arm64-apple-darwin20.1.0/rocksdb/librocksdb.a] Error 2
make: *** [build] Error 2

Perhaps related to facebook/rocksdb#7714

@ccampbell
Copy link
Author

ccampbell commented Jan 29, 2021

Okay I finally got it to build, but it requires a bunch of changes:

  1. The geos library needs this patch
  2. -march=native needs to be removed from rocks-db for mac arm64: https://github.com/cockroachdb/rocksdb/blob/2512e96f3bf87b3c1b5b0183ed2ec421dc35d0d7/CMakeLists.txt#L227
  3. The arm check for rocks-db needs to be modified to not trigger a ROCKSDB_LITE build for Mac: https://github.com/cockroachdb/rocksdb/blob/2512e96f3bf87b3c1b5b0183ed2ec421dc35d0d7/CMakeLists.txt#L394-L398
  4. The https://github.com/shirou/gopsutil library needs to be upgraded to at least version v2.20.9 (same major release as the current version) which includes the process_darwin_arm64.go and host_darwin_arm64.go files

I think that is everything, but it also got hung up during the build process at some point, and I haven’t had a chance to actually try out the final binary yet.

@otan
Copy link
Contributor

otan commented Feb 16, 2021

i can do the GEOS patch, but https://github.com/shirou/gopsutil needs an upgrade.

confused how rocksdb is still on your build - that thing is gone as of master about 3 months ago!

@ccampbell
Copy link
Author

confused how rocksdb is still on your build - that thing is gone as of master about 3 months ago!

I built from the latest stable at the time v20.2.4 which still includes it: https://github.com/cockroachdb/cockroach/tree/eda2309728392593162e962a61182eab6ab003ff/c-deps

@otan
Copy link
Contributor

otan commented Feb 16, 2021

Ah, right, we still needs rocks in v20.2, but it's gone in the upcoming master release (v21.1).

Did you need to build v20.2 for any reason?

@ccampbell
Copy link
Author

Nope. I just tend to use the latest stable release when I’m trying out new software. I can try building off of one of the v21 alpha builds.

craig bot pushed a commit that referenced this issue Feb 17, 2021
60629: c-deps/geos: add patch to compile on Mac ARM64 r=sumeerbhola a=otan

Release note: None

Refs #59569 

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
craig bot pushed a commit that referenced this issue Feb 17, 2021
60643: vendor: upgrade github.com/shirou/gopsutil to v2.20.9 r=knz a=otan

This version resolves an ARM/Mac compile issue.

Refs: #59569

Release note: None

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
@otan
Copy link
Contributor

otan commented Feb 17, 2021

should be fine on master, but i can't test it. let me know if you have any issues.

@otan otan closed this as completed Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner
Projects
None yet
Development

No branches or pull requests

2 participants