| Hi Brad, (Sorry for the late answer (again).) I addressed your comments in the files attached to this email (please see the remarks below). I have not yet addressed your comment about “MATLAB_ADDITIONAL_VERSIONS” but I think it is a better proposition, so I will do it next. I updated the documentation also, I think it looks now understandable. I had a hard time making some stuff compile again with Matlab under Linux. The fact is that Matlab is shipped with its own version of libC, libhdf5, libboost etc, and sometimes the filenames are the same (eg. hdf5, or libc) but the subminor versions are not. If I understand properly, the fact that the filenames are the same prevents the dynamic loader of Linux to load the files that are referred by the mex file in their respective rpath (there is only one libhdf51.8.2.so in the matlab process). Beside that, the symbols also may clash: I had an implementation with a dynamic loader under linux, but yet the boost symbols of my mex files were not loaded because same symbols were already there in the process. I found a technical solution to this on Linux: - the use of -Wl,--exclude-libs,ALL for the linker. - the symbol hiding (both include and function definition) from within the mex file - exporting only the mexFunction symbol I know that this scheme is working for statically linked libraries, that then should be recompiled with -fPIC. I know also that this is working for shared libraries that do not have the same name (eg. boost1.49.so vs. boost1.55.so). But I think there is nothing more I can do for the shared library having the same name (like hdf51.8.2.so), having the same symbols but apparently having a different ABI. I do not know how to do that properly under OSX neither. There is no -Wl,--exclude-libs,ALL option in Clang. Also, I am checking against CMAKE_CXX_COMPILER_ID, which is I think a not so good idea. Is there anything for having the -Wl,--exclude-libs,ALL like the variable CXX_VISIBILITY_PRESET in cmake? I started using a .map file on these two platforms, but also I would prefer limiting the number of files. I am using this FindMatlab in two projects now, under OSX 10.9, Win7 Visual2013 and Ubuntu12.04. Best, Raffi |
FindMatlab.cmake
Description: Binary data
MatlabTestsRedirect.cmake
Description: Binary data
—————— Hi Raffi, Done
Ok. I checked the documentation again, and I think it contains now all the necessary information, plus it is now visually more appealing. for creating MEX (compiled) extensions. There is an option to this I am not sure how to do that, please have a look at my changes. It looks ok to me (generated compilation command include the visibility element) but maybe there is something better. # set(MATLAB_ADDITIONAL_VERSIONS Right, it is better. I am not sure how my implementation is compatible with the previous This is something I should now check deeper. Is it an option to call it FindMatlab2 ? +# * ``MATLAB_USER_ROOT`` the root of the Matlab installation. This is given by the user. Ok + find_program(MATLAB_REG_EXE_LOCATION "reg") Done + if((NOT DEFINED MATLAB_USER_ROOT) OR (NOT MATLAB_USER_ROOT)) Done + if(NOT ${Matlab_PROGRAM}) Done BTW, is there any variable that tells the current cmake list, Good.
|
-- Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
