Hi Kenneth,

THANKS for guiding my through! I guess I have to learn how to handle git. My 
brain is hardwired to subversion.

** Python and IPython compiled, passed their tests and sanity checks, and both 
work nicely with readline and ncurses! **

This confirms that the fix works in our environment.

Concerning the "'self' not defined", I guess I did a sloppy installation which 
messed things up. 

Best regards and have a nice weekend!
Olaf

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Kenneth Hoste
Gesendet: Samstag, 22. März 2014 15:09
An: [email protected]
Betreff: Re: [easybuild] Python and readline

Hi Olaf,

Trying the lastest develop version of easybuild-easyblocks will not 
resolve the readline problem. Pull request #370 isn't merged into 
develop yet.

If you just copy the easyblock as it is in PR #370, it should work 
though, and you shouldn't get the error you're mentioning.

Please try this:

- download the updated Python easyblock from 
https://raw.githubusercontent.com/boegel/easybuild-easyblocks/python_readline/easybuild/easyblocks/p/python.py
 
(from the PR: click "View" and then "Raw" to get there).

- Use the file python.py to overwrite the python.py file in your current 
EasyBuild installation (it should be in a subdirectory named 
'easybuild/easyblocks/p/' somewhere).

I'm not sure why you're running into the "name 'self' is not defined" 
error, it looks weird...
Can you provide more details on what you did exactly?


regards,

Kenneth

On 22/03/14 12:52, Olaf Walter wrote:
> I tried the newest easybuild-easyblocks-develop, and Python compiles now. The 
> resulting executable has no readline capabilities, though.
>
> Olaf
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Olaf Walter
> Sent: Saturday, March 22, 2014 12:23 PM
> To: [email protected]
> Subject: RE: AW: [easybuild] Python and readline
>
> Hi Kenneth,
> I downloaded and installed the easybuild at the pull request 370, but then I 
> get:
>   
> == temporary log file in case of crash 
> /tmp/easybuild-eY4r_c/easybuild-0FU0Lc.log
> == resolving dependencies ...
> == processing EasyBuild easyconfig 
> /gpfs01/home/bioadmn/eb20140322py/eb/Python-2.7.6-goolf-1.4.12-no-OFED.eb
> == ERROR: Failed to get application instance for Python (easyblock: None): 
> EasyBuild crashed with an error (at 
> easybuild/1.11.1_p370_bin/lib/python2.6/site-packages/easybuild/framework/easyblock.py:1990
>  in get_class): Failed to obtain class for None easyblock (not available?): 
> name 'self' is not defined
>
> I attached the log file. Did I get the wrong files from git?
>
> Olaf
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Kenneth Hoste
> Sent: Wednesday, March 19, 2014 6:14 PM
> To: [email protected]
> Subject: Re: AW: AW: [easybuild] Python and readline
>
> Hi Olaf,
>
> On 14/03/14 14:36, Olaf Walter wrote:
>> Thanks! I'll check this out next week and let you know.
> Did you get the chance to try the fixed easyblock available in
> https://github.com/hpcugent/easybuild-easyblocks/pull/370 ?
>
> We're holding off merging that PR until the fix is confirmed.
>
>
> regards,
>
> Kenneth
>
>
>> Have a nice weekend,
>> Olaf
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [email protected] 
>> [mailto:[email protected]] Im Auftrag von Kenneth Hoste
>> Gesendet: Donnerstag, 13. März 2014 22:36
>> An: [email protected]
>> Betreff: Re: AW: [easybuild] Python and readline
>>
>> OK, I have this figured out now, and have a fix that resolves the
>> problem implemented in the Python easyblock.
>> See https://github.com/hpcugent/easybuild-easyblocks/pull/370 .
>>
>>
>> It boils down to having to specify both -lreadline and -lncurses, and
>> point Python to their respective non-standard locations.
>>
>> I also extend the list of sanity check commands for Python to include
>> "import readline", such that this doesn't pass by unnoticed again.
>>
>> I've rebuilt all existing Python easyconfigs with this adjusted
>> easyblock, works like a charm for all of them (so all builds now
>> properly have readline support).
>>
>> As soon as the PR is reviewed, I'll merge it in. Feel free to also test
>> it on your end and report back.
>>
>>
>> regards,
>>
>> Kenneth
>>
>> On 13/03/14 14:56, Kenneth Hoste wrote:
>>> Hi Olaf,
>>>
>>> On 13/03/14 14:50, Olaf Walter wrote:
>>>> Hi Kenneth,
>>>>
>>>>> So, it seems like somehow telling Python to also link with "-lncurses"
>>>>> should resolve the issue.
>>>> How can I do this? Just mentioning ncurses in the dependencies seems
>>>> not to be enough.
>>> I'm working on a proper fix.
>>>
>>> Python automagically tries to link to libreadline as follows:
>>>
>>> checking how to link readline libs... -lreadline -lncursesw
>>>
>>> Right now, the libncurses built with EasyBuild doesn't provide
>>> libncursesw.so (or .a).
>>>
>>> I'm trying to see whether making sure that they are there fixes the
>>> problem.
>>>
>>> I'll let you know once I've figured things out, and we'll enhance the
>>> sanity checks included in the Python easyblock to capture this problem
>>> earlier. It's easy to check: if "import readline" doesn't work, stuff
>>> is broken...
>>>
>>>
>>> regards,
>>>
>>> Kenneth
>>>
>>>
>>>> I tried Pablo's approach using the RPMs and it solves the issue in
>>>> Python, but not in IPython. I would prefer to solve this within
>>>> easybuild, but it's too puzzling.
>>>>
>>>> The IPython build fails, with a similar error message:
>>>>
>>>> == 2014-03-13 14:16:30,691 main.run INFO parse_log_for_error msg:
>>>> Command used: iptest
>>>> == 2014-03-13 14:16:30,692 main.run INFO parse_log_for_error (some
>>>> may be harmless) regExp (?<![(,-]|\w)(?:error|segmentation
>>>> fault|failed)(?![(,-]|\.?\w) found:
>>>> ERROR: Test we're not loading modules on startup that we shouldn't.
>>>> ValueError: Running file '/tmp/easybuild-9LI3g5/tmpvba19N.py'
>>>> produced error: 'WARNING: Readline services not available or not
>>>> loaded.\nWARNING: The auto-indent feature requires the readline
>>>> library\n'
>>>>
>>>> Did anybody get IPython working with readline?
>>>>
>>>> Best regards,
>>>> Olaf
>>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: [email protected]
>>>> [mailto:[email protected]] Im Auftrag von Kenneth Hoste
>>>> Gesendet: Donnerstag, 13. März 2014 11:03
>>>> An: [email protected]
>>>> Betreff: Re: [easybuild] Python and readline
>>>>
>>>>
>>>> On 13/03/14 10:54, Fotis Georgatos wrote:
>>>>> Hello *,
>>>>>
>>>>> On Mar 13, 2014, at 9:34 AM, Kenneth Hoste wrote:
>>>>>>         *** WARNING: renaming "readline" since importing it failed:
>>>>>> /path/to/software/libreadline/6.2-goolf-1.4.10/lib/libreadline.so.6: 
>>>>>> undefined
>>>>>> symbol: PC
>>>>> hey, that rings a bell:
>>>>> * ncurses is an -optional- dependency of libreadline;
>>>>>       and when not explicitly declared the above message appears.
>>>>>
>>>>> I have noticed at least two round of discussions over the last 12
>>>>> months as regards the matter;
>>>>> fi. last summer's EB-provided libreadline builds are supposed to
>>>>> have the dep defined (July 2013);
>>>>> *plenty* of software sits atop libreadline so that has far-reaching
>>>>> (and build-silent) effects;
>>>>> In fact, this is a prime example why having *buildsets* to fight sw
>>>>> temporal divergence is a MUST.
>>>>>
>>>>> I hope others can confirm that the above is on-topic hint.
>>>> I've been looking into this a bit more, and it's indeed ncurses who's to
>>>> blame.
>>>>
>>>> It's even worse... As far as I can tell, libreadline never links to
>>>> ncurses itself, even though the libreadline.so|a libraries use symbols
>>>> provided by ncurses.
>>>>
>>>> The idea is that users are left free to chose whether they use ncurses
>>>> or termcap to provide the symbols.
>>>>
>>>> Result: if you don't link with "-lreadline -lncurses", and e.g. use
>>>> "-lreadline", you can run into problems like this.
>>>> So, it seems like somehow telling Python to also link with "-lncurses"
>>>> should resolve the issue.
>>>>
>>>> Now, what really puzzles me is:
>>>>
>>>> 1) Why does this problem only occur with Python 2.7.5 and 2.7.6? Python
>>>> 2.7.3 seems to be fine...
>>>>
>>>> 2) Why didn't we notice this earlier? :(
>>>>
>>>>
>>>> regards,
>>>>
>>>> Kenneth

Reply via email to