LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2009, 10:52 AM   #1
zest n zeal
LQ Newbie
 
Registered: May 2007
Posts: 18

Rep: Reputation: 0
Error compiling mex files for matlab using make.


Hi I'm having problems compiling some files (mex files for matlab).

In the makefile they use "uname -m" to determine the HARDWARE and do not give an option for my output (i686), The nearest option is (i386)
PHP Code:
    HARDWARE  = $(shell uname -m)
    
ifeq (i386,$(HARDWARE))
      
SUF     mexglx
      CC      
gcc
      CFLAGS  
= -O3 -funroll-loops -fPIC -fexceptions
      MEXOPTS 
COPTIMFLAGS='-O3 -funroll-loops -fexceptions'
    
endif 
The variables SUF and CC look appropriate, I have no idea about CFLAGS and MEXOPTS but I tried just substituting i386 for i686 instead and ran make...

PHP Code:
am0032@linux-vvi7:~/spm5/srcmake && make install
_____________________________________________________________

        Linux compilation 
(x86-32) - using gcc
_____________________________________________________________

gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_uchar.mexglx.o spm_vol_utils.-DSPM_UNSIGNED_CHAR
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_short.mexglx.o spm_vol_utils.-DSPM_SIGNED_SHORT
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_int.mexglx.o spm_vol_utils.-DSPM_SIGNED_INT
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_schar.mexglx.o spm_vol_utils.-DSPM_SIGNED_CHAR
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_ushort.mexglx.o spm_vol_utils.-DSPM_UNSIGNED_SHORT
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_uint.mexglx.o spm_vol_utils.-DSPM_UNSIGNED_INT
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_float.mexglx.o spm_vol_utils.-DSPM_FLOAT
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_double.mexglx.o spm_vol_utils.-DSPM_DOUBLE
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_short_s.mexglx.o spm_vol_utils.-DSPM_SIGNED_SHORT -DSPM_BYTESWAP
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_int_s.mexglx.o spm_vol_utils.-DSPM_SIGNED_INT -DSPM_BYTESWAP
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_ushort_s.mexglx.o spm_vol_utils.-DSPM_UNSIGNED_SHORT -DSPM_BYTESWAP
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_uint_s.mexglx.o spm_vol_utils.-DSPM_UNSIGNED_INT -DSPM_BYTESWAP
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_float_s.mexglx.o spm_vol_utils.-DSPM_FLOAT -DSPM_BYTESWAP
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o utils_double_s.mexglx.o spm_vol_utils.-DSPM_DOUBLE -DSPM_BYTESWAP
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o spm_make_lookup.mexglx.o spm_make_lookup.c
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o spm_getdata.mexglx.o spm_getdata.c
gcc 
--O3 -funroll-loops -fPIC -fexceptions -o spm_vol_access.mexglx.o spm_vol_access.c
mex COPTIMFLAGS
='-O3 -funroll-loops -fexceptions' -c spm_mapping.
make
mexCommand not found
make
: *** [spm_mapping.mexglx.oError 127 

I understand that this mex function cannot be found, albeit that grepping the c files indicates multiple files with the line

PHP Code:
#include "mex.h" 

When I run 'make -d && make install' in debug mode I get the following as the last few lines of output.

PHP Code:
      Trying pattern rule with stem `spm_mapping'.
         Rejecting impossible implicit prerequisite 
`spm_mapping.w'.
         No implicit rule found for `spm_mapping.c'
.
         
Finished prerequisites of target file `spm_mapping.c'.
        No need to remake target 
`spm_mapping.c'.
        Considering target file `spm_mapping.h'
.
         
Looking for an implicit rule for `spm_mapping.h'.
         Trying pattern rule with stem 
`spm_mapping.h'.
         Trying implicit prerequisite `spm_mapping.h,v'
.
         
Trying pattern rule with stem `spm_mapping.h'.
         Trying implicit prerequisite 
`RCS/spm_mapping.h,v'.
         Trying pattern rule with stem `spm_mapping.h'
.
         
Trying implicit prerequisite `RCS/spm_mapping.h'.
         Trying pattern rule with stem 
`spm_mapping.h'.
         Trying implicit prerequisite `s.spm_mapping.h'
.
         
Trying pattern rule with stem `spm_mapping.h'.
         Trying implicit prerequisite 
`SCCS/s.spm_mapping.h'.
         No implicit rule found for `spm_mapping.h'
.
         
Finished prerequisites of target file `spm_mapping.h'.
        No need to remake target 
`spm_mapping.h'.
        Pruning file `spm_vol_access.h'
.
        
Pruning file `spm_datatypes.h'.
       Finished prerequisites of target file 
`spm_mapping.mexglx.o'.
      Must remake target `spm_mapping.mexglx.o'
.
mex COPTIMFLAGS='-O3 -funroll-loops -fexceptions' -c spm_mapping.
make
mexCommand not found
Putting child 0x0808a070 
(spm_mapping.mexglx.oPID 11002 on the chain.
Live child 0x0808a070 (spm_mapping.mexglx.oPID 11002 
Reaping losing child 0x0808a070 PID 11002 
make
: *** [spm_mapping.mexglx.oError 127
Removing child 0x0808a070 PID 11002 from chain
.
am0032@linux-vvi7:~/spm5/src

Does any kind soul have an idea what is going wrong? I am sure the source files are fine so I am just being a newbie-muppet.

Zest
 
Old 01-30-2009, 01:50 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
/usr/bin/mex ? You will have to 'buy' a Matlab licence
to get it, I think.
They have a 15 day trial for some applications too.
I don't think, that anyting else will substitute the genuine mex.

Files, you probably have it all ....

MEX Required
Mex (Matlab EXecutibles) are required to compile SPM. :

http://en.wikibooks.org/wiki/SPM/Ins...x#MEX_Required

files.c , files.h , Makefile ....
http://www.umich.edu/~fmri/course/2005/files/spm2/

mex.h
http://www.princeton.edu/~rvdb/matlab/mex.h
....

Last edited by knudfl; 01-30-2009 at 01:51 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when compiling kernel linux-2.6.22 : make: ***[_modinst_post] Error 137 ngoclan.it Linux - General 1 12-11-2007 06:54 AM
Error when compiling kernel linux-2.6.22 : make: ***[_modinst_post] Error 137 ngoclan.it Linux - Newbie 0 12-11-2007 06:49 AM
Amule -Compiling error - 'make' lnaia Linux - Software 1 03-04-2005 04:34 AM
Compiling error with make DaBlade Linux - Software 7 12-23-2004 08:23 AM
make error compiling Scribus - what to do? Bruce Hill Slackware 1 12-02-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration