foundationdb icon indicating copy to clipboard operation
foundationdb copied to clipboard

fatal error: jemalloc/jemalloc.h: No such file or directory

Open zk-kiger opened this issue 3 years ago • 2 comments

[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.

zk-kiger avatar Aug 13 '22 08:08 zk-kiger

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

sfc-gh-anoyes avatar Aug 15 '22 15:08 sfc-gh-anoyes

@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:

  1. How did you trigger the cmake? Did you add any flags?
  2. Can you do a find -name "jemalloc.h" at /? I would like to know if you have it or not.
  3. 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 avatar Feb 24 '23 02:02 xis19

@xis19 , I believe this should have been fixed. Since you are refactoring Jemalloc.cmake, assign this to you.

jzhou77 avatar Jul 12 '24 04:07 jzhou77