Open kahlil29 opened 4 years ago
I got the same error as #615 when I tried to build on Windows 10.
Then I tried to build on Ubuntu, and I got the same error..
/var/task/main: error while loading shared libraries: libopencv_highgui.so.4.2: cannot open shared object file: No such file or directory
@kahlil29 Do you know if there is any way to get gocv to run on AWS Lambda?
After trying for a bit, I kind of gave up. Am not allowed (it's not feasible) to spend more time on this for now (officially, at atleast). But I'm going to try if and when I have some spare time.
if I can get it to work, I will let you know. Please let me know if you get it to work or find the solution!
On Thu, 19 Mar, 2020, 12:12 am EeFey, notifications@github.com wrote:
I got the same error as #615 https://github.com/hybridgroup/gocv/issues/615 when I tried to build on Windows 10.
Then I tried to build on Ubuntu, and I got the same error.. /var/task/main: error while loading shared libraries: libopencv_highgui.so.4.2: cannot open shared object file: No such file or directory
@kahlil29 https://github.com/kahlil29 Do you know if there is any way to get gocv to run on AWS Lambda?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hybridgroup/gocv/issues/636#issuecomment-600722349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6CJ3KQ64ODX3RVOSLBSCLRIDXFRANCNFSM4LG46WMQ .
@EeFey Any luck with this? I'm probably going to have to revisit this problem sometime soon and try to crack it.
@kahlil29 sadly no, and I have moved on to alternatives...
// return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, NULL, swapRB, crop, ddepth));
return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, cv::Scalar(), swapRB, crop, ddepth));
@deadprogram Do you have any insights/thoughts on this?
Not entirely sure if this will fix your specific problem but you could try:
Try build with -extldflags "-static"
:
go build -extldflags "-static" -o output -v main.go
Use YES
when you compile opencv:
-D OPENCV_GENERATE_PKGCONFIG=YES
did anybody try to copy the dynamic libraries (listed by ldd) to the lambda package in the lib/ directory ?
This is a new PR to address the static build issue on Linux: https://github.com/hybridgroup/gocv/pull/802
Windows will be worked on in a subsequent PR.
Description
I'm trying to compile a static binary and deploy it to an AWS Lambda (using serverless). Earlier I faced a cross-compile issue because I was trying to build on Mac and run it on Linux (I think the default is Amazon Linux for Lambdas). So due to that I'm now building it on an EC2 instance (same OS that will be used to run it).
When I run
make
to build/compile, it gives the following warning (which does not seem to be related or relevant to the isssue) :The build command is :
I then run
sls deploy
or run it locally usingsls invoke local -f hello
(hello is currently the name of the function/program)It errors out (in runtime) with the following error :
I encounter the same error in the logs of the deployed Lambda. Is there anything I need to do in order to properly package the
gocv
dependency? Or is this something to do with shared libs? I took a look at #601 and tried re-building opencv from source by using cmake with the following options:but it does not affect the error(error is still the same).
Your Environment
/tmp
directory ? )env.sh
orenv.cmd
script before trying togo run
orgo build
? No