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

node-gyp error on M1 (Apple Sillicon): errorthe clang compiler does not support '-march=native': #169

Closed
jrop opened this issue May 29, 2021 · 5 comments · Fixed by #171
Closed
Labels
help wanted Extra attention is needed

Comments

@jrop
Copy link

jrop commented May 29, 2021

I am getting the following build-error on my Apple M1:

Code/local/rocksdb-sandbox
❯ npm install rocksdb@5

> [email protected] install /Users/me/Code/local/rocksdb-sandbox/node_modules/rocksdb
> node-gyp-build

  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/clock_cache.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/lru_cache.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/sharded_cache.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_addition.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_builder.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_cache.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_garbage.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_meta.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_reader.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_log_format.o
  CXX(target) Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_log_sequential_reader.o
clangclang: clang: : clang: clang: error: error: errorthe clang compiler does not support '-march=native': the clang compiler does not support '-march=native'

errorthe clang compiler does not support '-march=native':
the clang compiler does not support '-march=native'error
: the clang compiler does not support '-march=native'
clangclang: : errorerror: : the clang compiler does not support '-march=native'the clang compiler does not support '-march=native'

clang: error: the clang compiler does not support '-march=native'
clangclang: : errorerror: : the clang compiler does not support '-march=native'the clang compiler does not support '-march=native'

clang: error: the clang compiler does not support '-march=native'
clang: clang: error: the clang compiler does not support '-march=native'error
: the clang compiler does not support '-march=native'
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_reader.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_garbage.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_cache.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_builder.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/lru_cache.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/clock_cache.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_log_sequential_reader.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_addition.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_log_format.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/sharded_cache.o] Error 1
make: *** [Release/obj.target/rocksdb/deps/rocksdb/rocksdb/db/blob/blob_file_meta.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/Cellar/node@12/12.22.1_1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/opt/homebrew/Cellar/node@12/12.22.1_1/bin/node" "/opt/homebrew/Cellar/node@12/12.22.1_1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/me/Code/local/rocksdb-sandbox/node_modules/rocksdb
gyp ERR! node -v v12.22.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2021-05-29T16_13_55_051Z-debug.log
Code/local/rocksdb-sandbox
❯
@vweevers vweevers added the help wanted Extra attention is needed label Jun 7, 2021
@Nazgolze
Copy link
Contributor

Nazgolze commented Jun 9, 2021

-march=native isn't strictly required for building. Would it make sense to just remove it?

@vweevers
Copy link
Member

vweevers commented Jun 9, 2021

@Nazgolze Could you elaborate? The march=native flag is an optimization flag, correct? So removing it will harm performance (by how much?) but increase hardware compat.

@Nazgolze
Copy link
Contributor

Nazgolze commented Jun 9, 2021

@Nazgolze Could you elaborate? The march=native flag is an optimization flag, correct? So removing it will harm performance (by how much?) but increase hardware compat.

exactly, yes 🙂

@vweevers
Copy link
Member

vweevers commented Jun 9, 2021

A PR is welcome to remove it:

, '-march=native'

We can keep that PR open for a week or so for anyone (that cares about the potential performance impact) to object.

@Nazgolze
Copy link
Contributor

Nazgolze commented Jun 9, 2021

Cool. I will have that ready shortly :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants