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