Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password   Forgot your Password?
 All Forums
 Support Forums
 Analysis Software Support
 buildmex error on a Mac
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dvsmith
Advanced Member

USA
218 Posts

Posted - Oct 29 2009 :  01:22:57 AM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
Hi Syam,

I downloaded the latest version of the BIAC Matlab tools, and tried to compile them on my computer using buildmex. I get the following errors:

>> buildmex
Warning: Function /Users/dvsmith/Documents/MATLAB/BIAC/general/beep.m has the same
name as a MATLAB builtin. We suggest you rename the function to avoid a potential
name conflict.
> In buildmex at 48
Building minmax.c
/Applications/MATLAB_R2009b.app/bin/mex: line 1107: gcc-4.0: command not found
/Applications/MATLAB_R2009b.app/bin/mex: line 1086: gcc-4.0: command not found
/Applications/MATLAB_R2009b.app/bin/mex: line 997: gcc-4.0: command not found

mex: compile of ' "minmax.c"' failed.

??? Error using ==> buildmex at 130
Error using ==> mex at 221
Unable to complete successfully.

I know I've see this before, and I believe you told me how to fix it. But, unfortunately, I can't find the email from you that provided the solution to this problem. I'm pretty sure I installed X11 and I believe I have the Xcode tools on here, so I'm not sure what else I could be missing... Any ideas?

Thanks!
David

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Oct 29 2009 :  07:55:29 AM  Show Profile  Reply with Quote
Does:
gcc -v
on a command line give you anything? If not, you probably do need to install (or re-install) Xcode.
Go to Top of Page

dvsmith
Advanced Member

USA
218 Posts

Posted - Oct 29 2009 :  08:07:14 AM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
That command is unrecognized... I'll go back and take a look at the Xcode stuff to make sure it is installed.

Thanks!
David
Go to Top of Page

dvsmith
Advanced Member

USA
218 Posts

Posted - Oct 31 2009 :  11:06:17 AM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
OK, I downloaded the Xcode tools and that got me through most of compiling process... It crashes at the very end:


>> buildmex
Building minmax.c
Building scaled2rgb.c
Building trilinear.c
Building hcoords.c
Building cellfun2.c
Building readxml.c & writexml.c
Undefined symbols:
"_mxGetFieldNumber", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_mexFunction in readxml.o
"_mxGetM", referenced from:
_mexFunction in readxml.o
_mexFunction in readxml.o
_mexFunction in readxml.o
"_mxGetN", referenced from:
_xmlNodeToMxArray in readxml.o
_mexFunction in readxml.o
_mexFunction in readxml.o
_mexFunction in readxml.o
"_mxGetData", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxSetFieldByNumber_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_mexFunction in readxml.o
"_mxGetFieldNameByNumber", referenced from:
_mexFunction in readxml.o
"_mxCreateString", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_mexFunction in readxml.o
"_mxGetFieldByNumber_700", referenced from:
_xmlNodeToMxArray in readxml.o
_mexFunction in readxml.o
"_mxSetN_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxDestroyArray", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxSetCell_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxGetNumberOfFields", referenced from:
_mexFunction in readxml.o
"_mxRealloc", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxIsChar", referenced from:
_mexFunction in readxml.o
_mexFunction in readxml.o
"_mxCreateCellMatrix_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxSetField_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxAddField", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_mexFunction in readxml.o
"_mxGetString_700", referenced from:
_mexFunction in readxml.o
_mexFunction in readxml.o
_mexFunction in readxml.o
"_mxIsStruct", referenced from:
_mexFunction in readxml.o
"_mxGetElementSize", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxGetClassName", referenced from:
_mexFunction in readxml.o
"_mxSetData", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxCreateStructMatrix_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxSetPr", referenced from:
_xmlNodeToMxArray in readxml.o
"_mxGetField_700", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxGetPr", referenced from:
_xmlNodeToMxArray in readxml.o
"_mxGetNumberOfElements", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxDuplicateArray", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
"_mxCreateDoubleScalar", referenced from:
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
_xmlNodeToMxArray in readxml.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

mex: link of ' "readxml.mexmaci"' failed.

??? Error using ==> buildmex at 130
Error using ==> mex at 221
Unable to complete successfully.


In case you need it, the output of gcc -v is below:

David-V-Smiths-MacBook-Pro:~ dvsmith$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646.1~2/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)

Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Oct 31 2009 :  12:39:01 PM  Show Profile  Reply with Quote
I forgot to mention -- we figured out something not too long ago, you need the following in buildmex.sh for Macs, before the readxml/writexml build commands. Hopefully this should fix that error.

# Build functions with library dependencies
MACLIBFIX=
if [ x`uname -s` = xDarwin ] ; then
  # Apparently Darwin needs the MATLAB library directory first in the search path for some reason
  MACLIBFIX=-L/Applications/MATLAB_R2009a.app/bin/maci
fi
echo "Building readxml"
...
Go to Top of Page

dvsmith
Advanced Member

USA
218 Posts

Posted - Oct 31 2009 :  2:32:11 PM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
Hmm... still doesn't work. I get the same error after editing the buildmex.sh file. I have MATLAB_R2009b on Snow Leopard (OS 10.6.1), and I changed the path of MACLIBFIX to reflect this...

Any other suggestions?

Thanks,
David
Go to Top of Page

dvsmith
Advanced Member

USA
218 Posts

Posted - Oct 31 2009 :  7:25:02 PM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
Hi Syam,

Let me clarify two things that may or may not help.

1.) I was using the buildmex.m function in MATLAB -- not the buildmex.sh file in BASH. But, I did try the buildmex.sh file from the command line and it threw a lot of syntax errors in various parts of the script (see below, but note this syntax error is below other syntax errors involving the disp_usage function at the top of the file).

David-V-Smiths-MacBook-Pro:general dvsmith$ sh buildmex.sh --libxm2dir /usr/include/libxml2/libxml --matlabver 7.9
: command not found:
: command not found1:
: command not found5:
'uildmex.sh: line 39: syntax error near unexpected token `in
'uildmex.sh: line 39: ` case "$1" in

I copied all of these file directly from the latest version of the BIAC tools on Munin. I've tried it with and without inputs. Is it possible they got corrupted at some point when Hill died? The fact that is throwing errors on the disp_usage function seems to be a red flag.

2.) I think my libxml2 directory doesn't match the default location -- there is actually a subfolder containing all of the .h files called libxml (/usr/include/libxml2/libxml/). So, I changed what I think is the call to this directory within buildmex.m so that line 75 reads
libxmlIncludeDir = fullfile(externPath,'include','libxml2','libxml');

Yet, this little change still doesn't make buildmex.m work either. I now get the errors below. Based on the first two errors about the missing tree.h and xpath.h files, I assume I should not have added the libxml folder to the path because these files are definitely in the libxmlIncludeDir directory...


readxml.c:20:25: error: libxml/tree.h: No such file or directory
readxml.c:21:26: error: libxml/xpath.h: No such file or directory
readxml.c:33: error: syntax error before 'xmlNodePtr'
readxml.c:34: error: syntax error before 'xmlNodePtr'
readxml.c:35: error: syntax error before 'xmlNodePtr'
readxml.c:36: error: syntax error before 'xmlNodePtr'
readxml.c:37: error: syntax error before 'np'
readxml.c: In function 'mexFunction':
readxml.c:55: error: 'xmlDocPtr' undeclared (first use in this function)
readxml.c:55: error: (Each undeclared identifier is reported only once
readxml.c:55: error: for each function it appears in.)
readxml.c:55: error: syntax error before 'doc'
readxml.c:56: error: 'xmlXPathContextPtr' undeclared (first use in this function)
readxml.c:58: error: 'xmlNodePtr' undeclared (first use in this function)
readxml.c:58: error: 'stringnodes' undeclared (first use in this function)
readxml.c:59: error: syntax error before 'root'
readxml.c:71: error: 'doc' undeclared (first use in this function)
readxml.c:76: error: 'ctxt' undeclared (first use in this function)
readxml.c:90: error: 'xmlNsPtr' undeclared (first use in this function)
readxml.c:90: error: syntax error before 'newns'
readxml.c:102: error: syntax error before ')' token
readxml.c:103: error: 'newns' undeclared (first use in this function)
readxml.c:103: error: 'xmlNs' undeclared (first use in this function)
readxml.c:103: error: syntax error before ')' token
readxml.c:107: error: 'XML_NAMESPACE_DECL' undeclared (first use in this function)
readxml.c:108: error: syntax error before 'xmlChar'
readxml.c:109: error: syntax error before 'xmlChar'
readxml.c:119: error: 'root' undeclared (first use in this function)
readxml.c:123: error: syntax error before ')' token
readxml.c:128: error: 'xmlXPathObjectPtr' undeclared (first use in this function)
readxml.c:128: error: syntax error before 'obj'
readxml.c:129: error: 'xmlNodeSetPtr' undeclared (first use in this function)
readxml.c:130: error: 'newstringnodes' undeclared (first use in this function)
readxml.c:150: error: 'obj' undeclared (first use in this function)
readxml.c:150: error: 'xmlChar' undeclared (first use in this function)
readxml.c:150: error: syntax error before ')' token
readxml.c:157: error: 'XPATH_NODESET' undeclared (first use in this function)
readxml.c:165: error: 'nodeset' undeclared (first use in this function)
readxml.c:166: error: syntax error before ')' token
readxml.c:198: error: syntax error before 'doc'
readxml.c: At top level:
readxml.c:243: error: syntax error before 'np'
readxml.c: In function 'xmlNodeToMxArray':
readxml.c:248: error: 'xmlNodePtr' undeclared (first use in this function)
readxml.c:248: error: syntax error before 'nontextchild'
readxml.c:256: error: 'np' undeclared (first use in this function)
readxml.c:256: error: 'XML_ELEMENT_NODE' undeclared (first use in this function)
readxml.c:257: error: 'XML_ATTRIBUTE_NODE' undeclared (first use in this function)
readxml.c:258: error: 'XML_TEXT_NODE' undeclared (first use in this function)
readxml.c:259: error: 'XML_PI_NODE' undeclared (first use in this function)
readxml.c:260: error: 'XML_CDATA_SECTION_NODE' undeclared (first use in this function)
readxml.c:261: error: 'XML_DOCUMENT_NODE' undeclared (first use in this function)
readxml.c:268: error: 'stringnodes' undeclared (first use in this function)
readxml.c:268: error: 'numstringnodes' undeclared (first use in this function)
readxml.c:280: error: 'nontextchild' undeclared (first use in this function)
readxml.c: At top level:
readxml.c:315: error: syntax error before 'xmlNodePtr'
readxml.c: In function 'getTextValue':
readxml.c:322: error: 'xmlNodePtr' undeclared (first use in this function)
readxml.c:322: error: syntax error before 'cur'
readxml.c:326: error: 'numstringnodes' undeclared (first use in this function)
readxml.c:333: error: 'np' undeclared (first use in this function)
readxml.c:333: error: 'stringnodes' undeclared (first use in this function)
readxml.c:352: error: 'cur' undeclared (first use in this function)
readxml.c:360: error: 'XML_TEXT_NODE' undeclared (first use in this function)
readxml.c:360: error: 'XML_CDATA_SECTION_NODE' undeclared (first use in this function)
readxml.c: At top level:
readxml.c:443: error: syntax error before 'xmlNodePtr'
readxml.c: In function 'addNamespaces':
readxml.c:447: error: 'np' undeclared (first use in this function)
readxml.c:451: error: 'sm' undeclared (first use in this function)
readxml.c:459: error: 'xmlNsPtr' undeclared (first use in this function)
readxml.c:459: error: syntax error before 'ns'
readxml.c:461: error: 'ns' undeclared (first use in this function)
readxml.c:467: error: 'XML_ELEMENT_NODE' undeclared (first use in this function)
readxml.c:470: error: syntax error before 'cur'
readxml.c:477: error: 'cur' undeclared (first use in this function)
readxml.c: At top level:
readxml.c:500: error: syntax error before 'xmlNodePtr'
readxml.c: In function 'addAttributes':
readxml.c:505: error: 'xmlNodePtr' undeclared (first use in this function)
readxml.c:505: error: syntax error before 'cur'
readxml.c:507: error: 'sm' undeclared (first use in this function)
readxml.c:515: error: 'cur' undeclared (first use in this function)
readxml.c:516: error: syntax error before 'np'
readxml.c:516: error: syntax error before ')' token
readxml.c:521: error: continue statement not within a loop
readxml.c:524: error: 'newchild' undeclared (first use in this function)
readxml.c:524: error: 'stringnodes' undeclared (first use in this function)
readxml.c:524: error: 'numstringnodes' undeclared (first use in this function)
readxml.c:526: error: continue statement not within a loop
readxml.c: At top level:
readxml.c:534: error: syntax error before numeric constant
readxml.c:534: error: conflicting types for 'mxSetFieldByNumber_700'
/Applications/MATLAB_R2009b.app/extern/include/matrix.h:1437: error: previous declaration of 'mxSetFieldByNumber_700' was here
readxml.c:534: warning: data definition has no type or storage class
readxml.c:538: error: syntax error before 'xmlNodePtr'
readxml.c: In function 'addChildren':
readxml.c:540: error: 'xmlNodePtr' undeclared (first use in this function)
readxml.c:540: error: syntax error before 'cur'
readxml.c:541: error: 'cur' undeclared (first use in this function)
readxml.c:541: error: 'np' undeclared (first use in this function)
readxml.c:549: error: 'XML_TEXT_NODE' undeclared (first use in this function)
readxml.c:549: error: 'XML_CDATA_SECTION_NODE' undeclared (first use in this function)
readxml.c:551: error: 'XML_PI_NODE' undeclared (first use in this function)
readxml.c:558: error: 'rank' undeclared (first use in this function)
readxml.c:559: error: 'sm' undeclared (first use in this function)
readxml.c:563: error: 'XML_COMMENT_NODE' undeclared (first use in this function)
readxml.c:565: error: 'xmlChar' undeclared (first use in this function)
readxml.c:565: error: syntax error before ')' token
readxml.c:574: error: 'names' undeclared (first use in this function)
readxml.c:596: error: continue statement not within a loop
readxml.c: At top level:
readxml.c:598: error: 'cur' undeclared here (not in a function)
readxml.c:598: error: 'stringnodes' undeclared here (not in a function)
readxml.c:598: error: 'numstringnodes' undeclared here (not in a function)
readxml.c:598: warning: initialization makes integer from pointer without a cast
readxml.c:598: error: initializer element is not constant
readxml.c:598: warning: data definition has no type or storage class
readxml.c:599: error: syntax error before 'if'
readxml.c:601: error: 'sm' undeclared here (not in a function)
readxml.c:601: error: initializer element is not constant
readxml.c:601: warning: data definition has no type or storage class
readxml.c:602: error: syntax error before 'if'
readxml.c:608: error: syntax error before string constant
readxml.c:608: warning: data definition has no type or storage class
readxml.c:609: error: syntax error before numeric constant
readxml.c:611: warning: initialization makes integer from pointer without a cast
readxml.c:611: error: initializer element is not constant
readxml.c:611: warning: data definition has no type or storage class
readxml.c:612: error: syntax error before numeric constant
readxml.c:612: error: conflicting types for 'mxSetCell_700'
/Applications/MATLAB_R2009b.app/extern/include/matrix.h:1537: error: previous declaration of 'mxSetCell_700' was here
readxml.c:612: warning: data definition has no type or storage class
readxml.c:613: error: redefinition of 'newchild'
readxml.c:598: error: previous definition of 'newchild' was here
readxml.c:613: error: initializer element is not constant
readxml.c:613: warning: data definition has no type or storage class
readxml.c:615: error: redefinition of 'fieldnum'
readxml.c:601: error: previous definition of 'fieldnum' was here
readxml.c:615: error: initializer element is not constant
readxml.c:615: warning: data definition has no type or storage class
readxml.c:616: error: syntax error before numeric constant
readxml.c:616: error: conflicting types for 'mxSetFieldByNumber_700'
/Applications/MATLAB_R2009b.app/extern/include/matrix.h:1437: error: previous declaration of 'mxSetFieldByNumber_700' was here
readxml.c:616: warning: data definition has no type or storage class
readxml.c:621: warning: initialization makes integer from pointer without a cast
readxml.c:621: error: initializer element is not constant
readxml.c:621: warning: data definition has no type or storage class
readxml.c:622: warning: data definition has no type or storage class
readxml.c:623: error: syntax error before 'if'
readxml.c:625: error: redefinition of 'oldlen'
readxml.c:622: error: previous definition of 'oldlen' was here
readxml.c:625: warning: passing argument 1 of 'mxGetNumberOfElements' makes pointer from integer without a cast
readxml.c:625: error: initializer element is not constant
readxml.c:625: warning: data definition has no type or storage class
readxml.c:626: warning: passing argument 1 of 'mxGetData' makes pointer from integer without a cast
readxml.c:626: warning: passing argument 1 of 'mxGetElementSize' makes pointer from integer without a cast
readxml.c:626: warning: initialization makes integer from pointer without a cast
readxml.c:626: error: initializer element is not constant
readxml.c:626: warning: data definition has no type or storage class
readxml.c:627: error: syntax error before 'if'
readxml.c:629: error: syntax error before '+' token
readxml.c:629: error: conflicting types for 'mxSetN_700'
/Applications/MATLAB_R2009b.app/extern/include/matrix.h:1547: error: previous declaration of 'mxSetN_700' was here
readxml.c:629: warning: data definition has no type or storage class
readxml.c:630: warning: parameter names (without types) in function declaration
readxml.c:630: error: conflicting types for 'mxSetData'
/Applications/MATLAB_R2009b.app/extern/include/matrix.h:499: error: previous declaration of 'mxSetData' was here
readxml.c:630: warning: data definition has no type or storage class
readxml.c:632: error: syntax error before string constant
readxml.c:632: warning: data definition has no type or storage class
readxml.c:633: error: syntax error before numeric constant
readxml.c:635: warning: parameter names (without types) in function declaration
readxml.c:635: error: conflicting types for 'mxSetCell_700'
/Applications/MATLAB_R2009b.app/extern/include/matrix.h:1537: error: previous declaration of 'mxSetCell_700' was here
readxml.c:635: warning: data definition has no type or storage class
readxml.c:636: error: syntax error before '}' token

mex: compile of ' "readxml.c"' failed.


Edited by - dvsmith on Oct 31 2009 7:33:08 PM
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Oct 31 2009 :  10:45:35 PM  Show Profile  Reply with Quote
I wonder if linefeeds were changed when you copied it from munin. Currently (on munin) buildmex.sh looks like it has UNIX linefeeds (i.e. just LF, not Windows CRLF), which should work. If you have the utility dos2unix, then:
dos2unix buildmex.sh
will fix the line feeds if they have been converted.

I also forgot another change to buildmex.sh. I have copied to munin/programs/MATLAB/BIAC the version that I think we used on Leopard (but have not tested on Snow Leopard). Maybe you could copy that and try again (and verify the line ending characters).

The include location should be /path/to/include/libxml2 -- the .c files then explicitly specify the libxml/ subdirectory when they try to include those .h files.
Go to Top of Page

dvsmith
Advanced Member

USA
218 Posts

Posted - Nov 01 2009 :  01:10:49 AM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
I never actually touched buildmex.sh with Windows, but running dos2unix errors on it seems to fix the syntax problems on the older version (no idea how they got there). This problem with the linefeeds is not present with the newest copy of buildmex.sh.

I suspect the problem should be pretty easy to pin down now. My terminal isn't recognizing "mex" as a command, but I've installed the Xcode tools (twice) and gcc -v provides the same output as before. What program(s) am I missing to make this work?
e.g.: ./buildmex.sh: line 90: mex: command not found

Also, and just for clarification, should we run buildmex.m or buildmex.sh when we try to compile the Matlab tools? Or is there no difference? They seem to do the same thing, but I could be missing something...

Thanks,
David



Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Nov 01 2009 :  07:33:17 AM  Show Profile  Reply with Quote
I only suggest buildmex.sh on UNIX-based machines because that's what I tend to use. At some point I will test buildmex.m too and see if it's possible to fix that.

mex comes from MATLAB, so should be in a MATLAB "bin" directory somewhere. On my (non-Mac) installation, mex is in the same directory as the matlab executable. If that is in your path ( export PATH=${PATH}:/path/to/matlab/bin ) then it should find it.
Go to Top of Page

dvsmith
Advanced Member

USA
218 Posts

Posted - Nov 01 2009 :  10:17:01 AM  Show Profile  Visit dvsmith's Homepage  Reply with Quote
Thanks, Syam. I fixed the path issue with the mex call and Matlab, but now I get the error below for everything (i.e., nothing is compiling). My machine is set to run as 32-bit and my Matlab is also 32-bit (I'm only saying this because I see a lot of 64s in the errors).

David-V-Smiths-MacBook-Pro:general dvsmith$ ./buildmex.sh
Building hcoords.c
mex hcoords.c
ld: can't open -exported_symbols_list file: /Applications/MATLAB_R2009b.app/extern/lib/maci64/mexFunction.map
collect2: ld returned 1 exit status

mex: link of ' "hcoords.mexmaci64"' failed.


When I was attempting to compile with the buildmex.m, it compiled everything but readxml and writexml.

Thanks again for your help on this. Hopefully there is a simple fix for it.

Cheers,
David

Go to Top of Page

clithero
Junior Member

37 Posts

Posted - Jan 05 2010 :  12:35:08 PM  Show Profile  Reply with Quote
Hi,

I am few steps behind David, but I just wanted to echo that I am encountering identical problems on Mac OS 10.6.2:

In matlab 7.9.0 (R2009b), to install BIAC tools, I get the following warning:
Warning: Function
/Users/JAC/matlab/BIAC_matlab_20090424_ver3.1.4.2/general/beep.m has the same
name as a MATLAB builtin. We suggest you rename the function to avoid a
potential name conflict.

In matlab, when running buildmex.m:
Mostly works, but then:
mex: link of ' "readxml.mexmaci"' failed.

I have Xcode installed and gcc version 4.2.1 (same as David).

Was there any resolution for the buildmex error?

Thanks,
John
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Jan 05 2010 :  12:41:32 PM  Show Profile  Reply with Quote
Hi John,

I think David will be stopping by my cubicle later this week with a Mac to see if we can resolve this once and for all. Hopefully it will be a easy fix.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.62 seconds. Snitz Forums 2000