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

Error while building the raft library in dqlite. #373

Closed
kwakubiney opened this issue Jul 7, 2022 · 11 comments
Closed

Error while building the raft library in dqlite. #373

kwakubiney opened this issue Jul 7, 2022 · 11 comments

Comments

@kwakubiney
Copy link

So by following the project's README, i tried to build the raft library so I could build dqlite.

Steps I took:

  1. Clone dqlite.
  2. Clone raft in dqlite and run commands as stated in the README:
     git clone https://github.com/canonical/raft.git
     cd raft
     autoreconf -i
     ./configure
     make
     sudo make install
     cd ..
    
  3. When I run make, I get a fatal error: 'lz4frame.h' file not found. I digged into the codebase and found this block in compress.c
#ifdef LZ4_AVAILABLE
#include <lz4frame.h>
#endif

I am assuming LZ4_AVAILABLE exists but lz4frame.h does not. How do I resolve this issue?

@stgraber
Copy link
Contributor

stgraber commented Jul 7, 2022

stgraber@dakara:~$ find /usr/include | grep lz4f
/usr/include/lz4frame_static.h
/usr/include/lz4frame.h

Sounds like your system built with lz4 enabled but missing the headers?

@kwakubiney
Copy link
Author

@stgraber I should think so. Let me dig into my header files and get back to you.

@kwakubiney
Copy link
Author

@stgraber i realized I do not have such a header file. But, it looks like a macro has been defined somewhere that is enabling build with lz4. Can't seem to find it though. Is there a way to disable build with lz4?

@MathieuBordere
Copy link
Contributor

adding --disable-lz4 to the configure step should disable lz4, example: https://github.com/canonical/raft/blob/05a49e09d1af5aa47244384a1d162787549e2485/.github/workflows/build-and-test.yml#L86

@kwakubiney
Copy link
Author

kwakubiney commented Jul 7, 2022

@MathieuBordere this is what happens after using --disable-lz4, same thing with or without it.

config.status: executing libtool commands
kwakubiney@Kwakus-MacBook-Pro raft % make
  CC       src/libraft_la-compress.lo
src/compress.c:4:10: fatal error: 'lz4frame.h' file not found
#include <lz4frame.h>
         ^~~~~~~~~~~~
1 error generated.
make: *** [src/libraft_la-compress.lo] Error 1

Sorry if this is a noob question but how do I get the lz4frame.h header file so I could build without these errors.

@stgraber
Copy link
Contributor

stgraber commented Jul 7, 2022

If on Ubuntu or Debian, apt install liblz4-dev should do it

@stgraber
Copy link
Contributor

stgraber commented Jul 7, 2022

@MathieuBordere #ifdef LZ4_AVAILABLE, is that a case of LZ4_AVAILABLE being defined as 0 when not found and 1 when found? We've had that kind of issue in liblxc recently, basically needing to be converted to a #if

@MathieuBordere
Copy link
Contributor

hmm --disable-lz4 only doesn't define LZ4_ENABLED , LZ4_AVAILABLE will still be defined so the issue remains with the missing header. Indeed, installing liblz4-dev should get rid of the issue. I'll see if I can change configure.ac to handle this case, lz4.h seems to be found, but not lz4frame.h.

@kwakubiney
Copy link
Author

@stgraber I am on Unix. I think I have seen something close to brew install lz4 but looks like I already have that installed. Might have to find another way to get the header files on this machine.

@MathieuBordere
Copy link
Contributor

MathieuBordere commented Jul 8, 2022

Mac is not supported at the moment, there have been efforts to support it, but they have not been finished.

@kwakubiney
Copy link
Author

Bummer. Thanks.

@stgraber stgraber closed this as not planned Won't fix, can't repro, duplicate, stale Jul 8, 2022
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

No branches or pull requests

3 participants