Skip to content
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

build: Minor cleanup in CMakeLists #11453

Closed
wants to merge 1 commit into from

Conversation

zuyu
Copy link
Contributor

@zuyu zuyu commented Nov 6, 2024

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 6, 2024
Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 2fefa95
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/673cdcb8c6d6ab0008d677d3

@zuyu zuyu marked this pull request as ready for review November 6, 2024 05:21
@zuyu zuyu requested a review from majetideepak as a code owner November 6, 2024 05:21
@majetideepak
Copy link
Collaborator

@zuyu what is the motivation for this change?

@zuyu
Copy link
Contributor Author

zuyu commented Nov 6, 2024

ON_APPLE_M1, only used in folly CMake, equals ARM + macOS.

folly CMake, however, should set CMAKE_LIBRARY_ARCHITECTURE for ARM, not only for macOS (although currently there are no other OS on ARM). Thus, ON_APPLE_M1 is obsoleted.

@majetideepak
Copy link
Collaborator

Folly seems to handle Linux arm which is aarch64
https://github.com/facebook/folly/blob/main/CMakeLists.txt#L88
So this change should be specific to Apple arm which is arm64 as it is.

@zuyu zuyu requested a review from assignUser as a code owner November 6, 2024 23:50
@majetideepak
Copy link
Collaborator

@zuyu The IS_AARCH64_ARCH seems to be enabling some optimizations for arm. It looks like we cannot remove this.
https://github.com/facebook/folly/blob/main/CMakeLists.txt#L413

@zuyu zuyu force-pushed the cmake-cleanup branch 2 times, most recently from 7f1d396 to 786b58a Compare November 12, 2024 15:54
# folly will wrongly assume x86_64 if this is not set
set(CMAKE_LIBRARY_ARCHITECTURE aarch64)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
set(IS_AARCH64_ARCH TRUE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zuyu Are you able to confirm from the build that this change works? Can you share the log?

Copy link
Contributor Author

@zuyu zuyu Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@majetideepak W/ the following changes:

if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
   set(IS_AARCH64_ARCH TRUE)
   message(STATUS "set(IS_AARCH64_ARCH TRUE)")
 endif()

make debug output on macOS:

-- Setting folly source to AUTO
CMake Warning at CMake/ResolveDependency.cmake:70 (find_package):
  By not providing "Findfolly.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "folly", but
  CMake did not find one.

  Could not find a package configuration file provided by "folly" with any of
  the following names:

    follyConfig.cmake
    folly-config.cmake

  Add the installation prefix of "folly" to CMAKE_PREFIX_PATH or set
  "folly_DIR" to a directory containing one of the above files.  If "folly"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:502 (velox_resolve_dependency)


-- Building Folly from source
-- set(IS_AARCH64_ARCH TRUE)

...

-- Setting FOLLY_USE_SYMBOLIZER: OFF
-- Setting FOLLY_HAVE_ELF:
-- Setting FOLLY_HAVE_DWARF: FALSE

...

-- Using BUNDLED folly

...

[3567/3568] Linking CXX executable velox/tool/trace/velox_query_replayer
ld: warning: ignoring duplicate libraries:  ... '_deps/folly-build/libfolly.a' ...

Note that

  • IS_AARCH64_ARCH is defined in v2024.07.15.00, so it has no effects for now (v2024.07.01.00).
  • CMAKE_LIBRARY_ARCHITECTURE is only used in message cmds in folly CMake. In other words, it has no effects at all.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to come in late, this whole if can be removed because I upstreamed the change to folly last year https://github.com/facebook/folly/blob/main/CMakeLists.txt#L82

Copy link
Contributor Author

@zuyu zuyu Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@assignUser I get your point, but on macOS ${CMAKE_SYSTEM_PROCESSOR} is arm64, NOT aarch64.

Or, we could update folly w/ ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|arm64", and remove it here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but are you running into the linking issues described here: facebook/folly@c30d49d ? From what I can tell this is about linux arm not apple?

Because the actual issue why this use of ON_M1 was added was fixed (it added sse flags on m1).

Copy link
Contributor Author

@zuyu zuyu Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I do not have any build / link issues.

This PR just to remove ON_APPLE_M1, which was set in root/CMake, but only used in folly/CMake.

Btw, facebook/folly@c30d49d is part of v2024.07.15.00, and Velox uses v2024.07.01.00 for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so we can just remove the entire thing :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@assignUser Plz also review facebook/folly#2341. Ty!

@zuyu zuyu changed the title Minor cleanup in CMakeLists build: Minor cleanup in CMakeLists Nov 15, 2024
@zuyu zuyu requested a review from majetideepak November 16, 2024 06:41
@assignUser assignUser added the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Nov 20, 2024
@facebook-github-bot
Copy link
Contributor

@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@kagamiori merged this pull request in 63b4b08.

Copy link

Conbench analyzed the 1 benchmark run on commit 63b4b081.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

@zuyu zuyu deleted the cmake-cleanup branch November 21, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants