nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#831 ./configure does not find MATLAB correctly on OSX, #2559

Closed nikhilgupta10 closed 7 years ago

nikhilgupta10 commented 7 years ago

The following was placed in Makefile

MATLAB = matlab
MATLAB_CPPFLAGS = -Imatlab/extern/include
MATLAB_LDFLAGS = -L

when it should have been

MATLAB = /Applications/MATLAB_R2011a.app
MATLAB_CPPFLAGS = -I${MATLAB}/extern/include
MATLAB_LDFLAGS = -L${MATLAB}/extern/lib/maci64

,

nikhilgupta10 commented 7 years ago

nikhilgupta10 imported these comments from Sourceforge: "dchassin":It looks like configure doesn't look at what 'matlab -e' returns but instead tries to construct the include and library path from the path found. First of all, that path found isn't necessary the original binary. Second of all, depending on the platform it may be impossible to guess the correct library path from the binary path. The needed information is contained in the output of the command 'matlab -e':

MATLAB=...
(DY)LD_LIBRARY_PATH=...

In the case of include, it should always be $MATLAB/extern/include.

,

"dchassin":The following was implemented in ticket:830 as a solution that seems to work ok.

--- configure.ac    (revision 4702)
+++ configure.ac    (working copy)
@@ -476,8 +476,9 @@
             [gld_cv_matlab_ldpath=`$MATLAB -e | grep ^DYLD_LIBRARY_PATH= | cut -f2 -d=`
 ])])])
 AS_IF([test /x$MATLAB\ != x],
-    [MATLAB_CPPFLAGS=\-I$MATLAB/extern/include\n    -     MATLAB_LDFLAGS=\-L${MATLAB_LDPATH//:/ -L}\n    +    [MATLAB=`$MATLAB -e | grep ^MATLAB= | cut -f2 -d=`
+     MATLAB_CPPFLAGS=\-I$MATLAB/extern/include\n    +     MATLAB_LDFLAGS=\-L${gld_cv_matlab_ldpath//:/ -L}\n          MATLAB_LIBS=\-lmx -leng\n          GLD_CPPFLAGS=\$GLD_CPPFLAGS -DHAVE_MATLAB\n          HAVE_MATLAB=yes],

,

"jcfuller":- Description has changed:

Diff: