Open hrheydarian opened 5 years ago
Hi,
That error happens because version 2.8 of CMake is very old. The FindMatlab module that also implements the matlab_add_mex function that we use was introduced in CMake 3.2.
The CUDA language support in CMake is different from the way Matlab is supported. There used to be a FindCUDA module, but as of version 3.10 CUDA became a 'first-class language' and that's why we should use enable_language instead of find_module.
I had set the minimum version 3.12, because it was the latest at the time. I think 3.10 may work as well, but any lower than that won't work. Interpret these version numbers not as decimals but
I've installed CMake version 3.12 in my home directory on the HPC servers, so that's how I've been using it there. I'd recommend that you install the latest version from here: https://cmake.org/download/#latest Let me know if you run into anything.
Hi,
That error happens because version 2.8 of CMake is very old. The FindMatlab module that also implements the matlab_add_mex function that we use was introduced in CMake 3.2.
The CUDA language support in CMake is different from the way Matlab is supported. There used to be a FindCUDA module, but as of version 3.10 CUDA became a 'first-class language' and that's why we should use enable_language instead of find_module.
I had set the minimum version 3.12, because it was the latest at the time. I think 3.10 may work as well, but any lower than that won't work. Interpret these version numbers not as decimals but ..
I've installed CMake version 3.12 in my home directory on the HPC servers, so that's how I've been using it there. I'd recommend that you install the latest version from here: https://cmake.org/download/#latest Let me know if you run into anything.
Hi Ben,
Thanks for the tips. I installed the latest version of cmake locally in my home directory. Before, I thought that this is not possible without admin permission. Now, I can compile everything using the cmake without any error in Linux. For this, I updated readme with instructions on how to install latest version of cmake locally in Linux environment.
By the way, have you made any progress for the Windows installation?
I've made some progress, but haven't fully resolved the issues. There seems to be a bug in cmake on windows for Matlab. When I manually add libmx as a linker requirement, in addition to libmex, Visual Studio is able to compile the mexfiles for the CPU version. I plan to make a small example and report this as a bug.
Furthermore, it seems I have mismatching versions of CUDA and MS Visual Studio. I just installed the latest version of both, which are apparently incompatible. So I need to figure out which versions are compatible and then I can continue.
I've made some progress, but haven't fully resolved the issues. There seems to be a bug in cmake on windows for Matlab. When I manually add libmx as a linker requirement, in addition to libmex, Visual Studio is able to compile the mexfiles for the CPU version. I plan to make a small example and report this as a bug.
Furthermore, it seems I have mismatching versions of CUDA and MS Visual Studio. I just installed the latest version of both, which are apparently incompatible. So I need to figure out which versions are compatible and then I can continue.
OK, good. So wouldn't it be possible to provide two different ways for compiling the code on Windows and Linux for the moment until the time we can fix this and provide a single solution?
Hi Ben,
Have you made any progress on this?
Bests, Hamid
I'm sorry for the slow progress on this. I've been searching for a solution that works and is sustainable, but at this point I'm not sure if we can find a solution that is both.
I've also been looking at how other projects are handling this, for example ASTRA (https://github.com/astra-toolbox/astra-toolbox) has a set of scripts that generate the MS project build files. I was hoping that we could avoid something like that and use CMake instead.
Hi Hamid,
I've managed to make it work under windows, albeit with a workaround to fix the ms build files. I've pushed to a branch named 'windows' could you check it out and see if you can get it to work on your machine?
Hi Hamid,
I've managed to make it work under windows, albeit with a workaround to fix the ms build files. I've pushed to a branch named 'windows' could you check it out and see if you can get it to work on your machine?
Hi Ben,
That is great. I am going to test it on my windows machine and will let you know about the outcome.
Hi Ben,
In the CMakeLists.txt, the minimum required version of cmake is 3.12. I have cmake version 2.8 which seems to be a different version numbering (isn't it? larger number but older version). When I try to run cmake with version 2.8 (after changing the required minimum version) I get the following error:
I got the same error on my colleague's linux machine which has cmake 3.5 version. There the error was about another flag related to CUDA which was undefined.
Unfortunately, on HPC servers I cannot update cmake version. So it there any solution to make this compatible with older version of cmake?