velox: setup-macos.sh fails on Apple M1
env: Apple M1
error message:
-- Build files have been written to: /Users/abei/Code/velox/range-v3/_build
+ ninja -C _build install
ninja: Entering directory `_build'
[0/1] Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/cmake/range-v3/range-v3-targets.cmake
-- Installing: /usr/local/lib/cmake/range-v3/range-v3-config-version.cmake
-- Up-to-date: /usr/local/lib/cmake/range-v3/range-v3-config.cmake
-- Installing: /usr/local/include
CMake Error at cmake_install.cmake:64 (file):
file INSTALL cannot make directory "/usr/local/include": Permission denied.
I have to add sudo for cmake_install to walk around.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 32 (5 by maintainers)
Commits related to this issue
- Link brew package install dir to /usr/local to make Apple M1 happy(#1446) — committed to xumingming/velox by xumingming 2 years ago
- Link brew package install dir to /usr/local to make Apple M1 happy(#1446) — committed to Yuhta/velox by xumingming 2 years ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to rishitc/velox by rishitc a year ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to rishitc/velox by rishitc a year ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to rishitc/velox by rishitc a year ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to rishitc/velox by rishitc a year ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to majetideepak/velox by rishitc a year ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to rishitc/velox by rishitc 8 months ago
- Set environment variable for OpenSSL in CMake file (#5309) Summary: Folly needs OpenSSL 1.1 version to function. In the presence of other OpenSSL versions, it is possible that folly in bundled mode c... — committed to rishitc/velox by rishitc 8 months ago
It is recommended to use
INSTALL_PREFIXsayexport INSTALL_PREFIX=/Users/velox/velox_dependency_installwhen installing the dependencies to avoid polluting the default install location. This should also help with the permissions issue.Thanks @jayzhan211. Running the shared
exportcommand before runningCPU_TARGET="arm64" ./scripts/setup-macos.shworked 👍For future reference to anyone who stumbles on the same issue, here is the list of steps I followed for successfully setting up Velox on M1 Macs.
NOTE: The command for exporting
OPENSSL_ROOT_DIRwas to solve a setup error wherein the build script could not find OpenSSL because it required this environment variable to be defined.@majetideepak I think adding these commands to the project
README.mdwould be worthwhile, possibly under a Troubleshooting heading. This would be a helpful exercise because I found multiple similar issues/threads on the same topic while trying to debug this issue. The number of such problems can be reduced by modifying the projectREADME.md.If it makes sense, I would love to create a PR.
Thanks.
@dulvinw sure! We have to make this change to the other OS setup scripts as well. We should modify the README and suggest users invoke the setup scripts from the Velox root directory. We need a BUILD_PREFIX for builds similar to INSTALL_PREFIX. We can then create a
dependencies_builddirectory for the builds and adependencies_installdirectory for the installs in the Velox root directory. And add these directories to.gitignoreThen change setups scripts to add the above defaults for BUILD_PREFIX, INSTALL_PREFIX, and also the root CMakeLists.txt to include CMAKE_PREFIX_PATH CC: @kgpaii used same way to deal with protobuf, and finally suceessed!
@majetideepak @rishitc thanks you so much!
This is expected. The unit tests are not tested on MacOS and some of them fail as you reported.
23.x protobuf issue is very recent. We could throw an error, but it is cumbersome to keep track of and maintain such incompatible versions on different OSes. The ideal solution is to bundle Protobuf and other dependencies which I believe is a work in progress. Installing to the system path via brew or other means is a recipe for such conflicts. Users can alternatively use a container or VM to avoid such build conflicts.
Hi @majetideepak, Yes, I’d like to work on it 👍
On MacOS, you have to set
-DCMAKE_CXX_FLAGS=" -isystem /Users/velox/velox_dependency_install"-DCMAKE_PREFIX_PATH=/Users/velox/velox_dependency_installfor the build to pick up the dependencies.It seems there is still build error for m1
Any workaround or PR to fix?
@kgpai This is a permission issue on directory /usr/local. We got it on Intel processor too (MacOS).
@yingsu00 sure, will open an PR soon.