Opencv: Is it possible to install opencv in AppVeyor?
Hi guys,
I need to integrate node-opencv to create pre-compiled binaries for windows users, as I did for node-serialport AppVeyor was the solution, but I can't find any way to install it via command line, is there a way to include opencv in the app-veyor build environment?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 24 Oct, 2014 06:22 PM
Hi Edgar,
Have you tried installing it with Chocolatey?
http://chocolatey.org/packages/OpenCV
2 Posted by edgar.osc on 24 Oct, 2014 07:03 PM
No I haven't, let me give that a try, is chocolatey already in the AppVeyoy build envs?
Support Staff 3 Posted by Feodor Fitsner on 24 Oct, 2014 07:04 PM
Yes.
4 Posted by edgar.osc on 24 Oct, 2014 07:06 PM
Awesome, let me give it a try on a VM first and make sure I can compile the stuff, then push to AppVeyor, thanks.
5 Posted by edgar.osc on 24 Oct, 2014 10:11 PM
The Chocolatey install of opencv worked great and I think I'm almost done with the setup to finish compiling, I do have one last problem with this:
'pkg-config' is not recognized as an internal or external command,
436operable program or batch file.
437gyp: Call to 'pkg-config --libs opencv' returned exit status 1. while trying to load binding.gyp
Found out that I need to add `C:\MinGW\bin` to the PATH, do you happen to know if this location is the correct one for that package?
Thanks in advance,
Support Staff 6 Posted by Feodor Fitsner on 24 Oct, 2014 10:17 PM
The location is correct, but what package is that?
7 Posted by edgar.osc on 24 Oct, 2014 11:02 PM
Seems to be part of gtkwindows, see here:
http://gtkwindows.blogspot.mx/
But Adding it to the path did not worked, I received the same error on compilation.
8 Posted by edgar.osc on 29 Oct, 2014 12:16 AM
Hi Feodor,
Find outhe packages that I need which are this:
C:\MinGW
C:\msys
C:\GTK
I now know the GTK lib is the one with the packages I'm missing for compilation to work, do you know if there is a way to get them in appveyor or install them from command line (appveyor.yml), Thanks for your help.
Support Staff 9 Posted by Feodor Fitsner on 29 Oct, 2014 12:31 AM
Sure, we'll deploy msys and GTK to
unstable
image today-tomorrow.10 Posted by edgar.osc on 29 Oct, 2014 03:09 PM
Awesome! Great news. What do I need to know and do to use this unstable build environment once it has been created. Is there any docs you can point me to?
11 Posted by edgar.osc on 30 Oct, 2014 04:57 PM
Hi @feodor, sorry to be a pest, but do you have any updates on the unstable image with the missing packages? thanks.
Support Staff 12 Posted by Feodor Fitsner on 30 Oct, 2014 05:20 PM
Sure, will do that today.
Support Staff 13 Posted by Feodor Fitsner on 30 Oct, 2014 07:59 PM
OK, everything has been installed in C:\msys and C:\GTK. You should update
PATH
variable in your own build script.To run build on "unstable" image add this to your
appveyor.yml
:14 Posted by edgar.osc on 30 Oct, 2014 10:04 PM
Neat, I'll give it a try right a way, thanks for all the help.
15 Posted by edgar.osc on 31 Oct, 2014 05:03 PM
The packages work, I just need to add an opencv.pc file to the GTK\lib\pkgconfig folder with all the libs and include directories. I'll copy it from the repo to the correct path. But I need to do this with the correct path for each architecture.
Is there an env variable or other way to get the architecture of the current platform in appveyor?
Support Staff 16 Posted by Feodor Fitsner on 31 Oct, 2014 06:54 PM
That
platform
setting was introduced for MSBuild mostly. It has nothing to do with build worker OS architecture. It's always Windows Server 2012 R2 x64.17 Posted by edgar.osc on 01 Nov, 2014 12:08 AM
Hi Feodor, good news, everything working now, we are no compiling and generating node-opencv pre built binaries for windows x86 and x64!
This will help a lot of people, thanks a lot for you help as always appveyor support is top notch.
We can close this question now. or mark it as solved not sure what is the procedure.
Thanks again! until later.
Support Staff 18 Posted by Feodor Fitsner on 01 Nov, 2014 12:26 AM
Great news, thanks for the update!
If you'd like you can put some notes (gotchas) here and then we'll move this thread to "KB".
19 Posted by edgar.osc on 03 Nov, 2014 11:48 PM
Well, the major problem I faced was knowing where node-opencv was looking for the opencv-pc file and how to create that one based on where openvc itself was installed, maybe it is easier to explain by reading the appveyor config file here:
https://github.com/hybridgroup/node-opencv/blob/master/appveyor.yml
And this is the opencv.pc file for the pkgconfig that I created, I copy it to the correct location in the appveyor.yml file before compilation for each architecture, here:
https://github.com/hybridgroup/node-opencv/tree/master/utils
I'll probably need to do some updates if the file structure of opencv and GTK+ changes drastically from one version to the next, but I doubt it will be the case. The updates will probably be when node-opencv updates to use the next opencv version.
That is basically it, pretty simple but took a while and a lot of trials and errors to figure it out, hope it helps someone else save some time.
Regards, and thanks for all the help Feodor.
Support Staff 20 Posted by Feodor Fitsner on 04 Nov, 2014 01:50 AM
Thank you!
21 Posted by jcongote on 19 Jul, 2016 03:36 PM
Hello,
I am trying to use opencv in my project, but I can not install it using chocolatey. I got the following error.
---------------
choco upgrade opencv -version 3.1.0
Upgrading the following packages:
opencv
By upgrading you accept licenses for the packages.
opencv is not installed. Installing...
OpenCV v3.1.0
No directory specified, installing to C:\.
To install to a specific directory, pass '/InstallationPath:C:\path\to'. OpenCV will create its own folder within the directory you passed.
You will need to manually create an OPENCV_DIR environment variable then add %OPENCV_DIR%\bin to your PATH.
Alternately, you can rerun this and pass '/Environment:C:\path\to' Follow the OpenCV instructions on their website to figure out which directory you would want.
Attempt to get headers for http://iweb.dl.sourceforge.net/project/opencvlibrary/opencv-win/3.1.0/opencv-3.1.0.exe failed.
Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (404) Not Found."
Downloading OpenCV 32 bit
--------------
I also try
choco install opencv
choco upgrade opencv
cinst opencv
cinst opencv --version 3.1.0
However none of the configuration install opencv. The package configuration of opencv in chocolatey is using other download sites as "'https://github.com/Itseez/opencv/releases/download/3.1.0/opencv-3.1.0.exe'", so I don't understand which version of package is trying to install the appveyor.
am I missing something???
Thanks,
John
Support Staff 22 Posted by Feodor Fitsner on 19 Jul, 2016 05:28 PM
This worked for me:
23 Posted by jcongote on 20 Jul, 2016 04:52 PM
Thanks,
The opencv works perfect.
regards,
John
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:07 AM.