ricedsp / rwt

The Rice Wavelet Toolbox (RWT) is a collection of Matlab M-files and C MEX-files for 1D and 2D wavelet and filter bank design, analysis, and processing. The toolbox provides tools for denoising and interfaces directly with our Matlab code for wavelet domain hidden Markov models and wavelet regularized deconvolution.
http://dsp.rice.edu
Other
134 stars 48 forks source link

Error when installing the Python version #9

Closed Padoup-Padoup closed 8 years ago

Padoup-Padoup commented 8 years ago

Hello,

I successfully downloaded and compiled rwt for Python (v2.7). I first had to install swig:

sudo apt-get install swig 

(maybe this could be added as a requirement in the INSTALL file)

Then, the compilation ran smoothly (I think, I am not very familiar with CMake):

$ cmake .
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found SWIG: /usr/bin/swig2.0 (found version "2.0.7") 
-- Found PythonLibs: /usr/lib/libpython3.2mu.so (found version "3.2.3") 
python: /usr/bin/python
numpy : /usr/local/lib/python2.7/dist-packages/numpy-1.11.0rc1-py2.7-linux-x86_64.egg/numpy/core/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/maxime/code/rwt/python

However, when running sudo make install, I get the following error:

$ sudo make install
[ 12%] Swig source
/home/maxime/code/rwt/python/rwt.i:3: Error: Syntax error in input(1).
make[2]: *** [rwtPYTHON_wrap.cxx] Erreur 1
make[1]: *** [CMakeFiles/_rwt.dir/all] Erreur 2
make: *** [all] Erreur 2

I wonder whether this can be related with conflicting versions of Python, but I am unable to troubleshoot this. I'd be happy to provide any version information/log.

Thank you

kalliste commented 8 years ago

It looks like you are on Linux - what distribution are you running?

On Wed, May 11, 2016 at 5:28 AM, Padoup-Padoup notifications@github.com wrote:

Hello,

I successfully downloaded and compiled rwt for Python (v2.7). I first had to install swig:

sudo apt-get install swig

(maybe this could be added as a requirement in the INSTALL file)

Then, the compilation ran smoothly (I think, I am not very familiar with CMake):

$ cmake . -- The C compiler identification is GNU 4.7.2 -- The CXX compiler identification is GNU 4.7.2 -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Found SWIG: /usr/bin/swig2.0 (found version "2.0.7") -- Found PythonLibs: /usr/lib/libpython3.2mu.so (found version "3.2.3") python: /usr/bin/python numpy : /usr/local/lib/python2.7/dist-packages/numpy-1.11.0rc1-py2.7-linux-x86_64.egg/numpy/core/include -- Configuring done -- Generating done -- Build files have been written to: /home/maxime/code/rwt/python

However, when running sudo make install, I get the following error:

$ sudo make install [ 12%] Swig source /home/maxime/code/rwt/python/rwt.i:3: Error: Syntax error in input(1). make[2]: * [rwtPYTHON_wrap.cxx] Erreur 1 make[1]: * [CMakeFiles/_rwt.dir/all] Erreur 2 make: *\ [all] Erreur 2

I wonder whether this can be related with conflicting versions of Python, but I am unable to troubleshoot this. I'd be happy to provide any version information/log.

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/ricedsp/rwt/issues/9

Padoup-Padoup commented 8 years ago

Thank you for your reply. I'm using Debian 7 (Wheezy), which is Debian oldstable:

$ uname -a
Linux *** 3.2.0-4-amd64 #1 SMP Debian 3.2.78-1 x86_64 GNU/Linux

Here /usr/bin/python points to python2.7. Thus, I am a little bit surprised to see that it links to /usr/lib/libpython3.2mu.so (shouldn't it be to /usr/lib/libpython2.7.so.1)?

kalliste commented 8 years ago

You'll need at least version 2.0.11 of SWIG, and I've documented that now.

I was able to backport SWIG 2.0.12 from Jessie to Wheezy and then rwt compiled and installed properly. https://packages.debian.org/source/jessie/swig2.0 https://wiki.debian.org/SimpleBackportCreation

I did not have any further problems with this on a fresh Wheezy install with pyhon 2.7 so if you have problems with the python 3 libraries you may need to remove them.

Padoup-Padoup commented 8 years ago

Thanks a lot, it works (I indeed had to remove the Python3 librairies during the compilation). An alternative could be to specify the PYTHON_LIBRARY path (as described in http://stackoverflow.com/questions/7660001/cmake-finds-wrong-python-libs#9810796 ), but I haven't tested.