tjlane / thor

support code for x-ray scattering experiments
GNU General Public License v2.0
3 stars 3 forks source link

setup.py not working on Ubuntu 14.10 #28

Closed CoChrists closed 7 years ago

CoChrists commented 9 years ago

Here are the changes I had to do in order to make it work:

139a140,144
>             cudaconfig_list=[{'home'   : home[x], 
>                               'nvcc'   : nvcc[x],
>                               'include': pjoin(home[x], 'include'),
>                               'lib64'  : pjoin(home[x], 'lib64')} \
>                              for x in xrange(len(home)) ]
148a154,158
>             cudaconfig_list=[{'home'   : home, 
>                               'nvcc'   : nvcc,
>                               'include': pjoin(home, 'include'),
>                               'lib64'  : pjoin(home, 'lib')} ]
>                               # 'lib64'  : pjoin(home, 'lib64')} ]
151,155d160
<         cudaconfig_list=[{'home'   : home[x], 
<                           'nvcc'   : nvcc[x],
<                           'include': pjoin(home[x], 'include'),
<                           'lib64'  : pjoin(home[x], 'lib64')} \
<                           for x in xrange(len(home)) ]
323c328,329
<         import pyfftw

---
>         # import pyfftw
>         import fftw3
tjlane commented 9 years ago

what's with the pyfftw vs fftw3 part?

want to open a pull request with these changes? that should check it against whatever version of ubuntu Travis is running. Then I can also test it on my mac easily.

TJ

CoChrists commented 9 years ago

I don't know. I guess it might be a naming convention thingy.

CoChrists commented 9 years ago

btw I don't expect these changes to work anywhere else. They are a hack to make it work, not a general solution...

tjlane commented 9 years ago

any chance I can convince you to develop & test a general soln :) ??

dermen commented 9 years ago

Why not add a " try/except ImportError " routine ?

-Derek

On Tue, May 5, 2015 at 12:13 PM, TJ Lane notifications@github.com wrote:

any chance I can convince you to develop & test a general soln :) ??

— Reply to this email directly or view it on GitHub https://github.com/tjlane/thor/issues/28#issuecomment-99247550.

tjlane commented 9 years ago

There are 2 issues: the use of lib vs lib64 paths, and pyfftw vs. fftw3.

@CoChrists can you confirm the origins of fftw3? It looks like pyfftw3 and pyfftw are two completely different and unfortunately named packages.

The lib/lib64 issue is hopefully straightfoward, it would just help to have a little more info about the system setup that breaks it (in this case, Ubuntu 14). That's where @CoChrists can be a big help! Gundolf if you dont want to deal with it, give me an account on your machine :).

CoChrists commented 9 years ago

I am happy to help debugging this. I have installed all the python stuff from scratch on that machine. The fftw package I installed is named python-fftw (along with it's dependencies, of course). What other info do you need?

CoChrists commented 8 years ago

This is still an issue on Ubuntu Xenial. Can I commit the changes?

tjlane commented 8 years ago

@CoChrists open a pull request if you can. I'll take a quick look and we can merge it into master.

CoChrists commented 8 years ago

I could, but actually we would need a general solution to the lib/lib64 and the pyfftw/fftw3 issues.

I am tempted to do just this for fftw issue:

[...]
    FFTW_NOSUCCESS = 0
    try:
        import pyfftw
        FFTW_NOSUCCESS = 0
    except:
        FFTW_NOSUCCESS = 1
    try:
        import fftw3
        FFTW_NOSUCCESS = 0
    except:
        FFTW_NOSUCCESS = 1

    if FFTW_NOSUCCESS:
        print()
        print('*'*65)
        print('* WARNING : PYFFTW SUPPORT')
        print('* --------------------------')
        print('* Could not load the pyfftw package, EVERYTHING WILL STILL')
[...]
tjlane commented 8 years ago

@CoChrists I'm a little confused. pyfftw and fftw3 are different python wrappers for fftw3. They don't have the same API, though, so they are not interchangeable.

Further, the code above does not change anything in the execution of the actual simulation code -- so won't improve your performance. Just (incorrectly) get rid of a warning.

CoChrists commented 8 years ago

@tjlane This is indeed confusing. From the Ubuntu package description of python-fftw: http://packages.ubuntu.com/xenial/python-fftw

[...] PyFFTW are Python bindings for the FFTW3 C-routines, using numpy and ctypes. [...]

Now (in Xenial) we have a package called python-pyfftw again (was not present in Trusty). However it is currently broken until Ubuntu package maintainers decide to update: https://github.com/pyFFTW/pyFFTW/issues/112 This means until the package is fixed one needs to either install pyfftw naually (e.g. via pip) or live without fft in python for now.

However the first proposed change is still necessary when no CUDA environment variables are defined. I am just not sure how deal with the lib/lib64 issue. Maybe ok to submit as is and see if someone runs into it.

CoChrists commented 7 years ago

Why has this been closed? Is there a fix?

tjlane commented 7 years ago

Must admit no real changes -- but I read over this and couldn't pinpoint what the exact issue was. If you have a specific error that is still current post it and I will consider reopening.