-
Notifications
You must be signed in to change notification settings - Fork 61
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
add cmake #7
add cmake #7
Conversation
endif() | ||
|
||
if(NOT TARGET absl::base) | ||
find_package(absl REQUIRED) |
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.
There are some issues with the current implementation.
# env
g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
cmake version 3.29.0
# build
mkdir bld && cd bld && cmake .. -DBUILD_DEPS=ON
# failure log
CMake Error at cmake/babylon-deps.cmake:9 (find_package):
Could not find a package configuration file provided by "absl" with any of
the following names:
abslConfig.cmake
absl-config.cmake
Add the installation prefix of "absl" to CMAKE_PREFIX_PATH or set
"absl_DIR" to a directory containing one of the above files. If "absl"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:8 (include)
I have already added the parameter -DBUILD_DEPS=ON
https://stackoverflow.com/questions/69748915/could-not-find-a-package-configuration-file-provided-by-absl-with-any-of-the-f
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.
do you expect CMake use FetchContent to download dependencies automatically? this CMakeList.txt try to support this scenes
- manually install pre-built abseil-cpp/boost/protobuf from package system like apt or yum
- or, manually built them from source and install them to default place or specify in CMAKE_PREFIX_PATH
- or, add them along with babylon use add_subdirectory
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.
do you expect CMake use FetchContent to download dependencies automatically?
Yep. I think maybe it's friendly for users.
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 have used on CUTLASS before, as follows:
include(FetchContent)
FetchContent_Declare(
repo-cutlass
GIT_REPOSITORY https://github.com/NVIDIA/cutlass.git
GIT_TAG 6f47420213f757831fae65c686aa471749fa8d60
GIT_SHALLOW ON
)
set(CUTLASS_ENABLE_HEADERS_ONLY ON CACHE BOOL "Enable only the header library")
FetchContent_MakeAvailable(repo-cutlass)
Maybe it can be used as a reference.
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.
@zhyncs try this new commit. I also add a new CI pipeline do demonstrate this basic usage
https://github.com/baidu/babylon/actions/runs/9032823762/job/24821774034
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.
@zhyncs try this new commit. I also add a new CI pipeline do demonstrate this basic usage https://github.com/baidu/babylon/actions/runs/9032823762/job/24821774034
Thanks very much, it is currently usable!
README.md
Outdated
- 使用预编译依赖`cmake -Bbuild` | ||
- 使用自动依赖下载`cmake -Bbuild -DBUILD_DEPS=ON` | ||
- 编译`cmake --build build` | ||
- 单测`--test-dir build` |
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.
--test-dir build
-> ctest --test-dir build
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.
fixed
No description provided.