Closed ld4lpha closed 12 years ago
Yes i can, you have to name the directories for headers and libs of talib when installing that gem. First make sure that you have installed the MacPorts library 'talib'. Next you have to find the directories where the headers and libraries of talib are installed. Depending on your Platform (i386 or x86_64) your install call looks like this:
sudo env ARCHFLAGS="-arch PLATFORM" gem install talib_ruby -- --with-talib-include=ABSOLUTE_PATH_TO_TALIB_HEADERS --with-talib-lib=ABSOLUTE_PATH_TO_TALIB_LIBS
Here you see all these instructions: https://github.com/rivella50/talib-ruby Then it should also work on Debian. Bests Valentin
I'm hoping you can offer some insight as to what might be going on here (see output below). My guess is that the issue is with the line, "talib.c:2:25: error: ta_abstract.h: No such file or directory". I've installed ta-lib-dev, which I thought would take care of these dependencies, but perhaps not. Thoughts?
sudo gem install talib_ruby Building native extensions. This could take a while... ERROR: Error installing talib_ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb checking for TA_Initialize() in -lta_lib... no creating Makefile
make gcc -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c talib.c talib.c:2:25: error: ta_abstract.h: No such file or directory talib.c:30: error: expected specifier-qualifier-list before ‘TA_ParamHolder’ talib.c:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token talib.c: In function ‘ta_func_param_info’: talib.c:57: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:57: error: (Each undeclared identifier is reported only once talib.c:57: error: for each function it appears in.) talib.c:57: error: expected ‘;’ before ‘ret_code’ talib.c:58: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token talib.c:58: error: ‘handle’ undeclared (first use in this function) talib.c:60: error: ‘ret_code’ undeclared (first use in this function) talib.c:61: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token talib.c:67: error: ‘param_info’ undeclared (first use in this function) talib.c:77: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token talib.c:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token talib.c: In function ‘init_tables’: talib.c:118: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:118: error: expected ‘;’ before ‘ret_code’ talib.c:120: error: ‘TA_StringTable’ undeclared (first use in this function) talib.c:120: error: ‘group_table’ undeclared (first use in this function) talib.c:123: error: ‘ret_code’ undeclared (first use in this function) talib.c:124: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c:127: error: ‘function_table’ undeclared (first use in this function) talib.c: In function ‘ta_func_free’: talib.c:160: error: ‘ParamHolder’ has no member named ‘in’ talib.c:160: error: ‘ParamHolder’ has no member named ‘in’ talib.c:161: error: ‘ParamHolder’ has no member named ‘out’ talib.c:161: error: ‘ParamHolder’ has no member named ‘out’ talib.c:162: error: ‘ParamHolder’ has no member named ‘p’ talib.c: In function ‘ta_func_initialize’: talib.c:184: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:184: error: expected ‘;’ before ‘ret_code’ talib.c:185: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token talib.c:185: error: ‘handle’ undeclared (first use in this function) talib.c:186: error: ‘TA_ParamHolder’ undeclared (first use in this function) talib.c:186: error: ‘ta_param_holder’ undeclared (first use in this function) talib.c:191: error: ‘ret_code’ undeclared (first use in this function) talib.c:192: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c:197: error: ‘ParamHolder’ has no member named ‘p’ talib.c: In function ‘ta_func_get_input_count’: talib.c:210: error: invalid type argument of ‘->’ (have ‘int’) talib.c: In function ‘ta_func_get_option_input_count’: talib.c:218: error: invalid type argument of ‘->’ (have ‘int’) talib.c: In function ‘ta_func_get_output_count’: talib.c:226: error: invalid type argument of ‘->’ (have ‘int’) talib.c: In function ‘ta_func_setup_in_integer’: talib.c:283: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:283: error: expected ‘;’ before ‘ret_code’ talib.c:287: error: ‘ret_code’ undeclared (first use in this function) talib.c:287: error: ‘ParamHolder’ has no member named ‘p’ talib.c:288: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_setup_in_real’: talib.c:299: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:299: error: expected ‘;’ before ‘ret_code’ talib.c:303: error: ‘ParamHolder’ has no member named ‘in’ talib.c:305: error: ‘ret_code’ undeclared (first use in this function) talib.c:305: error: ‘ParamHolder’ has no member named ‘p’ talib.c:306: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_setup_in_price’: talib.c:312: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:312: error: expected ‘;’ before ‘ret_code’ talib.c:315: error: ‘ParamHolder’ has no member named ‘in’ talib.c:316: error: ‘ret_code’ undeclared (first use in this function) talib.c:316: error: ‘ParamHolder’ has no member named ‘p’ talib.c:317: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_setup_opt_in_integer’: talib.c:328: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:328: error: expected ‘;’ before ‘ret_code’ talib.c:331: error: ‘ret_code’ undeclared (first use in this function) talib.c:331: error: ‘ParamHolder’ has no member named ‘p’ talib.c:332: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_setup_opt_in_real’: talib.c:343: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:343: error: expected ‘;’ before ‘ret_code’ talib.c:347: error: ‘ret_code’ undeclared (first use in this function) talib.c:347: error: ‘ParamHolder’ has no member named ‘p’ talib.c:348: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_setup_out_real’: talib.c:359: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:359: error: expected ‘;’ before ‘ret_code’ talib.c:367: error: ‘ParamHolder’ has no member named ‘out’ talib.c:370: error: ‘ret_code’ undeclared (first use in this function) talib.c:370: error: ‘ParamHolder’ has no member named ‘p’ talib.c:371: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_setup_out_integer’: talib.c:377: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:377: error: expected ‘;’ before ‘ret_code’ talib.c:385: error: ‘ParamHolder’ has no member named ‘out’ talib.c:388: error: ‘ret_code’ undeclared (first use in this function) talib.c:388: error: ‘ParamHolder’ has no member named ‘p’ talib.c:389: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘ta_func_call’: talib.c:400: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:400: error: expected ‘;’ before ‘ret_code’ talib.c:402: error: ‘TA_Integer’ undeclared (first use in this function) talib.c:402: error: expected ‘;’ before ‘out_start’ talib.c:407: error: ‘ret_code’ undeclared (first use in this function) talib.c:407: error: ‘ParamHolder’ has no member named ‘p’ talib.c:407: error: ‘out_start’ undeclared (first use in this function) talib.c:407: error: ‘out_num’ undeclared (first use in this function) talib.c:408: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c:417: error: ‘ParamHolder’ has no member named ‘out’ talib.c: In function ‘ta_func_lookback’: talib.c:426: error: ‘TA_RetCode’ undeclared (first use in this function) talib.c:426: error: expected ‘;’ before ‘ret_code’ talib.c:428: error: ‘TA_Integer’ undeclared (first use in this function) talib.c:428: error: expected ‘;’ before ‘out_lookback’ talib.c:431: error: ‘ret_code’ undeclared (first use in this function) talib.c:431: error: ‘ParamHolder’ has no member named ‘p’ talib.c:431: error: ‘out_lookback’ undeclared (first use in this function) talib.c:432: error: ‘TA_SUCCESS’ undeclared (first use in this function) talib.c: In function ‘Init_talib’: talib.c:446: error: ‘TA_Input_Price’ undeclared (first use in this function) talib.c:447: error: ‘TA_Input_Real’ undeclared (first use in this function) talib.c:448: error: ‘TA_Input_Integer’ undeclared (first use in this function) talib.c:449: error: ‘TA_IN_PRICE_OPEN’ undeclared (first use in this function) talib.c:450: error: ‘TA_IN_PRICE_HIGH’ undeclared (first use in this function) talib.c:451: error: ‘TA_IN_PRICE_LOW’ undeclared (first use in this function) talib.c:452: error: ‘TA_IN_PRICE_CLOSE’ undeclared (first use in this function) talib.c:453: error: ‘TA_IN_PRICE_VOLUME’ undeclared (first use in this function) talib.c:454: error: ‘TA_IN_PRICE_OPENINTEREST’ undeclared (first use in this function) talib.c:455: error: ‘TA_IN_PRICE_TIMESTAMP’ undeclared (first use in this function) talib.c:456: error: ‘TA_OptInput_RealRange’ undeclared (first use in this function) talib.c:457: error: ‘TA_OptInput_RealList’ undeclared (first use in this function) talib.c:458: error: ‘TA_OptInput_IntegerRange’ undeclared (first use in this function) talib.c:459: error: ‘TA_OptInput_IntegerList’ undeclared (first use in this function) talib.c:460: error: ‘TA_OPTIN_IS_PERCENT’ undeclared (first use in this function) talib.c:461: error: ‘TA_OPTIN_IS_DEGREE’ undeclared (first use in this function) talib.c:462: error: ‘TA_OPTIN_IS_CURRENCY’ undeclared (first use in this function) talib.c:463: error: ‘TA_OPTIN_ADVANCED’ undeclared (first use in this function) talib.c:464: error: ‘TA_Output_Real’ undeclared (first use in this function) talib.c:465: error: ‘TA_Output_Integer’ undeclared (first use in this function) talib.c:466: error: ‘TA_OUT_LINE’ undeclared (first use in this function) talib.c:467: error: ‘TA_OUT_DOT_LINE’ undeclared (first use in this function) talib.c:468: error: ‘TA_OUT_DASH_LINE’ undeclared (first use in this function) talib.c:469: error: ‘TA_OUT_DOT’ undeclared (first use in this function) talib.c:470: error: ‘TA_OUT_HISTO’ undeclared (first use in this function) talib.c:471: error: ‘TA_OUT_PATTERN_BOOL’ undeclared (first use in this function) talib.c:472: error: ‘TA_OUT_PATTERN_BULL_BEAR’ undeclared (first use in this function) talib.c:473: error: ‘TA_OUT_PATTERN_STRENGTH’ undeclared (first use in this function) talib.c:474: error: ‘TA_OUT_POSITIVE’ undeclared (first use in this function) talib.c:475: error: ‘TA_OUT_NEGATIVE’ undeclared (first use in this function) talib.c:476: error: ‘TA_OUT_ZERO’ undeclared (first use in this function) talib.c:477: error: ‘TA_OUT_UPPER_LIMIT’ undeclared (first use in this function) talib.c:478: error: ‘TA_OUT_LOWER_LIMIT’ undeclared (first use in this function) talib.c:479: error: ‘TA_MAType_SMA’ undeclared (first use in this function) talib.c:480: error: ‘TA_MAType_EMA’ undeclared (first use in this function) talib.c:481: error: ‘TA_MAType_WMA’ undeclared (first use in this function) talib.c:482: error: ‘TA_MAType_DEMA’ undeclared (first use in this function) talib.c:483: error: ‘TA_MAType_TEMA’ undeclared (first use in this function) talib.c:484: error: ‘TA_MAType_TRIMA’ undeclared (first use in this function) talib.c:485: error: ‘TA_MAType_KAMA’ undeclared (first use in this function) talib.c:486: error: ‘TA_MAType_MAMA’ undeclared (first use in this function) talib.c:487: error: ‘TA_MAType_T3’ undeclared (first use in this function) make: *\ [talib.o] Error 1
Gem files will remain installed in /var/lib/gems/1.8/gems/talib_ruby-1.0.3 for inspection. Results logged to /var/lib/gems/1.8/gems/talib_ruby-1.0.3/ext/talib/gem_make.out