-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Correct INSTALL_PREFIX for MacOS #4916
Correct INSTALL_PREFIX for MacOS #4916
Conversation
✅ Deploy Preview for meta-velox canceled.
|
@majetideepak Please review this. |
@nmahadevuni the builds are failing. You need to rebase your branch with the latest main. |
3b9678d
to
88466b6
Compare
scripts/setup-helper-functions.sh
Outdated
@@ -130,6 +130,10 @@ function cmake_install { | |||
CPU_TARGET="${CPU_TARGET:-avx}" | |||
COMPILER_FLAGS=$(get_cxx_flags $CPU_TARGET) | |||
|
|||
if [ "${CPU_TARGET}" == "arm64" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naveen, have you verified if the CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX are also "/opt/homebrew" on other OS? It would be safer to check both CPU and OS here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check. In the same file, it is clear that arm64 target type is only for Apple M1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can have arm64 with Linux like AWS Graviton. I see that we do not handle this under the Linux OS above.
But let's do the right thing here by adding "$OS" = "Darwin"
.
88466b6
to
7240bd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kgpai Can you please review and merge? Thanks.
Thanks, @nmahadevuni |
scripts/setup-helper-functions.sh
Outdated
@@ -130,6 +131,11 @@ function cmake_install { | |||
CPU_TARGET="${CPU_TARGET:-avx}" | |||
COMPILER_FLAGS=$(get_cxx_flags $CPU_TARGET) | |||
|
|||
if [[ "$OS" == "Darwin" && "${CPU_TARGET}" == "arm64" ]]; then | |||
INSTALL_PREFIX="/opt/homebrew" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convention internally is to have homebrew installed on personal home dirs, Can we instead change this to `INSTALL_PREFIX="${INSTALL_PREFIX:-/opt/homebrew}"
7240bd7
to
f204244
Compare
Thanks @majetideepak @kgpai . Addressed the comments. Please review again. |
Hi @majetideepak @kgpai, can we revisit this? It seems to be very close. |
@nmahadevuni Can you rebase against latest main , I will start the merge process after that. |
@nmahadevuni is this still relevant? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to setup-macos.sh?
@majetideepak This change needs to be in setup-helper-functions.sh, since the build commands here use the prefix. |
f204244
to
67de8bf
Compare
INSTALL_PREFIX variable can be defined inside setup-macos.sh as well since that includes the helper script. |
I am also curious why we need to install dependencies in the brew prefix and not the default system location. |
That's the default in M1, all brew installed dependencies go in this path, and other components that need these dependencies will need to use the brew prefix. I will automate getting HOMEBREW_PREFIX as you mentioned. |
You just have to add the CMAKE_PREFIX_PATH to include the brew install location. You don't need to set INSTALL_PREFIX to brew prefix for other dependencies. |
67de8bf
to
159a4b1
Compare
159a4b1
to
4581757
Compare
@majetideepak can you check? |
We can set CMAKE_PREFIX_PATH to the install directory to work around this. Closing this. |
On MacOS, all brew installed dependencies go in brew prefix path(/opt/homebrew), and other components that need these dependencies will need to use this path as INSTALL_PREFIX.