The problem of compilation failure after importing `port/likely.h`
EAHITechnology opened this issue · 0 comments
EAHITechnology commented
When I compiled my demo, I found that you imported port/likely.h
, and at the same time I also found that the dependency on port/likely.h has been removed from rocksdb. This dependency leads to the need to add another search path, such as issues facebook/rocksdb#2008. So is this behavior what we expected?
Expected behavior
demo CMakeLists.txt:
......
find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h PATHS)
include_directories(${ROCKSDB_INCLUDE_DIR})
add_executable(toplingdb_forbid_l0_compact script.cc)
target_link_libraries(rocksdb_test rocksdb lz4 -lpthread -lz -lsnappy -lbz2 -lzstd -ldl)
After the introduction of rocksdb/db.h
, the compilation can be passed.
Actual behavior
In file included from /workspaces/toplingdb/script/main.cc:1:
In file included from /usr/local/include/rocksdb/db.h:21:
In file included from /usr/local/include/rocksdb/listener.h:15:
In file included from /usr/local/include/rocksdb/advanced_options.h:13:
In file included from /usr/local/include/rocksdb/cache.h:30:
In file included from /usr/local/include/rocksdb/compression_type.h:9:
In file included from /usr/local/include/rocksdb/enum_reflection.h:4:
/usr/local/include/rocksdb/preproc.h:473:10: fatal error: 'port/likely.h' file not found
#include "port/likely.h"
^~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/rocksdb_test.dir/build.make:76: CMakeFiles/rocksdb_test.dir/main.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/rocksdb_test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Steps to reproduce the behavior
introduction of rocksdb/db.h
(complete a Put/Get logic) and cmake .. && make -j20
your project.