matlab_add_mex is not found

4 ビュー (過去 30 日間)
Chanoh Park
Chanoh Park 2017 年 2 月 13 日
回答済み: Sonam Gupta 2017 年 2 月 15 日
Hi,
I have installed matlab and matlab-support in ubuntu 14.04 and cmake does not work. Seems like it is not able to find matlab_add_mex in my CMakeList.txt. It's weird because it worked in ubuntu 16.04. I'm using R2016b and cmake version is 2.8. Does anyone know what's wrong?
>> cmake..
-- Configuring MEX files
CMake Error at CMakeLists.txt:17 (matlab_add_mex):
Unknown CMake command "matlab_add_mex".
-- Configuring incomplete, errors occurred!

回答 (1 件)

Sonam Gupta
Sonam Gupta 2017 年 2 月 15 日
Ubuntu 16.04 uses version 3.x for CMake which supports 'matlab_add_mex' function which is there inside FindMatlab package. It is not there in CMake version 2.8 which you have by default on Ubuntu 14.04. I expect that upgrading to CMake version 3.3.2 or higher should resolve the error.
Below is the link that might be useful for you to upgrade CMake to a higher version:
This link uses wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz instead of which you can get 3.3.2 using
wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz
Hope this helps.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by