SikuliX-2014
SikuliX-2014 copied to clipboard
LinuxSupport saying it has found OpenCV libs when it has not
My team and I were attempting to install sikuli x on a system that was disconnected from the internet. We currently have all of the external dependencies but we were unable to get the installation to work. We turned up debugging and saw the following lines of output:
LinuxSupport: we have to build libVisionProxy.so
LinuxSupport: checking: availability of OpenCV and Tesseract
LinuxSupport: checking: scanning loader cache (ldconfig -p)
RunTimeSETUP: ldconfig -p
LinuxSupport: checking: found OpenCV libs:
LinuxSupport: checking: found Tesseract iib:
RunTimeSETUP: wmctrl -m
On our system it turned out we were running as a non-root user that did not have ldconfig. I took a look at the LinuxSupport.java and found the following issue:
51 private static String libOpenCVcore = "";
52 private static String libOpenCVimgproc = "";
53 private static String libOpenCVhighgui = "";
54 private static String libTesseract = "";
For starters each of the values is initialized to a blank string and not null.
136 cmdRet = runTime.runcmd("ldconfig -p");
137 if (cmdRet.contains(runTime.runCmdError)) {
Next it attempts to run the ldconfig to get all of the libs on the path. Since I'm not seeing the error on line 138:
138 log(-1, "checking: ldconfig returns error:\ns", cmdRet);
It appears the remaining lines of code are being executed:
140 } else {
141 String[] libs = cmdRet.split("\n");
142 for (String libx : libs) {
143 libx = libx.trim();
144 if (!libx.startsWith("lib")) {
145 continue;
146 }
147 if (libx.startsWith("libopencv_core.so.")) {
148 libOpenCVcore = libx.split("=>")[1].trim();
149 } else if (libx.startsWith("libopencv_highgui.so.")) {
150 libOpenCVhighgui = libx.split("=>")[1].trim();
151 } else if (libx.startsWith("libopencv_imgproc.so.")) {
152 libOpenCVimgproc = libx.split("=>")[1].trim();
153 } else if (libx.startsWith("libtesseract.so.")) {
154 libTesseract = libx.split("=>")[1].trim();
155 }
156 }
157 if (libOpenCVcore == null || libOpenCVhighgui == null || libOpenCVimgproc == null) {
158 log(-1, "checking: OpenCV not in loader cache (see doc-note on OpenCV)");
159 opencvAvail = checkSuccess = false;
160 } else {
161 log(lvl, "checking: found OpenCV libs:\n%s\n%s\n%s",
162 libOpenCVcore, libOpenCVhighgui, libOpenCVimgproc);
163 }
As a result the libOpenCVcore, libOpenCVhighgui and the libOpenCVImgproc never get updated and remain with their initial value of.
As a result, I get the output
"checking:found OpenCV libs
"
For our issue, we're working with out admin to get opencv added to the ldcache. Is there anyway to link the opencv libs without it being the ldcache?
Thanks for finding.
I have to admit, that I never did nor had a chance, to test this helper feature on a system having your environment.
Do you get a resulting build commandfile?
If yes, just modify and run it to success. Then tell the setup, that you have a working libVisionProxy.so.
If not, come back.