Skip to content
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

Problem with installing MPsolve for Matlab #34

Open
mahradsv opened this issue Jan 12, 2023 · 2 comments
Open

Problem with installing MPsolve for Matlab #34

mahradsv opened this issue Jan 12, 2023 · 2 comments

Comments

@mahradsv
Copy link

I am using MacBook Pro and after entering "./configure" on terminal, I receive the following summary:
MPSolve configuration:

    Source location:	.
Pthread CFLAGS:		-D_THREAD_SAFE 
    C compiler:		gcc
CFLAGS:			-D_REENTRANT -Wall -DMPS_USE_BUILTIN_COMPLEX  -DNICE_DEBUG -fno-math-errno -fomit-frame-pointer -D_MPS_PRIVATE
    LDFLAGS:                 -L/usr/local/opt/gmp/lib -lgmp 
Additional CFLAGS:	-I/usr/local/opt/gmp/ -g -O2
    Debug enabled:		yes
    Check enabled:		no
Octave module:		no
MATLAB (tm) module:	yes (generates examples/matlab/mpsolve-toolbox.tar.gz)
Graphical UI:		no
Python module:          yes

Type 'make' to compile MPSolve, and then make install
to install the binaries, the library and the headers
system-wide.

As you can see I have: MATLAB (tm) module: yes
But then we I enter "make" in the terminal I receive the following error regarding gmp.h file.

Making all in matlab
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from /Users/mahradvaghefi/Desktop/mpsolve-3.2.1/examples/matlab/mps_roots_string.c:2:
In file included from /Users/mahradvaghefi/Desktop/mpsolve-3.2.1/examples/matlab/mps_option_parser.h:2:
In file included from ../../include/mps/mps.h:65:
../../include/mps/gmptools.h:18:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
^~~~~~~
1 error generated.

@robol
Copy link
Owner

robol commented Jan 13, 2023

Make sure to specify the CFLAGS for gmp using GMP_CFLAGS, for instance

./configure GMP_CFLAGS="-I/usr/local/opt/gmp/"

Other CFLAGS are not passed to the MATLAB compiler because it tends to be picky about what it supports. If this does not work (or you did it already), there may be a problem in how the variables are passed to that script, but I cannot reproduced it locally.

@mahradsv
Copy link
Author

Thanks for your response. I have already tried

./configure GMP_CFLAGS="-I/usr/local/opt/gmp/"

and it did not work. Is there any instruction I can follow to see how the variables are passed to the script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants