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 error "cant find CacheAllocator.cpp" #345

Open
Z-Jie2020 opened this issue Oct 8, 2024 · 2 comments · May be fixed by #349
Open

build error "cant find CacheAllocator.cpp" #345

Z-Jie2020 opened this issue Oct 8, 2024 · 2 comments · May be fixed by #349

Comments

@Z-Jie2020
Copy link

Describe the bug
After git clone the resposity, I went to the Cachelib directory and execute the statement: ./ntrib/build.sh -d -j -v. It ended with an error.

-- Configuring done
CMake Error at allocator/CMakeLists.txt:26 (add_library):
  Cannot find source file:

    CacheAllocator.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


CMake Error at allocator/CMakeLists.txt:26 (add_library):
  No SOURCES given to target: cachelib_allocator


CMake Generate step failed.  Build files cannot be regenerated correctly.
build-package.sh: error: cmake failed on cachelib
build.sh: error: failed to build cachelib

Screenshots
image

Another Problem
What should I do to fix it,There really is no CacheAllocator.cpp in the allocator directory.
Moreover, when I run the statement : ./contrib/build.sh -j -T , it showed another problem:

make[2]: *** [CMakeFiles/logging_unittest.dir/build.make:102: logging_unittest] Error 1
make[1]: *** [CMakeFiles/Makefile2:879: CMakeFiles/logging_unittest.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
build-package.sh: error: make failed
build.sh: error: failed to build dependency 'googlelog'

image

Please give me some advice

@vaavaav
Copy link

vaavaav commented Nov 2, 2024

It seems that after commit dfe99bdfe7bd17d444d268b4364382900d01dc8f, CacheAllocator.cpp was split into multiple files (as it can be read here).

However, the cachelib/allocator/CMakeLists.txt was not updated accordingly.

@vaavaav vaavaav linked a pull request Nov 2, 2024 that will close this issue
@byrnedj
Copy link
Contributor

byrnedj commented Nov 8, 2024

I had to use fbthrift commit aa448e447ebab229e8d4ebb5fa30f1a0c522d487 and fmt tag 11.0.2 once I applied this patch to get a build.

Also I made these changes after the compressedptr update:

diff --git a/cachelib/allocator/memory/CompressedPtr.h b/cachelib/allocator/memory/CompressedPtr.h
index b56cbf2e..dbdcf625 100644
--- a/cachelib/allocator/memory/CompressedPtr.h
+++ b/cachelib/allocator/memory/CompressedPtr.h
@@ -294,12 +294,12 @@ class CACHELIB_PACKED_ATTR CompressedPtr5B {
            (slabIdx << kNumAllocIdxBits) + allocIdx;
   }

-  static IdxPtrType32 deserializePtr(SerializedPtrType ptr) {
+  static constexpr IdxPtrType32 deserializePtr(SerializedPtrType ptr) {
     XDCHECK(ptr >= 0);
     return static_cast<IdxPtrType32>(ptr);
   }

-  static RegionPtrType8 deserializeRegion(SerializedPtrType ptr) {
+  static constexpr RegionPtrType8 deserializeRegion(SerializedPtrType ptr) {
     XDCHECK(ptr >= 0);
     return static_cast<RegionPtrType8>(ptr >> kIdxNumBits);
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants