{"id":289613,"date":"2024-01-22T05:12:19","date_gmt":"2024-01-21T21:12:19","guid":{"rendered":"https:\/\/lrxjmw.cn\/lazixtzrhcgb.html"},"modified":"2024-01-22T05:12:19","modified_gmt":"2024-01-21T21:12:19","slug":"lazixtzrhcgb","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lazixtzrhcgb.html","title":{"rendered":"linux\u5b89\u88c5infer Linux\u7cfb\u7edf\u4e2d\u5982\u4f55\u6210\u529f\u90e8\u7f72\u5e76\u5145\u5206\u5229\u7528Infer\uff1f\u6559\u4f603\u6b65\u641e\u5b9a"},"content":{"rendered":"

\u5728\u6ee1\u8db3\u5927\u5bb6\u5bf9\u63d0\u9ad8\u4ee3\u7801\u7a33\u5b9a\u5ea6\u4e0e\u8d28\u91cf\u7684\u9700\u6c42\u4e0a\uff0c\u201cInfer\u201d\u4f5c\u4e3a\u9ad8\u6548\u5353\u8d8a\u7684\u9759\u6001\u5206\u6790\u5de5\u5177\u6709\u5176\u72ec\u7279\u7684\u4ef7\u503c\u3002\u63a5\u4e0b\u6765\u5e38\u7528linux\u7cfb\u7edf\uff0c\u4e0d\u59a8\u8ba9\u6211\u4ee5\u5f00\u53d1\u8005\u89c6\u89d2\uff0c\u4e3a\u60a8\u4ecb\u7ecd\u5982\u4f55\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\u6210\u529f\u90e8\u7f72\u5e76\u5145\u5206\u5229\u7528\u201cInfer\u201d\u5566\uff01<\/p>\n

1.\u4e0b\u8f7dinfer<\/b><\/p>\n

\u5c0a\u656c\u7684\u7528\u6237\u7ea2\u65d7 linux\uff0c\u6211\u4eec\u63a8\u8350\u60a8\u8bbf\u95eeinfer\u5b98\u7f51\u4e0a\u4f20\u6e20\u9053()\u67e5\u627e\u4e0e\u60a8\u7535\u8111OS\u517c\u5bb9\u7684\u6700\u65b0\u7248\u672c\uff0c\u5e76\u6309\u7167\u63d0\u793a\u5b8c\u6210\u6b63\u786e\u7684\u4e0b\u8f7d\u548c\u89e3\u538b\u7f29\u5904\u7406\u3002\u6700\u7ec8\uff0c\u5e0c\u671b\u60a8\u80fd\u591f\u987a\u5229\u5730\u5b89\u88c5\u8be5\u8f6f\u4ef6\uff0c\u4eab\u53d7\u5230\u5b83\u5e26\u6765\u7684\u4fbf\u5229\u3002<\/p>\n

2.\u89e3\u538b\u5b89\u88c5\u5305<\/b><\/p>\n

\u975e\u5e38\u611f\u6fc0\u60a8\u4e0b\u8f7d\u5e76\u51c6\u5907\u5b89\u88c5\u534e\u4e3a\u5171\u4eab\u4e91\u8d44\u6e90\u4e2d\u5fc3\u8f6f\u4ef6\u5305\u3002\u4e3a\u4fdd\u8bc1\u987a\u5229\u8fdb\u884c\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6d41\u7a0b\u89e3\u538b\u7f29\u5e76\u653e\u7f6e\u5230\u5408\u9002\u7684\u76ee\u6807\u8def\u5f84\u3002\u8bf7\u4f7f\u7528\u7535\u8111\u4e2d\u7684\u547d\u4ee4<\/a>\u884c\u7ec8\u7aef\uff0c\u7167\u7740\u4e0b\u5217\u63d0\u793a\u64cd\u4f5c\u5373\u53ef\u5b8c\u6210\u3002<\/p>\n

```<\/p>\n

tar -xvf infer.tar.xz<\/p>\n

3.\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/a><\/b><\/p>\n

\u4e3a\u7b80\u4fbf\u8fdb\u884c\u63a8\u7406\u6307\u4ee4\u64cd\u4f5c\uff0c\u6211\u4eec\u5efa\u8bae\u60a8\u9996\u5148\u5728\u7ec8\u7aef\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u7f16\u8f91bashrc\u6587\u4ef6\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u8bf7\u52a1\u5fc5\u786e\u4fdd\u6b64\u6587\u4ef6\u7684\u8def\u5f84\u5df2\u88ab\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8bc6\u522b\u7684\u5230\u3002<\/p>\n

vi ~\/.bashrc<\/p>\n

\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n

\u656c\u7231\u7684\u670b\u53cb\uff0c\u60a8\u597d\uff01\u5e0c\u671b\u80fd\u5728\u60a8\u7684\u7cfb\u7edf\u4e2d\u76f4\u63a5\u5c06\u6211\u4eec\u516c\u53f8\u7684\u8def\u5f84\u6dfb\u52a0\u5230$PATH\u53d8\u91cf\uff0c\u4f4d\u7f6e\u4e3a\uff1a$PATH:\/\/path\/to\/our\/dir\u3002\u975e\u5e38\u611f\u8c22\u60a8\u7684\u5408\u4f5c\u4e0e\u652f\u6301\uff01<\/p>\n

\u4fdd\u5b58\u5e76\u9000\u51fabashrc\u6587\u4ef6\u540elinux\u5b89\u88c5infer<\/strong>\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u73af\u5883\u53d8\u91cf\u751f\u6548\uff1a<\/p>\n

source ~\/.bashrc<\/p>\n

4.\u5b89\u88c5\u4f9d\u8d56\u5e93<\/b><\/p>\n

\u5c0a\u656c\u7684\u60a8\uff0c\u5e0c\u671b\u80fd\u6309\u7167\u4ee5\u4e0b\u8be6\u7ec6\u6d41\u7a0b\uff0c\u987a\u5229\u5730\u5b89\u88c5\u5e76\u8fd0\u7528\u6570\u4e2a\u5fc5\u8981\u7684\u4f9d\u8d56\u5e93\uff0c\u63d0\u5347Infer\u7684\u6027\u80fd\u8868\u73b0\u3002<\/p>\n

\u8bf7\u60a8\u597d\u5947\u5730\u5c1d\u8bd5\u4e00\u4e0b\u5427\uff01\u7b80\u5355\u7684\u4e00\u6761\u547d\u4ee4\"sudo apt-get install -yclang llvm python3-pip\"\u5c31\u53ef\u4ee5\u8f7b\u677e\u5e2e\u60a8\u5b8c\u6210Clang\u548cLLVM\u4ee5\u53caPython 3 PIP\u4e09\u6b3e\u8f6f\u4ef6\u7684\u5b89\u88c5\u54e6~\u795d\u60a8\u4f7f\u7528\u6109\u5feb\uff01<\/p>\n

5.\u5b89\u88c5infer<\/b><\/p>\n

\u5b89\u88c5Infer\u975e\u5e38\u7b80\u5355\u5566\uff01\u60a8\u53ea\u9700\u8f7b\u677e\u70b9\u51fbpip\u547d\u4ee4\u5373\u53ef\u5b89\u88c5\u6210\u529f\u3002\u9996\u5148\u8bf7\u542f\u52a8\u7ec8\u7aef\u7a97\u53e3\uff0c\u5e76\u6839\u636e\u5c4f\u5e55\u63d0\u793a\u8fdb\u884c\u76f8\u5e94\u64cd\u4f5c\u54e6\u3002<\/p>\n

pip3 install infer<\/p>\n

\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u540elinux\u5b89\u88c5infer<\/strong>\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528infer\u4e86\u3002<\/p>\n

6.\u4f7f\u7528infer<\/b><\/p>\n

\u5728\u4ee3\u7801\u5206\u6790\u9886\u57df\uff0c\u6211\u4eec\u4e3a\u60a8\u63d0\u4f9b\u4e86\u5927\u91cf\u4e14\u5b9e\u7528\u7684\u6307\u4ee4\u4e0e\u9009\u9879\uff0c\u8bf7\u53c2\u8003\u4ee5\u4e0b\u51e0\u79cd\u5e38\u7528\u4e14\u4fbf\u6377\u7684Infer\u547d\u4ee4\u793a\u4f8b\uff1a<\/p>\n

-\u68c0\u67e5\u5355\u4e2a\u6587\u4ef6\uff1a<\/p>\n

infer -- clang -c file.c<\/p>\n

-\u68c0\u67e5\u6574\u4e2a\u9879\u76ee\uff1a<\/p>\n

infer -- make<\/p>\n

-\u751f\u6210\u62a5\u544a\uff1a<\/p>\n

infer -- report<\/p>\n

-\u5ffd\u7565\u7279\u5b9a\u6587\u4ef6\u6216\u76ee\u5f55\uff1a<\/p>\n

\u5728\u57fa\u7840\u76ee\u5f55\u4e2d\u521b\u5efa\"inferconfig\"\u683c\u5f0f\u7684\u914d\u7f6e\u6587\u4ef6\uff1b<\/p>\n

2.\u8bf7\u660e\u786e\u89c4\u5b9a\u9700\u5ffd\u7565\u7684\u6587\u4ef6\u53ca\u76ee\u5f55\u8def\u5f84\u3002<\/b><\/p>\n

7.\u4f18\u5316\u4ee3\u7801\u8d28\u91cf<\/b><\/p>\n

\u5229\u7528Infer\u51fa\u8272\u7684\u9759\u6001\u4ee3\u7801\u5206\u6790\u529f\u80fd\uff0c\u80fd\u5feb\u901f\u7cbe\u51c6\u53d1\u73b0\u5e76\u4fee\u590d\u4ee3\u7801\u9690\u60a3\uff0c\u4ece\u800c\u6709\u6548\u63d0\u9ad8\u7f16\u7801\u6280\u80fd\u4e0e\u4ee3\u7801\u8d28\u91cf\u3002\u5728\u6b64\u63d0\u9192\u5e7f\u5927\u7528\u6237\u5728\u5e73\u65f6\u5de5\u4f5c\u65f6\uff0c\u4e0d\u59a8\u591a\u501a\u8d56\u6b64\u5de5\u5177\u8fdb\u884c\u8f6f\u4ef6\u6821\u5bf9\uff0c\u6839\u636e\u6d4b\u8bd5\u62a5\u544a\u6240\u63d0\u4f9b\u7684\u6307\u5bfc\u610f\u89c1\uff0c\u8fdb\u4e00\u6b65\u4f18\u5316\u60a8\u7684\u4ee3\u7801\u3002<\/p>\n

\u611f\u8c22\u60a8\u9075\u5b88\u6b64\u6559\u7a0b\uff0c\u5b66\u4f1a\u4e86\u5982\u4f55\u4f7f\u7528Infer\u8f6f\u4ef6\uff0c\u5e0c\u671b\u8fd9\u4e9b\u65b0\u6280\u5de7\u80fd\u5e2e\u52a9\u63d0\u5347\u60a8\u7684\u7f16\u7a0b\u6c34\u5e73\u548c\u8f6f\u4ef6\u7a33\u5b9a\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u63a5\u4e0b\u6765\uff0c\u4e0d\u59a8\u8ba9\u6211\u4ee5\u5f00\u53d1\u8005\u89c6\u89d2\uff0c\u4e3a\u60a8\u4ecb\u7ecd\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e2d\u6210\u529f\u90e8\u7f72\u5e76\u5145\u5206\u5229\u7528\u201cInfer\u201d\u5566\uff01\u4e3a\u4fdd\u8bc1\u987a\u5229\u8fdb\u884c\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6d41\u7a0b\u89e3\u538b\u7f29\u5e76\u653e\u7f6e\u5230\u5408\u9002\u7684\u76ee\u6807\u8def\u5f84\u3002\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528infer\u4e86\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-289613","post","type-post","status-publish","format-standard","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=289613"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289613\/revisions"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=289613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=289613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=289613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}