bailey-lab / SeekDeep

Bioinformatic Tools for analyzing targeted amplicon sequencing developed by Nicholas Hathaway of Bailey Lab
http://seekdeep.brown.edu/
GNU Lesser General Public License v3.0
13 stars 5 forks source link

Install like a charm on OSX and crash on UNIX based due to encoding prolly. #3

Closed jnesme closed 6 years ago

jnesme commented 6 years ago

Dear devs,

The install scripts works great on osx highSierra but will fail on Debian 3.16.43 as follow:

I suspect non-UNIX encoding in easy_install python scripts. Could you please fix this issue?

Sincerely,

This is the error traceback I get on UNIX using Python2.7 : Traceback (most recent call last): File "scripts/setUpScripts/njhConfigure.py", line 6, in <module> from utils import Utils File "scripts/pyUtils/utils.py", line 57 print CT.boldGreen(cmd) ^ SyntaxError: invalid syntax Traceback (most recent call last): File "configure.py", line 15, in <module> main() File "configure.py", line 13, in main Utils.run(cmd) File "scripts/pyUtils/utils.py", line 81, in run raise Exception(cmd, exitCode, actualOutput) Exception: ('scripts/setUpScripts/njhConfigure.py -name SeekDeep -libs seqServer:v1.5.1', 1, 'Traceback (most recent call last):\n File "scripts/setUpScripts/njhConfigure.py", line 6, in <module>\n from utils import Utils\n File "scripts/pyUtils/utils.py", line 57\n print CT.boldGreen(cmd)\n ^\nSyntaxError: invalid syntax\n')

eventually that when using system python that is 3.6.1 :

Traceback (most recent call last): File "./configure.py", line 6, in <module> from utils import Utils File "scripts/pyUtils/utils.py", line 57 print CT.boldGreen(cmd) ^ SyntaxError: invalid syntax

nickjhathaway commented 6 years ago

Hi @jnesme , So it looks like it is a python version issue. So, unfortunately, I wrote these install scripts more than 3 years ago and didn't consider a future where python would no longer be python2 and become python3 instead. The failure comes from the difference in the print functions between 2 and 3 which 3 sees the naked print message rather than print (message) as a syntax error.

I'm guessing you tried to run python2 by calling python2 directly on the configure script which would have solved the problem if I wasn't doing unfortunate things internally which is I call python on the next set of script to run so even if you call python2 directory on configure.py it will solve the problem for configure but not for the next set of scripts. I have fixed this in the developmental branch by making the call to python be python2. So you can try using the developmental branch like below:

git clone https://github.com/bailey-lab/SeekDeep.git
cd SeekDeep
git checkout develop
./configure.py 
./setup.py --compfile compfile.mk --outMakefile makefile-common.mk 
make

You can also solve this in the current branch by making the call to python always be python2 by doing something like this

git clone https://github.com/bailey-lab/SeekDeep.git
cd SeekDeep
mkdir python2Bin
ln -s $(which python2) python2Bin/python
PATH=$(pwd)/python2Bin:$PATH ./configure.py 
PATH=$(pwd)/python2Bin:$PATH ./setup.py --compfile compfile.mk --outMakefile makefile-common.mk 
make

This would make it so just for these two calls to configure.py and setup.py the symlinked python2 would be called for python.

Let me know if that solves your issue.

Nick

nickjhathaway commented 6 years ago

Hi @jnesme, I tested out on Debian myself and I got it to install. I was able to reproduce your error if python is set to python3 but is fine when it's set to python2 or when using the new code I added. So I'm going to close the issue as it seems that was the problem. Feel free to reopen if you still have issues.

Best, Nick

jnesme commented 6 years ago

Hi @nickjhathaway , sorry for the late answer, I was actually posting for a colleague and forgot to follow up, my bad and sorry for the extra time spent :/

After changing binary names of gcc and g++ to gcc-7 and g++-7 from my linuxbrew install then I could run configure.py and it then builds perfectly

Thanks a lot for the fix and the software, time to try it out now

nickjhathaway commented 6 years ago

No worries! And it assumes gcc-7 and g++-7 by default but you don't have to necessary change the names of the binaries to that, you can set which compilers to use by setting environmental CC and CXX or by setting them at the configure.py step

CC=gcc CXX=g++ ./configure.py 

or

./configure.py -CC gcc -CXX g++ 

And it just needs to be a c++14 compliant compiler so you could also use clang

CC=clang-3.8 CXX=clang-3.8++ ./configure.py