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

[BUG] Building from outside the repository folder #739

Open
fabh2o opened this issue Nov 1, 2024 · 1 comment
Open

[BUG] Building from outside the repository folder #739

fabh2o opened this issue Nov 1, 2024 · 1 comment

Comments

@fabh2o
Copy link

fabh2o commented Nov 1, 2024

Describe the bug
(Not really sure if it's a bug, since we are supposed to run the meson commands inside the repo folder)

I'm trying to create an archlinux package. The build directory is not inside the repository folder. The process is more or less like this:

mkdir src; cd src
git clone https://github.com/raspberrypi/rpicam-apps.git
meson setup --prefix=/usr --buildtype=plain build rpicam-apps -D enable_libav=disabled -D enable_dr
m=enabled -D enable_egl=disabled -D enable_qt=disabled -D enable_opencv=disabled -D enable_tflite=disabled -D enable_hailo=disabled
# $ ls
# build/  rpicam-apps/
meson compile -C build

I can not build the package due to the error:

[24/42] Compiling C++ object post_processing_stages/core-postproc.so.p/hdr_stage.cpp.o
FAILED: post_processing_stages/core-postproc.so.p/hdr_stage.cpp.o
c++ -Ipost_processing_stages/core-postproc.so.p -Ipost_processing_stages -I../rpicam-apps/post_processing_stages -I.. -I/usr/local/include/libcamera -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Wextra
 -Wpedantic -Werror -std=c++17 -pedantic -Wno-unused-parameter -faligned-new -Wno-psabi -ftree-vectorize -fPIC -pedantic -Wno-unused-parameter -faligned-new -D_FILE_OFFSET_BITS=64 -Wno-psabi -ftree-vectorize -DLIBDRM_PRESENT=1
-MD -MQ post_processing_stages/core-postproc.so.p/hdr_stage.cpp.o -MF post_processing_stages/core-postproc.so.p/hdr_stage.cpp.o.d -o post_processing_stages/core-postproc.so.p/hdr_stage.cpp.o -c ../rpicam-apps/post_processing_st
ages/hdr_stage.cpp
../rpicam-apps/post_processing_stages/hdr_stage.cpp:27:10: fatal error: core/rpicam_app.hpp: No such file or directory
   27 | #include "core/rpicam_app.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Same outcome for other files (post_processing_stages/core-postproc.so.p/motion_detect_stage.cpp.o, post_processing_stages/core-postproc.so.p/negate_stage.cpp.o)

Changing this include from '../..' to '..' fixes the issue and i can build the package succesfully:
https://github.com/raspberrypi/rpicam-apps/blob/6de1ab6a899df35f929b2a15c0831780bd8e750e/post_processing_stages/meson.build#L33C35-L33C65

Note that this change does not affect building from inside the repo folder (as indicated in the build instructions) so it should be possible to change the relative path and build both from inside of the repo folder and from outside it.

I'm building the headless version of the package, maybe enabling other options breaks building for other files but i think that the fix still remains the same.

@naushir
Copy link
Collaborator

naushir commented Nov 4, 2024

Have you tried using meson dist --no-tests to create a zip package of the source? We do this for building our packages and everything seems to work as epxected.

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

2 participants