最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Specify header locations for C compiler (compiling R code with emscripten) - Stack Overflow

programmeradmin6浏览0评论

I'm relatively inexperienced piling C code. Nevertheless, I'm trying to use emscripten to pile an algorithm from the R source code into JavaScript. The function is in a file called pf.c here

Naively, I have just gone into the src directory and tried:

emcc nmath/pf.c 

This results in:

In file included from nmath/pf.c:25:
nmath/nmath.h:38:10: fatal error: 'Rconfig.h' file not found
#include <Rconfig.h>
         ^
1 error generated.
ERROR    root: piler frontend failed to generate LLVM bitcode, halting

I know where this header is:

$ find . -name "Rconfig.h"
./gnuwin32/fixed/h/Rconfig.h

My immediate question is, how do I tell the piler where this header exists? I'd like to end up with a pf function in JavaScript. Any insight into this idea would be appreciated.

I'm relatively inexperienced piling C code. Nevertheless, I'm trying to use emscripten to pile an algorithm from the R source code into JavaScript. The function is in a file called pf.c here

Naively, I have just gone into the src directory and tried:

emcc nmath/pf.c 

This results in:

In file included from nmath/pf.c:25:
nmath/nmath.h:38:10: fatal error: 'Rconfig.h' file not found
#include <Rconfig.h>
         ^
1 error generated.
ERROR    root: piler frontend failed to generate LLVM bitcode, halting

I know where this header is:

$ find . -name "Rconfig.h"
./gnuwin32/fixed/h/Rconfig.h

My immediate question is, how do I tell the piler where this header exists? I'd like to end up with a pf function in JavaScript. Any insight into this idea would be appreciated.

Share Improve this question edited Feb 15, 2015 at 1:29 Iharob Al Asimi 53k6 gold badges65 silver badges100 bronze badges asked Feb 15, 2015 at 1:29 Skylar SavelandSkylar Saveland 11.5k10 gold badges76 silver badges96 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

Use -I to add to the include search path.

emcc nmath/pf.c -Ignuwin32/fixed/h/

Regarding the overall idea... sounds weird, I don't know.

发布评论

评论列表(0)

  1. 暂无评论