osx - SWIG, perl, DynaLoader can't find boot_$Module on OS X -


i trying build , install swig-generated perl api on os x 10.10.2. (it's freeling 3.1 language analysis toolkit.) have generated , compiled swig files, producing freeling.so.

but when try use freeling in perl script, error:

can't find 'boot_freeling' symbol in /usr/local/lib/libfreeling.dylib @ freeling.pm line 11. 

but boot_freeling should defined in swig-generated freeling.so, not in libfreeling.dylib (the freeling package lib). (nm -u confirms this: _boot_freeling defined in freeling.so; i'm assuming leading underscore part of object file format.)

i have made sure freeling.so comes before libfreeling.dylib in ld_library_path. i've tried unshifting path freeling.so onto @dynaloader::dl_library_path.

i suspect not path problem, building os x. in past, have built on ubuntu , works fine. have tweaked gcc options (-bundle instead of -shared).


additional info:

perl -v:dlext => dlext='bundle'; 

building soso-0.01.patch.txt produces:

blib ├── blib/arch │   └── blib/arch/auto │       └── blib/arch/auto/soso │           └── blib/arch/auto/soso/soso.bundle ├── blib/bin ├── blib/lib │   ├── blib/lib/soso.pm │   └── blib/lib/auto │       └── blib/lib/auto/soso ├── blib/man1 ├── blib/man3 └── blib/script 

makefile target:

freeling.bundle: freeling_perlapi.cxx     g++ -v -bundle -o freeling.bundle freeling_perlapi.cxx -lfreeling -lperl -lboost_system -i $(freelingdir)/include -i $(boostdir)/include -i $(icu4cdir)/include -l $(freelingdir)/libfreeling -i $(perldir)/core -l $(libdir) -l $(boostdir)/lib -l $(perldir)/core -fpic 

ok, promoting answer :)

what perl -v:dlext ? when compile module soso-0.01.patch.txt files created in blib?

well :) if os/perl configured freeling.bundle, don't think going try @ freeling.so .... i'd try ... rename file use dlext


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -