Olaf,

You might also like the RunCmdCP block I wrote, which will run a command
for each file in the sources list.
https://github.com/hpcugent/easybuild-easyblocks/pull/395

If this is not flexible enought, consider making it a bit more generic.
I'm sure we'll need more of this kind of tricks in the future anyway.

Regards
Jens Timmerman

On 04/28/2014 05:20 PM, Kenneth Hoste wrote:
>
> On 04/04/14 16:03, Olaf Walter wrote:
>> Hi Kenneth,
>>
>> thanks, option 1 an easy fix. I wouldn't consider it dirty, at least
>> to my standards...
>>
>> I put my extra Makefile (that calls the two Makefiles that come with
>> the software) next to the eb file. Then:
>>
>> patches = [('erds.Makefile', '.')] # copy Makefile to build directory
>> makeopts = '-f erds.Makefile' # and use this Makefile
>>
>> Option 2 look super elegant. In my case, it's the MakeCp block, not
>> ConfigureMake, so I tried
>> premakeopts = ["cd hmm && ", "cd phmm && "]
>>
>> As far as I can see, MakeCp will not iterate through the list. Only
>> hmm got was built.
>
> Hmm, weird, that should work...
>
> For each of the configure-make-make install cycles, EasyBuild will
> unpack the source tarball again, and start from scratch. Maybe that's
> what you're seeing?
>
>
>
> regards,
>
> Kenneth
>>
>> Thanks everybody for jumping in, and congratulations on the 1.12.0
>> release.
>>
>> Have a good weekend,
>> Olaf
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [email protected]
>> [mailto:[email protected]] Im Auftrag von Kenneth Hoste
>> Gesendet: Freitag, 4. April 2014 15:04
>> An: [email protected]
>> Betreff: Re: [easybuild] A patch containing a new file
>>
>> Hi Olaf,
>>
>> On 04/04/14 14:45, Olaf Walter wrote:
>>> Dear easybuilders,
>>>
>>> the tool that I'm working on contains two source directories, each
>>> of them requiring a make. My idea was to create a patch that writes
>>> a top-level Makefile that calls both of them.
>> The tool source doesn't come with Makefiles provided?
>>
>>> This is what I get:
>>>
>>> EasyBuildError: "EasyBuild crashed with an error (at
>>> easybuild/1.11.1_p370_2/lib/python2.6/site-packages/easybuild_framework-1.11.1-py2.6.egg/easybuild/tools/filetools.py:610
>>> in apply_patch): Can't determine patch level for patch
>>> /gpfs01/home/bioadmn/eb20140311/eb/erds-1.1-Makefile.patch from
>>> directory
>>> /gpfs01/home/bioadmn/.local/easybuild/build/erds/1.1/goolf-1.4.12-no-OFED/erds1.1"
>>>
>>> This is my patch:
>>>
>>> diff -urN erds1.1.orig/Makefile erds1.1/Makefile
>>> --- erds1.1.orig/Makefile       1970-01-01 01:00:00.000000000 +0100
>>> +++ erds1.1/Makefile    2014-04-04 14:10:49.015186000 +0200
>>> @@ -0,0 +1,9 @@
>>> +
>>> +all: make_hmm make_phmm
>>> +
>>> +make_hmm:
>>> +       cd hmm && $(MAKE)
>>> +
>>> +make_phmm:
>>> +       cd phmm && $(MAKE)
>>> +
>>> Does anybody have an idea how to solve this, or a different approach
>>> to my problem?
>>>
>>> Thanks,
>>> Olaf
>>
>> EasyBuild requires that the file to be patched is already there, so this
>> approach won't work.
>>
>> There's a couple of thing you can do:
>>
>> 1) EasyBuild support simply copying of files via the 'patches' entry:
>> ship the Makefile via patches, but not as a patch file:
>>
>> patches = [('Makefile', '.')]  # copy Makefile to build directory
>>
>> Something similar is done for OpenBLAS, see
>> https://github.com/hpcugent/easybuild-easyconfigs/blob/master/easybuild/easyconfigs/o/OpenBLAS/OpenBLAS-0.2.6-gompi-1.4.10-LAPACK-3.4.2.eb#L30
>>
>> .
>>
>> This is a rather 'dirty' approach though, since you need to add an extra
>> file.
>>
>>
>> 2) Use/abuse premakeopts and makeopts:
>>
>> prebuildopts = "cd hmm && "
>> buildopts = " && cd ../phmm && make"
>>
>> This will result in a build command line "cd hmm && make -j 8 && cd
>> ../phmm && make"
>>
>> (the "make -j 8" part is filled in by EasyBuild)
>>
>> This is already better, but note that you'd have to take care of "make
>> -j" yourself for phmm, and you have no idea what to set the value for
>> "-j" to (you don't know on which systems the easyconfig file would be
>> used).
>>
>>
>> 3) define prebuildopts as a *list* of strings; EasyBuild will cycle
>> through the configure/make/make install procedure multiple times
>>
>> prebuildopts = ["cd hmm && ", "cd phmm && "]
>>
>> This is also done for FFTW, where multiple calls to configure are
>> required to build the libraries with different precision, see
>> https://github.com/hpcugent/easybuild-easyconfigs/blob/master/easybuild/easyconfigs/f/FFTW/FFTW-3.3.3-gompi-1.4.10.eb#L16-21
>>
>> .
>>
>> I would definitely go for the last option.
>>
>>
>> regards,
>>
>> Kenneth
>>
>

Reply via email to