Giter Club home page Giter Club logo

Comments (19)

rivella50 avatar rivella50 commented on September 3, 2024

Try to install the gem with sudo, i.e.

sudo env ARCHFLAGS="-arch i386" gem install talib_ruby ...

from talib-ruby.

tonkla avatar tonkla commented on September 3, 2024

I use RVM, no need to use sudo. Thanks.

from talib-ruby.

rivella50 avatar rivella50 commented on September 3, 2024

I just tried on my OSX Mountain Lion again with RVM and Ruby 1.9.3 and it works without any problems.
The only difference i see is that my GCC Version is older (4.2.1) than yours, but since it compiled and installed the gem it should work also on your machine.
You're sure that you don't have a 64bit machine ?
Since i don't have much time at the moment you would have to look yourself what could be the problem.

from talib-ruby.

brianlong avatar brianlong commented on September 3, 2024

There are known problems with Mac OS X, Ruby, and the newer GCC.

I recall there some patches available to help resolve the problem.

Check stackoverflow.com and you should find some posts there.

I hope that helps get you in the right direction.

On Apr 3, 2013, at 9:34 AM, Valentin Treu wrote:

I just tried on my OSX Mountain Lion again with RVM and Ruby 1.9.3 and it works without any problems.
The only difference i see is that my GCC Version is older (4.2.1) than yours, but since it compiled and installed the gem it should work also on your machine.
You're sure that you don't have a 64bit machine ?
Since i don't have much time at the moment you would have to look yourself what could be the problem.


Reply to this email directly or view it on GitHub.

from talib-ruby.

rivella50 avatar rivella50 commented on September 3, 2024

Thank you, Brian.
I remember that i've also heard about these problems.
@tonkla: If you find a solution it would be nice if you could post a hint here, then others can profit as well. Thank you.

from talib-ruby.

tonkla avatar tonkla commented on September 3, 2024

The problem is about Linux's shared libraries. Some Python TA-Lib users got the similar error. Thanks for your cool work and kindly answers.

from talib-ruby.

rmldj avatar rmldj commented on September 3, 2024

I have exactly the same problem. However in my case the issue is not the same as in the Python TA-Lib discussion mentioned above. In my case /usr/local/lib is in the library search path and I can see that libta_lib.so is in the output of ldconfig -v

The talib-ruby installation went as follows:

romuald@erato ~ $ env ARCHFLAGS="-arch x86_64" gem install talib_ruby -- --with-talib-include=/usr/local/include/ta-lib --with-talib-lib=/usr/local/lib
Fetching: talib_ruby-1.0.5.gem (100%)
Building native extensions with: '--with-talib-include=/usr/local/include/ta-lib --with-talib-lib=/usr/local/lib'
This could take a while...
Successfully installed talib_ruby-1.0.5
Parsing documentation for talib_ruby-1.0.5
unable to convert "\xEC" from ASCII-8BIT to UTF-8 for lib/talib.so, skipping
Installing ri documentation for talib_ruby-1.0.5
1 gem installed

The example script failed as before

ruby: symbol lookup error: /home/romuald/.rvm/gems/ruby-2.0.0-p0/gems/talib_ruby-1.0.5/lib/talib.so: undefined symbol: TA_GetFuncHandle

The mkmf.log file opens with

 have_library: checking for TA_Initialize() in -lta_lib... -------------------- no

The final conftest in mkmf.log also gave some weird errors

"gcc -o conftest -I/home/romuald/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/x86_64-linux -I/home/romuald/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/backward -I/home/romuald/.rvm/rubies/
ruby-2.0.0-p0/include/ruby-2.0.0 -I. -I/usr/local/include/ta-lib  -I/home/romuald/.rvm/usr/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-lon
g -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L/home/romuald/.rvm/rubi
es/ruby-2.0.0-p0/lib -Wl,-R/home/romuald/.rvm/rubies/ruby-2.0.0-p0/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/home/romuald/.rvm/usr/lib -Wl,-R/home/romuald/.rvm/usr/lib -L. -fstack-protector -
rdynamic -Wl,-export-dynamic -L/home/romuald/.rvm/usr/lib  -Wl,-R/home/romuald/.rvm/usr/lib      -Wl,-R -Wl,/home/romuald/.rvm/rubies/ruby-2.0.0-p0/lib -L/home/romuald/.rvm/rubies/ruby-2.0.0-p0/
lib -lruby -lta_lib  -lpthread -lrt -ldl -lcrypt -lm   -lc"
conftest.c: In function ‘t’:
conftest.c:6:1: warning: implicit declaration of function ‘TA_Initialize’ [-Wimplicit-function-declaration]
/usr/local/lib/libta_lib.so: undefined reference to `sinh'
/usr/local/lib/libta_lib.so: undefined reference to `sincos'

...

/usr/local/lib/libta_lib.so: undefined reference to `floor'
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main(void) {return 0;}
5: extern int t(void);
6: int t(void) { TA_Initialize(); return 0; }
/* end */

from talib-ruby.

rivella50 avatar rivella50 commented on September 3, 2024

I have never seen these errors before.
Does this also happen with another ruby version (1.8.7 or 1.9.x) ?
What operating system do you have ?

from talib-ruby.

rmldj avatar rmldj commented on September 3, 2024

I have linux mint 14. I used rvm to install ruby-2.0.0. I'll try to see if I can switch to an older version then.

from talib-ruby.

rivella50 avatar rivella50 commented on September 3, 2024

That would be interesting.
I can tell you that on my OSX Mountain Lion the library works fine for all current Ruby versions.
Unfortunately i don't have a Linux environment here to test your problem.

from talib-ruby.

rmldj avatar rmldj commented on September 3, 2024

I just installed ruby-1.9.3 using rvm, switched to it and installed the talib-ruby gem. Unfortunately I get the same errors as before (apart from the ASCII-8BIT to UTF-8 issue which went away during installation).

from talib-ruby.

rivella50 avatar rivella50 commented on September 3, 2024

Ok then it's not Ruby. Therefore there's something wrong (or missing) with how you installed talib or there's a problem with the (newer) gcc version you have on your system.
Please check the links above tonkla provided. Perhaps you find there some hints how to get it work.

from talib-ruby.

rmldj avatar rmldj commented on September 3, 2024

Thanks! Indeed this is a problem with the Linux ta-lib installation (ta-lib-0.4.0-src.tar.gz from the talib download page). Finally I figured out that one has to compile the talib library with an additional flag for linking in the math library - this was not the default of .configure.

So I had to use

./configure  LDFLAGS="-lm"
make
sudo make install

After I did that, I reinstalled the talib-ruby gem and the example program is now working!

from talib-ruby.

rivella50 avatar rivella50 commented on September 3, 2024

Very nice, i'm glad that it's working now on your machine, too.
Thanks for the explanation, i'm sure others can profit from that.

from talib-ruby.

tonkla avatar tonkla commented on September 3, 2024

Thanks @rmldj for your solution. Adding LDFLAGS="-lm" works like a charm. Actually, I still can't solve this problem for talib_ruby. How do you find the clue? Thanks.

from talib-ruby.

rmldj avatar rmldj commented on September 3, 2024

So this does not solve the problem in your case?
I looked at the mkmf.log log file in the build directory for the talib_ruby extension

.rvm/gems/ruby-2.0.0-p0/gems/talib_ruby-1.0.5/ext/talib

There, I had undefined references to mathematical functions in /usr/local/lib/libta_lib.so (see the excerpt in my first post).

from talib-ruby.

tonkla avatar tonkla commented on September 3, 2024

@rmldj Sorry, I mean since I have closed this issue. Now, my problem has been solved by your solution 👍

from talib-ruby.

WealthCity avatar WealthCity commented on September 3, 2024

Still getting this error after doing the above...

ruby: symbol lookup error: /usr/local/rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0/talib_ruby-1.0.6/talib.so: undefined symbol: TA_GetFuncHandle

from talib-ruby.

klepsydra avatar klepsydra commented on September 3, 2024

@WealthCity At first I had the same problem. It seemed that recompiling 'ta-lib' with the math library & reinstalling the ruby gem 'talib_ruby' didn't work.

So I tried cleaning my env in both steps, then is worked:

# cd /usr/local/src/ta-lib
# make clean  ## I had skipped this before the 1st time I recompiled/relinked with LDFLAGS="-lm" 
# (date; umask 000; set -x;  time ./configure  LDFLAGS="-lm"   --prefix=/usr/local; time make; time make install)  |tee -a /tmp/ruby.gem.update.log

# ldconfig -v |tee /tmp/ldconfig.log   # just in case.


$ gem uninstall   talib_ruby  # Previously I hadn't tried this either, before reinstalling.
$ (date; time gem install --verbose  talib_ruby  ) |tee -a /tmp/ruby.gem.update.log

Now for a quick test:

$  ruby -e "require 'talib_ruby'; l = TaLib::Function.new('MA') "

No more

ruby: symbol lookup error: /usr/local/rvm/gems/ruby-2.2.1/gems/talib_ruby-1.0.6/lib/talib.so: undefined symbol: TA_GetFuncHandle

so this means it must have worked.

from talib-ruby.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.