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

I'm relatively inexperienced piling C code. Nevertheless, I'm trying to use emscripten to pil

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744402118a4572441.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信