19 February 2016 at 11 h 26 min #5847
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.
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6947:31: error: use of undeclared
Display *const _dpy = XOpenDisplay(0);
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6951:9: error: use of undeclared
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6968:31: error: use of undeclared
Display *const _dpy = XOpenDisplay(0);
/Users/ip/Work/sofa/sofa-source-master/extlibs/CImg/../CImg/CImg.h:6972:9: error: use of undeclared
XCloseDisplay(_dpy);19 February 2016 at 14 h 17 min #5849
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 7 h 29 min #5855
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).
ip22 February 2016 at 9 h 45 min #5864
Indeed, the error occurred in DiffusionSolver (which is marked as required in imageplugin)
However, even without DiffusionSolver, image plugin needs X11:
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 h 31 min #5883
After 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 h 59 min #5884
Master branch has been updated with a patch for the plugin image.
It will try to detect if X11 was installed using XQuartz and add correct includes if needed.23 February 2016 at 9 h 08 min #5891
Apparently, 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 h 12 min #5896
Perfect, it compiles. Thanks!
- You must be logged in to reply to this topic.