You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 31 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <!DOCTYPE html>
  2. <html class="no-js" lang="en">
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta content="width=device-width,initial-scale=1" name="viewport"/>
  6. <link href="https://openblas.net/docs/build_system/" rel="canonical"/>
  7. <link href="../developers/" rel="prev"/>
  8. <link href="../runtime_variables/" rel="next"/>
  9. <link href="../logo.svg" rel="icon"/>
  10. <meta content="mkdocs-1.6.1, mkdocs-material-9.6.14" name="generator"/>
  11. <title>Build system - OpenBLAS</title>
  12. <link href="../assets/stylesheets/main.342714a4.min.css" rel="stylesheet"/>
  13. <link href="../assets/stylesheets/palette.06af60db.min.css" rel="stylesheet"/>
  14. <link crossorigin="" href="https://fonts.gstatic.com" rel="preconnect"/>
  15. <link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback" rel="stylesheet"/>
  16. <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
  17. <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
  18. </head>
  19. <body data-md-color-accent="indigo" data-md-color-primary="blue-grey" data-md-color-scheme="slate" dir="ltr">
  20. <input autocomplete="off" class="md-toggle" data-md-toggle="drawer" id="__drawer" type="checkbox"/>
  21. <input autocomplete="off" class="md-toggle" data-md-toggle="search" id="__search" type="checkbox"/>
  22. <label class="md-overlay" for="__drawer"></label>
  23. <div data-md-component="skip">
  24. <a class="md-skip" href="#makefile-dependency-graph">
  25. Skip to content
  26. </a>
  27. </div>
  28. <div data-md-component="announce">
  29. </div>
  30. <header class="md-header md-header--shadow" data-md-component="header">
  31. <nav aria-label="Header" class="md-header__inner md-grid">
  32. <a aria-label="OpenBLAS" class="md-header__button md-logo" data-md-component="logo" href=".." title="OpenBLAS">
  33. <img alt="logo" src="../logo.svg"/>
  34. </a>
  35. <label class="md-header__button md-icon" for="__drawer">
  36. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"></path></svg>
  37. </label>
  38. <div class="md-header__title" data-md-component="header-title">
  39. <div class="md-header__ellipsis">
  40. <div class="md-header__topic">
  41. <span class="md-ellipsis">
  42. OpenBLAS
  43. </span>
  44. </div>
  45. <div class="md-header__topic" data-md-component="header-topic">
  46. <span class="md-ellipsis">
  47. Build system
  48. </span>
  49. </div>
  50. </div>
  51. </div>
  52. <form class="md-header__option" data-md-component="palette">
  53. <input aria-label="Switch to light mode" class="md-option" data-md-color-accent="indigo" data-md-color-media="" data-md-color-primary="blue-grey" data-md-color-scheme="slate" id="__palette_0" name="__palette" type="radio"/>
  54. <label class="md-header__button md-icon" for="__palette_1" hidden="" title="Switch to light mode">
  55. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"></path></svg>
  56. </label>
  57. <input aria-label="Switch to dark mode" class="md-option" data-md-color-accent="indigo" data-md-color-media="" data-md-color-primary="blue-grey" data-md-color-scheme="default" id="__palette_1" name="__palette" type="radio"/>
  58. <label class="md-header__button md-icon" for="__palette_0" hidden="" title="Switch to dark mode">
  59. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"></path></svg>
  60. </label>
  61. </form>
  62. <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
  63. <label class="md-header__button md-icon" for="__search">
  64. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"></path></svg>
  65. </label>
  66. <div class="md-search" data-md-component="search" role="dialog">
  67. <label class="md-search__overlay" for="__search"></label>
  68. <div class="md-search__inner" role="search">
  69. <form class="md-search__form" name="search">
  70. <input aria-label="Search" autocapitalize="off" autocomplete="off" autocorrect="off" class="md-search__input" data-md-component="search-query" name="query" placeholder="Search" required="" spellcheck="false" type="text"/>
  71. <label class="md-search__icon md-icon" for="__search">
  72. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"></path></svg>
  73. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"></path></svg>
  74. </label>
  75. <nav aria-label="Search" class="md-search__options">
  76. <button aria-label="Clear" class="md-search__icon md-icon" tabindex="-1" title="Clear" type="reset">
  77. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>
  78. </button>
  79. </nav>
  80. </form>
  81. <div class="md-search__output">
  82. <div class="md-search__scrollwrap" data-md-scrollfix="" tabindex="0">
  83. <div class="md-search-result" data-md-component="search-result">
  84. <div class="md-search-result__meta">
  85. Initializing search
  86. </div>
  87. <ol class="md-search-result__list" role="presentation"></ol>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="md-header__source">
  94. <a class="md-source" data-md-component="source" href="https://github.com/OpenMathLib/OpenBLAS" title="Go to repository">
  95. <div class="md-source__icon md-icon">
  96. <svg viewbox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"></path></svg>
  97. </div>
  98. <div class="md-source__repository">
  99. GitHub
  100. </div>
  101. </a>
  102. </div>
  103. </nav>
  104. </header>
  105. <div class="md-container" data-md-component="container">
  106. <main class="md-main" data-md-component="main">
  107. <div class="md-main__inner md-grid">
  108. <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation">
  109. <div class="md-sidebar__scrollwrap">
  110. <div class="md-sidebar__inner">
  111. <nav aria-label="Navigation" class="md-nav md-nav--primary" data-md-level="0">
  112. <label class="md-nav__title" for="__drawer">
  113. <a aria-label="OpenBLAS" class="md-nav__button md-logo" data-md-component="logo" href=".." title="OpenBLAS">
  114. <img alt="logo" src="../logo.svg"/>
  115. </a>
  116. OpenBLAS
  117. </label>
  118. <div class="md-nav__source">
  119. <a class="md-source" data-md-component="source" href="https://github.com/OpenMathLib/OpenBLAS" title="Go to repository">
  120. <div class="md-source__icon md-icon">
  121. <svg viewbox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"></path></svg>
  122. </div>
  123. <div class="md-source__repository">
  124. GitHub
  125. </div>
  126. </a>
  127. </div>
  128. <ul class="md-nav__list" data-md-scrollfix="">
  129. <li class="md-nav__item">
  130. <a class="md-nav__link" href="..">
  131. <span class="md-ellipsis">
  132. Home
  133. </span>
  134. </a>
  135. </li>
  136. <li class="md-nav__item">
  137. <a class="md-nav__link" href="../install/">
  138. <span class="md-ellipsis">
  139. Install OpenBLAS
  140. </span>
  141. </a>
  142. </li>
  143. <li class="md-nav__item">
  144. <a class="md-nav__link" href="../user_manual/">
  145. <span class="md-ellipsis">
  146. User manual
  147. </span>
  148. </a>
  149. </li>
  150. <li class="md-nav__item">
  151. <a class="md-nav__link" href="../extensions/">
  152. <span class="md-ellipsis">
  153. Extensions
  154. </span>
  155. </a>
  156. </li>
  157. <li class="md-nav__item">
  158. <a class="md-nav__link" href="../developers/">
  159. <span class="md-ellipsis">
  160. Developer manual
  161. </span>
  162. </a>
  163. </li>
  164. <li class="md-nav__item md-nav__item--active">
  165. <input class="md-nav__toggle md-toggle" id="__toc" type="checkbox"/>
  166. <label class="md-nav__link md-nav__link--active" for="__toc">
  167. <span class="md-ellipsis">
  168. Build system
  169. </span>
  170. <span class="md-nav__icon md-icon"></span>
  171. </label>
  172. <a class="md-nav__link md-nav__link--active" href="./">
  173. <span class="md-ellipsis">
  174. Build system
  175. </span>
  176. </a>
  177. <nav aria-label="Table of contents" class="md-nav md-nav--secondary">
  178. <label class="md-nav__title" for="__toc">
  179. <span class="md-nav__icon md-icon"></span>
  180. Table of contents
  181. </label>
  182. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix="">
  183. <li class="md-nav__item">
  184. <a class="md-nav__link" href="#makefile-dependency-graph">
  185. <span class="md-ellipsis">
  186. Makefile dependency graph
  187. </span>
  188. </a>
  189. </li>
  190. <li class="md-nav__item">
  191. <a class="md-nav__link" href="#important-variables">
  192. <span class="md-ellipsis">
  193. Important Variables
  194. </span>
  195. </a>
  196. <nav aria-label="Important Variables" class="md-nav">
  197. <ul class="md-nav__list">
  198. <li class="md-nav__item">
  199. <a class="md-nav__link" href="#cpu-related">
  200. <span class="md-ellipsis">
  201. CPU related
  202. </span>
  203. </a>
  204. </li>
  205. <li class="md-nav__item">
  206. <a class="md-nav__link" href="#toolchain-related">
  207. <span class="md-ellipsis">
  208. Toolchain related
  209. </span>
  210. </a>
  211. </li>
  212. <li class="md-nav__item">
  213. <a class="md-nav__link" href="#library-related">
  214. <span class="md-ellipsis">
  215. Library related
  216. </span>
  217. </a>
  218. <nav aria-label="Library related" class="md-nav">
  219. <ul class="md-nav__list">
  220. <li class="md-nav__item">
  221. <a class="md-nav__link" href="#library-kind-and-bitness-options">
  222. <span class="md-ellipsis">
  223. Library kind and bitness options
  224. </span>
  225. </a>
  226. </li>
  227. <li class="md-nav__item">
  228. <a class="md-nav__link" href="#data-type-options">
  229. <span class="md-ellipsis">
  230. Data type options
  231. </span>
  232. </a>
  233. </li>
  234. <li class="md-nav__item">
  235. <a class="md-nav__link" href="#threading-options">
  236. <span class="md-ellipsis">
  237. Threading options
  238. </span>
  239. </a>
  240. </li>
  241. <li class="md-nav__item">
  242. <a class="md-nav__link" href="#library-and-symbol-name-options">
  243. <span class="md-ellipsis">
  244. Library and symbol name options
  245. </span>
  246. </a>
  247. </li>
  248. <li class="md-nav__item">
  249. <a class="md-nav__link" href="#blas-and-lapack-options">
  250. <span class="md-ellipsis">
  251. BLAS and LAPACK options
  252. </span>
  253. </a>
  254. </li>
  255. </ul>
  256. </nav>
  257. </li>
  258. </ul>
  259. </nav>
  260. </li>
  261. </ul>
  262. </nav>
  263. </li>
  264. <li class="md-nav__item">
  265. <a class="md-nav__link" href="../runtime_variables/">
  266. <span class="md-ellipsis">
  267. Runtime variables
  268. </span>
  269. </a>
  270. </li>
  271. <li class="md-nav__item">
  272. <a class="md-nav__link" href="../distributing/">
  273. <span class="md-ellipsis">
  274. Redistributing OpenBLAS
  275. </span>
  276. </a>
  277. </li>
  278. <li class="md-nav__item">
  279. <a class="md-nav__link" href="../ci/">
  280. <span class="md-ellipsis">
  281. CI jobs
  282. </span>
  283. </a>
  284. </li>
  285. <li class="md-nav__item">
  286. <a class="md-nav__link" href="../about/">
  287. <span class="md-ellipsis">
  288. About
  289. </span>
  290. </a>
  291. </li>
  292. <li class="md-nav__item">
  293. <a class="md-nav__link" href="../faq/">
  294. <span class="md-ellipsis">
  295. FAQ
  296. </span>
  297. </a>
  298. </li>
  299. </ul>
  300. </nav>
  301. </div>
  302. </div>
  303. </div>
  304. <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc">
  305. <div class="md-sidebar__scrollwrap">
  306. <div class="md-sidebar__inner">
  307. <nav aria-label="Table of contents" class="md-nav md-nav--secondary">
  308. <label class="md-nav__title" for="__toc">
  309. <span class="md-nav__icon md-icon"></span>
  310. Table of contents
  311. </label>
  312. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix="">
  313. <li class="md-nav__item">
  314. <a class="md-nav__link" href="#makefile-dependency-graph">
  315. <span class="md-ellipsis">
  316. Makefile dependency graph
  317. </span>
  318. </a>
  319. </li>
  320. <li class="md-nav__item">
  321. <a class="md-nav__link" href="#important-variables">
  322. <span class="md-ellipsis">
  323. Important Variables
  324. </span>
  325. </a>
  326. <nav aria-label="Important Variables" class="md-nav">
  327. <ul class="md-nav__list">
  328. <li class="md-nav__item">
  329. <a class="md-nav__link" href="#cpu-related">
  330. <span class="md-ellipsis">
  331. CPU related
  332. </span>
  333. </a>
  334. </li>
  335. <li class="md-nav__item">
  336. <a class="md-nav__link" href="#toolchain-related">
  337. <span class="md-ellipsis">
  338. Toolchain related
  339. </span>
  340. </a>
  341. </li>
  342. <li class="md-nav__item">
  343. <a class="md-nav__link" href="#library-related">
  344. <span class="md-ellipsis">
  345. Library related
  346. </span>
  347. </a>
  348. <nav aria-label="Library related" class="md-nav">
  349. <ul class="md-nav__list">
  350. <li class="md-nav__item">
  351. <a class="md-nav__link" href="#library-kind-and-bitness-options">
  352. <span class="md-ellipsis">
  353. Library kind and bitness options
  354. </span>
  355. </a>
  356. </li>
  357. <li class="md-nav__item">
  358. <a class="md-nav__link" href="#data-type-options">
  359. <span class="md-ellipsis">
  360. Data type options
  361. </span>
  362. </a>
  363. </li>
  364. <li class="md-nav__item">
  365. <a class="md-nav__link" href="#threading-options">
  366. <span class="md-ellipsis">
  367. Threading options
  368. </span>
  369. </a>
  370. </li>
  371. <li class="md-nav__item">
  372. <a class="md-nav__link" href="#library-and-symbol-name-options">
  373. <span class="md-ellipsis">
  374. Library and symbol name options
  375. </span>
  376. </a>
  377. </li>
  378. <li class="md-nav__item">
  379. <a class="md-nav__link" href="#blas-and-lapack-options">
  380. <span class="md-ellipsis">
  381. BLAS and LAPACK options
  382. </span>
  383. </a>
  384. </li>
  385. </ul>
  386. </nav>
  387. </li>
  388. </ul>
  389. </nav>
  390. </li>
  391. </ul>
  392. </nav>
  393. </div>
  394. </div>
  395. </div>
  396. <div class="md-content" data-md-component="content">
  397. <article class="md-content__inner md-typeset">
  398. <h1>Build system</h1>
  399. <div class="admonition info">
  400. <p class="admonition-title">Supported build systems</p>
  401. <p>This page describes the Make-based build, which is the
  402. default/authoritative build method. Note that the OpenBLAS repository also
  403. supports building with CMake (not described here) - that generally works
  404. and is tested, however there may be small differences between the Make and
  405. CMake builds.</p>
  406. </div>
  407. <h2 id="makefile-dependency-graph">Makefile dependency graph</h2>
  408. <!---
  409. An easy way to update this diagram is to copy it into https://mermaid.live
  410. and edit it interactively.
  411. -->
  412. <pre class="mermaid"><code>flowchart LR
  413. A[Makefile] --&gt;|included by many of the Makefiles in the subdirectories!| B(Makefile.system)
  414. B --&gt;|triggered, not included, once by Makefile.system, and runs before any of the actual library code is built. builds and runs the 'getarch' tool for cpu identification, runs the compiler detection scripts c_check/f_check| C{Makefile.prebuild}
  415. C --&gt;|either this or Makefile_kernel.conf is generated| D[Makefile.conf]
  416. C --&gt;|temporary Makefile.conf during DYNAMIC_ARCH builds| E[Makefile_kernel.conf]
  417. B --&gt;|defaults for build options that can be given on the make command line| F[Makefile.rule]
  418. B --&gt;|architecture-specific compiler options and OpenBLAS buffer size values| G[Makefile.$ARCH]
  419. A --&gt; exports
  420. A --&gt;|directories: test, ctest, utest, cpp_thread_test| H(test directories)
  421. A --&gt; I($BLASDIRS)
  422. I --&gt; interface
  423. I --&gt; driver/level2
  424. I --&gt; driver/level3
  425. I --&gt; driver/others
  426. A --&gt;|for each target in DYNAMIC_CORE if DYNAMIC_ARCH=1| kernel
  427. A --&gt;|subdirs: timing, testing, testing/EIG, testing/LIN| J($NETLIB_LAPACK_DIR)
  428. A --&gt; relapack
  429. </code></pre>
  430. <h2 id="important-variables">Important Variables</h2>
  431. <p>Most of the tunable variables are found in
  432. <a href="https://github.com/xianyi/OpenBLAS/blob/develop/Makefile.rule">Makefile.rule</a>,
  433. along with their detailed descriptions.</p>
  434. <p>Most of the variables are detected automatically in
  435. <a href="https://github.com/xianyi/OpenBLAS/blob/develop/Makefile.prebuild">Makefile.prebuild</a>,
  436. if they are not set in the environment.</p>
  437. <p>The most commonly used variables are documented below. There are more options
  438. though - please read the linked Makefiles if you want to see all variables.</p>
  439. <h3 id="cpu-related">CPU related</h3>
  440. <ul>
  441. <li><code>ARCH</code>: target architecture (e.g., <code>x86-64</code>).</li>
  442. <li><code>DYNAMIC_ARCH</code>: For building library for multiple <code>TARGET</code>s (does not lose any
  443. optimizations, but increases library size).</li>
  444. <li><code>DYNAMIC_LIST</code>: optional user-provided subset of the <code>DYNAMIC_CORE</code> list in
  445. <a href="https://github.com/xianyi/OpenBLAS/blob/develop/Makefile.system">Makefile.system</a>.</li>
  446. <li><code>TARGET</code>: target CPU architecture. In case of <code>DYNAMIC_ARCH=1</code>, it means that
  447. the library will not be usable on less capable CPUs.</li>
  448. <li><code>TARGET_CORE</code>: override <code>TARGET</code> internally during each CPU-specific cycle of
  449. the build for <code>DYNAMIC_ARCH</code>.</li>
  450. </ul>
  451. <h3 id="toolchain-related">Toolchain related</h3>
  452. <ul>
  453. <li><code>CC</code>: <code>TARGET</code> C compiler used for compilation (can be cross-toolchains).</li>
  454. <li><code>FC</code>: <code>TARGET</code> Fortran compiler used for compilation (can be cross-toolchains,
  455. set <code>NOFORTRAN=1</code> if the used cross-toolchain has no Fortran compiler).</li>
  456. <li><code>COMMON_OPT</code>: flags to add to all invocations of the target C and Fortran compilers
  457. (overrides <code>CFLAGS</code>/<code>FFLAGS</code> - prefer using <code>COMMON_OPT</code>)</li>
  458. <li><code>CCOMMON_OPT</code>: flags to add to all invocations of the target C compiler
  459. (overrides <code>CFLAGS</code>)</li>
  460. <li><code>FCOMMON_OPT</code>: flags to add to all invocations of the target Fortran compiler
  461. (overrides <code>FFLAGS</code>)</li>
  462. <li><code>LDFLAGS</code>: flags to add to all target linker invocations</li>
  463. <li><code>AR</code>, <code>AS</code>, <code>LD</code>, <code>RANLIB</code>: <code>TARGET</code> toolchain helpers used for compilation
  464. (can be cross-toolchains).</li>
  465. <li><code>HOSTCC</code>: compiler of build machine, needed to create proper config files for
  466. the target architecture.</li>
  467. <li><code>HOST_CFLAGS</code>: flags for the build machine compiler.</li>
  468. </ul>
  469. <h3 id="library-related">Library related</h3>
  470. <h4 id="library-kind-and-bitness-options">Library kind and bitness options</h4>
  471. <ul>
  472. <li><code>BINARY</code>: whether to build a 32-bit or 64-bit library (default is <code>64</code>, set
  473. to <code>32</code> on a 32-bit platform).</li>
  474. <li><code>INTERFACE64</code>: build with 64-bit (ILP64) integer representations to support
  475. large array index values (incompatible with the standard 32-bit integer (LP64) API).</li>
  476. <li><code>NO_STATIC</code>: if set to <code>1</code>, don't build a static library (default is <code>0</code>)</li>
  477. <li><code>NO_SHARED</code>: if set to <code>1</code>, don't build a shared library (default is <code>0</code>)</li>
  478. </ul>
  479. <h4 id="data-type-options">Data type options</h4>
  480. <ul>
  481. <li><code>BUILD_SINGLE</code>: build the single-precision real functions of BLAS and (if
  482. it's built) LAPACK</li>
  483. <li><code>BUILD_DOUBLE</code>: build the double-precision real functions</li>
  484. <li><code>BUILD_COMPLEX</code>: build the single-precision complex functions</li>
  485. <li><code>BUILD_COMPLEX16</code>: build the double-precision complex functions</li>
  486. <li><code>BUILD_BFLOAT16</code>: build the "half precision brainfloat" real functions </li>
  487. <li><code>EXPRECISION</code>: (do not use, this is a work in progress) option to use <code>long
  488. double</code> functions</li>
  489. </ul>
  490. <p>By default, the single- and double-precision real and complex floating-point
  491. functions are included in the build, while the half- and extended-precision
  492. functions are not.</p>
  493. <h4 id="threading-options">Threading options</h4>
  494. <ul>
  495. <li><code>USE_THREAD</code>: Use a multithreading backend (defaults to <code>pthreads</code>).</li>
  496. <li><code>USE_LOCKING</code>: implement locking for thread safety even when <code>USE_THREAD</code> is
  497. not set (so that the single-threaded library can safely be called from
  498. multithreaded programs).</li>
  499. <li><code>USE_OPENMP</code>: Use OpenMP as multithreading backend</li>
  500. <li><code>NUM_THREADS</code>: define this to the maximum number of parallel threads you
  501. expect to need (defaults to the number of cores in the build CPU).</li>
  502. <li><code>NUM_PARALLEL</code>: define this to the number of OpenMP instances that your code
  503. may use for parallel calls into OpenBLAS (the default is <code>1</code>, see below).</li>
  504. </ul>
  505. <p>OpenBLAS uses a fixed set of memory buffers internally, used for communicating
  506. and compiling partial results from individual threads. For efficiency, the
  507. management array structure for these buffers is sized at build time - this
  508. makes it necessary to know in advance how many threads need to be supported on
  509. the target system(s).</p>
  510. <p>With OpenMP, there is an additional level of complexity as there may be calls
  511. originating from a parallel region in the calling program. If OpenBLAS gets
  512. called from a single parallel region, it runs single-threaded automatically to
  513. avoid overloading the system by fanning out its own set of threads. In the case
  514. that an OpenMP program makes multiple calls from independent regions or
  515. instances in parallel, this default serialization is not sufficient as the
  516. additional caller(s) would compete for the original set of buffers already in
  517. use by the first call. So if multiple OpenMP runtimes call into OpenBLAS at the
  518. same time, then only one of them will be able to make progress while all the
  519. rest of them spin-wait for the one available buffer. Setting <code>NUM_PARALLEL</code> to
  520. the upper bound on the number of OpenMP runtimes that you can have in a process
  521. ensures that there are a sufficient number of buffer sets available.</p>
  522. <h4 id="library-and-symbol-name-options">Library and symbol name options</h4>
  523. <ul>
  524. <li><code>FIXED_LIBNAME</code>: if set to <code>1</code>, uses a non-versioned name for the library and
  525. no symbolic linking to variant names (default is <code>0</code>)</li>
  526. <li><code>LIBNAMEPREFIX</code>: prefix that, if given, will be inserted in the library name
  527. before <code>openblas</code> (e.g., <code>xxx</code> will result in <code>libxxxopenblas.so</code>)</li>
  528. <li><code>LIBNAMESUFFIX</code>: suffix that, if given, will be inserted in the library name
  529. after <code>openblas</code>, separated by an underscore (e.g., <code>yyy</code> will result in
  530. <code>libopenblas_yyy.so</code>)</li>
  531. <li><code>SYMBOLPREFIX</code>: prefix that, if given, will be added to all symbol names
  532. <em>and</em> to the library name</li>
  533. <li><code>SYMBOLSUFFIX</code>: suffix that, if given, will be added to all symbol names
  534. <em>and</em> to the library name</li>
  535. </ul>
  536. <h4 id="blas-and-lapack-options">BLAS and LAPACK options</h4>
  537. <p>By default, the Fortran and C interfaces to BLAS and LAPACK are built,
  538. including deprecated functions, while
  539. <a href="https://github.com/HPAC/ReLAPACK">ReLAPACK</a> is not.</p>
  540. <ul>
  541. <li><code>NO_CBLAS</code>: if set to <code>1</code>, don't build the CBLAS interface (default is <code>0</code>)</li>
  542. <li><code>ONLY_CBLAS</code>: if set to <code>1</code>, only build the CBLAS interface (default is <code>0</code>)</li>
  543. <li><code>NO_LAPACK</code>: if set to <code>1</code>, don't build LAPACK (default is <code>0</code>)</li>
  544. <li><code>NO_LAPACKE</code>: if set to <code>1</code>, don't build the LAPACKE interface (default is <code>0</code>)</li>
  545. <li><code>BUILD_LAPACK_DEPRECATED</code>: if set to <code>0</code>, don't build deprecated LAPACK
  546. functions (default is <code>1</code>)</li>
  547. <li><code>BUILD_RELAPACK</code>: if set to <code>1</code>, build Recursive LAPACK on top of LAPACK
  548. (default is <code>0</code>)</li>
  549. </ul>
  550. <aside class="md-source-file">
  551. <span class="md-source-file__fact">
  552. <span class="md-icon" title="Last update">
  553. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"></path></svg>
  554. </span>
  555. <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="January 4, 2025 17:13:40 UTC">January 4, 2025</span>
  556. </span>
  557. <span class="md-source-file__fact">
  558. <span class="md-icon" title="Created">
  559. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M14.47 15.08 11 13V7h1.5v5.25l3.08 1.83c-.41.28-.79.62-1.11 1m-1.39 4.84c-.36.05-.71.08-1.08.08-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8c0 .37-.03.72-.08 1.08.69.1 1.33.32 1.92.64.1-.56.16-1.13.16-1.72 0-5.5-4.5-10-10-10S2 6.5 2 12s4.47 10 10 10c.59 0 1.16-.06 1.72-.16-.32-.59-.54-1.23-.64-1.92M18 15v3h-3v2h3v3h2v-3h3v-2h-3v-3z"></path></svg>
  560. </span>
  561. <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="August 4, 2023 07:21:01 UTC">August 4, 2023</span>
  562. </span>
  563. </aside>
  564. </article>
  565. </div>
  566. <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
  567. </div>
  568. </main>
  569. <footer class="md-footer">
  570. <div class="md-footer-meta md-typeset">
  571. <div class="md-footer-meta__inner md-grid">
  572. <div class="md-copyright">
  573. <div class="md-copyright__highlight">
  574. Copyright © 2012- OpenBLAS contributors
  575. </div>
  576. Made with
  577. <a href="https://squidfunk.github.io/mkdocs-material/" rel="noopener" target="_blank">
  578. Material for MkDocs
  579. </a>
  580. </div>
  581. <div class="md-social">
  582. <a class="md-social__link" href="https://github.com/OpenMathLib/OpenBLAS" rel="noopener" target="_blank" title="github.com">
  583. <svg viewbox="0 0 496 512" xmlns="http://www.w3.org/2000/svg"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"></path></svg>
  584. </a>
  585. <a class="md-social__link" href="https://github.com/OpenMathLib/OpenBLAS/LICENSE" rel="noopener" target="_blank" title="github.com">
  586. <svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 10a3.04 3.04 0 0 1 3-3 3.04 3.04 0 0 1 3 3 3.04 3.04 0 0 1-3 3 3.04 3.04 0 0 1-3-3m3 9 4 1v-3.08A7.54 7.54 0 0 1 12 18a7.54 7.54 0 0 1-4-1.08V20m4-16a5.78 5.78 0 0 0-4.24 1.74A5.78 5.78 0 0 0 6 10a5.78 5.78 0 0 0 1.76 4.23A5.78 5.78 0 0 0 12 16a5.78 5.78 0 0 0 4.24-1.77A5.78 5.78 0 0 0 18 10a5.78 5.78 0 0 0-1.76-4.26A5.78 5.78 0 0 0 12 4m8 6a8 8 0 0 1-.57 2.8A7.8 7.8 0 0 1 18 15.28V23l-6-2-6 2v-7.72A7.9 7.9 0 0 1 4 10a7.68 7.68 0 0 1 2.33-5.64A7.73 7.73 0 0 1 12 2a7.73 7.73 0 0 1 5.67 2.36A7.68 7.68 0 0 1 20 10"></path></svg>
  587. </a>
  588. </div>
  589. </div>
  590. </div>
  591. </footer>
  592. </div>
  593. <div class="md-dialog" data-md-component="dialog">
  594. <div class="md-dialog__inner md-typeset"></div>
  595. </div>
  596. <script id="__config" type="application/json">{"base": "..", "features": ["header.autohide"], "search": "../assets/javascripts/workers/search.d50fe291.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
  597. <script src="../assets/javascripts/bundle.13a4f30d.min.js"></script>
  598. <script type="module">import mermaid from "https://unpkg.com/mermaid@10.4.0/dist/mermaid.esm.min.mjs";
  599. window.mermaidConfig = {default: {
  600. startOnLoad: false
  601. }};</script></body>
  602. </html>

OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.