actions.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 shelltools
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import cmaketools
  10. from pisi.actionsapi import get
  11. WorkDir="fftw-%s" % get.srcVERSION()
  12. def setup():
  13. autotools.autoreconf("-fi")
  14. shelltools.copytree("../fftw-%s" % get.srcVERSION(), "../fftw-%s-double" % get.srcVERSION())
  15. shelltools.copytree("../fftw-%s" % get.srcVERSION(), "../fftw-%s-long-double" % get.srcVERSION())
  16. shelltools.copytree("../fftw-%s" % get.srcVERSION(), "../fftw-%s-quad" % get.srcVERSION())
  17. shelltools.copytree("../fftw-%s" % get.srcVERSION(), "../fftw-%s-cmake" % get.srcVERSION())
  18. autotools.configure("--enable-sse \
  19. --enable-shared \
  20. --disable-static \
  21. --disable-dependency-tracking \
  22. --enable-threads \
  23. --enable-mpi \
  24. --enable-fortran \
  25. --enable-single")
  26. shelltools.cd("../fftw-%s-quad" % get.srcVERSION())
  27. autotools.configure("--enable-quad-precision \
  28. --enable-shared \
  29. --disable-static \
  30. --disable-dependency-tracking \
  31. --enable-fortran \
  32. --enable-threads")
  33. # The only difference here is that there is no --enable-float
  34. shelltools.cd("../fftw-%s-double" % get.srcVERSION())
  35. autotools.configure("--enable-sse2 \
  36. --enable-shared \
  37. --disable-static \
  38. --enable-fortran \
  39. --disable-dependency-tracking \
  40. --enable-threads")
  41. # The only difference here is --enable-long-double
  42. shelltools.cd("../fftw-%s-long-double" % get.srcVERSION())
  43. autotools.configure("--enable-shared \
  44. --disable-static \
  45. --disable-dependency-tracking \
  46. --enable-threads \
  47. --enable-fortran \
  48. --enable-long-double")
  49. shelltools.cd("../fftw-%s-cmake" % get.srcVERSION())
  50. shelltools.system("sed -e 's/3.6.9/3.6.10/' -i CMakeLists.txt")
  51. cmaketools.configure("-B build \
  52. -D CMAKE_INSTALL_PREFIX=/usr \
  53. -D CMAKE_BUILD_TYPE=None \
  54. -D ENABLE_OPENMP=ON \
  55. -D ENABLE_THREADS=ON \
  56. -D ENABLE_FLOAT=ON \
  57. -D ENABLE_LONG_DOUBLE=ON \
  58. -D ENABLE_QUAD_PRECISION=ON \
  59. ")
  60. # -D ENABLE_AVX2=ON \
  61. # -D ENABLE_AVX=ON \
  62. # -D ENABLE_SSE=ON \
  63. # -D ENABLE_SSE2=ON \
  64. #def check():
  65. #autotools.make("check")
  66. #shelltools.cd("../fftw-%s-double" % get.srcVERSION())
  67. #autotools.make("check")
  68. #shelltools.cd("../fftw-%s-long-double" % get.srcVERSION())
  69. #autotools.make("check")
  70. #shelltools.cd("../fftw-%s-quad" % get.srcVERSION())
  71. #autotools.make("check")
  72. def build():
  73. autotools.make()
  74. shelltools.cd("../fftw-%s-double" % get.srcVERSION())
  75. autotools.make()
  76. shelltools.cd("../fftw-%s-long-double" % get.srcVERSION())
  77. autotools.make()
  78. shelltools.cd("../fftw-%s-quad" % get.srcVERSION())
  79. autotools.make()
  80. shelltools.cd("../fftw-%s-cmake" % get.srcVERSION())
  81. shelltools.system("export F77='gfortran'")
  82. shelltools.export("CFLAGS", " -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math")
  83. shelltools.cd("build")
  84. cmaketools.make()
  85. # shelltools.cd("../fftw-%s-cmake" % get.srcVERSION())
  86. shelltools.system("""sed -e 's|\(IMPORTED_LOCATION_NONE\).*|\1 "/usr/lib/libfftw3.so.3"|' -i FFTW3LibraryDepends.cmake""")
  87. def install():
  88. # shelltools.cd("../fftw-%s" % get.srcVERSION())
  89. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  90. shelltools.cd("../fftw-%s-double" % get.srcVERSION())
  91. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  92. shelltools.cd("../fftw-%s-long-double" % get.srcVERSION())
  93. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  94. shelltools.cd("../fftw-%s-quad" % get.srcVERSION())
  95. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  96. shelltools.cd("../fftw-%s" % get.srcVERSION())
  97. shelltools.cd("../fftw-%s-cmake" % get.srcVERSION())
  98. shelltools.cd("build")
  99. cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
  100. pisitools.insinto("/usr/lib/cmake/fftw3", "FFTW3LibraryDepends.cmake")
  101. pisitools.dohtml("../doc/html/*")
  102. shelltools.cd("..")
  103. pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING", "NEWS", "README", "TODO", "CONVENTIONS")