Skip to content

Fix build when building out-of-tree: use $(top_srcdir) in -I flags #96

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ libqatzip_la_SOURCES = \
qatzip_lz4.c \
xxhash.c
libqatzip_la_CFLAGS = \
-I./ \
-I../include/ \
-I$(srcdir) \
-I$(top_srcdir)/include \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not make sense to me since it's trying to include public and internal header file for source code build with relative path.
Why we need to change it to use absolute folder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the relative path is wrong. From QATzip/build/src + ../include you only get to QATzip/build/include and the headers are not there. The relative paths are relative to where the compiler is launched, not to where the file is.

qatlib needed a similar fix, see intel/qatlib#57

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello, @thiagomacieira, very thanks for your PR, but this issue is caused by the script "cd build ..... ${MAKE-make} -C src V=1", it means you are build the qatzip lib out the "QZ_ROOT".
For now, we don't recommand the customer to build the qatzip lib out of the "QZ_ROOT", because it may cause the Version confusion or other issue when you use the perf script from the qatzip. we recommand you to build the qatzip in QZ_ROOT, then maybe install the qatzip lib. it would aviod this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care about perf scripts. I just need to build and building out-of-tree is a requirement. This patch fixes the build.

$(COMMON_CFLAGS) \
$(SAL_CFLAGS) \
$(ADF_CFLAGS) \
Expand Down