Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Adding support to apple-m1 architecture #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

doronaviguy
Copy link

@doronaviguy doronaviguy commented Jan 5, 2022

This PR includes the following

  1. detecting arm based apple devices and passing the right value to clang complier
  2. in case of ARM processor we are declaring the cpp version to be 14 set(CMAKE_CXX_STANDARD 14)
  3. changing the clang flag from march to mcpu and pass the right flag based on the system architecture, in case of an apple arm based processor we are passing -mcpu=apple-m1

Tested on apple both arm and non arm cpus

@doronaviguy doronaviguy changed the title Adding support to apple-m1 arthitectecture Adding support to apple-m1 architecture Jan 6, 2022
@awesome-doge
Copy link

Everything unrelated to rocksdb will pass the test, including

  • test-cells
  • test-ed25519
  • test-fec
  • test-hello-world
  • test-http
  • test-net
  • test-tdactor
  • test-tdutils
  • adnl/adnl-proxy
  • blockchain-explorer/blockchain-explorer

Anything that has dependencies on rocksdb cannot be compiled.
will get the following error. This also needs the adjustment of rocksdb.

FAILED: third-party/rocksdb/CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DIOS_CROSS_COMPILE -DNDEBUG -DOS_MACOSX -DROCKSDB_LIB_IO_POSIX -DROCKSDB_LITE -DROCKSDB_NO_DYNAMIC_EXTENSION -DROCKSDB_PLATFORM_POSIX -I/Users/awesome-doge/ton/third-party/rocksdb -I/Users/awesome-doge/ton/third-party/rocksdb/include -isystem /Users/awesome-doge/ton/third-party/rocksdb/third-party/gtest-1.8.1/fused-src -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -std=c++11 -march=native -g -DROCKSDB_USE_RTTI -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -fPIC -std=gnu++14 -MD -MT third-party/rocksdb/CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o -MF third-party/rocksdb/CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o.d -o third-party/rocksdb/CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o -c /Users/awesome-doge/ton/third-party/rocksdb/db/arena_wrapped_db_iter.cc
clang: error: the clang compiler does not support '-march=native'
[12/245] Building CXX object third-party/rocksdb/CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o
FAILED: third-party/rocksdb/CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DIOS_CROSS_COMPILE -DNDEBUG -DOS_MACOSX -DROCKSDB_LIB_IO_POSIX -DROCKSDB_LITE -DROCKSDB_NO_DYNAMIC_EXTENSION -DROCKSDB_PLATFORM_POSIX -I/Users/awesome-doge/ton/third-party/rocksdb -I/Users/awesome-doge/ton/third-party/rocksdb/include -isystem /Users/awesome-doge/ton/third-party/rocksdb/third-party/gtest-1.8.1/fused-src -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -std=c++11 -march=native -g -DROCKSDB_USE_RTTI -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -fPIC -std=gnu++14 -MD -MT third-party/rocksdb/CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o -MF third-party/rocksdb/CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o.d -o third-party/rocksdb/CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o -c /Users/awesome-doge/ton/third-party/rocksdb/db/compacted_db_impl.cc
clang: error: the clang compiler does not support '-march=native'
ninja: build stopped: subcommand failed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants