README.dev 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009, 2010, 2011 Université de Bordeaux 1
  4. # Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. Contents
  17. ========
  18. - Developer Warnings
  19. - Coding Conventions
  20. - Installing StarPU on Windows
  21. Developer Warnings
  22. ------------------
  23. They are enabled only if the STARPU_DEVEL environment variable is
  24. defined to a non-empty value, when calling configure.
  25. Coding Conventions
  26. ------------------
  27. - Prefix names of public objects (types, functions, etc.) with "starpu"
  28. - Prefix names of internal objects (types, functions, etc.) with "_starpu"
  29. - Names for qualified types (struct, union, enum) do not end with _t, _s or similar.
  30. Use _t only for typedef types, such as opaque public types, e.g
  31. typedef struct _starpu_data_state* starpu_data_handle_t;
  32. or
  33. typedef uint64_t starpu_tag_t;
  34. - When a variable can only take a finite set of values, use an enum
  35. type instead of defining macros for each of the values.
  36. Installing StarPU on windows
  37. ----------------------------
  38. If you are building from a tarball downloaded from the website, you can skip the
  39. cygwin part.
  40. 1. Install cygwin
  41. http://cygwin.com/install.html
  42. Make sure the following packages are available:
  43. - (Devel)/subversion
  44. - (Devel)/libtool
  45. - (Devel)/gcc
  46. - (Devel)/make
  47. - your favorite editor (vi, emacs, ...)
  48. - (Devel)/gdb
  49. - (Archive)/zip
  50. - (Devel)/pkg-config
  51. 2. Install mingw
  52. http://sourceforge.net/projects/mingw/
  53. 3. Install hwloc (not mandatory)
  54. http://www.open-mpi.org/projects/hwloc
  55. 4. Install Microsoft Visual C++ Studio Express
  56. http://www.microsoft.com/express/Downloads
  57. Add in your path the following directories.
  58. (adjusting where necessary for the Installation location according to VC
  59. version and on 64 and 32bit Windows versions)
  60. On cygwin, with Visual C++ 2010 e.g.;
  61. export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE":$PATH
  62. export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin":$PATH
  63. On MingW, with Visual C++ 2010, e.g.;
  64. export PATH="/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE":$PATH
  65. export PATH="/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin":$PATH
  66. Try to call <lib.exe> and <link.exe> without any option to make sure these
  67. dump their help output, else no .def or .lib file will be produced.
  68. 5. Install GPU Drivers (not mandatory)
  69. 5.1 Install Cuda
  70. http://developer.nvidia.com/object/cuda_3_2_downloads.html
  71. You need to install at least the CUDA toolkit.
  72. libtool is not able to find the libraries automatically, you
  73. need to make some copies:
  74. copy c:\cuda\lib\cuda.lib c:\cuda\lib\libcuda.lib
  75. copy c:\cuda\lib\cudart.lib c:\cuda\lib\libcudart.lib
  76. copy c:\cuda\lib\cublas.lib c:\cuda\lib\libcublas.lib
  77. copy c:\cuda\lib\cufft.lib c:\cuda\lib\libcufft.lib
  78. copy c:\cuda\lib\OpenCL.lib c:\cuda\lib\libOpenCL.lib
  79. (and if the version of your CUDA driver is >= 3.2)
  80. copy c:\cuda\lib\curand.lib c:\cuda\lib\libcurand.lib
  81. Add the CUDA bin directory in your path
  82. export PATH=/cygdrive/c/CUDA/bin:$PATH
  83. Since we tell nvcc to build CUDA code with gcc instead of Visual studio,
  84. a fix is needed: c:\cuda\include\host_defines.h has a bogus CUDARTAPI
  85. definition which makes linking fail completely. Replace the first
  86. occurence of
  87. #define CUDARTAPI
  88. with
  89. #ifdef _WIN32
  90. #define CUDARTAPI __stdcall
  91. #else
  92. #define CUDARTAPI
  93. #endif
  94. While at it, you can also comment the __cdecl definition to avoid spurious
  95. warnings.
  96. 5.2 Install OpenCL
  97. http://developer.nvidia.com/object/opencl-download.html
  98. You need to download the NVIDIA Drivers for your version of
  99. Windows. Executing the file will extract all files in a given
  100. directory. The the driver installation will start, it will fail
  101. if no compatibles drivers can be found on your system.
  102. Anyway, you should copy the *.dl_ files from the directory
  103. (extraction path) in the bin directory of the CUDA installation
  104. directory (the directory should be v3.2/bin/)
  105. 5.3 Install MsCompress
  106. http://gnuwin32.sourceforge.net/packages/mscompress.htm
  107. Go in the CUDA bin directory, uncompress .dl_ files and rename
  108. them in .dll files
  109. cp /cygdrive/c/NVIDIA/DisplayDriver/190.89/International/*.dl_ .
  110. for i in *.dl_ ; do /cygdrive/c/Program\ Files/GnuWin32/bin/msexpand.exe $i ; mv ${i%_} ${i%_}l ; done
  111. If you are building from a tarball downloaded from the website, you can skip the
  112. autogen.sh part.
  113. 6. Start autogen.sh from cygwin
  114. cd starpu-trunk
  115. ./autogen.sh
  116. 7. Start a MinGW shell
  117. /cygdrive/c/MinGW/msys/1.0/bin/sh.exe --login -i
  118. 8. Configure, make, install from MinGW
  119. If you have a non-english version of windows, use
  120. export LANG=C
  121. else libtool has troubles parsing the translated output of the toolchain.
  122. cd starpu-trunk
  123. mkdir build
  124. cd build
  125. ../configure --prefix=$PWD/target --disable-default-drand48 \
  126. --with-hwloc=<HWLOC installation directory> \
  127. --with-cuda-dir=<CUDA installation directory> \
  128. --with-cuda-lib-dir=<CUDA installation directory>/lib/Win32 \
  129. --with-opencl-dir=<CUDA installation directory>
  130. make
  131. make install
  132. Also convert a couple of files to CRLF:
  133. sed -e 's/$/'$'\015'/ < README > $PWD/target/README.txt
  134. sed -e 's/$/'$'\015'/ < AUTHORS > $PWD/target/AUTHORS.txt
  135. sed -e 's/$/'$'\015'/ < COPYING.LGPL > $PWD/target/COPYING.LGPL.txt
  136. 9. If you want your StarPU installation to be standalone, you need to
  137. copy the DLL files from hwloc, Cuda, and OpenCL into the StarPU
  138. installation bin directory, as well as MinGW/bin/libpthread*dll
  139. cp <CUDA directory>/bin/*dll target/bin
  140. cp <HWLOC directory>/bin/*dll target/bin
  141. cp /cygdrive/c/MinGW/bin/libpthread*dll target/bin
  142. and set the StarPU bin directory in your path.
  143. export PATH=<StarPU installation directory>/bin:$PATH