actions.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt.
  6. from pisi.actionsapi import cmaketools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import get
  11. def setup():
  12. pisitools.dosed("INSTALL/make.inc.gfortran", "-O2 -frecursive", "")
  13. pisitools.dosed("INSTALL/make.inc.gfortran", "-O0 -frecursive", "")
  14. '''
  15. shelltools.copy("INSTALL/make.inc.gfortran", "make.inc")
  16. if get.ARCH() == "x86_64":
  17. pisitools.dosed("make.inc", "-O2", "%s -fPIC -m64 -funroll-all-loops" % get.CFLAGS())
  18. pisitools.dosed("make.inc", "NOOPT =", "NOOPT =-m64 -fPIC ")
  19. else:
  20. pisitools.dosed("make.inc", "-O2", "%s -fPIC -funroll-all-loops" % get.CFLAGS())
  21. '''
  22. shelltools.makedirs("build")
  23. shelltools.cd("build")
  24. options = "-DCMAKE_INSTALL_LIBDIR=lib \
  25. -DBUILD_SHARED_LIBS=ON \
  26. -DCBLAS=ON \
  27. -DBUILD_TESTING=OFF"
  28. if get.buildTYPE() == "static":
  29. options = "-DCMAKE_INSTALL_LIBDIR=lib \
  30. -DBUILD_SHARED_LIBS=OFF \
  31. -DCBLAS=ON \
  32. -DBUILD_TESTING=OFF"
  33. cmaketools.configure(options, sourceDir="..")
  34. def build():
  35. shelltools.cd("build")
  36. cmaketools.make()
  37. def install():
  38. shelltools.cd("build")
  39. cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
  40. shelltools.cd("../")
  41. pisitools.dodoc("LICENSE", "README.md")