Skip to content

Commit

Permalink
Rename stadenio module - now it links against Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Jan 31, 2009
1 parent 9afb82b commit a76f79a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 6 deletions.
36 changes: 36 additions & 0 deletions doc/wikitex/MAPPING_TRICKS.tex
Expand Up @@ -21,6 +21,18 @@

rm CMakeCache.txt ; cmake .

=== Naming modules ===

The way BioLib uses CMake and SWIG depends on a strict naming
convention of modules. There is no freedom. The location of C sources
for a C library with name 'module' and version 1.0 is in:

./src/clibs/module-1.0

The Ruby mapping module is in:

./src/bindings/swig/ruby/module

=== Debugging CMake ===

CMake can be run at any level in the tree. Start from the
Expand Down Expand Up @@ -60,6 +72,17 @@
cmake .
make
It may also be necessary to remove the shared libraries installed in
your Ruby/Perl/Python etc. tree. Unfortunately, because of naming
conventions, it is hard to version those, so make sure they don't link
in by accident. Typically:
rm /usr/lib/ruby/1.8/i486-linux/biolib/example.so
or
rm /usr/lib/ruby/1.8/i486-linux/biolib/*
As a convention the shared libraries are built in
./src/clibs/module-1.0/build, so the mapper can find them easily. E.g.
Expand Down Expand Up @@ -100,3 +123,16 @@
there will be a mismatch between the names in
./src/clibs/module-version and the build/libmodule-version.so names.
=== undefined symbol Init_module ===
A message like:
../stadenio/staden_io_lib.so: ../stadenio/staden_io_lib.so: undefined symbol: Init_staden_io_lib - ../stadenio/staden_io_lib.so (LoadError)
indicates another naming problem. A grep in the module gives:
ruby_staden_io_libRUBY_wrap.cxx:#define SWIG_init Init_stadenio
which shows the Init function naming does not match the module
(stadenio rather than staden_io_lib).
2 changes: 1 addition & 1 deletion src/bindings/swig/ruby/CMakeLists.txt
@@ -1,3 +1,3 @@
add_subdirectory (example)
add_subdirectory (affyio)
add_subdirectory (stadenio)
add_subdirectory (staden_io_lib)
@@ -1,4 +1,4 @@
# Make biolib_ruby_staden-io_lib module
# Make biolib_ruby_staden_io_lib module

cmake_minimum_required(VERSION 2.6)
ENABLE_TESTING()
Expand All @@ -18,7 +18,7 @@ INCLUDE(CMakeBackwardCompatibilityC)

FIND_PACKAGE(BioLibRuby)

# ADD_TEST(TestRubyAffyio ${RUBY_EXECUTABLE} -I../${M_NAME} ./../test/test_${M_NAME}.rb)
ADD_TEST(TestRubyAffyio ${RUBY_EXECUTABLE} -I../${M_NAME} ./../test/test_${M_NAME}.rb)

INSTALL(TARGETS ${M_MODULE}
LIBRARY DESTINATION ${RUBY_LIB_PATH}/biolib
Expand Down
3 changes: 3 additions & 0 deletions src/bindings/swig/ruby/staden_io_lib/ruby_staden_io_lib.i
@@ -0,0 +1,3 @@
%module staden_io_lib

%include ../../staden_io_lib.i
3 changes: 0 additions & 3 deletions src/bindings/swig/ruby/stadenio/ruby_staden_io_lib.i

This file was deleted.

6 changes: 6 additions & 0 deletions src/bindings/swig/ruby/test/test_staden_io_lib.rb
@@ -0,0 +1,6 @@

require 'staden_io_lib'

# result = Biolib::Example.my_mod(7,3)
# print "Biolib::Example.my_mod(7,3) renders #{result}\n"
exit 0
File renamed without changes.

0 comments on commit a76f79a

Please sign in to comment.