HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> Announcements >> [ANNOUNCEMENT] HyPhy as a library
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1209440092

Message started by Sergei on Apr 28th, 2008 at 8:34pm

Title: [ANNOUNCEMENT] HyPhy as a library
Post by Sergei on Apr 28th, 2008 at 8:34pm
Dear HyPhy users,

There has been some interest in having HyPhy available as a 'headless' library that could be plugged into scripting languages and other code. I have created a source distribution that (thanks to the excellent SWIG package) can be compiled as a shared library and used as modules for other languages (the included link has bindings for R and Python). Other languages such as Perl and Java can be easily added. The distro can be had from Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login


This is a preliminary version and has only been tested on Mac OS X. Please let me know if you get it to work on other platforms. Windows will be difficult and because it is not may not be easy as it should be to compile DLLs with open source tools), Linux should work out of the box. Take a look at the README and included basic examples.

I welcome all and any comments and feedback.

Cheers,
Sergei

Title: Re: [ANNOUNCEMENT] HyPhy as a library
Post by jamescotton on Jun 4th, 2009 at 3:35am
Hi Sergei - i've had a quick look go at building this library on a Ubuntu machine.

An easy problem to fix was that line 16 of setup.py has '_Hyphy' when it should be '_HyPhy' for case-sensitive file systems. I also needed to install a new version of libcurl.. the library then seems to build okay, but when I try running the example, I get an error:


Quote:
james@james-desktop:~/Desktop/HyPhyLibrary/Examples/Python$ python BasicHyPhy.py
Traceback (most recent call last):
 File "BasicHyPhy.py", line 4, in <module>
   import os, HyPhy
 File "/usr/lib/python2.5/site-packages/HyPhy/__init__.py", line 51, in <module>
   THYPHY_TYPE_COUNT = _HyPhy.THYPHY_TYPE_COUNT
AttributeError: 'module' object has no attribute 'THYPHY_TYPE_COUNT'


When I try and build the R library on the same machine, the build fails with an error message:


Quote:
LibraryModules/Source/THyPhy_R.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [LibraryModules/R/HyPhy.so] Error 1
R library written to /home/james/Desktop/HyPhyLibrary/LibraryModules/R/HyPhy.so
Finished


I don't know anything about SWIG, and don't really use python much, so I'm not well qualified to try and fix these,. it could be something really obvious, but I hope these reports help. It would be really exciting to have hyphy available in R - in particular it might make it really easy to do Bayesian inference under some of the rich models that hyphy makes possible.

Thanks for this! - I'm surprised it hasn't attracted much attention - although I only just noticed the post.

Yours,
James

Title: Re: [ANNOUNCEMENT] HyPhy as a library
Post by jamescotton on Jun 4th, 2009 at 3:45am
After posting the above message, I found the problem with building the R library - the tgz file you post ships with a pre-compiled


Quote:
-rw-r--r-- james/james  142096 2008-04-27 23:54 HyPhyLibrary/LibraryModules/Source/THyPhy_R.o


which the shell script tries to link into the executable. I'm guessing this is a mac os x object file, which explains the problem. If you kill this file, before building, then everything builds fine, and the example R script runs happily.

Exciting! - it'll take me a while to work out what I can do beyond just executing batch files, but thanks for this.

James

Title: Re: [ANNOUNCEMENT] HyPhy as a library
Post by Sergei on Jun 5th, 2009 at 5:20pm
Dear James,

Let me know if you run into any further issues.

Cheers,
Sergei

HyPhy message board » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2022. All Rights Reserved.