blob: dbbe4fc9076a1181b0ddb2a341f3fc24c87a00a7 [file] [log] [blame]
"use strict";(self.webpackChunkdoris_website=self.webpackChunkdoris_website||[]).push([[9117],{15680:(e,n,t)=>{t.d(n,{xA:()=>g,yg:()=>y});var r=t(296540);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var p=r.createContext({}),s=function(e){var n=r.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},g=function(e){var n=s(e.components);return r.createElement(p.Provider,{value:n},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},m=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,g=l(e,["components","mdxType","originalType","parentName"]),c=s(t),m=a,y=c["".concat(p,".").concat(m)]||c[m]||d[m]||i;return t?r.createElement(y,o(o({ref:n},g),{},{components:t})):r.createElement(y,o({ref:n},g))}));function y(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=m;var l={};for(var p in n)hasOwnProperty.call(n,p)&&(l[p]=n[p]);l.originalType=e,l[c]="string"==typeof e?e:a,o[1]=l;for(var s=2;s<i;s++)o[s]=t[s];return r.createElement.apply(null,o)}return r.createElement.apply(null,t)}m.displayName="MDXCreateElement"},447093:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var r=t(58168),a=(t(296540),t(15680));const i={title:"Doris BE \u5f00\u53d1\u8c03\u8bd5\u73af\u5883 -- clion",language:"zh-CN"},o=void 0,l={unversionedId:"developer-guide/be-clion-dev",id:"developer-guide/be-clion-dev",title:"Doris BE \u5f00\u53d1\u8c03\u8bd5\u73af\u5883 -- clion",description:"\x3c!--",source:"@site/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/developer-guide/be-clion-dev.md",sourceDirName:"developer-guide",slug:"/developer-guide/be-clion-dev",permalink:"/zh-CN/community/developer-guide/be-clion-dev",draft:!1,tags:[],version:"current",frontMatter:{title:"Doris BE \u5f00\u53d1\u8c03\u8bd5\u73af\u5883 -- clion",language:"zh-CN"},sidebar:"community",previous:{title:"Doris BE\u5f00\u53d1\u8c03\u8bd5\u73af\u5883 -- vscode",permalink:"/zh-CN/community/developer-guide/be-vscode-dev"},next:{title:"Doris Mac \u5f00\u53d1\u8c03\u8bd5\u51c6\u5907",permalink:"/zh-CN/community/developer-guide/mac-dev/dev-prepare"}},p={},s=[{value:"\u8fdc\u7a0b\u670d\u52a1\u5668\u4ee3\u7801\u4e0b\u8f7d\u7f16\u8bd1",id:"\u8fdc\u7a0b\u670d\u52a1\u5668\u4ee3\u7801\u4e0b\u8f7d\u7f16\u8bd1",level:2},{value:"\u672c\u5730 Clion \u5b89\u88c5\u914d\u7f6e\u8fdc\u7a0b\u5f00\u53d1\u73af\u5883",id:"\u672c\u5730-clion-\u5b89\u88c5\u914d\u7f6e\u8fdc\u7a0b\u5f00\u53d1\u73af\u5883",level:2},{value:"\u672c\u5730 Clion \u8fd0\u884c\u8c03\u8bd5\u8fdc\u7a0b BE",id:"\u672c\u5730-clion-\u8fd0\u884c\u8c03\u8bd5\u8fdc\u7a0b-be",level:2}],g={toc:s},c="wrapper";function d(e){let{components:n,...i}=e;return(0,a.yg)(c,(0,r.A)({},g,i,{components:n,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"\u4f7f\u7528-clion-\u8fdb\u884c-apache-doris-be-\u8fdc\u7a0b\u5f00\u53d1\u8c03\u8bd5"},"\u4f7f\u7528 Clion \u8fdb\u884c Apache Doris BE \u8fdc\u7a0b\u5f00\u53d1\u8c03\u8bd5"),(0,a.yg)("h2",{id:"\u8fdc\u7a0b\u670d\u52a1\u5668\u4ee3\u7801\u4e0b\u8f7d\u7f16\u8bd1"},"\u8fdc\u7a0b\u670d\u52a1\u5668\u4ee3\u7801\u4e0b\u8f7d\u7f16\u8bd1"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},"\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u4e0b\u8f7d\u4e00\u4efd Doris \u4ee3\u7801\u3002\u6bd4\u5982 Doris \u6839\u76ee\u5f55\u4e3a ",(0,a.yg)("inlineCode",{parentName:"li"},"/mnt/datadisk0/chenqi/doris"),"\u3002")),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"git clone https://github.com/apache/doris.git\n")),(0,a.yg)("ol",{start:2},(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u4fee\u6539\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a Doris \u4ee3\u7801\u6839\u76ee\u5f55\u4e0b\u7684 env.sh \u6587\u4ef6\uff0c\u5728\u5f00\u5934\u589e\u52a0 ",(0,a.yg)("inlineCode",{parentName:"p"},"DORIS_HOME")," \u7684\u914d\u7f6e\uff0c\u6bd4\u5982 ",(0,a.yg)("inlineCode",{parentName:"p"},"DORIS_HOME=/mnt/datadisk0/chenqi/doris"),"\u3002")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u6267\u884c\u76f8\u5173\u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\u3002\u5176\u4e2d\u8be6\u7ec6\u7f16\u8bd1\u8fc7\u7a0b\u53ef\u53c2\u8003",(0,a.yg)("a",{parentName:"p",href:"https://doris.apache.org/zh-CN/docs/dev/install/source-install/compilation-with-ldb-toolchain"},"\u7f16\u8bd1\u6587\u6863"),"\u3002"))),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"cd /mnt/datadisk0/chenqi/doris\n./build.sh\n")),(0,a.yg)("h2",{id:"\u672c\u5730-clion-\u5b89\u88c5\u914d\u7f6e\u8fdc\u7a0b\u5f00\u53d1\u73af\u5883"},"\u672c\u5730 Clion \u5b89\u88c5\u914d\u7f6e\u8fdc\u7a0b\u5f00\u53d1\u73af\u5883"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u5728\u672c\u5730\u4e0b\u8f7d\u5b89\u88c5 Clion\uff0c\u5bfc\u5165 Doris BE \u4ee3\u7801\u3002")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u5728\u672c\u5730\u8bbe\u7f6e\u8fdc\u7a0b\u5f00\u53d1\u73af\u5883\u3002 \u5728 Clion \u4e2d\u6253\u5f00 ",(0,a.yg)("strong",{parentName:"p"},"Preferences -> Build, Execution, Deployment -> Deployment")," \u4e2d\u6dfb\u52a0\u8fdc\u7a0b\u5f00\u53d1\u73af\u5883\u3002\n\u4f7f\u7528 ",(0,a.yg)("strong",{parentName:"p"},"SFTP")," \u6765\u6dfb\u52a0\u4e00\u4e2a\u8fdc\u7a0b\u5f00\u53d1\u670d\u52a1\u5668\u7684\u76f8\u5173\u8fde\u63a5\u767b\u9646\u4fe1\u606f\u3002\u8bbe\u7f6e ",(0,a.yg)("strong",{parentName:"p"},"Mappings")," \u8def\u5f84\u3002\n\u6bd4\u5982 Local Path \u4e3a\u672c\u5730\u8def\u5f84 ",(0,a.yg)("inlineCode",{parentName:"p"},"/User/kaka/Programs/doris/be"),"\uff0cDeployment Path \u4e3a\u8fdc\u7a0b\u670d\u52a1\u5668\u8def\u5f84 ",(0,a.yg)("inlineCode",{parentName:"p"},"/mnt/datadisk0/chenqi/clion/doris/be"),"\u3002"))),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Deployment1",src:t(655842).A,width:"2220",height:"1428"})),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Deployment2",src:t(638777).A,width:"2216",height:"1426"})),(0,a.yg)("ol",{start:3},(0,a.yg)("li",{parentName:"ol"},"\u5c06\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7f16\u8bd1\u5b8c\u6210\u7684 ",(0,a.yg)("inlineCode",{parentName:"li"},"gensrc")," \u8def\u5f84\uff0c\u6bd4\u5982 ",(0,a.yg)("inlineCode",{parentName:"li"},"/mnt/datadisk0/chenqi/doris/gensrc")," \u62f7\u8d1d\u5230 ",(0,a.yg)("strong",{parentName:"li"},"Deployment Path")," \u7684\u4e0a\u4e00\u7ea7\u76ee\u5f55\u3002\n\u6bd4\u5982\u62f7\u8d1d\u5b8c\u6700\u7ec8\u7684\u76ee\u5f55\u4e3a\u8fdc\u7a0b\u670d\u52a1\u5668\u8def\u5f84 ",(0,a.yg)("inlineCode",{parentName:"li"},"/mnt/datadisk0/chenqi/clion/doris/gensrc"),"\u3002")),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"cp -R /mnt/datadisk0/chenqi/doris/gensrc /mnt/datadisk0/chenqi/clion/doris/gensrc\n")),(0,a.yg)("ol",{start:4},(0,a.yg)("li",{parentName:"ol"},"\u5728 Clion \u4e2d\u6253\u5f00 ",(0,a.yg)("strong",{parentName:"li"},"Preferences -> Build, Execution, Deployment -> Toolchains")," \u4e2d\u6dfb\u52a0\u8fdc\u7a0b\u73af\u5883\u7684\u76f8\u5173 Toolchains\uff0c\u6bd4\u5982 cmake\u3001gcc\u3001g++\u3001gdb \u7b49\u3002\n",(0,a.yg)("strong",{parentName:"li"},"\u5176\u4e2d\u6700\u5173\u952e\u7684\u4e00\u70b9\u662f\u9700\u8981\u5728 "),"Environment file",(0,a.yg)("strong",{parentName:"li"}," \u4e2d \u586b\u5199\u8fdc\u7a0b\u670d\u52a1\u5668 Doris \u4ee3\u7801\u4e2d\u7684 "),"env.sh",(0,a.yg)("strong",{parentName:"li"}," \u6587\u4ef6\u8def\u5f84\u3002"))),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Toolchains",src:t(482722).A,width:"2226",height:"1416"})),(0,a.yg)("ol",{start:5},(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u5728 Clion \u4e2d\u6253\u5f00 ",(0,a.yg)("strong",{parentName:"p"},"Preferences -> Build, Execution, Deployment -> CMake")," \uff0c\u5728CMake options\u4e2d\u6dfb\u52a0\u7f16\u8bd1\u9009\u9879-DDORIS_JAVA_HOME=/path/to/remote/JAVA_HOME\uff0c\u5c06DORIS_JAVA_HOME\u8bbe\u7f6e\u4e3a\u8fdc\u7a0b\u670d\u52a1\u5668\u7684JAVA_HOME\u8def\u5f84\uff0c\u5426\u5219\u4f1a\u627e\u4e0d\u5230 jni.h\u3002")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u5728 Clion \u4e2d\u53f3\u952e\u70b9\u51fb ",(0,a.yg)("strong",{parentName:"p"},"Load Cmake Project"),"\u3002\u6b64\u64cd\u4f5c\u4f1a\u540c\u6b65\u4ee3\u7801\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\uff0c\u5e76\u4e14\u8c03\u7528\u751f\u6210\u76f8\u5173 Cmake Build Files\u3002"))),(0,a.yg)("h2",{id:"\u672c\u5730-clion-\u8fd0\u884c\u8c03\u8bd5\u8fdc\u7a0b-be"},"\u672c\u5730 Clion \u8fd0\u884c\u8c03\u8bd5\u8fdc\u7a0b BE"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u5728 ",(0,a.yg)("strong",{parentName:"p"},"Preferences -> Build, Execution, Deployment -> CMake")," \u4e2d\u914d\u7f6e CMake\u3002\u53ef\u4ee5\u914d\u7f6e\u7c7b\u4f3c\u4e8e Debug / Release \u7b49\u4e0d\u540c\u7684 Target\uff0c \u5176\u4e2d ",(0,a.yg)("strong",{parentName:"p"},"ToolChain")," \u9700\u8981\u9009\u62e9\u521a\u624d\u914d\u7f6e\u7684\u3002\n",(0,a.yg)("strong",{parentName:"p"},"\u5982\u679c\u8981\u8fd0\u884c\u8c03\u8bd5 Unit Test \u7684\u8bdd\uff0c\u9700\u8981\u5728 CMake Options \u4e2d\u914d\u7f6e\u4e0a ",(0,a.yg)("inlineCode",{parentName:"strong"},"-DMAKE_TEST=ON"),"\uff08\u8be5\u9009\u9879\u9ed8\u8ba4\u5173\u95ed\uff0c\u9700\u8981\u6253\u5f00\u624d\u4f1a\u7f16\u8bd1 Test \u4ee3\u7801\uff09"))),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},"\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u5c06 Doris \u6e90\u4ee3\u7801\u4e2d\u7684 ",(0,a.yg)("inlineCode",{parentName:"p"},"output")," \u76ee\u5f55\u62f7\u8d1d\u5230\u4e00\u4e2a\u5355\u72ec\u7684\u8def\u5f84\u4e0b\uff0c\u6bd4\u5982 ",(0,a.yg)("inlineCode",{parentName:"p"},"/mnt/datadisk0/chenqi/clion/doris/doris_be/"),"\u3002"))),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"cp -R /mnt/datadisk0/chenqi/doris/output /mnt/datadisk0/chenqi/clion/doris/doris_be\n")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Output Tree",src:t(296319).A,width:"814",height:"310"})),(0,a.yg)("ol",{start:3},(0,a.yg)("li",{parentName:"ol"},"\u5728 Clion \u4e2d\u9009\u62e9 doris_be \u76f8\u5173\u7684 Target\uff0c\u6bd4\u5982 ",(0,a.yg)("strong",{parentName:"li"},"Debug")," \u6216\u8005 ",(0,a.yg)("strong",{parentName:"li"},"Release"),"\uff0c\u8fdb\u884c\u914d\u7f6e\u8fd0\u884c\u3002")),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Run Debug Conf1",src:t(289033).A,width:"2074",height:"1356"})),(0,a.yg)("p",null,"\u53c2\u7167 Doris \u6839\u76ee\u5f55\u4e0b\u7684 ",(0,a.yg)("inlineCode",{parentName:"p"},"be/bin/start_be.sh")," \u4e2d export \u7684\u73af\u5883\u53d8\u91cf\u8fdb\u884c\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u3002\u5176\u4e2d\u73af\u5883\u53d8\u91cf\u7684\u503c\u6307\u5411\u8fdc\u7a0b\u670d\u52a1\u5668\u5bf9\u5e94\u7684\u8def\u5f84\u3002\n\u73af\u5883\u53d8\u91cf\u53c2\u8003\uff1a"),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Run Debug Conf2",src:t(474418).A,width:"3118",height:"796"})),(0,a.yg)("ol",{start:4},(0,a.yg)("li",{parentName:"ol"},"\u70b9\u51fb\u8fd0\u884c\u6216\u8005\u8c03\u8bd5 BE\u3002\u5176\u4e2d\u70b9\u51fb ",(0,a.yg)("strong",{parentName:"li"},"Run")," \u53ef\u4ee5\u7f16\u8bd1\u8fd0\u884c BE\uff0c\u800c\u70b9\u51fb ",(0,a.yg)("strong",{parentName:"li"},"Debug")," \u53ef\u4ee5\u7f16\u8bd1\u8c03\u8bd5 BE\u3002")))}d.isMDXComponent=!0},655842:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/clion-deployment1-a36f51febb0818fed20a02a71b697a5a.png"},638777:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/clion-deployment2-5887d4af6d031a8b484cc0dcb6399837.png"},289033:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/clion-run-debug-conf1-e57278a1580b0b96f3a9016924613981.png"},474418:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/clion-run-debug-conf2-abdc543704be6a69328c6985b0c7a36f.png"},482722:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/clion-toolchains-6160ba355a369c4a39be6dae1bede1fb.png"},296319:(e,n,t)=>{t.d(n,{A:()=>r});const r=t.p+"assets/images/doris-dist-output-tree-e5e484ba7fe826861a853756e9cb3cdc.png"}}]);