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
4.0.0 does not produce pkgconfig file #13154
Comments
Pkg-config has very limited functionality, so this support has been dropped. Use CMake with Changes are here: In general, package maintainers should provide own .pc file validated for provided OpenCV build configuration. Perhaps written from the scratch. |
Is there a way to reintroduce |
Option OPENCV_GENERATE_PKGCONFIG=ON generates the '.pc' file. I think also it should be generated by default in *nix systems where pkg-config is used. I tested my binary files with ldd and they are linked right. It is just development time when conflicts can occur. And I think same problems can occur with cmake also. It is possible to be more specific than just -llib. its possible to specify libs exactly by .so file. |
CMakeLists.txt :
it doesn't work |
@codenoid i believe the argument for that option is actually |
ffmpeg relies on .pc files for opencv library dependency, FWIW... |
Also as a note "make install" doesn't install the .pc file, even if it's generated :| |
have you managed to install the .pc file? |
Yeah I just manually copied it in. :|
…On Tue, Jan 15, 2019 at 2:20 PM Favi0 ***@***.***> wrote:
Also as a note "make install" doesn't install the .pc file, even if it's
generated :|
have you managed to install the .pc file?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13154 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAw0IVOZFkcmQtjPGnwDjxWhzJoO-dxks5vDkYegaJpZM4Ycby9>
.
|
I had the same issue, thankfully I found this thread, and I must agree, not everyone uses cmake. The key here being: |
opencv 4.0.1 has his question too, after making install , there is no opencv.pc generated, even no pkgconfig file |
I did it as you told but there was still no pkgconfig nor opencv.pc ... |
I added the "-D OPENCV_GENERATE_PKGCONFIG=YES" flag, ran cmake, make, and found: .../unix-install/opencv4.pc As mentioned by others, "make install" didn't copy the file anywhere under /usr/local. |
Also had the same problem where |
@UberEclectic @Kevin-Mok The opencv4.pc file should be copied to /usr/local/lib/pkgconfig. Don't forget to 'sudo ldconfig', for making sure the recently installed OpenCV libraries are correctly taken into account. RC |
It did not install .cp file in my case. |
How did you do that?, In my case it even have not created opencv.cp file! |
Here's how I do it FWIW opencv 3.4.5
do_make_and_make_install
cp unix-install/opencv.pc $PKG_CONFIG_PATH
…On Mon, Apr 29, 2019 at 10:26 AM s ***@***.***> wrote:
Yeah I just manually copied it in. :|
… <#m_9070919798374828714_>
On Tue, Jan 15, 2019 at 2:20 PM Favi0 *@*.***> wrote: Also as a note
"make install" doesn't install the .pc file, even if it's generated :| have
you managed to install the .pc file? — You are receiving this because you
commented. Reply to this email directly, view it on GitHub <#13154
(comment)
<#13154 (comment)>>,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAw0IVOZFkcmQtjPGnwDjxWhzJoO-dxks5vDkYegaJpZM4Ycby9
.
How did you do that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13154 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAADBUGSALBP6IJAXOVIOLTPS4OSLANCNFSM4GDRXS6Q>
.
|
don't say that is deprecated [1] please [1] |
On 4.1.0, and the below does not generate pc file |
With 4.1.0, got it functional. I found the mistake in the command provided earlier. Need to use ON, instead of YES.
|
I change my point of view maybe can be called deprecated ... |
So the -D OPENCV_GENERATE_PKGCONFIG=ON option in cmake is deprecated now? How can we get the pkgconfig and opencv.pc files then? |
if you not explicitly add OPENCV_GENERATE_PKGCONFIG=ON is not generated . I added to my %cmake
For cmake files be installed in default cmake folder I add :
|
Please don't force everyone to use CMAKE. Many projects don't use CMAKE and for good reasons. |
Hi there. I don't like putting -1 on already accepted (but biased) proposal, but here a wider explanation:
If one application is compatible with opencv2 -> opencv5 (if ever future master is 5 ), then it's easy enough to rely on the same opencv.pc (when using pkgconf), and not to adapt every now and then. My point to keep using opencv.pc by default is to avoid having to adapt applications everytime the opencv.pc version changes. Because from a distro package maintainer, it's easier if everyone use the same opencv.pc. |
I try OPENCV_GENERATE_PKGCONFIG=ON. but not work. |
in the cmake option you need to put -DOPENCV_GENERATE_PKGCONFIG=ON |
You didn't forget the "-D" option, did you? I have always had a space after -D as in the docs, like: but writing without the space apparently works as well: The following below is a quote from my install script and the cmake part definitively works for opencv 4.2.0. This quote is not a complete install script by any means. I have lots of libraries installed separately before that so you need to make a script of your own for your own purposes. Do not forget the ldconfig at the end as that finalizes some install stuff on Linux. You may also need to edit you paths in ~/.bashrc. First moving downloaded stuff to opencv folder then etc... mv opencv-4.2.0 opencv cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_QT=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_V4L=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D FORCE_VTK=ON -D WITH_TBB=ON -D WITH_XINE=ON -D BUILD_EXAMPLES=ON -D BUILD_PERF_TESTS=OFF -D ENABLE_PRECOMPILED_HEADERS=OFF .. -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D BUILD_opencv_python3=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-4.2.0/modules .. make -j6 Check where your opencv4.pc is: First move all the way up, twice from your home with Then: sudo find -name opencv4.pc You should find some pkgfolders with this: sudo find -name pkgconfig Hope this helps. |
PS. The copy of cmake in my previous post must be a one single continuous line without line breaks. Just add proper line breaks if you want to split it manually to multiple lines. cd ~/opencv/samples/cpp Compile the opencv_version.cpp to a run file named show_my_version g++ opencv_version.cpp $(pkg-config --cflags --libs opencv4) -o show_my_version and run it : ./show_my_version |
@dalilander yeah. it works. so amazing. thanks for your kindly reply. |
I faced a similar issue after installing OpenCV 4.2.0 and could not find a way to compile a c++ program using CMakeLists.txt. I had other versions of OpenCV installed too so had to provide specific path to compiler. The pkg--configs was set and could identify opencv4 thanks to the solution posted above for building OpenCV with The usual way I compiled with OpenCV upto version 3.4.4 was I also added |
Hello there, I compiled openCV as in the command bellow. I also tried ... =ON as in ... -D OPENCV_GENERATE_PKGCONFIG=YES make3 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_GENERATE_PKGCONFIG=YES -D OPENCV_EXTRA_MODULES_PATH=/usr/local/src/opencv_build/opencv_contrib/modules -D BUILD_EXAMPLES=ON .. Then, I followed the installation steps, make -j4 (in my case is 4) then, it returns the error bellow @Rasp build]$ pkg-config --modversion opencv4 Must I add opencv4.pc manually? How must I add it? Best wishes, |
@iuri I think you did not export the PKG_CONFIG_PATH like I proposed in my solution. You need to do it manually. I think your problem will be solved once you do it. Just replace the path with yours. |
Exactly! [@Rasp ~]$ sudo find / -iname "Config.cmake" Should I install pkg_config ? Best wishes, |
Hi there, sudo ln -s /usr/local/lib64/pkgconfig/opencv4.pc /usr/share/pkgconfig/ There is no /lib64/. So, I removed that symlink, searched for any reference of opencv.pc in the filesystem, found "usr/local/lib/pkgconfig/opencv.pc" , then created a new symlink, ln -s /usr/local/lib/pkgconfig/opencv.pc /usr/share/pkgconfig/ "pkg-config --modversion opencv" now returns 3.4.11. It seems I've got a previous version of openCV, which I had installed from YUM pkg manager system. I'm going to clean up that version, and start from scratch a new openCV insllation from the 4.2 source. Best wishes, |
Using well-known system paths such as |
System information (version)
Detailed description
I did cmake ...Then make and then make install
and it does not generate opencv.pc file.
If I use same commands for version 3.4.3 then the file is created.
Another thing
if I link with pkgconfig then it links to librarys with no version numbers.
so installing 4.0.0-rc after 3.4.3 makes pkgconfig unusable.
it would be nice if there were multiple opencv.pc files like opencv3.4.pc opencv4.pc
The text was updated successfully, but these errors were encountered: