1

Question about this post:

Why does march=native not work on Apple M1?

I try to make qrandomx work on the M1 macbook. https://github.com/theQRL/qrandomx/

student@students-Air qrandomx % sudo python3 setup.py install
/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py:720: UserWarning: Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead
  warnings.warn(
/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py:720: UserWarning: Usage of dash-separated 'home-page' will not be supported in future versions. Please use the underscore name 'home_page' instead
  warnings.warn(
/opt/homebrew/lib/python3.9/site-packages/setuptools/dist.py:720: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
  warnings.warn(
/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_pyscaffold'
  warnings.warn(msg)
running install
/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/opt/homebrew/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
writing pyqrandomx.egg-info/PKG-INFO
writing dependency_links to pyqrandomx.egg-info/dependency_links.txt
writing top-level names to pyqrandomx.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'pyqrandomx.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-12-arm64/egg
running install_lib
running build_py
running build_ext
-- BUILD_TESTS    OFF
-- PYTHON WRAPPER ON
-- GO WRAPPER     OFF
-- WEBASSEMBLY    OFF
-- Python wrapper enabled
Python_FOUND:TRUE
Python_VERSION:3.9.9
Python_Development_FOUND:TRUE
Python_LIBRARIES:/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib
-- CMAKE_SWIG_OUTDIR: /Users/student/Documents/QRL_rpi/qrandomx/build/lib.macosx-12-arm64-3.9/pyqrandomx
-- CMAKE_LIBRARY_OUTPUT_DIRECTORY: /Users/student/Documents/QRL_rpi/qrandomx/build/lib.macosx-12-arm64-3.9/pyqrandomx
CMake Deprecation Warning at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/UseSWIG.cmake:734 (message):
  SWIG_ADD_MODULE is deprecated.  Use SWIG_ADD_LIBRARY instead.
Call Stack (most recent call first):
  CMakeLists.txt:144 (SWIG_ADD_MODULE)


CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/UseSWIG.cmake:775 (message):
  Policy CMP0078 is not set: UseSWIG generates standard target names.  Run
  "cmake --help-policy CMP0078" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/UseSWIG.cmake:735 (swig_add_library)
  CMakeLists.txt:144 (SWIG_ADD_MODULE)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/UseSWIG.cmake:617 (message):
  Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
  flag.  Run "cmake --help-policy CMP0086" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/UseSWIG.cmake:888 (SWIG_ADD_SOURCE_TO_MODULE)
  /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/UseSWIG.cmake:735 (swig_add_library)
  CMakeLists.txt:144 (SWIG_ADD_MODULE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- BUILD_TESTS    OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/student/Documents/QRL_rpi/qrandomx/build/temp.macosx-12-arm64-3.9
[  2%] Built target pyqrandomx_swig_compilation
[  5%] Building CXX object CMakeFiles/_pyqrandomx.dir/build/lib.macosx-12-arm64-3.9/pyqrandomx/qrandomxPYTHON_wrap.cxx.o
clang: error: the clang compiler does not support '-march=native'
make[2]: *** [CMakeFiles/_pyqrandomx.dir/build/lib.macosx-12-arm64-3.9/pyqrandomx/qrandomxPYTHON_wrap.cxx.o] Error 1
make[1]: *** [CMakeFiles/_pyqrandomx.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
  File "/Users/student/Documents/QRL_rpi/qrandomx/setup.py", line 79, in <module>
    setup_package()
  File "/Users/student/Documents/QRL_rpi/qrandomx/setup.py", line 69, in setup_package
    setup(setup_requires=['six', 'pyscaffold>=3.0.2'] + sphinx + cmake,
  File "/opt/homebrew/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py", line 74, in run
    self.do_egg_install()
  File "/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py", line 116, in do_egg_install
    self.run_command('bdist_egg')
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/opt/homebrew/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/opt/homebrew/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/opt/homebrew/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/student/Documents/QRL_rpi/qrandomx/setup.py", line 47, in run
    subprocess.check_call(['cmake', '--build', '.',
  File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release']' returned non-zero exit status 2.

It's about this:

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

How do i fix this? I try to add the flag -mcpu=apple-a14 but i'm not sure where to do that and what files for example.

kaylum
  • 13,833
  • 2
  • 22
  • 31
l33t
  • 133
  • 6

0 Answers0