Advertisement
Guest User

Untitled

a guest
Dec 16th, 2011
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.51 KB | None | 0 0
  1. #
  2. # mexopts.sh Shell script for configuring MEX-file creation script,
  3. # mex. These options were tested with the specified compiler.
  4. #
  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.
  9. #
  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/
  13. #
  14. #
  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 ':'.
  19. #
  20. #SELECTION_TAG_MEX_OPT: Template Options file for building gcc MEX-files
  21. #
  22. # Copyright 1984-2011 The MathWorks, Inc.
  23. # $Revision: 1.78.4.17 $ $Date: 2011/04/16 06:07:44 $
  24. #----------------------------------------------------------------------------
  25. #
  26.  
  27. # ADDED: fix "cannot find crti.o: No such file or directory" error
  28. export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
  29.  
  30. TMW_ROOT="$MATLAB"
  31. MFLAGS=''
  32. if [ "$ENTRYPOINT" = "mexLibrary" ]; then
  33. MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat -lmwservices -lut"
  34. else
  35. MLIBS="-L$TMW_ROOT/bin/$Arch -lmx -lmex -lmat"
  36. fi
  37. case "$Arch" in
  38. Undetermined)
  39. #----------------------------------------------------------------------------
  40. # Change this line if you need to specify the location of the MATLAB
  41. # root directory. The script needs to know where to find utility
  42. # routines so that it can determine the architecture; therefore, this
  43. # assignment needs to be done while the architecture is still
  44. # undetermined.
  45. #----------------------------------------------------------------------------
  46. MATLAB="$MATLAB"
  47. ;;
  48. glnx86)
  49. #----------------------------------------------------------------------------
  50. RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
  51. # StorageVersion: 1.0
  52. # CkeyName: GNU C
  53. # CkeyManufacturer: GNU
  54. # CkeyLanguage: C
  55. # CkeyVersion:
  56. CC='gcc'
  57. CFLAGS='-ansi -D_GNU_SOURCE'
  58. CFLAGS="$CFLAGS -fPIC -pthread -m32"
  59. CFLAGS="$CFLAGS -fexceptions"
  60. CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
  61. CLIBS="$RPATH $MLIBS -lm"
  62. COPTIMFLAGS='-O -DNDEBUG'
  63. CDEBUGFLAGS='-g'
  64. CLIBS="$CLIBS -lstdc++"
  65. #
  66. # C++keyName: GNU C++
  67. # C++keyManufacturer: GNU
  68. # C++keyLanguage: C++
  69. # C++keyVersion:
  70. CXX='g++'
  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'
  76. CXXDEBUGFLAGS='-g'
  77. #
  78. #
  79. # FortrankeyName: gfortran
  80. # FortrankeyManufacturer: GNU
  81. # FortrankeyLanguage: Fortran
  82. # FortrankeyVersion:
  83. FC='gfortran'
  84. FFLAGS='-fexceptions -fbackslash'
  85. FFLAGS="$FFLAGS -fPIC"
  86. FLIBS="$RPATH $MLIBS -lm"
  87. FOPTIMFLAGS='-O'
  88. FDEBUGFLAGS='-g'
  89. #
  90. LD="$COMPILER"
  91. LDEXTENSION='.mexglx'
  92. LDFLAGS="-pthread -shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
  93. LDOPTIMFLAGS='-O'
  94. LDDEBUGFLAGS='-g'
  95. #
  96. POSTLINK_CMDS=':'
  97. #----------------------------------------------------------------------------
  98. ;;
  99. glnxa64)
  100. #----------------------------------------------------------------------------
  101. RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch"
  102. # StorageVersion: 1.0
  103. # CkeyName: GNU C
  104. # CkeyManufacturer: GNU
  105. # CkeyLanguage: C
  106. # CkeyVersion:
  107. CC='/opt/gcc-4.3.4/bin/gcc'
  108. CFLAGS='-ansi -D_GNU_SOURCE'
  109. CFLAGS="$CFLAGS -fexceptions"
  110. CFLAGS="$CFLAGS -fPIC -fno-omit-frame-pointer -pthread"
  111. CLIBS="$RPATH $MLIBS -lm"
  112. COPTIMFLAGS='-O -DNDEBUG'
  113. CDEBUGFLAGS='-g'
  114. CLIBS="$CLIBS -lstdc++"
  115. #
  116. # C++keyName: GNU C++
  117. # C++keyManufacturer: GNU
  118. # C++keyLanguage: C++
  119. # C++keyVersion:
  120. CXX='/opt/gcc-4.3.4/bin/g++'
  121. CXXFLAGS='-ansi -D_GNU_SOURCE'
  122. CXXFLAGS="$CXXFLAGS -fPIC -fno-omit-frame-pointer -pthread"
  123. CXXLIBS="$RPATH $MLIBS -lm"
  124. CXXOPTIMFLAGS='-O -DNDEBUG'
  125. CXXDEBUGFLAGS='-g'
  126. #
  127. # FortrankeyName: gfortran
  128. # FortrankeyManufacturer: GNU
  129. # FortrankeyLanguage: Fortran
  130. # FortrankeyVersion:
  131. #
  132. FC='/opt/gcc-4.3.4/bin/gfortran'
  133. FFLAGS='-fexceptions -fbackslash'
  134. FFLAGS="$FFLAGS -fPIC -fno-omit-frame-pointer"
  135. FLIBS="$RPATH $MLIBS -lm"
  136. FOPTIMFLAGS='-O'
  137. FDEBUGFLAGS='-g'
  138. #
  139. LD="$COMPILER"
  140. LDEXTENSION='.mexa64'
  141. LDFLAGS="-pthread -shared -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"
  142. LDOPTIMFLAGS='-O'
  143. LDDEBUGFLAGS='-g'
  144. #
  145. POSTLINK_CMDS=':'
  146. #----------------------------------------------------------------------------
  147. ;;
  148. sol64)
  149. #----------------------------------------------------------------------------
  150. echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh sol64 12
  151. #----------------------------------------------------------------------------
  152. ;;
  153. mac)
  154. #----------------------------------------------------------------------------
  155. echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh mac 12
  156. #----------------------------------------------------------------------------
  157. ;;
  158. maci)
  159. #----------------------------------------------------------------------------
  160. echo "Error: Did not imbed 'options.sh' code"; exit 1 #imbed options.sh maci 12
  161. #----------------------------------------------------------------------------
  162. ;;
  163. maci64)
  164. #----------------------------------------------------------------------------
  165. # StorageVersion: 1.0
  166. # CkeyName: GNU C
  167. # CkeyManufacturer: GNU
  168. # CkeyLanguage: C
  169. # CkeyVersion:
  170. CC='gcc-4.2'
  171. SDKROOT='/Developer/SDKs/MacOSX10.6.sdk'
  172. MACOSX_DEPLOYMENT_TARGET='10.5'
  173. ARCHS='x86_64'
  174. CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
  175. CFLAGS="$CFLAGS -fexceptions"
  176. CLIBS="$MLIBS"
  177. COPTIMFLAGS='-O2 -DNDEBUG'
  178. CDEBUGFLAGS='-g'
  179. #
  180. CLIBS="$CLIBS -lstdc++"
  181. # C++keyName: GNU C++
  182. # C++keyManufacturer: GNU
  183. # C++keyLanguage: C++
  184. # C++keyVersion:
  185. CXX=g++-4.2
  186. CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
  187. CXXLIBS="$MLIBS -lstdc++"
  188. CXXOPTIMFLAGS='-O2 -DNDEBUG'
  189. CXXDEBUGFLAGS='-g'
  190. #
  191. # FortrankeyName: GNU Fortran
  192. # FortrankeyManufacturer: GNU
  193. # FortrankeyLanguage: Fortran
  194. # FortrankeyVersion:
  195. FC='gfortran'
  196. FFLAGS='-fexceptions -m64 -fbackslash'
  197. FC_LIBDIR=`$FC -print-file-name=libgfortran.dylib 2>&1 | sed -n '1s/\/*libgfortran\.dylib//p'`
  198. FC_LIBDIR2=`$FC -print-file-name=libgfortranbegin.a 2>&1 | sed -n '1s/\/*libgfortranbegin\.a//p'`
  199. FLIBS="$MLIBS -L$FC_LIBDIR -lgfortran -L$FC_LIBDIR2 -lgfortranbegin"
  200. FOPTIMFLAGS='-O'
  201. FDEBUGFLAGS='-g'
  202. #
  203. LD="$CC"
  204. LDEXTENSION='.mexmaci64'
  205. LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
  206. LDFLAGS="$LDFLAGS -bundle -Wl,-exported_symbols_list,$TMW_ROOT/extern/lib/$Arch/$MAPFILE"
  207. LDOPTIMFLAGS='-O'
  208. LDDEBUGFLAGS='-g'
  209. #
  210. POSTLINK_CMDS=':'
  211. #----------------------------------------------------------------------------
  212. ;;
  213. esac
  214. #############################################################################
  215. #
  216. # Architecture independent lines:
  217. #
  218. # Set and uncomment any lines which will apply to all architectures.
  219. #
  220. #----------------------------------------------------------------------------
  221. # CC="$CC"
  222. # CFLAGS="$CFLAGS"
  223. # COPTIMFLAGS="$COPTIMFLAGS"
  224. # CDEBUGFLAGS="$CDEBUGFLAGS"
  225. # CLIBS="$CLIBS"
  226. #
  227. # FC="$FC"
  228. # FFLAGS="$FFLAGS"
  229. # FOPTIMFLAGS="$FOPTIMFLAGS"
  230. # FDEBUGFLAGS="$FDEBUGFLAGS"
  231. # FLIBS="$FLIBS"
  232. #
  233. # LD="$LD"
  234. # LDFLAGS="$LDFLAGS"
  235. # LDOPTIMFLAGS="$LDOPTIMFLAGS"
  236. # LDDEBUGFLAGS="$LDDEBUGFLAGS"
  237. #----------------------------------------------------------------------------
  238. #############################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement