Ruby - FANN is not working on linux

96 views
Skip to first unread message

Nandakumar

unread,
Sep 25, 2008, 4:19:25 PM9/25/08
to ruby_fann
When im trying to combile this file,

require 'ruby-fann'


sample.rb:1:in `require': no such file to load -- ruby-fann
(LoadError)
from sample.rb:2


I installed the FANN 2.0 & also FANN gem

can any one please help me ?

Harold

unread,
Sep 25, 2008, 4:35:13 PM9/25/08
to ruby_fann
Could you try uninstalling FANN 2.0, and compile FANN 2.1?

Nandakumar

unread,
Sep 25, 2008, 4:50:08 PM9/25/08
to ruby_fann
I have installed FANN version 2.1 .. There are lot of people getting
same kind error ..


Also, when im trying to run a simple C program ( basic example in
FANN ):

i throws,
/tmp/ccMiWz58.o: In function `main':
sample.c:(.text+0x4c): undefined reference to `fann_create_standard'
sample.c:(.text+0x5e): undefined reference to
`fann_set_activation_function_hidden'
sample.c:(.text+0x6c): undefined reference to
`fann_set_activation_function_output'
sample.c:(.text+0x8b): undefined reference to `fann_train_on_file'
sample.c:(.text+0x99): undefined reference to `fann_save'
sample.c:(.text+0xa2): undefined reference to `fann_destroy'

Steven Miers

unread,
Sep 25, 2008, 5:35:31 PM9/25/08
to ruby...@googlegroups.com
Nandakumar,

It looks like your FANN installation is not quite there, and one or
more libraries are not available to the source program. Once you get
that working, I would expect that the ruby-fann gem would also work.
What other people do you know of that are getting this same kind of
error?

What do you see when you do a "gem list | grep fann" command? Also,
to where did you install FANN 2.1? By that I mean "/usr/local", "/
usr", etc?

Regards,
-Steven

Harold A. Giménez Ch.

unread,
Sep 25, 2008, 10:16:52 PM9/25/08
to ruby...@googlegroups.com
Here's how I got this to go (on Fedora Core 8 and 9):

1. install FANN 2.1 library:
    download source code for v2.1, unzip it, and run:

./configure
make
sudo make install

At this point, make sure these files are present:
 ls /usr/local/lib |grep fann
libdoublefann.a
libdoublefann.so
libdoublefann.so.2
libdoublefann.so.2.0.1
libfann.a
libfann.so
libfann.so.2
libfann.so.2.0.1
libfixedfann.a
libfixedfann.so
libfixedfann.so.2
libfixedfann.so.2.0.1
libfloatfann.a
libfloatfann.so
libfloatfann.so.2
libfloatfann.so.2.0.1
2. sudo /sbin/ldconfig /usr/local/lib
2. install ruby-fann gem
    sudo gem install ruby-fann
3. test environment by running the example from - http://ruby-fann.rubyforge.org/


Hope it helps.

-Harold

Nandakumar

unread,
Sep 26, 2008, 6:26:40 AM9/26/08
to ruby_fann
Hi Harold,

thanks for your details.. i tried.. i got installed FANN 2.1

Is there any settings to set lib path ?

when im trying to install, i get the following

[root@fc5133247 rubygems-0.8.11]# sudo gem install ruby-fann
Attempting local installation of 'ruby-fann'
Building native extensions. This could take a while...
In file included from neural_network.c:5:
fann_augment.h:110:2: warning: no newline at end of file
neural_network.c: In function âfann_freeâ:
neural_network.c:159: warning: format â%dâ expects type âintâ, but
argument 3 has type âstruct fann *â
neural_network.c: In function âfann_training_data_freeâ:
neural_network.c:166: warning: format â%dâ expects type âintâ, but
argument 3 has type âstruct fann_train_data *â
neural_network.c: In function âfann_initializeâ:
neural_network.c:258: warning: format â%dâ expects type âintâ, but
argument 3 has type âstruct fann *â
neural_network.c:268: warning: format â%dâ expects type âintâ, but
argument 3 has type âstruct fann *â
neural_network.c:292: warning: format â%dâ expects type âintâ, but
argument 3 has type âstruct fann *â
neural_network.c:304: warning: passing argument 2 of
âfann_set_user_dataâ makes pointer from integer without a cast
neural_network.c:305: warning: format â%dâ expects type âintâ, but
argument 3 has type âfann_callback_typeâ
neural_network.c: In function âtraining_saveâ:
neural_network.c:392: warning: control reaches end of non-void
function
neural_network.c: In function âshuffleâ:
neural_network.c:401: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_num_candidate_groupsâ:
neural_network.c:1434: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_activation_steepnessesâ:
neural_network.c:1453: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_activation_functionsâ:
neural_network.c:1391: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_max_cand_epochsâ:
neural_network.c:1323: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_max_out_epochsâ:
neural_network.c:1307: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_candidate_limitâ:
neural_network.c:1291: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_weight_multiplierâ:
neural_network.c:1275: warning: control reaches end of non-void
function
neural_network.c: In function
âset_cascade_candidate_stagnation_epochsâ:
neural_network.c:1257: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_candidate_change_fractionâ:
neural_network.c:1241: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_output_stagnation_epochsâ:
neural_network.c:1227: warning: control reaches end of non-void
function
neural_network.c: In function âset_cascade_output_change_fractionâ:
neural_network.c:1211: warning: control reaches end of non-void
function
neural_network.c: In function âcascadetrain_on_dataâ:
neural_network.c:1197: warning: control reaches end of non-void
function
neural_network.c: In function âset_training_algorithmâ:
neural_network.c:946: warning: control reaches end of non-void
function
neural_network.c: In function âset_learning_momentumâ:
neural_network.c:1370: warning: control reaches end of non-void
function
neural_network.c: In function âset_learning_rateâ:
neural_network.c:1356: warning: control reaches end of non-void
function
neural_network.c: In function âreset_MSEâ:
neural_network.c:821: warning: control reaches end of non-void
function
neural_network.c: In function âtrain_on_dataâ:
neural_network.c:1125: warning: control reaches end of non-void
function
neural_network.c: In function ârandomize_weightsâ:
neural_network.c:1045: warning: control reaches end of non-void
function
neural_network.c: In function âprint_connectionsâ:
neural_network.c:1024: warning: control reaches end of non-void
function
neural_network.c: In function âset_rprop_delta_zeroâ:
neural_network.c:672: warning: control reaches end of non-void
function
neural_network.c: In function âset_rprop_delta_minâ:
neural_network.c:644: warning: control reaches end of non-void
function
neural_network.c: In function âset_rprop_delta_maxâ:
neural_network.c:658: warning: control reaches end of non-void
function
neural_network.c: In function âset_rprop_decrease_factorâ:
neural_network.c:630: warning: control reaches end of non-void
function
neural_network.c: In function âset_rprop_increase_factorâ:
neural_network.c:616: warning: control reaches end of non-void
function
neural_network.c: In function âset_quickprop_muâ:
neural_network.c:601: warning: control reaches end of non-void
function
neural_network.c: In function âset_quickprop_decayâ:
neural_network.c:585: warning: control reaches end of non-void
function
neural_network.c: In function âset_bit_fail_limitâ:
neural_network.c:569: warning: control reaches end of non-void
function
neural_network.c: In function âset_train_stop_functionâ:
neural_network.c:992: warning: control reaches end of non-void
function
neural_network.c: In function âset_train_error_functionâ:
neural_network.c:896: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_steepness_outputâ:
neural_network.c:555: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_steepness_layerâ:
neural_network.c:547: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_steepness_hiddenâ:
neural_network.c:533: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_steepnessâ:
neural_network.c:525: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_function_outputâ:
neural_network.c:496: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_function_layerâ:
neural_network.c:463: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_function_hiddenâ:
neural_network.c:443: warning: control reaches end of non-void
function
neural_network.c: In function âset_activation_functionâ:
neural_network.c:428: warning: control reaches end of non-void
function
neural_network.c: In function âinit_weightsâ:
neural_network.c:1098: warning: control reaches end of non-void
function
neural_network.c: In function âget_training_algorithmâ:
neural_network.c:954: warning: âret_valâ may be used uninitialized in
this function
neural_network.c: In function âget_network_typeâ:
neural_network.c:828: warning: âret_valâ may be used uninitialized in
this function
neural_network.c: In function âget_train_stop_functionâ:
neural_network.c:1000: warning: âret_valâ may be used uninitialized in
this function
neural_network.c: In function âget_train_error_functionâ:
neural_network.c:904: warning: âret_valâ may be used uninitialized in
this function
ruby extconf.rb install ruby-fann
checking for fann_create_standard() in -ldoublefann... yes
creating Makefile

make
x86_64-redhat-linux-gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I.
-I/usr/local/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -
mtune=generic -Wall -fPIC -c neural_network.c
x86_64-redhat-linux-gcc -shared -L"/usr/local/lib" -L"/usr/lib64" -o
neural_network.so neural_network.o -lruby -ldoublefann -lpthread -
ldl -lcrypt -lm -lc

make install
/usr/bin/install -c -m 0755 neural_network.so /usr/lib64/ruby/gems/1.8/
gems/ruby-fann-0.7.9/lib
Successfully installed ruby-fann, version 0.7.9
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__': no such file to load -- rdoc/rdoc (LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
21:in `require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:43:in
`generate_rdoc'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:
215:in `execute'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:
214:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:
214:in `execute'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:
153:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:
153:in `execute'
from /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb:49:in
`invoke'
from /usr/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:94:in
`process_args'
from /usr/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:67:in
`run'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:13:in
`run'
from /usr/bin/gem:17


On Sep 26, 7:16 am, "Harold A. Giménez Ch." <harold.gime...@gmail.com>
wrote:
> 3. test environment by running the example from -http://ruby-fann.rubyforge.org/
>
> Hope it helps.
>
> -Harold
Reply all
Reply to author
Forward
0 new messages