JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for SPM Archives


SPM Archives

SPM Archives


SPM@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  September 2008

SPM September 2008

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Compiling SPM5 for Matlab64 on Intel MAC

From:

Guillaume Flandin <[log in to unmask]>

Reply-To:

Guillaume Flandin <[log in to unmask]>

Date:

Tue, 16 Sep 2008 19:58:49 +0100

Content-Type:

multipart/mixed

Parts/Attachments:

Parts/Attachments

text/plain (25 lines) , Makefile (507 lines)

Dear Scott,

please find attached to this email a more recent Makefile (to be put in
the src directory of the SPM5 distribution) that should handle R2008a
Beta for 64-bit Intel-Based Mac.

To compile, you need to type the following:
export MACI64=1
make && make install

Best regards,
Guillaume.

Scott Ziegler wrote:
> Has anyone had any success compiling the SPM5 tool set on the Intel MAC 
> using Matlab 64 Beta?

-- 
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG



#!/usr/bin/env make -f # General Makefile to compile SPM C-MEX files # # Copyright (C) 2005 Wellcome Department of Imaging Neuroscience # # $Id: Makefile 1962 2008-07-28 15:40:56Z guillaume $ # ############################################################################### # # This Makefile has been tested under Linux, SunOS and Windows (at the FIL). # # If you have to tweak this Makefile to compile the SPM mex-files for your # platform, please send the details to <[log in to unmask]> so they # can be included here. # # You can specify a particular platform with the following syntax: # make PLATFORM=Your_Platform # The standard targets are 'all', 'clean', 'distclean' and 'install'. # # For a list of compatible compilers, see # http://www.mathworks.com/support/tech-notes/1600/1601.html # ############################################################################### SHELL = /bin/sh MEX_BIN = mex MEXOPTS = -O MEXEND = CC = cc CFLAGS = MOSUF = o # mex output object suffix CHMODIT = chmod 644 ADDED_OBS = AR = ar rcs RANLIB = ranlib COPY = cp -f DEL = rm -f MOVE = mv -f ifndef SUF   ifndef PLATFORM     PLATFORM = $(shell uname)   endif   ifeq (SunOS,$(PLATFORM))     SUF = mexsol     CFLAGS = -xO5 -DBIGENDIAN     MEXOPTS = COPTIMFLAGS='-xO5 -DBIGENDIAN'   endif   ifeq (SunOS.gcc,$(PLATFORM))     # See http://en.wikibooks.org/wiki/SPM-Installation_on_SunOS     SUF = mexsol     CC = gcc     CFLAGS = -O3 -funroll-loops -DBIGENDIAN -fPIC     MEXOPTS = COPTIMFLAGS='-O3 -funroll-loops -DBIGENDIAN'   endif   ifeq (SunOS64.gcc,$(PLATFORM))     # Added mexs64 filename extension (as R2007a requires) and -m64 compiler option     SUF = mexs64     CC = gcc     CFLAGS = -m64 -O3 -funroll-loops -DBIGENDIAN -fPIC     MEXOPTS = COPTIMFLAGS='-O3 -funroll-loops -DBIGENDIAN'   endif   ifeq (Linux,$(PLATFORM))     # 'uname -i' may not work     HARDWARE = $(shell uname -m)     ifeq (i386,$(HARDWARE))       SUF = mexglx       CC = gcc       CFLAGS = -O3 -funroll-loops -fPIC -fexceptions       MEXOPTS = COPTIMFLAGS='-O3 -funroll-loops -fexceptions'     endif     ifeq (i686,$(HARDWARE))       SUF = mexglx       CC = gcc       CFLAGS = -O3 -funroll-loops -fPIC -fexceptions       MEXOPTS = COPTIMFLAGS='-O3 -funroll-loops -fexceptions'     endif     ifeq (x86_64,$(HARDWARE))       # See http://en.wikibooks.org/wiki/SPM-Installation_on_64bit_Linux       SUF = mexa64       CC = gcc       # The '-fPIC' option is necessary to allow the linking process to complete.       # '-march=x86-64' provides generic optimisations for both Opteron and 64bit Xeon.       # If the code is running on a 64bit Xeon you can change '-march=x86-64' to       # '-march=nocona', when running on an Opteron, change it to '-march=opteron'.       # Also possibly use '-march=k8' for 64 bit Athlon.       CFLAGS = -O3 -funroll-loops -fPIC -march=x86-64 -mfpmath=sse       MEXOPTS = COPTIMFLAGS='-O3 -funroll-loops -fPIC -march=x86-64 -mfpmath=sse'     endif     ifndef SUF       $(error Unknowm platform $(PLATFORM)-$(HARDWARE))     endif   endif   ifeq (HP-UX,$(PLATFORM))     SUF = mexphux     CFLAGS = -O +z -Ae +DAportable -DBIGENDIAN     MEXOPTS = -O -DBIGENDIAN   endif   ifeq (Darwin,$(PLATFORM))     # See http://en.wikibooks.org/wiki/SPM-Installation_on_Mac_OS     #     # Patch for gcc 3.x with Matlab 6.5 and 6.5.1 on Mac OS X:     # http://www.mathworks.com/support/solutions/data/1-1BEIS.html?solution=1-1BEIS     HARDWARE = $(shell uname -p)     ifeq (i386,$(HARDWARE))       ifeq (1,$(MACI64))         SUF = mexmaci64         CFLAGS = -O3 -funroll-loops -fPIC -m64         MEXOPTS = COPTIMFLAGS='-O3 -funroll-loops -fPIC -m64'       else         SUF = mexmaci         CFLAGS =         MEXOPTS = -O       endif     endif     ifeq (powerpc,$(HARDWARE))       SUF = mexmac       CFLAGS = -DBIGENDIAN       MEXOPTS = -O -DBIGENDIAN     endif   endif   # See Matthew Brett's web page on mex files for Windows:   # http://gnumex.sourceforge.net/   #   # New extension .mexw32 for MEX-files on 32-bit versions of Windows in Matlab 7.1:   # http://www.mathworks.com/access/helpdesk/help/techdoc/rn/r14sp3_external_upgrade.html   ifeq (windows,$(PLATFORM))     # Assume a Cygwin/MinGW Windows compilation     override PLATFORM = CYGWIN   endif   ifeq (MINGW32,$(word 1,$(subst _, ,$(PLATFORM))))     # MinGW (Minimalist GNU for Windows) can be obtained from:     # http://www.mingw.org/     # Packages required are mingw-runtime, w32api, binutils, gcc-core and mingw32-make     SUF = dll     SUF = mexw32     CC = gcc     CFLAGS = -O3 -funroll-loops -DSPM_WIN32     MEX_BIN = cmd /c "mex.bat     MEXOPTS = -O -DSPM_WIN32     MEXEND = "     MOSUF = obj     CHMODIT = chmod 755   endif   ifeq (CYGWIN,$(word 1,$(subst _, ,$(PLATFORM))))     # Cygwin packages can be obtained from:     # http://www.cygwin.com/     # (install the Default configuration, along with the gcc C compiler,     # and make from the "Devel" options)     SUF = dll     SUF = mexw32     CC = gcc     # Consider adding either of the following, depending on your platform:     # -march=pentium3     # -march=pentium4     # Consider also: -mfpmath=sse and: -mno-cygwin     CFLAGS = -mno-cygwin -O3 -funroll-loops -DSPM_WIN32     MEX_BIN = mex.bat     MEXOPTS = -O -DSPM_WIN32     MOSUF = obj     CHMODIT = chmod 755   endif   ifndef SUF     $(error Unknowm platform $(PLATFORM))   endif endif MEX = $(MEX_BIN) $(MEXOPTS) ############################################################################### # Objects to go in the archive and mexfiles ############################################################################### OBS =\ utils_uchar.$(SUF).o utils_short.$(SUF).o utils_int.$(SUF).o \ utils_schar.$(SUF).o utils_ushort.$(SUF).o utils_uint.$(SUF).o\ utils_float.$(SUF).o utils_double.$(SUF).o\ utils_short_s.$(SUF).o utils_int_s.$(SUF).o\ utils_ushort_s.$(SUF).o utils_uint_s.$(SUF).o\ utils_float_s.$(SUF).o utils_double_s.$(SUF).o\ spm_make_lookup.$(SUF).o spm_getdata.$(SUF).o spm_vol_access.$(SUF).o\ spm_mapping.$(SUF).o $(ADDED_OBS) SPMMEX =\ spm_sample_vol.$(SUF) spm_slice_vol.$(SUF) spm_brainwarp.$(SUF)\ spm_add.$(SUF) spm_conv_vol.$(SUF) spm_render_vol.$(SUF)\ spm_global.$(SUF) spm_resels_vol.$(SUF)\ spm_bsplinc.$(SUF) spm_bsplins.$(SUF) spm_bias_mex.$(SUF)\ spm_atranspa.$(SUF) spm_unlink.$(SUF) spm_hist.$(SUF)\ spm_krutil.$(SUF) spm_project.$(SUF) spm_hist2.$(SUF)\ spm_dilate_erode.$(SUF) spm_bwlabel.$(SUF) spm_get_lm.$(SUF)\ spm_digamma.$(SUF) mat2file.$(SUF) file2mat.$(SUF)\ spm_invdef.$(SUF) ############################################################################### # The main ways to run make ############################################################################### all: verb.$(SUF) $(SPMMEX) @ echo "_____________________________________________________________" @ echo "" @ echo " FINISHED" @ echo "_____________________________________________________________" @ echo "" clean: @ echo "_____________________________________________________________" @ echo "" @ echo " Deleting object (.o) files" @ echo "_____________________________________________________________" @ echo "" $(DEL) $(OBS) distclean: clean @ echo "_____________________________________________________________" @ echo "" @ echo " Deleting mex and archive (.a) files" @ echo "_____________________________________________________________" @ echo "" $(DEL) $(SPMMEX) spm_vol_utils.$(SUF).a archive: spm_vol_utils.$(SUF).a install: $(SPMMEX) @ echo "_____________________________________________________________" @ echo "" @ echo " Installing mex files" @ echo "_____________________________________________________________" @ echo "" $(COPY) $(SPMMEX) .. ############################################################################### # Compile spm_vol_utils.c with various flags ############################################################################### spm_vol_utils.$(SUF).a: $(OBS) $(DEL) $@ $(AR) $@ $(OBS) @ $(CHMODIT) $@ UTILS = spm_vol_utils.c spm_make_lookup.h spm_getdata.h utils_uchar.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_UNSIGNED_CHAR @ $(CHMODIT) $@ utils_short.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_SIGNED_SHORT @ $(CHMODIT) $@ utils_int.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_SIGNED_INT @ $(CHMODIT) $@ utils_schar.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_SIGNED_CHAR @ $(CHMODIT) $@ utils_ushort.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_UNSIGNED_SHORT @ $(CHMODIT) $@ utils_uint.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_UNSIGNED_INT @ $(CHMODIT) $@ utils_float.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_FLOAT @ $(CHMODIT) $@ utils_double.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_DOUBLE @ $(CHMODIT) $@ utils_short_s.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_SIGNED_SHORT -DSPM_BYTESWAP @ $(CHMODIT) $@ utils_int_s.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_SIGNED_INT -DSPM_BYTESWAP @ $(CHMODIT) $@ utils_ushort_s.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_UNSIGNED_SHORT -DSPM_BYTESWAP @ $(CHMODIT) $@ utils_uint_s.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_UNSIGNED_INT -DSPM_BYTESWAP @ $(CHMODIT) $@ utils_float_s.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_FLOAT -DSPM_BYTESWAP @ $(CHMODIT) $@ utils_double_s.$(SUF).o: $(UTILS) $(CC) -c $(CFLAGS) -o $@ spm_vol_utils.c -DSPM_DOUBLE -DSPM_BYTESWAP @ $(CHMODIT) $@ ############################################################################### # Compile a few additional C routines for linking ############################################################################### %.$(SUF).o : %.c $(CC) -c $(CFLAGS) -o $@ $< @ $(CHMODIT) $@ spm_getdata.$(SUF).o: spm_getdata.c spm_getdata.h $(CC) -c $(CFLAGS) -o $@ spm_getdata.c @ $(CHMODIT) $@ spm_vol_access.$(SUF).o: spm_vol_access.c spm_vol_access.h spm_datatypes.h $(CC) -c $(CFLAGS) -o $@ spm_vol_access.c @ $(CHMODIT) $@ spm_make_lookup.$(SUF).o: spm_make_lookup.c spm_make_lookup.h $(CC) -c $(CFLAGS) -o $@ spm_make_lookup.c @ $(CHMODIT) $@ spm_mapping.$(SUF).o: spm_mapping.c spm_mapping.h spm_vol_access.h spm_datatypes.h $(MEX) -c spm_mapping.c $(MEXEND) $(MOVE) spm_mapping.$(MOSUF) $@ @ $(CHMODIT) $@ ############################################################################### # Compile the mex files themselves ############################################################################### %.$(SUF) : %.c $(MEX) $< $(MEXEND) @ $(CHMODIT) $@ spm_add.$(SUF): spm_add.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_add.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_bias_mex.$(SUF): spm_bias_mex.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_datatypes.h $(MEX) spm_bias_mex.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_brainwarp.$(SUF): spm_brainwarp.c spm_matfuns.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_brainwarp.c spm_vol_utils.$(SUF).a spm_matfuns.c $(MEXEND) @ $(CHMODIT) $@ spm_bsplinc.$(SUF): spm_bsplinc.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_bsplinc.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_conv_vol.$(SUF): spm_conv_vol.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h spm_datatypes.h $(MEX) spm_conv_vol.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_global.$(SUF): spm_global.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_global.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_render_vol.$(SUF): spm_render_vol.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_render_vol.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_resels_vol.$(SUF): spm_resels_vol.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_resels_vol.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_sample_vol.$(SUF): spm_sample_vol.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_sample_vol.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ spm_slice_vol.$(SUF): spm_slice_vol.c spm_vol_utils.$(SUF).a\ spm_mapping.h spm_vol_access.h $(MEX) spm_slice_vol.c spm_vol_utils.$(SUF).a $(MEXEND) @ $(CHMODIT) $@ file2mat.$(SUF): file2mat.c $(MEX) file2mat.c $(MEXEND) @ $(CHMODIT) $@ mat2file.$(SUF): mat2file.c $(MEX) mat2file.c $(MEXEND) @ $(CHMODIT) $@ spm_atranspa.$(SUF): spm_atranspa.c $(MEX) spm_atranspa.c $(MEXEND) @ $(CHMODIT) $@ spm_bsplins.$(SUF): spm_bsplins.c $(MEX) spm_bsplins.c $(MEXEND) @ $(CHMODIT) $@ spm_bwlabel.$(SUF): spm_bwlabel.c $(MEX) spm_bwlabel.c $(MEXEND) @ $(CHMODIT) $@ spm_digamma.$(SUF): spm_digamma.c $(MEX) spm_digamma.c $(MEXEND) @ $(CHMODIT) $@ spm_dilate_erode.$(SUF): spm_dilate_erode.c $(MEX) spm_dilate_erode.c $(MEXEND) @ $(CHMODIT) $@ spm_get_lm.$(SUF): spm_get_lm.c $(MEX) spm_get_lm.c $(MEXEND) @ $(CHMODIT) $@ spm_hist.$(SUF): spm_hist.c $(MEX) spm_hist.c $(MEXEND) @ $(CHMODIT) $@ spm_hist2.$(SUF): spm_hist2.c $(MEX) spm_hist2.c $(MEXEND) @ $(CHMODIT) $@ spm_invdef.$(SUF): spm_invdef.c $(MEX) spm_invdef.c $(MEXEND) @ $(CHMODIT) $@ spm_krutil.$(SUF): spm_krutil.c $(MEX) spm_krutil.c $(MEXEND) @ $(CHMODIT) $@ spm_project.$(SUF): spm_project.c $(MEX) spm_project.c $(MEXEND) @ $(CHMODIT) $@ spm_unlink.$(SUF): spm_unlink.c $(MEX) spm_unlink.c $(MEXEND) @ $(CHMODIT) $@ ############################################################################### # Assorted architecture dependent messages ############################################################################### verb.dll verb.mexw32: @ echo "_____________________________________________________________" @ echo "" @ echo " Windows compilation - using $(CC)/`uname`" @ echo " see http://gnumex.sourceforge.net/" @ echo "_____________________________________________________________" @ echo "" verb.mexglx: @ echo "_____________________________________________________________" @ echo "" @ echo " Linux compilation (x86-32) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.mexa64: @ echo "_____________________________________________________________" @ echo "" @ echo " Linux compilation (x86-64) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.mexmac: @ echo "_____________________________________________________________" @ echo "" @ echo " Unix compilation (MacOS X, PowerPC) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.mexmaci: @ echo "_____________________________________________________________" @ echo "" @ echo " Unix compilation (MacOS X, Intel) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.mexmaci64: @ echo "_____________________________________________________________" @ echo "" @ echo " Unix compilation (MacOS X, Intel 64 bit) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.mexsol: @ echo "_____________________________________________________________" @ echo "" @ echo " Unix compilation (Solaris) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.mexs64: @ echo "_____________________________________________________________" @ echo "" @ echo " Unix compilation (Solaris 64 bit) - using $(CC)" @ echo "_____________________________________________________________" @ echo "" verb.hpux: @ echo "_____________________________________________________________" @ echo "" @ echo " Unix compilation (HP-UX) - using $(CC)" @ echo "_____________________________________________________________" @ echo ""

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager