apt-get安装后找不到LLVM头(LLVM header not found after apt-get install)
我使用LLVM Nightly软件包链接中提供的以下命令安装了
llvm
和clang
3.9以及所有其他软件包。sudo apt-get install clang-3.9 clang-3.9-doc llvm-3.9 llvm-3.9-dev llvm-3.9-doc llvm-3.9-examples llvm-3.9-runtime clang-format-3.9 python-clang-3.9 libclang-common-3.9-dev libclang-3.9-dev libclang1-3.9 libclang1-3.9-dbg libllvm-3.9-ocaml-dev libllvm3.9 libllvm3.9-dbg lldb-3.9 lldb-3.9-dev liblldb-3.9-dbg
然后,我尝试编译并运行本教程中的万花筒语言样例词法分析器和解析器。
但是,我无法编译给定的示例程序,因为我收到错误消息:
clang++-3.9 -g -O3 toy.cpp toy.cpp:1:10: fatal error: 'llvm/ADT/STLExtras.h' file not found #include "llvm/ADT/STLExtras.h" ^ 1 error generated.
我认为这个错误是因为LLVM被安装为
llvm-3.9
,因此所有文件都安装在以*-3.9
结尾的目录中。 我怎样才能解决这个错误,而不必删除安装,并从LLVM源手动构建安装?I installed
llvm
andclang
3.9 along with all the other packages using the below command as given in LLVM Nightly packages link.sudo apt-get install clang-3.9 clang-3.9-doc llvm-3.9 llvm-3.9-dev llvm-3.9-doc llvm-3.9-examples llvm-3.9-runtime clang-format-3.9 python-clang-3.9 libclang-common-3.9-dev libclang-3.9-dev libclang1-3.9 libclang1-3.9-dbg libllvm-3.9-ocaml-dev libllvm3.9 libllvm3.9-dbg lldb-3.9 lldb-3.9-dev liblldb-3.9-dbg
Then I tried to compile and run the sample lexer and parser for kaleidoscope language according to this tutorial.
However, I am not able to compile the given sample program, because I get the error:
clang++-3.9 -g -O3 toy.cpp toy.cpp:1:10: fatal error: 'llvm/ADT/STLExtras.h' file not found #include "llvm/ADT/STLExtras.h" ^ 1 error generated.
I think this error is because LLVM was installed as
llvm-3.9
and hence all the files were installed in directories ending with*-3.9
. How can I fix this error without having to remove the installation and do a manual build install from the LLVM source?
原文:https://stackoverflow.com/questions/40307876
最满意答案
以下是在服务中调用的一个示例方法
const express = require('express'); const app = express(); const request = require('request'); app.post('/deleteFavorites', (req, res) => { req.body = [ {"id": "123"}, {"id":"124"}, ] console.log("deleteFavorites was called?") request.delete({ url: "http://" + req.headers.host + "/favorites/delete", body: req.body, json: true }, function(error, response, body){ console.log(body, error, response); res.status(200).send("all good"); }); }); app.delete('/favorites/delete', (req, res) => { console.log("favorites/delete was called?") res.status(200).send("all good"); }); app.listen(9090);
理想的方法是通过可重用功能来完成,但由于您提到这不是一种选择,所以这是另一种可以使用的方法。
但我建议将其限制为一次调用而不是多次调用,否则可能会导致服务器发生请求爆炸。 如果您在服务器中发送100个ID
/deleteFavorites
,那么也可能会在服务器上请求导致其中大多数超时Here is an example way of calling within the service
const express = require('express'); const app = express(); const request = require('request'); app.post('/deleteFavorites', (req, res) => { req.body = [ {"id": "123"}, {"id":"124"}, ] console.log("deleteFavorites was called?") request.delete({ url: "http://" + req.headers.host + "/favorites/delete", body: req.body, json: true }, function(error, response, body){ console.log(body, error, response); res.status(200).send("all good"); }); }); app.delete('/favorites/delete', (req, res) => { console.log("favorites/delete was called?") res.status(200).send("all good"); }); app.listen(9090);
The ideal way is to do it through re-usable functions but since you mentioned that is not an option, this is another possible approach one can use.
But I would recommend to limit it to one call instead of multiple calls, else you may cause a request explosion at the server. If you send 100 ids at server in
/deleteFavorites
then that would raise too may request at server causing most of them to timeout
相关问答
更多-
如何实现删除API调用(How to implement delete api call)[2021-07-11]
是的,使用doPost(..) 。 如果你正在制作一个REST API,你可以考虑doDelete(..) Yes, use doPost(..). If you are making a REST API you can consider doDelete(..) -
在单个POST调用中直接调用多个DELETE调用?(Call multiple DELETE calls from a single POST call in express?)[2023-04-08]
以下是在服务中调用的一个示例方法 const express = require('express'); const app = express(); const request = require('request'); app.post('/deleteFavorites', (req, res) => { req.body = [ {"id": "123"}, {"id":"124"}, ] console.log("deleteFavor ... -
如果你不要求交易,你(大多数)不会得到一个。 SQL Server需要事务中的所有内容,因此,默认情况下(没有其他事务管理),对于每个单独的语句 ,SQL Server将创建一个事务并自动提交它。 因此,在您的示例中(如果没有TransactionScope ),您将获得两个单独的事务,这两个事务都是独立提交或回滚(出错时)。 (除非您在该连接上启用了IMPLICIT_TRANSACTIONS ,在这种情况下,您将获得一个事务,但最后需要显式COMMIT或ROLLBACK 。我发现使用此模式的唯一人员是从O ...
-
UserId应该在查询字符串中: var paymentServiceResponse = paymentServicePostClient .PostAsJsonAsync("api/billpayment?userId=" + userId.ToString(), payData) .Result; UserId should be in query string: var paymentS ...
-
AngularJS指令调用多次而不是一次调用(AngularJS directive calls multiple time rather than to call a single time)[2023-09-18]
将autosave逻辑移动到仅执行一次的指令工厂函数: .directive("hzAutoSaveTextarea", ['$timeout', '$interval', 'HzSocket', function ($timeout, $interval, HzSocket) { var currentElement = null; var currentVal = null, previousVal = null; $interval(function () { ... -
Express:处理多个依赖于彼此的休息api呼叫(Express: Handling multiple rest api calls which depends on one another)[2023-05-18]
像这样的东西: function task(options, done){ // options.url will have the URL; // you can add more options request.post(options.url).response(function(err, data){ if(/* successful */) done(); else request.dele ... -
$.ajax({ type: "POST", url: ajax_url, data: "{\"input\": \"" + input + "\", \"planner\": \"" + parent.userID + "\"}", contentType: "application/json; charset=utf-8", dataType: "json", processdata: true, async: false, success ...
-
您可以非常轻松地获得任务列表 - 例如: var tasks = uris.Select(async uri => { using (var client = new HttpClient()) { return await client.GetStringAsync(uri) } }) .ToList ...
-
那么任何一天我建议只拨打一个电话,而不是3个单独的电话。 正如您所提到的,您有三个不同请求的成本,另一个原因是在某些浏览器上对域的并发连接数限制(对于IE7为2)。 还要考虑您的网络服务器以及随着用户数量的增加它可以处理的最大请求。 此外,您仍然可以通过执行所有三个操作使其成为模块化,并且可以调用这三个操作并聚合结果,如果可能的话,因为我对Rails体系结构不太确定。 希望这可以帮助。 Well Any day I would suggest having a single call instead of ...
-
在laravel测试中进行多个post调用时,会忽略帖子主体(Post bodies ignored when making multiple post calls in laravel test)[2022-10-08]
经过大量的反复试验,我发现在每次http调用之后调用Facade::clearResolvedInstances()会使连续的http调用正常工作。 这似乎避免了破坏来自refreshApplication的数据库事务的副作用。 我最终包装了所有的http动词方法,以这种方式自动调用方法: public function get($uri, array $headers = []) { $ret = parent::get($uri, $headers); Facade::clearReso ...