fatal error: jemalloc/jemalloc.h: No such file or directory
[21/1190] Building CXX object flow/CMakeFiles/flow.dir/FastAlloc.cpp.o FAILED: flow/CMakeFiles/flow.dir/FastAlloc.cpp.o /data/zk/toolchain/bin/c++ -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -DNO_INTELLISENSE -I/data/zk/foundationdb -I/data/zk/foundationdb/build -I/data/zk/foundationdb/contrib/fmt-8.1.1/include -isystem /data/zk/foundationdb/build/boost_install/include -O3 -DNDEBUG -DCMAKE_BUILD -ggdb -fno-omit-frame-pointer -mavx -Wno-pragmas -Wno-attributes -Wno-error=format -Wunused-variable -Wno-deprecated -fvisibility=hidden -Wreturn-type -fPIC -Wclass-memaccess -DHAVE_OPENSSL -pthread -std=gnu++17 -MD -MT flow/CMakeFiles/flow.dir/FastAlloc.cpp.o -MF flow/CMakeFiles/flow.dir/FastAlloc.cpp.o.d -o flow/CMakeFiles/flow.dir/FastAlloc.cpp.o -c /data/zk/foundationdb/flow/FastAlloc.cpp /data/zk/foundationdb/flow/FastAlloc.cpp:594:10: fatal error: jemalloc/jemalloc.h: No such file or directory 594 | #include <jemalloc/jemalloc.h> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. ninja: build stopped: subcommand failed.
This is probably a consequence of the fact that the flow target does not actually link in/depend on jemalloc in cmake. What platform/environment are you compiling on? That will help me make sure I actually fix it
@zk-kiger -- Sorry for jumping in so late, as this is the first time I see this issue, but can you provide some more details about your build environment? I would be interested in the following things:
- How did you trigger the cmake? Did you add any flags?
- Can you do a
find -name "jemalloc.h"at/? I would like to know if you have it or not. - Can you please share the git hash you are using?
@mavenraven -- may I ask why this change would fix the issue? I would guess adding such dependency would trigger some
INCLUDE_DIRECTORY(xxx)command which updates the default include paths but can you show me, e..g the command line that compiles FastAlloc.cpp with/without this patch?
@xis19 , I believe this should have been fixed. Since you are refactoring Jemalloc.cmake, assign this to you.