-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't Build MATLAB Interface (Can't find MATLAB) #63
Comments
The error message that bothers me is "missing: Matlab_INCLUDE_DIRS Matlab_MEX_LIBRARY I obtain:
|
When I run that command in MATLAB and then select the "C++" option, here's what I get:
|
Update: I was able to get it to work, but only by setting the MATLAB root in the CMakeLists file (right before the find_package() call):
However, this is an advanced step that shouldn't be necessary. Any ideas why the code couldn't locate MATLAB on its own? I added the root directory to the PATH and it still didn't work as intended... |
I was about to suggest this (set(Matlab_ROOT_Dir ...). Clearly the find_package(Matlab ...) is not working properly with cmake 3.16. It can be the FindMatlab.cmake or where your matlab is installed. Can you be more specific about what is not working as intended ? |
I just checked my environment variables : |
No joy, unfortunately. I have MATLABROOT set and added to PATH, but I still get the same error.
|
This issue also arises with OSX. As mentioned previously, the first option is to set the MATLAB root in the CMakeLists file (right before the find_package() call): Another way is to pass the variable to CMake during configuration:
|
I receive the following error when I attempt to build the software on Linux (Linux Mint). For what it's worth, I've also tried this on CentOS and got the same error, and on Windows I got the same error until I specified the target platform with "-A x64".
I could use some help figuring out how to handle this. My version of CMake is up to date (3.16). I'm on MATLAB R2021a and I've already added the appropriate entry for this MATLAB version to the FindMATLAB cmake file.
adam@adam-VirtualBox:~/Desktop/nomad-v.4.2.0$ cmake -DTEST_OPENMP=OFF -DBUILD_INTERFACE_MATLAB=ON -S . -B build/release
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CHECK_START Configuring custom options
-- Installation prefix set to /home/adam/Desktop/nomad-v.4.2.0/build/release
CHECK_START Configuring for use of Sgtelib library
CHECK_PASS Sgtelib found. done
-- Compiling Nomad without OpenMP
CHECK_START Configuring build for library and batch mode examples
-- Add example library #1
-- Add example library #2
-- Add example library #3
-- Add example library single_obj_parallel
-- Add example library tests using Suggest And Observe
-- Add example batch #1
-- Add example batch #2
-- Add example batch single_obj
-- Add example batch surrogate sort
-- Add example batch single_obj_MPIparallel (MPI found).
CHECK_PASS done
-- C interface to Nomad NOT built
-- Python interface to Nomad NOT built
CHECK_START Configuring build for Matlab interface
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Matlab (missing: Matlab_INCLUDE_DIRS Matlab_MEX_LIBRARY
Matlab_MEX_EXTENSION Matlab_ROOT_DIR Matlab_MX_LIBRARY MEX_COMPILER) (found
version "NOTFOUND")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindMatlab.cmake:1803 (find_package_handle_standard_args)
CMakeLists.txt:170 (find_package)
-- Configuring incomplete, errors occurred!
I've attached my CMakeOutput.log file, hopefully that will provide some insight.
CMakeOutput.log
Any help you can provide would be appreciated!
The text was updated successfully, but these errors were encountered: