jhkorhonen / MOODS

MOODS: Motif Occurrence Detection Suite
Other
95 stars 12 forks source link

Compilation and installation problems #7

Closed biogberg closed 8 years ago

biogberg commented 8 years ago

Hi,

I have used older versions of moods, but when I tried to update I ran into problems. Below is a summary.

Am I doing something obviously wrong? I'm not very experienced with python. Is there a way to get a simple executable without any python?

Best regards,

Bernt

Build command does not work; gcc chokes on:

gcc: error: core/tools_wrap.cxx: No such file or directory
gcc: fatal error: no input files
compilation terminated.
error: command 'gcc' failed with exit status 1

Changed to root directory of distribution and ran

python python/setup.py build

Several source files are not found. setup.py does not run swig. Tried to run swig manually. Turns out build requires a relatively recent version of swig. Running newer version of swig manually.

swig -c++ -python misc.i

etc. succeeds.

Running

python python/setup.py build

fails with

error: package directory 'MOODS' does not exist.

Created MOODS directory in root directory of distribution.

Build now warns:

cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++

Switching to different version of gcc does not help.

Build proceeds with lots and lots of warnings.

install warns

package init file 'MOODS/__init__.py' not found (or not a regular file)
package init file 'MOODS/__init__.py' not found (or not a regular file)

MOODS/init.py is an empty file

Tried to run example from root of distribution (had to change path to script):

python python/scripts/moods_dna.py -m example-data/matrices/*.{pfm,adm} -s example-data/seq/chr1-5k-55k.fa -p 0.0001
Traceback (most recent call last):
  File "python/scripts/moods_dna.py", line 8, in <module>
    import MOODS.scan
ImportError: No module named MOODS.scan
jhkorhonen commented 8 years ago

Hi,

for easy installation, don't clone the repository, but instead download the release package linked on the front page (direct link), as that way you don't need swig and everything should actually work. Then follow the installation instructions; if you just want to use MOODS as a standalone tool, it's probably easiest to follow Option 1 (and then use moods_dna.py script, see Getting Started).

Installation from the repository is somewhat more complicated process because of reasons.

biogberg commented 8 years ago

Hi,

Thank you for your comments. I was using version 1.9.2. My results were produced on a clean download. I need to use swig as the build requires core/tools_wrap.cxx etc. and they are not in the distribution.

For reference python is 2.7.11, swig is 3.0.8 and gcc is 4.9.2.

Regards,

Bernt

jhkorhonen commented 8 years ago

Missing tools_wrap.cxx does sound like you've used git clone to clone the repository (or alternatively used the "download zip" button to get a snapshot of the development tree) instead of downloading the release tarball linked on the MOODS Github page (scroll down to "Downloads"), as the swig wrapper .cxx files are included in the release tarball (just double-checked this). Try this:

wget https://github.com/jhkorhonen/MOODS/releases/download/v1.9.2/MOODS-python-1.9.2.tar.gz
tar xvf MOODS-python-1.9.2.tar.gz 
cd MOODS-python-1.9.2
python setup.py build_ext --inplace
cd scripts/
ln -s ../MOODS/
python moods_dna.py -m example-data/matrices/*.{pfm,adm} -s example-data/seq/chr1-5k-55k.fa -p 0.0001

If the above does not work, please attach a full log of running the above commands.

jhkorhonen commented 8 years ago

Now that I think about this, the "Download ZIP" button is probably the cause of this problem, and I can see why that can be confusing. The long and short of it is that that button gives you a zip of the github master branch, but that gives you the files and directory layout that I use when developing MOODS, which in particular does not contain the swig-generated files (as these are anyway re-generated when things change). A bunch of scripts is then used to produce the release package from these files, which has different directory layout and the swig files for easy building.

biogberg commented 8 years ago

Hi, Thank you. I can confirm that re-downloading and starting from scratch makes things work. Sorry for the inconvenience. Regards, Bernt