Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #574 from hpcugent/develop

release EasyBuild v2.0.0
  • Loading branch information...
commit 8bd3a34f3c8606fc218c71722a4c29e8b104129f 2 parents 9b1638d + efcc798
@boegel boegel authored
Showing with 1,020 additions and 428 deletions.
  1. +36 −4 RELEASE_NOTES
  2. +4 −4 easybuild/__init__.py
  3. +5 −5 easybuild/easyblocks/__init__.py
  4. +1 −1  easybuild/easyblocks/a/abaqus.py
  5. +1 −1  easybuild/easyblocks/a/acml.py
  6. +1 −1  easybuild/easyblocks/a/aladin.py
  7. +1 −1  easybuild/easyblocks/a/ansys.py
  8. +1 −1  easybuild/easyblocks/a/ant.py
  9. +1 −1  easybuild/easyblocks/a/arb.py
  10. +1 −1  easybuild/easyblocks/a/armadillo.py
  11. +1 −1  easybuild/easyblocks/a/atlas.py
  12. +1 −1  easybuild/easyblocks/b/bamtools.py
  13. +1 −1  easybuild/easyblocks/b/bioconductor.py
  14. +1 −1  easybuild/easyblocks/b/bisearch.py
  15. +1 −1  easybuild/easyblocks/b/blacs.py
  16. +1 −1  easybuild/easyblocks/b/blat.py
  17. +1 −1  easybuild/easyblocks/b/boost.py
  18. +1 −1  easybuild/easyblocks/b/bowtie2.py
  19. +1 −1  easybuild/easyblocks/b/bwa.py
  20. +1 −1  easybuild/easyblocks/b/bzip2.py
  21. +1 −1  easybuild/easyblocks/c/cgal.py
  22. +1 −1  easybuild/easyblocks/c/chapel.py
  23. +48 −29 easybuild/easyblocks/c/clang.py
  24. +2 −2 easybuild/easyblocks/c/cp2k.py
  25. +7 −25 easybuild/easyblocks/c/cplex.py
  26. +1 −1  easybuild/easyblocks/c/cuda.py
  27. +1 −1  easybuild/easyblocks/c/cufflinks.py
  28. +1 −1  easybuild/easyblocks/d/dolfin.py
  29. +1 −1  easybuild/easyblocks/d/doxygen.py
  30. +49 −19 easybuild/easyblocks/e/easybuildmeta.py
  31. +1 −1  easybuild/easyblocks/e/eigen.py
  32. +1 −1  easybuild/easyblocks/e/epd.py
  33. +1 −1  easybuild/easyblocks/e/espresso.py
  34. +21 −1 easybuild/easyblocks/f/fdtd_solutions.py
  35. +1 −1  easybuild/easyblocks/f/ferret.py
  36. +1 −1  easybuild/easyblocks/f/flex.py
  37. +1 −1  easybuild/easyblocks/f/fluent.py
  38. +1 −1  easybuild/easyblocks/f/freetype.py
  39. +1 −1  easybuild/easyblocks/f/fsl.py
  40. +1 −1  easybuild/easyblocks/g/g2clib.py
  41. +1 −1  easybuild/easyblocks/g/g2lib.py
  42. +289 −0 easybuild/easyblocks/g/gamess_us.py
  43. +1 −1  easybuild/easyblocks/g/gate.py
  44. +2 −2 easybuild/easyblocks/g/gcc.py
  45. +1 −1  easybuild/easyblocks/g/geant4.py
  46. +11 −2 easybuild/easyblocks/g/genomeanalysistk.py
  47. +1 −1  easybuild/easyblocks/g/ghc.py
  48. +4 −4 easybuild/easyblocks/generic/__init__.py
  49. +31 −2 easybuild/easyblocks/generic/binary.py
  50. +62 −0 easybuild/easyblocks/generic/bundle.py
  51. +7 −5 easybuild/easyblocks/generic/cmakemake.py
  52. +1 −1  easybuild/easyblocks/generic/cmakepythonpackage.py
  53. +1 −1  easybuild/easyblocks/generic/configuremake.py
  54. +1 −1  easybuild/easyblocks/generic/fortranpythonpackage.py
  55. +3 −27 easybuild/easyblocks/generic/intelbase.py
  56. +1 −1  easybuild/easyblocks/generic/jar.py
  57. +1 −1  easybuild/easyblocks/generic/packedbinary.py
  58. +1 −1  easybuild/easyblocks/generic/perlmodule.py
  59. +1 −1  easybuild/easyblocks/generic/pythonpackage.py
  60. +23 −7 easybuild/easyblocks/generic/rpackage.py
  61. +57 −48 easybuild/easyblocks/generic/rpm.py
  62. +8 −6 easybuild/easyblocks/generic/tarball.py
  63. +4 −21 easybuild/easyblocks/generic/toolchain.py
  64. +4 −5 easybuild/easyblocks/generic/versionindependendpythonpackage.py
  65. +80 −0 easybuild/easyblocks/h/hadoop.py
  66. +1 −1  easybuild/easyblocks/h/hdf5.py
  67. +1 −1  easybuild/easyblocks/h/hpcg.py
  68. +1 −1  easybuild/easyblocks/h/hpl.py
  69. +1 −1  easybuild/easyblocks/h/hypre.py
  70. +1 −1  easybuild/easyblocks/i/icc.py
  71. +1 −1  easybuild/easyblocks/i/ifort.py
  72. +1 −1  easybuild/easyblocks/i/imkl.py
  73. +1 −1  easybuild/easyblocks/i/impi.py
  74. +1 −1  easybuild/easyblocks/i/ipp.py
  75. +1 −1  easybuild/easyblocks/i/itac.py
  76. +1 −1  easybuild/easyblocks/j/java.py
  77. +1 −1  easybuild/easyblocks/l/lapack.py
  78. +30 −18 easybuild/easyblocks/l/{libint2.py → libint.py}
  79. +1 −1  easybuild/easyblocks/l/libsmm.py
  80. +1 −1  easybuild/easyblocks/l/libxml2.py
  81. +1 −1  easybuild/easyblocks/m/maple.py
  82. +1 −1  easybuild/easyblocks/m/matlab.py
  83. +1 −1  easybuild/easyblocks/m/metavelvet.py
  84. +1 −1  easybuild/easyblocks/m/metis.py
  85. +4 −7 easybuild/easyblocks/m/mrbayes.py
  86. +1 −1  easybuild/easyblocks/m/mtl4.py
  87. +1 −1  easybuild/easyblocks/m/mummer.py
  88. +1 −1  easybuild/easyblocks/m/mumps.py
  89. +1 −1  easybuild/easyblocks/m/mvapich2.py
  90. +1 −1  easybuild/easyblocks/n/namd.py
  91. +1 −1  easybuild/easyblocks/n/ncl.py
  92. +1 −1  easybuild/easyblocks/n/ncurses.py
  93. +1 −1  easybuild/easyblocks/n/netcdf.py
  94. +1 −1  easybuild/easyblocks/n/netcdf_fortran.py
  95. +1 −1  easybuild/easyblocks/n/neuron.py
  96. +1 −1  easybuild/easyblocks/n/nose.py
  97. +1 −1  easybuild/easyblocks/n/numpy.py
  98. +1 −1  easybuild/easyblocks/n/nwchem.py
  99. +1 −1  easybuild/easyblocks/o/openfoam.py
  100. +1 −1  easybuild/easyblocks/o/openssl.py
  101. +1 −1  easybuild/easyblocks/p/parmetis.py
  102. +1 −1  easybuild/easyblocks/p/pasha.py
  103. +2 −3 easybuild/easyblocks/p/perl.py
  104. +1 −1  easybuild/easyblocks/p/petsc.py
  105. +6 −2 easybuild/easyblocks/p/picard.py
  106. +1 −1  easybuild/easyblocks/p/primer3.py
  107. +78 −42 easybuild/easyblocks/p/psi.py
  108. +1 −1  easybuild/easyblocks/p/pyquante.py
  109. +1 −1  easybuild/easyblocks/p/python.py
  110. +1 −1  easybuild/easyblocks/p/python_meep.py
  111. +1 −1  easybuild/easyblocks/p/pyzmq.py
  112. +1 −1  easybuild/easyblocks/q/qlogicmpi.py
  113. +1 −1  easybuild/easyblocks/q/quantumespresso.py
  114. +1 −1  easybuild/easyblocks/r/r.py
  115. +1 −1  easybuild/easyblocks/r/rmpi.py
  116. +5 −4 easybuild/easyblocks/r/root.py
  117. +1 −1  easybuild/easyblocks/r/rosetta.py
  118. +1 −1  easybuild/easyblocks/r/rserve.py
  119. +6 −2 easybuild/easyblocks/s/samtools.py
  120. +1 −1  easybuild/easyblocks/s/scalapack.py
  121. +1 −1  easybuild/easyblocks/s/scipy.py
  122. +1 −1  easybuild/easyblocks/s/scotch.py
  123. +1 −1  easybuild/easyblocks/s/shrimp.py
  124. +1 −1  easybuild/easyblocks/s/slepc.py
  125. +1 −1  easybuild/easyblocks/s/soapdenovo.py
  126. +15 −9 easybuild/easyblocks/s/suitesparse.py
  127. +1 −1  easybuild/easyblocks/s/swig.py
  128. +1 −1  easybuild/easyblocks/t/tbb.py
  129. +1 −1  easybuild/easyblocks/t/tornado.py
  130. +1 −1  easybuild/easyblocks/t/totalview.py
  131. +1 −1  easybuild/easyblocks/t/trilinos.py
  132. +4 −1 easybuild/easyblocks/t/trinity.py
  133. +1 −1  easybuild/easyblocks/u/ufc.py
  134. +1 −1  easybuild/easyblocks/v/velvet.py
  135. +1 −1  easybuild/easyblocks/v/vsc_tools.py
  136. +1 −1  easybuild/easyblocks/w/wien2k.py
  137. +1 −1  easybuild/easyblocks/w/wps.py
  138. +1 −1  easybuild/easyblocks/w/wrf.py
  139. +1 −1  easybuild/easyblocks/x/xcrysden.py
  140. +1 −1  easybuild/easyblocks/x/xml.py
  141. +1 −1  test/__init__.py
  142. +2 −11 test/easyblocks/init_easyblocks.py
  143. +1 −1  test/easyblocks/suite.py
View
40 RELEASE_NOTES
@@ -3,7 +3,39 @@ For more detailed information, please see the git log.
These release notes can also be consulted at http://easybuild.readthedocs.org/en/latest/Release_notes.html.
-The latest version of easybuild-easyblocks provides 141 software-specific easyblocks and 20 generic easyblocks.
+The latest version of easybuild-easyblocks provides 143 software-specific easyblocks and 21 generic easyblocks.
+
+
+v2.0.0 (March 6th 2015)
+-----------------------
+
+feature + bugfix release
+- one new generic easyblock for installing a bundle of modules: Bundle (#550)
+ - and let the Toolchain generic easyblock derive from Bundle
+- new easyblocks for 2 software packages that require customized support:
+ - GAMESS-US (#470, #544, #558), Hadoop (#563)
+- various other enhancements, including:
+ - move support for staged_install from CPLEX easyblock to generic Binary easyblock (#502)
+ - fix sanity check in picard easyblock for v1.119 that doesn't include sam.jar (#522)
+ - log warning message when unlinking jellyfish symlink fails in Trinity easyblock (#534)
+ - revamp EB_libint2 easyblock into EB_Libint that works for both Libint v1x and v2.x (#536)
+ - update CP2K easyblock for recent versions (no more 'fes') (#537)
+ - update SuiteSparse easyblock for recent versions (#541)
+ - fix easyblock unit tests after dropping support for deprecated behaviour in framework (#543)
+ - rework PSI easyblock to support future releases (#545)
+ - enable always generating a 'verbose' Makefile in the generic CMakeMake easyblock (#546)
+ - remove functionality in (generic) easyblocks that was deprecated for EasyBuild v2.0 (#547)
+ - enhance generic RPackage easyblock to support installing extensions in a separate prefix (#551)
+ - deprecate GenomeAnalysisTK easyblock, since it's basically equivalent to Tarball (#557)
+ - update SAMtools easyblock for v1.2 (#562)
+ - take preconfigopts easyconfig parameter into account in ROOT easyblock (#566)
+ - update easyblock for installing EasyBuild
+ - to support bootstrapping with provided source tarballs (#559)
+ - to also cover vsc-base dependency, and verify easy-install.pth (#567)
+ - update disabling sanitizer tests for Clang 3.6 (#570)
+- various bug fixes, including:
+ - fix handling of LTO in GCC easyblock (#535)
+ - relocate FDTD RPM to fix installation on SL6 (#538)
v1.16.2 (March 6th 2015)
------------------------
@@ -19,7 +51,7 @@ v1.16.0 (December 18th 2014)
----------------------------
feature + bugfix release
-- new easyblocks for 2 software packages that requires customized support:
+- new easyblocks for 2 software packages that require customized support:
- Chimera (#524), GATE (#518)
- fix use of deprecated functionality, enhance unit tests to check for it (#523)
- various other enhancements, including:
@@ -65,7 +97,7 @@ v1.15.0 (September 12th 2014)
-----------------------------
feature + bugfix release
-- added support for 2 new software packages that requires customized support: Modeller (#392), NAMD (#397)
+- added support for 2 new software packages that require customized support: Modeller (#392), NAMD (#397)
- various enhancements, including:
- fix locale used for running Perl unit tests (#425)
- fix Rmpi easyblock to correctly configure for Intel MPI (#435)
@@ -90,7 +122,7 @@ v1.14.0 (July 9th 2014)
feature + bugfix release
- added one new generic easyblock: CmdCp (#395)
-- added support for 2 new software packages that requires customized support: ANSYS (#398), HPCG (#408)
+- added support for 2 new software packages that require customized support: ANSYS (#398), HPCG (#408)
- various enhancements, including:
- updated ABAQUS easyblock so that it works for version 13.2 (#406)
- enhance BLAT easyblock by using super's build_step and prebuildopts/buildopts (#423)
View
8 easybuild/__init__.py
@@ -1,10 +1,10 @@
##
-# Copyright 2009-2012 Ghent University
-# Copyright 2009-2012 Stijn De Weirdt
+# Copyright 2009-2015 Ghent University
+# Copyright 2009-2015 Stijn De Weirdt
# Copyright 2010 Dries Verdegem
-# Copyright 2010-2012 Kenneth Hoste
+# Copyright 2010-2015 Kenneth Hoste
# Copyright 2011 Pieter De Baets
-# Copyright 2011-2012 Jens Timmerman
+# Copyright 2011-2015 Jens Timmerman
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
10 easybuild/easyblocks/__init__.py
@@ -1,10 +1,10 @@
# #
-# Copyright 2009-2014 Ghent University
-# Copyright 2009-2014 Stijn De Weirdt
+# Copyright 2009-2015 Ghent University
+# Copyright 2009-2015 Stijn De Weirdt
# Copyright 2010 Dries Verdegem
-# Copyright 2010-2014 Kenneth Hoste
+# Copyright 2010-2015 Kenneth Hoste
# Copyright 2011 Pieter De Baets
-# Copyright 2011-2014 Jens Timmerman
+# Copyright 2011-2015 Jens Timmerman
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -33,7 +33,7 @@
# note: release candidates should be versioned as a pre-release, e.g. "1.1rc1"
# 1.1-rc1 would indicate a post-release, i.e., and update of 1.1, so beware
-VERSION = LooseVersion("1.16.2")
+VERSION = LooseVersion("2.0.0")
UNKNOWN = "UNKNOWN"
View
2  easybuild/easyblocks/a/abaqus.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/acml.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/aladin.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/ansys.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2014 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/ant.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/arb.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/armadillo.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/a/atlas.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/bamtools.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 The Cyprus Institute
+# Copyright 2009-2015 The Cyprus Institute
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/bioconductor.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/bisearch.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/blacs.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/blat.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 the Cyprus Institute
+# Copyright 2009-2015 the Cyprus Institute
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/boost.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/b/bowtie2.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
+# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
View
2  easybuild/easyblocks/b/bwa.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
+# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Kenneth Hoste
# Authors:: George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Fotis Georgatos <fotis@cern.ch>
# License:: MIT/GPL
View
2  easybuild/easyblocks/b/bzip2.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/c/cgal.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/c/chapel.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
+# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
View
77 easybuild/easyblocks/c/clang.py
@@ -35,6 +35,7 @@
import fileinput
import glob
import os
+import re
import shutil
import sys
from distutils.version import LooseVersion
@@ -196,36 +197,54 @@ def configure_step(self):
super(EB_Clang, self).configure_step(srcdir=self.llvm_src_dir)
def disable_sanitizer_tests(self):
- """Disable the tests of all the sanitizers"""
- patchfiles = [
- "projects/compiler-rt/lib/asan/CMakeLists.txt",
- "projects/compiler-rt/lib/dfsan/CMakeLists.txt",
- "projects/compiler-rt/lib/lsan/CMakeLists.txt",
- "projects/compiler-rt/lib/msan/CMakeLists.txt",
- "projects/compiler-rt/lib/tsan/CMakeLists.txt",
- "projects/compiler-rt/lib/ubsan/CMakeLists.txt",
- ]
-
- for patchfile in patchfiles:
+ """Disable the tests of all the sanitizers by removing the test directories from the build system"""
+ if LooseVersion(self.version) < LooseVersion('3.6'):
+ # for Clang 3.5 and lower, the tests are scattered over several CMakeLists.
+ # We loop over them, and patch out the rule that adds the sanitizers tests to the testsuite
+ patchfiles = [
+ "lib/asan",
+ "lib/dfsan",
+ "lib/lsan",
+ "lib/msan",
+ "lib/tsan",
+ "lib/ubsan",
+ ]
+
+ for patchfile in patchfiles:
+ patchfile_fp = os.path.join(self.llvm_src_dir, "projects/compiler-rt", patchfile, "CMakeLists.txt")
+ if os.path.exists(patchfile_fp):
+ self.log.debug("Patching %s in %s" % (patchfile, self.llvm_src_dir))
+ try:
+ for line in fileinput.input(patchfile_fp, inplace=1, backup='.orig'):
+ if "add_subdirectory(lit_tests)" not in line:
+ sys.stdout.write(line)
+ except (IOError, OSError), err:
+ self.log.error("Failed to patch %s: %s" % (patchfile_fp, err))
+ else:
+ self.log.debug("Not patching non-existent %s in %s" % (patchfile, self.llvm_src_dir))
+
+ # There is a common part seperate for the specific saniters, we disable all
+ # the common tests
+ patchfile = "projects/compiler-rt/lib/sanitizer_common/CMakeLists.txt"
+ try:
+ for line in fileinput.input("%s/%s" % (self.llvm_src_dir, patchfile), inplace=1, backup='.orig'):
+ if "add_subdirectory(tests)" not in line:
+ sys.stdout.write(line)
+ except IOError, err:
+ self.log.error("Failed to patch %s/%s: %s" % (self.llvm_src_dir, patchfile, err))
+ else:
+ # In Clang 3.6, the sanitizer tests are grouped together in one CMakeLists
+ # We patch out adding the subdirectories with the sanitizer tests
+ patchfile = "projects/compiler-rt/test/CMakeLists.txt"
patchfile_fp = os.path.join(self.llvm_src_dir, patchfile)
- if os.path.exists(patchfile_fp):
- self.log.debug("Patching %s in %s" % (patchfile, self.llvm_src_dir))
- try:
- for line in fileinput.input(patchfile_fp, inplace=1, backup='.orig'):
- if "add_subdirectory(lit_tests)" not in line:
- sys.stdout.write(line)
- except (IOError, OSError), err:
- self.log.error("Failed to patch %s: %s" % (patchfile_fp, err))
- else:
- self.log.debug("Not patching non-existent %s in %s" % (patchfile, self.llvm_src_dir))
-
- patchfile = "projects/compiler-rt/lib/sanitizer_common/CMakeLists.txt"
- try:
- for line in fileinput.input("%s/%s" % (self.llvm_src_dir, patchfile), inplace=1, backup='.orig'):
- if "add_subdirectory(tests)" not in line:
- sys.stdout.write(line)
- except IOError, err:
- self.log.error("Failed to patch %s/%s: %s" % (self.llvm_src_dir, patchfile, err))
+ self.log.debug("Patching %s in %s" % (patchfile, self.llvm_src_dir))
+ patch_regex = re.compile(r'add_subdirectory\((.*san|sanitizer_common)\)')
+ try:
+ for line in fileinput.input(patchfile_fp, inplace=1, backup='.orig'):
+ if not patch_regex.search(line):
+ sys.stdout.write(line)
+ except IOError, err:
+ self.log.error("Failed to patch %s: %s" % (patchfile_fp, err))
def build_with_prev_stage(self, prev_obj, next_obj):
"""Build Clang stage N using Clang stage N-1"""
View
4 easybuild/easyblocks/c/cp2k.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -774,7 +774,7 @@ def sanity_check_step(self):
cp2k_type = self.cfg['type']
custom_paths = {
- 'files': ["bin/%s.%s" % (x, cp2k_type) for x in ["cp2k", "cp2k_shell", "fes"]],
+ 'files': ["bin/%s.%s" % (x, cp2k_type) for x in ["cp2k", "cp2k_shell"]],
'dirs': ["tests"]
}
View
32 easybuild/easyblocks/c/cplex.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -53,14 +53,6 @@ def __init__(self, *args, **kwargs):
super(EB_CPLEX, self).__init__(*args, **kwargs)
self.bindir = None
- @staticmethod
- def extra_options():
- extra_vars = {
- # staged install via a tmp dir can help with the hard (potentially faulty) check on available disk space
- 'staged_install': [False, "Should the installation should be staged via a temporary dir?", CUSTOM],
- }
- return Binary.extra_options(extra_vars)
-
def install_step(self):
"""CPLEX has an interactive installer, so use Q&A"""
@@ -78,16 +70,12 @@ def install_step(self):
cmd = "%s -i console" % dst
- install_target = self.installdir
- if self.cfg['staged_install']:
- install_target = stagedir
-
qanda = {
"PRESS <ENTER> TO CONTINUE:": '',
'Press Enter to continue viewing the license agreement, or enter' \
' "1" to accept the agreement, "2" to decline it, "3" to print it,' \
' or "99" to go back to the previous screen.:': '1',
- 'ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT :': install_target,
+ 'ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT :': self.installdir,
'IS THIS CORRECT? (Y/N):': 'y',
'PRESS <ENTER> TO INSTALL:': '',
"PRESS <ENTER> TO EXIT THE INSTALLER:": '',
@@ -98,20 +86,16 @@ def install_step(self):
run_cmd_qa(cmd, qanda, no_qa=noqanda, log_all=True, simple=True)
- if self.cfg['staged_install']:
- # move staged installation to actual install dir
- try:
- # copytree expects target directory to not exist yet
- shutil.rmtree(self.installdir)
- shutil.copytree(stagedir, self.installdir)
- except OSError, err:
- self.log.error("Failed to move staged install from %s to %s: %s" % (stagedir, self.installdir, err))
-
try:
os.chmod(self.installdir, stat.S_IRWXU | stat.S_IXOTH | stat.S_IXGRP | stat.S_IROTH | stat.S_IRGRP)
except OSError, err:
self.log.exception("Can't set permissions on %s: %s" % (self.installdir, err))
+ def post_install_step(self):
+ """Determine bin directory for this CPLEX installation."""
+ # handle staged install via Binary parent class
+ super(EB_CPLEX, self).post_install_step()
+
# determine bin dir
os.chdir(self.installdir)
binglob = 'cplex/bin/x86-64*'
@@ -135,10 +119,8 @@ def make_module_extra(self):
def sanity_check_step(self):
"""Custom sanity check for CPLEX"""
-
custom_paths = {
'files':["%s/%s" % (self.bindir, x) for x in ["convert", "cplex", "cplexamp"]],
'dirs':[],
}
-
super(EB_CPLEX, self).sanity_check_step(custom_paths=custom_paths)
View
2  easybuild/easyblocks/c/cuda.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Cyprus Institute / CaSToRC, Uni.Lu, NTUA, Ghent University
+# Copyright:: Copyright 2012-2015 Cyprus Institute / CaSToRC, Uni.Lu, NTUA, Ghent University
# Authors:: George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
View
2  easybuild/easyblocks/c/cufflinks.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
+# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
View
2  easybuild/easyblocks/d/dolfin.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/d/doxygen.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
68 easybuild/easyblocks/e/easybuildmeta.py
@@ -29,11 +29,12 @@
"""
import copy
import os
+import re
from distutils.version import LooseVersion
import easybuild.tools.environment as env
-from easybuild.framework.easyblock import EasyBlock
-from easybuild.easyblocks.generic.pythonpackage import PythonPackage
+from easybuild.easyblocks.generic.pythonpackage import PythonPackage, det_pylibdir
+from easybuild.tools.filetools import read_file
from easybuild.tools.modules import get_software_root_env_var_name
from easybuild.tools.ordereddict import OrderedDict
from easybuild.tools.utilities import flatten
@@ -49,6 +50,10 @@ def __init__(self, *args, **kwargs):
super(EB_EasyBuildMeta, self).__init__(*args, **kwargs)
self.orig_orig_environ = None
+ self.easybuild_pkgs = ['easybuild-framework', 'easybuild-easyblocks', 'easybuild-easyconfigs']
+ if LooseVersion(self.version) >= LooseVersion('2.0'):
+ self.easybuild_pkgs.insert(0, 'vsc-base')
+
def check_readiness_step(self):
"""Make sure EasyBuild can be installed with a loaded EasyBuild module."""
env_var_name = get_software_root_env_var_name(self.name)
@@ -67,38 +72,63 @@ def build_step(self):
def install_step(self):
"""Install EasyBuild packages one by one."""
+ # unset $PYTHONPATH to try and avoid that current EasyBuild is picked up, and ends up in easy-install.pth
+ orig_pythonpath = os.getenv('PYTHONPATH')
+ env.setvar('PYTHONPATH', '')
+
try:
subdirs = os.listdir(self.builddir)
- for pkg in ['vsc-base', 'easybuild-framework', 'easybuild-easyblocks', 'easybuild-easyconfigs']:
+ for pkg in self.easybuild_pkgs:
seldirs = [x for x in subdirs if x.startswith(pkg)]
if not len(seldirs) == 1:
- if pkg != 'vsc-base':
- tup = (pkg, subdirs, seldirs)
- self.log.error("Failed to find EasyBuild %s package (subdirs: %s, seldirs: %s)" % tup)
- else:
- self.log.debug("Installing EasyBuild package %s" % pkg)
- os.chdir(os.path.join(self.builddir, seldirs[0]))
- super(EB_EasyBuildMeta, self).install_step()
+ tup = (pkg, subdirs, seldirs)
+ self.log.error("Failed to find EasyBuild %s package (subdirs: %s, seldirs: %s)" % tup)
+
+ self.log.debug("Installing EasyBuild package %s" % pkg)
+ os.chdir(os.path.join(self.builddir, seldirs[0]))
+ super(EB_EasyBuildMeta, self).install_step()
except OSError, err:
self.log.error("Failed to install EasyBuild packages: %s" % err)
+ env.setvar('PYTHONPATH', orig_pythonpath)
+
def sanity_check_step(self):
"""Custom sanity check for EasyBuild."""
+ # check whether easy-install.pth contains correct entries
+ easy_install_pth = os.path.join(self.installdir, det_pylibdir(), 'easy-install.pth')
+ if os.path.exists(easy_install_pth):
+ easy_install_pth_txt = read_file(easy_install_pth)
+ for pkg in self.easybuild_pkgs:
+ if pkg == 'vsc-base':
+ # don't include strict version check for vsc-base
+ pkg_regex = re.compile(r"^\./%s" % pkg.replace('-', '_'), re.M)
+ else:
+ major_minor_version = '.'.join(self.version.split('.')[:2])
+ pkg_regex = re.compile(r"^\./%s-%s" % (pkg.replace('-', '_'), major_minor_version), re.M)
+
+ if not pkg_regex.search(easy_install_pth_txt):
+ tup = (pkg_regex.pattern, easy_install_pth, easy_install_pth_txt)
+ self.log.error("Failed to find pattern '%s' in %s: %s" % tup)
+
# list of dirs to check, by package
# boolean indicates whether dir is expected to reside in Python lib/pythonX/site-packages dir
- subdirs_by_pkg = [
- ('framework', [('easybuild/framework', True), ('easybuild/tools', True)]),
- ('easyblocks', [('easybuild/easyblocks', True)]),
- ('easyconfigs', [('easybuild/easyconfigs', False)]),
- ]
+ subdirs_by_pkg = {
+ 'easybuild-framework': [('easybuild/framework', True), ('easybuild/tools', True)],
+ 'easybuild-easyblocks': [('easybuild/easyblocks', True)],
+ 'easybuild-easyconfigs': [('easybuild/easyconfigs', False)],
+ }
+ if LooseVersion(self.version) >= LooseVersion('2.0'):
+ subdirs_by_pkg.update({
+ 'vsc-base': [('vsc/utils', True)],
+ })
# final list of directories to check, by setup tool
# order matters, e.g. setuptools before distutils
eb_dirs = OrderedDict()
eb_dirs['setuptools'] = []
- eb_dirs['distutils.core'] = flatten([x[1] for x in subdirs_by_pkg])
+ eb_dirs['distutils.core'] = flatten([x for x in subdirs_by_pkg.values()])
# determine setup tool (setuptools or distutils)
setup_tool = None
@@ -117,10 +147,10 @@ def sanity_check_step(self):
if setup_tool == 'setuptools':
try:
installed_dirs = os.listdir(os.path.join(self.installdir, self.pylibdir))
- for (pkg, subdirs) in subdirs_by_pkg:
- sel_dirs = [x for x in installed_dirs if x.startswith('easybuild_%s' % pkg)]
+ for (pkg, subdirs) in subdirs_by_pkg.items():
+ sel_dirs = [x for x in installed_dirs if x.startswith(pkg.replace('-', '_'))]
if not len(sel_dirs) == 1:
- self.log.error("Failed to isolate installed egg dir for easybuild-%s" % pkg)
+ self.log.error("Failed to isolate installed egg dir for %s" % pkg)
for (subdir, _) in subdirs:
# eggs always go in Python lib/pythonX/site-packages dir with setuptools
View
2  easybuild/easyblocks/e/eigen.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
+# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
View
2  easybuild/easyblocks/e/epd.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/e/espresso.py
@@ -1,7 +1,7 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
-# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
+# Copyright:: Copyright 2012-2015 Uni.Lu/LCSB, NTUA
# Authors:: Josh Berryman <the.real.josh.berryman@gmail.com>, Fotis Georgatos <fotis@cern.ch>, Kenneth Hoste
# License:: MIT/GPL
# $Id$
View
22 easybuild/easyblocks/f/fdtd_solutions.py
@@ -27,6 +27,10 @@
@author: Kenneth Hoste (Ghent University)
"""
+import glob
+import os
+import shutil
+from easybuild.easyblocks.generic.rpm import rebuild_rpm
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.run import run_cmd_qa
@@ -40,7 +44,23 @@ def configure_step(self):
def build_step(self):
"""No build step for FDTD Solutions."""
- pass
+ # locate RPM and rebuild it to make it relocatable
+ rpms = glob.glob(os.path.join(self.cfg['start_dir'], 'rpm_install_files', 'FDTD-%s*.rpm' % self.version))
+ if len(rpms) != 1:
+ self.log.error("Incorrect number of RPMs found, was expecting exactly one: %s" % rpms)
+ rebuilt_dir = os.path.join(self.cfg['start_dir'], 'rebuilt')
+ rebuild_rpm(rpms[0], rebuilt_dir)
+
+ # replace original RPM with relocatable RPM
+ rebuilt_rpms = glob.glob(os.path.join(rebuilt_dir, '*', '*.rpm'))
+ if len(rebuilt_rpms) != 1:
+ self.log.error("Incorrect number of rebuilt RPMs found, was expecting exactly one: %s" % rebuilt_rpms)
+
+ try:
+ os.rename(rpms[0], '%s.bk' % rpms[0])
+ shutil.copy2(rebuilt_rpms[0], rpms[0])
+ except OSError, err:
+ self.log.error("Failed to replace original RPM with rebuilt RPM: %s" % err)
def install_step(self):
"""Install FDTD Solutions using install.sh script."""
View
2  easybuild/easyblocks/f/ferret.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/f/flex.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/f/fluent.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/f/freetype.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/f/fsl.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/g/g2clib.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/g/g2lib.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
289 easybuild/easyblocks/g/gamess_us.py
@@ -0,0 +1,289 @@
+##
+# Copyright 2009-2015 Ghent University
+#
+# This file is part of EasyBuild,
+# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
+# with support of Ghent University (http://ugent.be/hpc),
+# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
+# the Hercules foundation (http://www.herculesstichting.be/in_English)
+# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
+#
+# http://github.com/hpcugent/easybuild
+#
+# EasyBuild is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation v2.
+#
+# EasyBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
+##
+"""
+EasyBuild support for building and installing GAMESS-US, implemented as an easyblock
+
+@author: Stijn De Weirdt (Ghent University)
+@author: Dries Verdegem (Ghent University)
+@author: Kenneth Hoste (Ghent University)
+@author: Pieter De Baets (Ghent University)
+@author: Jens Timmerman (Ghent University)
+@author: Toon Willems (Ghent University)
+@author: Pablo Escobar (sciCORE, SIB, University of Basel)
+@author: Benjamin Roberts (The University of Auckland)
+"""
+import fileinput
+import glob
+import os
+import re
+import shutil
+import sys
+import tempfile
+
+import easybuild.tools.toolchain as toolchain
+from easybuild.framework.easyblock import EasyBlock
+from easybuild.framework.easyconfig import CUSTOM, MANDATORY
+from easybuild.tools.filetools import mkdir, read_file, write_file
+from easybuild.tools.modules import get_software_root, get_software_version
+from easybuild.tools.run import run_cmd, run_cmd_qa
+from easybuild.tools.systemtools import get_platform_name
+from easybuild.tools import toolchain
+
+
+class EB_GAMESS_minus_US(EasyBlock):
+ """Support for building/installing GAMESS-US."""
+
+ @staticmethod
+ def extra_options():
+ """Define custom easyconfig parameters for GAMESS-US."""
+ extra_vars = {
+ 'ddi_comm': ['mpi', "DDI communication layer to use", CUSTOM],
+ 'maxcpus': [None, "Maximum number of cores per node", MANDATORY],
+ 'maxnodes': [None, "Maximum number of nodes", MANDATORY],
+ 'runtest': [True, "Run GAMESS-US tests", CUSTOM],
+ 'scratch_dir': ['$TMPDIR', "Scratch dir to be used in rungms script", CUSTOM],
+ }
+ return EasyBlock.extra_options(extra_vars)
+
+ def __init__(self, *args, **kwargs):
+ """Easyblock constructor, enable building in installation directory."""
+ super(EB_GAMESS_minus_US, self).__init__(*args, **kwargs)
+ self.build_in_installdir = True
+ self.testdir = None
+ if self.cfg['runtest']:
+ self.testdir = tempfile.mkdtemp()
+ # make sure test dir doesn't contain [ or ], rungms csh script doesn't handle that well ("set: No match")
+ if re.search(r'[\[\]]', self.testdir):
+ self.log.error("Temporary dir for tests '%s' will cause problems with rungms csh script" % self.testdir)
+
+ def extract_step(self):
+ """Extract sources."""
+ # strip off 'gamess' part to avoid having everything in a 'gamess' subdirectory
+ self.cfg['unpack_options'] = "--strip-components=1"
+ super(EB_GAMESS_minus_US, self).extract_step()
+
+ def configure_step(self):
+ """Configure GAMESS-US build via provided interactive 'config' script."""
+
+ # machine type
+ platform_name = get_platform_name()
+ x86_64_linux_re = re.compile('^x86_64-.*$')
+ if x86_64_linux_re.match(platform_name):
+ machinetype = "linux64"
+ else:
+ self.log.error("Build target %s currently unsupported" % platform_name)
+
+ # compiler config
+ comp_fam = self.toolchain.comp_family()
+ fortran_comp, fortran_ver = None, None
+ if comp_fam == toolchain.INTELCOMP:
+ fortran_comp = 'ifort'
+ (out, _) = run_cmd("ifort -v", simple=False)
+ res = re.search(r"^ifort version ([0-9]+)\.[0-9.]+$", out)
+ if res:
+ fortran_ver = res.group(1)
+ else:
+ self.log.error("Failed to determine ifort major version number")
+ elif comp_fam == toolchain.GCC:
+ fortran_comp = 'gfortran'
+ fortran_ver = '.'.join(get_software_version('GCC').split('.')[:2])
+ else:
+ self.log.error("Compiler family '%s' currently unsupported." % comp_fam)
+
+ # math library config
+ known_mathlibs = ['imkl', 'OpenBLAS', 'ATLAS', 'ACML']
+ mathlib, mathlib_root = None, None
+ for mathlib in known_mathlibs:
+ mathlib_root = get_software_root(mathlib)
+ if mathlib_root is not None:
+ break
+ if mathlib_root is None:
+ self.log.error("None of the known math libraries (%s) available, giving up." % known_mathlibs)
+ if mathlib == 'imkl':
+ mathlib = 'mkl'
+ mathlib_root = os.path.join(mathlib_root, 'mkl')
+ else:
+ mathlib = mathlib.lower()
+
+ # verify selected DDI communication layer
+ known_ddi_comms = ['mpi', 'mixed', 'shmem', 'sockets']
+ if not self.cfg['ddi_comm'] in known_ddi_comms:
+ tup = (known_ddi_comms, self.cfg['ddi_comm'])
+ self.log.error("Unsupported DDI communication layer specified (known: %s): %s" % tup)
+
+ # MPI library config
+ mpilib, mpilib_root, mpilib_path = None, None, None
+ if self.cfg['ddi_comm'] == 'mpi':
+
+ known_mpilibs = ['impi', 'OpenMPI', 'MVAPICH2', 'MPICH2']
+ for mpilib in known_mpilibs:
+ mpilib_root = get_software_root(mpilib)
+ if mpilib_root is not None:
+ break
+ if mpilib_root is None:
+ self.log.error("None of the known MPI libraries (%s) available, giving up." % known_mpilibs)
+ mpilib_path = mpilib_root
+ if mpilib == 'impi':
+ mpilib_path = os.path.join(mpilib_root, 'intel64')
+ else:
+ mpilib = mpilib.lower()
+
+ # run interactive 'config' script to generate install.info file
+ cmd = "%(preconfigopts)s ./config %(configopts)s" % {
+ 'preconfigopts': self.cfg['preconfigopts'],
+ 'configopts': self.cfg['configopts'],
+ }
+ qa = {
+ "After the new window is open, please hit <return> to go on.": '',
+ "please enter your target machine name: ": machinetype,
+ "Version? [00] ": self.version,
+ "Please enter your choice of FORTRAN: ": fortran_comp,
+ "hit <return> to continue to the math library setup.": '',
+ "MKL pathname? ": mathlib_root,
+ "MKL version (or 'skip')? ": 'skip',
+ "please hit <return> to compile the GAMESS source code activator": '',
+ "please hit <return> to set up your network for Linux clusters.": '',
+ "communication library ('sockets' or 'mpi')? ": self.cfg['ddi_comm'],
+ "Enter MPI library (impi, mvapich2, mpt, sockets):": mpilib,
+ "Please enter your %s's location: " % mpilib: mpilib_root,
+ "Do you want to try LIBCCHEM? (yes/no): ": 'no',
+ "Enter full path to OpenBLAS libraries (without 'lib' subdirectory):": mathlib_root,
+ }
+ stdqa = {
+ r"GAMESS directory\? \[.*\] ": self.builddir,
+ r"GAMESS build directory\? \[.*\] ": self.installdir, # building in install directory
+ r"Enter only the main version number, such as .*\nVersion\? ": fortran_ver,
+ r"gfortran version.\nPlease enter only the first decimal place, such as .*:": fortran_ver,
+ "Enter your choice of 'mkl' or .* 'none': ": mathlib,
+ }
+ run_cmd_qa(cmd, qa=qa, std_qa=stdqa, log_all=True, simple=True)
+
+ self.log.debug("Contents of install.info:\n%s" % read_file(os.path.join(self.builddir, 'install.info')))
+
+ # patch hardcoded settings in rungms to use values specified in easyconfig file
+ rungms = os.path.join(self.builddir, 'rungms')
+ extra_gmspath_lines = "set ERICFMT=$GMSPATH/auxdata/ericfmt.dat\nset MCPPATH=$GMSPATH/auxdata/MCP\n"
+ try:
+ for line in fileinput.input(rungms, inplace=1, backup='.orig'):
+ line = re.sub(r"^(\s*set\s*TARGET)=.*", r"\1=%s" % self.cfg['ddi_comm'], line)
+ line = re.sub(r"^(\s*set\s*GMSPATH)=.*", r"\1=%s\n%s" % (self.installdir, extra_gmspath_lines), line)
+ line = re.sub(r"(null\) set VERNO)=.*", r"\1=%s" % self.version, line)
+ line = re.sub(r"^(\s*set DDI_MPI_CHOICE)=.*", r"\1=%s" % mpilib, line)
+ line = re.sub(r"^(\s*set DDI_MPI_ROOT)=.*%s.*" % mpilib.lower(), r"\1=%s" % mpilib_path, line)
+ line = re.sub(r"^(\s*set GA_MPI_ROOT)=.*%s.*" % mpilib.lower(), r"\1=%s" % mpilib_path, line)
+ # comment out all adjustments to $LD_LIBRARY_PATH that involves hardcoded paths
+ line = re.sub(r"^(\s*)(setenv\s*LD_LIBRARY_PATH\s*/.*)", r"\1#\2", line)
+ if self.cfg['scratch_dir']:
+ line = re.sub(r"^(\s*set\s*SCR)=.*", r"\1=%s" % self.cfg['scratch_dir'], line)
+ line = re.sub(r"^(\s*set\s*USERSCR)=.*", r"\1=%s" % self.cfg['scratch_dir'], line)
+ sys.stdout.write(line)
+ except IOError, err:
+ self.log.error("Failed to patch %s: %s" % (rungms, err))
+
+ def build_step(self):
+ """Custom build procedure for GAMESS-US: using compddi, compall and lked scripts."""
+ compddi = os.path.join(self.cfg['start_dir'], 'ddi', 'compddi')
+ run_cmd(compddi, log_all=True, simple=True)
+
+ # make sure the libddi.a library is present
+ libddi = os.path.join(self.cfg['start_dir'], 'ddi', 'libddi.a')
+ if not os.path.isfile(libddi):
+ self.log.error("The libddi.a library (%s) was never built" % libddi)
+ else:
+ self.log.info("The libddi.a library (%s) was successfully built." % libddi)
+
+ compall_cmd = os.path.join(self.cfg['start_dir'], 'compall')
+ compall = "%s %s %s" % (self.cfg['prebuildopts'], compall_cmd, self.cfg['buildopts'])
+ run_cmd(compall, log_all=True, simple=True)
+
+ cmd = "%s gamess %s" % (os.path.join(self.cfg['start_dir'], 'lked'), self.version)
+ run_cmd(cmd, log_all=True, simple=True)
+
+ def test_step(self):
+ """Run GAMESS-US tests (if 'runtest' easyconfig parameter is set to True)."""
+ # don't use provided 'runall' script for tests, since that only runs the tests single-core
+ if self.cfg['runtest']:
+ try:
+ cwd = os.getcwd()
+ os.chdir(self.testdir)
+ except OSError, err:
+ self.log.error("Failed to move to temporary directory for running tests: %s" % err)
+
+ # copy input files for exam<id> standard tests
+ for test_input in glob.glob(os.path.join(self.installdir, 'tests', 'standard', 'exam*.inp')):
+ try:
+ shutil.copy2(test_input, os.getcwd())
+ except OSError, err:
+ self.log.error("Failed to copy %s to %s: %s" % (test_input, os.getcwd(), err))
+
+ rungms = os.path.join(self.installdir, 'rungms')
+ test_env_vars = ['TMPDIR=%s' % self.testdir]
+ if self.toolchain.mpi_family() == toolchain.INTELMPI:
+ test_env_vars.extend([
+ 'I_MPI_FALLBACK=enable', # enable fallback in case first fabric fails (see $I_MPI_FABRICS_LIST)
+ 'I_MPI_HYDRA_BOOTSTRAP=fork', # tests are only run locally (2 processes), so no SSH required
+ ])
+
+ # run all exam<id> tests, dump output to exam<id>.log
+ n_tests = 47
+ for i in range(1, n_tests+1):
+ test_cmd = ' '.join(test_env_vars + [rungms, 'exam%02d' % i, self.version, '1', '2'])
+ (out, _) = run_cmd(test_cmd, log_all=True, simple=False)
+ write_file('exam%02d.log' % i, out)
+
+ # verify output of tests
+ check_cmd = os.path.join(self.installdir, 'tests', 'standard', 'checktst')
+ (out, _) = run_cmd(check_cmd, log_all=True, simple=False)
+ success_regex = re.compile("^All %d test results are correct" % n_tests, re.M)
+ if success_regex.search(out):
+ self.log.info("All tests ran successfully!")
+ else:
+ self.log.error("Not all tests ran successfully...")
+
+ # cleanup
+ os.chdir(cwd)
+ try:
+ shutil.rmtree(self.testdir)
+ except OSError, err:
+ self.log.error("Failed to remove test directory %s: %s" % (self.testdir, err))
+
+ def install_step(self):
+ """Skip install step, since we're building in the install directory."""
+ pass
+
+ def sanity_check_step(self):
+ """Custom sanity check for GAMESS-US."""
+ custom_paths = {
+ 'files': ['gamess.%s.x' % self.version, 'rungms'],
+ 'dirs': [],
+ }
+ super(EB_GAMESS_minus_US, self).sanity_check_step(custom_paths=custom_paths)
+
+ def make_module_extra(self):
+ """Define GAMESS-US specific variables in generated module file, i.e. $GAMESSUSROOT."""
+ txt = super(EB_GAMESS_minus_US, self).make_module_extra()
+ txt += self.module_generator.set_environment('GAMESSUSROOT', '$root')
+ txt += self.module_generator.prepend_paths("PATH", [''])
+ return txt
View
2  easybuild/easyblocks/g/gate.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2014 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
4 easybuild/easyblocks/g/gcc.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2014 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -525,7 +525,7 @@ def sanity_check_step(self):
bin_files.append('gfortran')
lib_files.extend(['libgfortran.%s' % sharedlib_ext, 'libgfortran.a'])
- if 'lto' in self.cfg['languages']:
+ if self.cfg['withlto']:
libexec_files.extend(['lto1', 'lto-wrapper'])
if os_type in ['Linux']:
libexec_files.append('liblto_plugin.%s' % sharedlib_ext)
View
2  easybuild/easyblocks/g/geant4.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
13 easybuild/easyblocks/g/genomeanalysistk.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -24,6 +24,7 @@
##
"""
Support for building and installing GenomeAnalysisTK, implemented as an easyblock.
+DEPRECATED, use generic Tarball easyblock instead.
@author: Stijn De Weirdt (Ghent University)
@author: Dries Verdegem (Ghent University)
@@ -39,7 +40,15 @@
class EB_GenomeAnalysisTK(EasyBlock):
- """Support for building and installing GenomeAnalysisTK."""
+ """
+ Support for building and installing GenomeAnalysisTK.
+ DEPRECATED, use generic Tarball easyblock instead.
+ """
+
+ def __init__(self, *args, **kwargs):
+ """Constructor."""
+ super(EB_GenomeAnalysisTK, self).__init__(*args, **kwargs)
+ self.log.deprecated("Use the generic Tarball easyblock rather than this software-specific easyblock", '3.0')
def configure_step(self):
"""No configure step for GenomeAnalysisTK"""
View
2  easybuild/easyblocks/g/ghc.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
8 easybuild/easyblocks/generic/__init__.py
@@ -1,10 +1,10 @@
##
-# Copyright 2009-2012 Ghent University
-# Copyright 2009-2012 Stijn De Weirdt
+# Copyright 2009-2015 Ghent University
+# Copyright 2009-2015 Stijn De Weirdt
# Copyright 2010 Dries Verdegem
-# Copyright 2010-2012 Kenneth Hoste
+# Copyright 2010-2015 Kenneth Hoste
# Copyright 2011 Pieter De Baets
-# Copyright 2011-2012 Jens Timmerman
+# Copyright 2011-2015 Jens Timmerman
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
33 easybuild/easyblocks/generic/binary.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -38,7 +38,7 @@
from easybuild.framework.easyblock import EasyBlock
from easybuild.framework.easyconfig import CUSTOM
-from easybuild.tools.filetools import rmtree2
+from easybuild.tools.filetools import mkdir, rmtree2
from easybuild.tools.run import run_cmd
@@ -54,9 +54,22 @@ def extra_options(extra_vars=None):
extra_vars = EasyBlock.extra_options(extra_vars)
extra_vars.update({
'install_cmd': [None, "Install command to be used.", CUSTOM],
+ # staged installation can help with the hard (potentially faulty) check on available disk space
+ 'staged_install': [False, "Perform staged installation via subdirectory of build directory", CUSTOM],
})
return extra_vars
+ def __init__(self, *args, **kwargs):
+ """Initialize Binary-specific variables."""
+ super(Binary, self).__init__(*args, **kwargs)
+
+ self.actual_installdir = None
+ if self.cfg['staged_install']:
+ self.actual_installdir = self.installdir
+ self.installdir = os.path.join(self.builddir, 'staged')
+ mkdir(self.installdir, parents=True)
+ self.log.info("Performing staged installation via %s" % self.installdir)
+
def extract_step(self):
"""Move all source files to the build directory"""
@@ -94,6 +107,22 @@ def install_step(self):
self.log.info("Installing %s using command '%s'..." % (self.name, cmd))
run_cmd(cmd, log_all=True, simple=True)
+ def post_install_step(self):
+ """Copy installation to actual installation directory in case of a staged installation."""
+ if self.cfg['staged_install']:
+ staged_installdir = self.installdir
+ self.installdir = self.actual_installdir
+ try:
+ # copytree expects target directory to not exist yet
+ if os.path.exists(self.installdir):
+ rmtree2(self.installdir)
+ shutil.copytree(staged_installdir, self.installdir)
+ except OSError, err:
+ tup = (staged_installdir, self.installdir, err)
+ self.log.error("Failed to move staged install from %s to %s: %s" % tup)
+
+ super(Binary, self).post_install_step()
+
def make_module_extra(self):
"""Add the install directory to the PATH."""
View
62 easybuild/easyblocks/generic/bundle.py
@@ -0,0 +1,62 @@
+##
+# Copyright 2009-2015 Ghent University
+#
+# This file is part of EasyBuild,
+# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
+# with support of Ghent University (http://ugent.be/hpc),
+# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
+# the Hercules foundation (http://www.herculesstichting.be/in_English)
+# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
+#
+# http://github.com/hpcugent/easybuild
+#
+# EasyBuild is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation v2.
+#
+# EasyBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>.
+##
+"""
+EasyBuild support for installing a bundle of modules, implemented as a generic easyblock
+
+@author: Stijn De Weirdt (Ghent University)
+@author: Dries Verdegem (Ghent University)
+@author: Kenneth Hoste (Ghent University)
+@author: Pieter De Baets (Ghent University)
+@author: Jens Timmerman (Ghent University)
+"""
+
+from easybuild.framework.easyblock import EasyBlock
+
+
+class Bundle(EasyBlock):
+ """
+ Bundle of modules: only generate module files, nothing to build/install
+ """
+
+ def configure_step(self):
+ """Do nothing."""
+ pass
+
+ def build_step(self):
+ """Do nothing."""
+ pass
+
+ def install_step(self):
+ """Do nothing."""
+ pass
+
+ def sanity_check_step(self):
+ """
+ Nothing is being installed, so just being able to load the (fake) module is sufficient
+ """
+ self.log.info("Testing loading of module '%s' by means of sanity check" % self.full_mod_name)
+ fake_mod_data = self.load_fake_module(purge=True)
+ self.log.debug("Cleaning up after testing loading of module")
+ self.clean_up_fake_module(fake_mod_data)
View
12 easybuild/easyblocks/generic/cmakemake.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -37,7 +37,6 @@
from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.environment import setvar
-from easybuild.tools.modules import ROOT_ENV_VAR_NAME_PREFIX
from easybuild.tools.run import run_cmd
@@ -57,6 +56,9 @@ def extra_options(extra_vars=None):
def configure_step(self, srcdir=None, builddir=None):
"""Configure build using cmake"""
+ if builddir is not None:
+ self.log.nosupport("CMakeMake.configure_step: named argument 'builddir' (should be 'srcdir')", "2.0")
+
# Set the search paths for CMake
include_paths = os.pathsep.join(self.toolchain.get_variable("CPPFLAGS", list))
library_paths = os.pathsep.join(self.toolchain.get_variable("LDFLAGS", list))
@@ -76,9 +78,6 @@ def configure_step(self, srcdir=None, builddir=None):
if srcdir is None:
if self.cfg.get('srcdir', None) is not None:
srcdir = self.cfg['srcdir']
- elif builddir is not None:
- self.log.deprecated("CMakeMake.configure_step: named argument 'builddir' (should be 'srcdir')", "2.0")
- srcdir = builddir
else:
srcdir = default_srcdir
@@ -96,6 +95,9 @@ def configure_step(self, srcdir=None, builddir=None):
if value is not None:
options.append("-D%s='%s'" % (option, value))
+ # show what CMake is doing by default
+ options.append("-DCMAKE_VERBOSE_MAKEFILE=ON")
+
options_string = " ".join(options)
command = "%s cmake %s %s %s" % (self.cfg['preconfigopts'], srcdir, options_string, self.cfg['configopts'])
View
2  easybuild/easyblocks/generic/cmakepythonpackage.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/generic/configuremake.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/generic/fortranpythonpackage.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
30 easybuild/easyblocks/generic/intelbase.py
@@ -1,5 +1,5 @@
# #
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -42,11 +42,8 @@
import easybuild.tools.environment as env
from easybuild.framework.easyblock import EasyBlock
from easybuild.framework.easyconfig import CUSTOM
-from easybuild.tools.filetools import rmtree2
from easybuild.tools.run import run_cmd
-# required for deprecated log in static function (ie no self)
-from easybuild.framework.easyconfig.licenses import License
from vsc import fancylogger
_log = fancylogger.getLogger('generic.intelbase')
@@ -97,9 +94,6 @@ def __init__(self, *args, **kwargs):
self.setup_local_home_subdir()
self.clean_home_subdir()
- if self.cfg._config['license'][0] is not None:
- _log.deprecated('No old style license parameter, use license_file', '2.0')
-
@staticmethod
def extra_options(extra_vars=None):
extra_vars = EasyBlock.extra_options(extra_vars)
@@ -113,9 +107,6 @@ def extra_options(extra_vars=None):
'm32': [False, "Enable 32-bit toolchain", CUSTOM],
})
- # Support for old easyconfigs with license parameter
- extra_vars.update({'license': [None, "License file (DEPRECATED, use 'license_file' instead)", CUSTOM]})
-
return extra_vars
def clean_home_subdir(self):
@@ -183,22 +174,7 @@ def configure_step(self):
if not license_specs:
self.log.debug("No env var from %s set, trying 'license_file' easyconfig parameter..." % lic_env_vars)
# obtain license path
- try:
- self.license_file = self.cfg['license_file']
- except:
- # the default should exist
- self.log.deprecated('No new style license_file parameter, license_file is now mandatory', '2.0')
- self.license_file = None
-
- if self.license_file is None:
- self.log.deprecated('Checking for old style license', '2.0')
- self.cfg.enable_templating = False
- lic = self.cfg['license']
- # old style license is a path (type string)
- if isinstance(lic, License) and isinstance(lic, str):
- self.log.deprecated('No old style license parameter, license has to be pure License subclass', '2.0')
- self.license_file = lic
- self.cfg.enable_templating = True
+ self.license_file = self.cfg['license_file']
if self.license_file:
self.log.info("Using license file %s" % self.license_file)
@@ -285,7 +261,7 @@ def install_step(self, silent_cfg_names_map=None, silent_cfg_extras=None):
# also check whether specified activation type makes sense
lic_activation = self.cfg['license_activation']
lic_file_server_activations = [ACTIVATION_LIC_FILE, ACTIVATION_LIC_SERVER]
- other_activations = [act for act in ACTIVATION_TYPES if not act in lic_file_server_activations]
+ other_activations = [act for act in ACTIVATION_TYPES if act not in lic_file_server_activations]
lic_file_entry = ""
if lic_activation in lic_file_server_activations:
lic_file_entry = "%(license_file_name)s=%(license_file)s"
View
2  easybuild/easyblocks/generic/jar.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/generic/packedbinary.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/generic/perlmodule.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
2  easybuild/easyblocks/generic/pythonpackage.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
View
30 easybuild/easyblocks/generic/rpackage.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -32,9 +32,10 @@
@author: Toon Willems (Ghent University)
@author: Balazs Hajgato (Vrije Universiteit Brussel)
"""
+import os
import shutil
-from easybuild.easyblocks.r import EXTS_FILTER_R_PACKAGES
+from easybuild.easyblocks.r import EXTS_FILTER_R_PACKAGES, EB_R
from easybuild.framework.extensioneasyblock import ExtensionEasyBlock
from easybuild.tools.run import run_cmd, parse_log_for_error
@@ -72,7 +73,7 @@ def __init__(self, *args, **kwargs):
self.configureargs = []
self.ext_src = None
- def make_r_cmd(self):
+ def make_r_cmd(self, prefix=None):
"""Create a command to run in R to install an R package."""
confvars = "confvars"
confargs = "confargs"
@@ -87,12 +88,17 @@ def make_r_cmd(self):
confargslist = confargslist + "; names(%s)=\"%s\"" % (confargs, self.name)
confargsstr = ", configure.args=%s" % confargs
+ if prefix:
+ prefix = '"%s", ' % prefix
+ else:
+ prefix = ''
+
r_cmd = """
options(repos=c(CRAN="http://www.freestatistics.org/cran"))
%s
%s
- install.packages("%s", dependencies = FALSE %s%s)
- """ % (confvarslist, confargslist, self.name, confvarsstr, confargsstr)
+ install.packages("%s", %s dependencies = FALSE %s%s)
+ """ % (confvarslist, confargslist, self.name, prefix, confvarsstr, confargsstr)
cmd = "R -q --no-save"
self.log.debug("make_r_cmd returns %s with input %s" % (cmd, r_cmd))
@@ -172,6 +178,16 @@ def install_step(self):
def run(self):
"""Install R package as an extension."""
+ # determine location
+ if isinstance(self.master, EB_R):
+ # extension is being installed as part of an R installation/module
+ (out, _) = run_cmd("R RHOME", log_all=True, simple=False)
+ rhome = out.strip()
+ lib_install_prefix = os.path.join(rhome, 'library')
+ else:
+ # extension is being installed in a separate installation prefix
+ lib_install_prefix = self.installdir
+
if self.patches:
super(RPackage, self).run(unpack_src=True)
else:
@@ -180,10 +196,10 @@ def run(self):
if self.src:
self.ext_src = self.src
self.log.debug("Installing R package %s version %s." % (self.name, self.version))
- cmd, stdin = self.make_cmdline_cmd()
+ cmd, stdin = self.make_cmdline_cmd(prefix=lib_install_prefix)
else:
self.log.debug("Installing most recent version of R package %s (source not found)." % self.name)
- cmd, stdin = self.make_r_cmd()
+ cmd, stdin = self.make_r_cmd(prefix=lib_install_prefix)
self.install_R_package(cmd, inp=stdin)
View
105 easybuild/easyblocks/generic/rpm.py
@@ -1,5 +1,5 @@
##
-# Copyright 2009-2013 Ghent University
+# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
@@ -36,14 +36,57 @@
import glob
import os
import re
+import tempfile
from distutils.version import LooseVersion
from os.path import expanduser
+from vsc.utils import fancylogger
import easybuild.tools.environment as env
from easybuild.easyblocks.generic.binary import Binary
-from easybuild.framework.easyblock import EasyBlock
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.run import run_cmd
+from easybuild.tools.systemtools import check_os_dependency
+
+
+_log = fancylogger.getLogger('easyblocks.generic.rpm')
+
+
+def rebuild_rpm(rpm_path, targetdir):
+ """Rebuild the RPM on the specified location, to make it relocatable."""
+ # make sure that rpmrebuild command is available
+ if not check_os_dependency('rpmrebuild'):
+ _log.error("Command 'rpmrebuild' is required but not available.")
+
+ rpmmacros = os.path.join(expanduser('~'), '.rpmmacros')
+ if os.path.exists(rpmmacros):
+ _log.error("rpmmacros file %s found which will override any other settings, so exiting." % rpmmacros)
+
+ rpmrebuild_tmpdir = os.path.join(tempfile.gettempdir(), "rpmrebuild")
+ env.setvar("RPMREBUILD_TMPDIR", rpmrebuild_tmpdir)
+
+ try:
+ if not os.path.exists(rpmrebuild_tmpdir):
+ os.makedirs(rpmrebuild_tmpdir)
+ _log.debug("Created RPMREBUILD_TMPDIR dir %s" % rpmrebuild_tmpdir)
+ if not os.path.exists(targetdir):
+ os.makedirs(targetdir)
+ _log.debug("Created target directory for rebuilt RPMs %s" % targetdir)
+ except OSError, err:
+ _log.error("Failed to create directories for rebuilding RPM: %s" % err)
+
+ _log.debug("Rebuilding %s in %s to make it relocatable" % (rpm_path, targetdir))
+ cmd = ' '.join([
+ "rpmrebuild -v",
+ # replace whathever prefix is set with '/'
+ r"""--change-spec-whole='sed -e "s/^Prefix:.*/Prefix: \//"'""",
+ # comment out any specifications that involve relative file path (starting with '.') (??)
+ r"""--change-spec-whole='sed -e "s/^\(.*:[ ]\+\..*\)/#ERROR \1/"'""",
+ "--notest-install",
+ "-p -d",
+ targetdir,
+ rpm_path,
+ ])
+ run_cmd(cmd, log_all=True, simple=True)
class Rpm(Binary):
@@ -57,12 +100,12 @@ def __init__(self, *args, **kwargs):
"""Initialize class variables."""
super(Rpm, self).__init__(*args, **kwargs)
- self.rebuildRPM = False
+ self.rebuild_rpm = False
@staticmethod
def extra_options(extra_vars=None):
"""Extra easyconfig parameters specific to RPMs."""
- extra_vars = EasyBlock.extra_options(extra_vars)
+ extra_vars = Binary.extra_options(extra_vars)
extra_vars.update({
'force': [False, "Use force", CUSTOM],
'preinstall': [False, "Enable pre install", CUSTOM],
@@ -75,9 +118,8 @@ def configure_step(self):
"""Custom configuration procedure for RPMs: rebuild RPMs for relocation if required."""
# make sure that rpm is available
- if not 'rpm' in self.cfg['osdependencies']:
- self.cfg['osdependencies'].append('rpm')
- self.cfg.validate_os_deps()
+ if not check_os_dependency('rpm'):
+ self.log.error("Command 'rpm' is required but not available.")
# determine whether RPMs need to be rebuilt to make relocation work
cmd = "rpm --version"
@@ -90,59 +132,26 @@ def configure_step(self):
if res:
ver = res.groupdict()['version']
+ # rebuilding is required on SL6, which implies rpm v4.8 (works fine without rebuilding on SL5)
if LooseVersion(ver) >= LooseVersion('4.8.0'):
- self.rebuildRPM = True
+ self.rebuild_rpm = True
self.log.debug("Enabling rebuild of RPMs to make relocation work...")
else:
self.log.error("Checking RPM version failed, so just carrying on with the default behavior...")
- if self.rebuildRPM:
- self.rebuildRPMs()