Open d4nF opened 6 years ago
I'm not really able to help with Capnproto setup issues, sorry :-(. Wild guess, maybe it's building without C++ support for some reason? Check the build logs for Capnproto to make sure it detected a C++ environment?
So I looked further and found https://capnproto.org/cxx.html In the "Setting a Namespace" section, it mentions that the capnproto include file needs to be in the Prefix in order for using
Cxx = import "/capnp/c++.capnp"
to work
At this point im pretty sure the issue is with rr's CMakeLists.txt file not adding capnproto's include directory if it's being sourced from a different prefix.
I'm currently looking for the right place to add it to the include_directories() command, but so far am not having any luck
The include directory should be obtained by the call to pkg_check_modules
in CMakeLists.txt
and added to CMAKE_C(XX)_FLAGS
there. So you need to make sure pkg-config
is picking up your Capnproto build, perhaps by setting PKG_CONFIG_PATH
.
The cmake generation will fail if capnproto isnt found in the PKG_CONFIG_PATH...
I think i found the issue
In the main CMakeLists.txt file at line 345 (release 0.5.1) I added the equivilant of "-I$tgt/include" (see original post for $tgt) The issue is that the capnp command doesn't seem to know where it was installed at, and requires its callers to tell it where it was [installed at]
In anycase I was able to compile with this above hack
I don't really understand. Is an rr change needed, or is this a Capnproto build issue?
Hey, sorry for disappearing
rr's main cmakefile needs to deduce the include directory of capnproto (for "COMMAND capnp compile") and include that path as shown above. I say this since it seems that capnproto wont do the deduction by itself by design (as it states in the linked guide above)
Can you send me a PR that works for you?
+1 on this issue. Unfortunately I'm not really familiar with CMake, so don't know the right way to do this (I would have thought it would be handled by pkg-config), but calling pkg-config capnp --cflags-only-I
returned -I/path/to/capnp/include/directory
, and I basically just copied that into a new line as part of the COMMAND capnp compile
:
518 COMMAND capnp compile
519 "--src-prefix=${CMAKE_CURRENT_SOURCE_DIR}/src"
520 "-I/home/myuser/capnp/build/include"
521 "-oc++:${CMAKE_CURRENT_BINARY_DIR}"
522 "${CMAKE_CURRENT_SOURCE_DIR}/src/rr_trace.capnp"
(as well as ensuring PATH
and LD_LIBRARY_PATH
were set to include capnp appropriately) and the build succeeded. Not really appropriate for a pull request i'm afraid, but hopefully someone with better CMake knowledge can figure out how to incorporate that (i tried using "`pkg-config capnp --cflags-only-I`"
but that gave "no such command" :confused: ).
Hi,
I'm trying to compile rr to a custom env/folder and i'm having issues I've compiled capnproto 0.6.1 to that env, but whenever I run make I get the following error
my environment:
here is my procedure for reproducing this issue. assumption is that rr and capnproto do not exist on the machine yet