Home › Forum › SOFA › Building SOFA › [SOLVED] Building image plugin under El Capitan
Tagged: 64_bits, LLVM, MacOS, SOFA_other
- This topic has 7 replies, 2 voices, and was last updated 8 years, 8 months ago by Igor.
-
AuthorPosts
-
19 February 2016 at 11:26 #5847IgorBlocked
Hello guys,
I am experiencing an error when compiling the image plugin in the master branch.
Actually, it seems compiling in Ubuntu, but in Mac Os X (El Capitan), I am getting the output given below (already at 14% of the compilation).
Haven’t you by chance encountered this kind of problem? It’s related to CImg, but clearly not detected by cmake itself.
ip
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6947:31: error: use of undeclared
identifier ‘XOpenDisplay’
Display *const _dpy = XOpenDisplay(0);
^
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6951:9: error: use of undeclared
identifier ‘XCloseDisplay’
XCloseDisplay(_dpy);
^
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6968:31: error: use of undeclared
identifier ‘XOpenDisplay’
Display *const _dpy = XOpenDisplay(0);
^
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6972:9: error: use of undeclared
identifier ‘XCloseDisplay’
XCloseDisplay(_dpy);19 February 2016 at 14:17 #5849FroyKeymasterHello Igor,
According to Cimg requirements, it seems that it needs X11 library for Linux/Mac.
Then that’s why there is no problem on Ubuntu, as X11 is installed by default but it is not on OS X systems (https://support.apple.com/en-us/HT201341).So you need to install by yourself the X libraries with brew/macports or maybe with Xquartz (http://www.xquartz.org/)
But it is weird that your problem pops at compilation time, and not in the Cmake process. I just enabled the imagePlugin in order to test and, while not having any X11 libs it is telling me that I need X11.
CMake Error at applications/plugins/image/extlibs/DiffusionSolver/CMakeLists.txt:42 (message): Failed to find X11 which is required to build DiffusionSolver
Maybe a cmake cache problem ?
22 February 2016 at 07:29 #5855IgorBlockedHello Fred,
thanks for your reply.
First, actually, I have XQuartz installed in version 2.7.8. So it seems that it might be an issue related to the recent version of XQuartz.
Second, I have also Xorg ports installed. However, I have not figured out how to tell CImg (or Image) to use Xservers from ports instead of XQuartz.
Finally, you say that cmake lets you know about missing Xserver. Nonetheless, the log you sent is related to DiffusionSolver which maybe checks the availability of XServer (I do not have this solver, so I cannot verify). As for CImg, IMHO its CMakeLists.txt does not include any dependency checking.
And a final remark — actually, I was using image plugin on my Mac OS X before without any problem in Yosemite (with XQuartz).
ip
22 February 2016 at 09:45 #5864FroyKeymasterIndeed, the error occurred in DiffusionSolver (which is marked as required in imageplugin)
However, even without DiffusionSolver, image plugin needs X11:
Cmakelists.txt:if(NOT X11_FOUND) message(FATAL_ERROR "Failed to find X11 which is required to build plugin 'image'") endif()
And CImg needs X11 in the latest archive from their website (but it is true that it is not explicitly written in the version in the SOFA repository).
Anyway, we will try to compile it on a Mac X.11 system and get back to you.
22 February 2016 at 13:31 #5883FroyKeymasterAfter installing XQuartz, I got the same error as you ( X11/Xlib.h not found)
I did what is written here : .
I add -I/opt/X11/include in the cmake variable CXX_COMPILER_FLAGS and it compiled successfully.As people on Mac OS X will get the same error, I will patch image’s CMakeLists to handle this case (Xquartz installing includes in /opt/X11)
Hope it helps.
22 February 2016 at 14:59 #5884FroyKeymasterMaster branch has been updated with a patch for the plugin image.
(commit #7482c75)
It will try to detect if X11 was installed using XQuartz and add correct includes if needed.23 February 2016 at 09:08 #5891FroyKeymasterApparently, X11 dependency in image plugin has just been removed (commit #ee57c1 so you should not have any problem with X11 anymore (Ubuntu or OS X, whatever).
23 February 2016 at 14:12 #5896IgorBlockedPerfect, it compiles. Thanks!
Igor
-
AuthorPosts
- You must be logged in to reply to this topic.