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

lz4 code inside flann #307

Open
lepalom opened this issue Aug 31, 2016 · 3 comments
Open

lz4 code inside flann #307

lepalom opened this issue Aug 31, 2016 · 3 comments

Comments

@lepalom
Copy link

lepalom commented Aug 31, 2016

flann has code from another project lz4. It's not a license problem, but for instance it violates some policy in debian.

Could be possible to activate some flag in cmake that in case that lz4 was not detected use that folder or if detected use the external lz4 library?

See this project blosc
Think that if you use the external lz4 you should add then -lz4 in the pkg-config .pc file

@moriarty
Copy link

moriarty commented Apr 9, 2018

👍 plus one for this... It also causes problems because
/usr/include/lz4.h and
/usr/include/flann/ext/lz4.h

use #pragma once instead of include gaurds, and then if a user later includes two headers which indirectly include one of each of the lz4.h the pragma once doesn't actually do any gaurding, and both get included and then compile errors occur. despite the files being the same.

amoriarty at SW44 in ~/melodic
$ md5sum /usr/include/lz4.h
f9f3bd3fb79d7a132d8e22c24983193a  /usr/include/lz4.h
amoriarty at SW44 in ~/melodic
$ md5sum /usr/include/flann/ext/lz4.h
f9f3bd3fb79d7a132d8e22c24983193a  /usr/include/flann/ext/lz4.h

For a concrete example, it is impossible to include:
/usr/include/flann/flann.h
/opt/ros/melodic/include/rosbag/bag.h

The only way to fix this, is for both flann and the system version of lz4 to be newer, and include this commit:
lz4/lz4@19e585c

which replaced the #pragma once

-#pragma once
+#ifndef LZ4_H_2983827168210
+#define LZ4_H_2983827168210
...
+#endif /* LZ4_H_2983827168210 */

@mikepurvis
Copy link

Resolved by #399, but it has not been released, so packagers will need to patch on that change.

@nh2
Copy link

nh2 commented Nov 1, 2021

I made a PR to fix lz4 missing from the flann.pc pkg-config file: #481

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

4 participants