2 # mexopts.sh Shell script for configuring MEX-file creation script,
3 # mex. These options were tested with the specified compiler.
5 # usage: Do not call this file directly; it is sourced by the
6 # mex shell script. Modify only if you don't like the
7 # defaults after running mex. No spaces are allowed
8 # around the '=' in the variable assignment.
10 # Note: For the version of system compiler supported with this release,
11 # refer to the Supported and Compatible Compiler List at:
12 # http://www.mathworks.com/support/compilers/current_release/
15 # SELECTION_TAGs occur in template option files and are used by MATLAB
16 # tools, such as mex and mbuild, to determine the purpose of the contents
17 # of an option file. These tags are only interpreted when preceded by '#'
18 # and followed by ':'.
20 #SELECTION_TAG_MEX_OPT: Template Options file for building gcc MEX-files
22 # Copyright 1984-2011 The MathWorks, Inc.
23 # $Revision: 1.78.4.17 $ $Date: 2011/04/16 06:07:44 $
24 #----------------------------------------------------------------------------
28 if [ "$ENTRYPOINT" = "mexLibrary" ]; then
29 MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
31 MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
35 #----------------------------------------------------------------------------
36 # Change this line if you need to specify the location of the MATLAB
37 # root directory. The script needs to know where to find utility
38 # routines so that it can determine the architecture; therefore, this
39 # assignment needs to be done while the architecture is still
41 #----------------------------------------------------------------------------
45 #----------------------------------------------------------------------------
46 RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
49 # CkeyManufacturer: GNU
52 # CkeyLinkerName: GNU ld
55 CFLAGS='-ansi -D_GNU_SOURCE'
56 CFLAGS="$CFLAGS -fPIC -pthread -m32"
57 CFLAGS="$CFLAGS -fexceptions"
58 CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
59 CLIBS="$RPATH $MLIBS -lm"
60 COPTIMFLAGS='-O -DNDEBUG'
62 CLIBS="$CLIBS -lstdc++"
65 # C++keyManufacturer: GNU
68 # C++keyLinkerName: GNU ld
69 # C++keyLinkerVersion:
71 CXXFLAGS='-ansi -D_GNU_SOURCE'
72 CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
73 CXXFLAGS="$CXXFLAGS -fPIC -pthread"
74 CXXLIBS="$RPATH $MLIBS -lm"
75 CXXOPTIMFLAGS='-O -DNDEBUG'
79 # FortrankeyName: gfortran
80 # FortrankeyManufacturer: GNU
81 # FortrankeyLanguage: Fortran
83 # FortrankeyLinkerName: GNU ld
84 # FortrankeyLinkerVersion:
86 FFLAGS='-fexceptions -fbackslash'
87 FFLAGS="$FFLAGS -fPIC"
88 FLIBS="$RPATH $MLIBS -lm"
94 LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
99 #----------------------------------------------------------------------------
102 #----------------------------------------------------------------------------
103 RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
104 # StorageVersion: 1.0
106 # CkeyManufacturer: GNU
109 # CkeyLinkerName: GNU ld
112 CFLAGS='-D_GNU_SOURCE'
113 CFLAGS="$CFLAGS -fexceptions"
114 CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
115 CLIBS="$RPATH $MLIBS -lm"
116 COPTIMFLAGS='-O -DNDEBUG'
118 CLIBS="$CLIBS -lstdc++"
120 # C++keyName: GNU C++
121 # C++keyManufacturer: GNU
122 # C++keyLanguage: C++
124 # C++keyLinkerName: GNU ld
125 # C++keyLinkerVersion:
127 CXXFLAGS='-ansi -D_GNU_SOURCE'
128 CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
129 CXXLIBS="$RPATH $MLIBS -lm"
130 CXXOPTIMFLAGS='-O -DNDEBUG'
133 # FortrankeyName: gfortran
134 # FortrankeyManufacturer: GNU
135 # FortrankeyLanguage: Fortran
137 # FortrankeyLinkerName: GNU ld
138 # FortrankeyLinkerVersion:
141 FFLAGS='-fexceptions -fbackslash'
142 FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
143 FLIBS="$RPATH $MLIBS -lm"
148 LDEXTENSION='.mexa64'
149 LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
154 #----------------------------------------------------------------------------
157 #----------------------------------------------------------------------------
158 echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh sol64 12
159 #----------------------------------------------------------------------------
162 #----------------------------------------------------------------------------
163 echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
164 #----------------------------------------------------------------------------
167 #----------------------------------------------------------------------------
168 echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh maci 12
169 #----------------------------------------------------------------------------
172 #----------------------------------------------------------------------------
173 # StorageVersion: 1.0
175 # CkeyManufacturer: GNU
181 SDKROOT='/Developer/SDKs/MacOSX10.6.sdk'
182 MACOSX_DEPLOYMENT_TARGET='10.5'
184 CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
185 CFLAGS="$CFLAGS -fexceptions"
187 COPTIMFLAGS='-O2 -DNDEBUG'
190 CLIBS="$CLIBS -lstdc++"
191 # C++keyName: GNU C++
192 # C++keyManufacturer: GNU
193 # C++keyLanguage: C++
196 # C++keyLinkerVersion:
198 CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
199 CXXLIBS="$MLIBS -lstdc++"
200 CXXOPTIMFLAGS='-O2 -DNDEBUG'
203 # FortrankeyName: GNU Fortran
204 # FortrankeyManufacturer: GNU
205 # FortrankeyLanguage: Fortran
207 # FortrankeyLinkerName:
208 # FortrankeyLinkerVersion:
210 FFLAGS='-fexceptions -m64 -fbackslash'
211 FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
212 FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
213 FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
218 LDEXTENSION='.mexmaci64'
219 LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
220 LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
225 #----------------------------------------------------------------------------
228 #############################################################################
230 # Architecture independent lines:
232 # Set and uncomment any lines which will apply to all architectures.
234 #----------------------------------------------------------------------------
237 # COPTIMFLAGS="$COPTIMFLAGS"
238 # CDEBUGFLAGS="$CDEBUGFLAGS"
243 # FOPTIMFLAGS="$FOPTIMFLAGS"
244 # FDEBUGFLAGS="$FDEBUGFLAGS"
249 # LDOPTIMFLAGS="$LDOPTIMFLAGS"
250 # LDDEBUGFLAGS="$LDDEBUGFLAGS"
251 #----------------------------------------------------------------------------
252 #############################################################################