INSTALL 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2012 Université de Bordeaux 1
  4. # Copyright (C) 2010, 2011, 2013 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. * Installing StarPU on a Unix machine
  19. * Installing StarPU on Windows
  20. * Running StarPU Applications on Microsoft Visual C
  21. Installing StarPU on a Unix machine
  22. ------------------------------------
  23. $ ./autogen.sh # If running the SVN version
  24. $ ./configure --prefix=<prefix>
  25. $ make
  26. $ make install
  27. Installing StarPU on Windows
  28. ----------------------------
  29. If you are building from a tarball downloaded from the website, you can skip the
  30. cygwin part.
  31. 1. Install cygwin
  32. http://cygwin.com/install.html
  33. Make sure the following packages are available:
  34. - (Devel)/subversion
  35. - (Devel)/libtool
  36. - (Devel)/gcc
  37. - (Devel)/make
  38. - your favorite editor (vi, emacs, ...)
  39. - (Devel)/gdb
  40. - (Archive)/zip
  41. - (Devel)/pkg-config
  42. 2. Install mingw
  43. http://www.mingw.org/
  44. 3. Install hwloc (not mandatory, but strongly recommended)
  45. http://www.open-mpi.org/projects/hwloc
  46. Be careful which version you are installing. Even if your machine
  47. runs windows 64 bits, if you are running a 32 bits mingw (check the
  48. output of the command uname -a), you will need to install the 32
  49. bits version of hwloc.
  50. 4. Install Microsoft Visual C++ Studio Express
  51. http://www.microsoft.com/express/Downloads
  52. Add in your path the following directories.
  53. (adjusting where necessary for the Installation location according to VC
  54. version and on 64 and 32bit Windows versions)
  55. On cygwin, with Visual C++ 2010 e.g.;
  56. export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE":$PATH
  57. export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin":$PATH
  58. On MingW, with Visual C++ 2010, e.g.;
  59. export PATH="/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE":$PATH
  60. export PATH="/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin":$PATH
  61. Try to call <cl.exe>, <lib.exe> and <link.exe> without any option to make
  62. sure these dump their help output with a series of options, otherwise no
  63. .def or .lib file will be produced.
  64. 5. Install GPU Drivers (not mandatory)
  65. 5.1 Install Cuda
  66. http://developer.nvidia.com/object/cuda_3_2_downloads.html
  67. You need to install at least the CUDA toolkit.
  68. libtool is not able to find the libraries automatically, you
  69. need to make some copies:
  70. copy c:\cuda\lib\cuda.lib c:\cuda\lib\libcuda.lib
  71. copy c:\cuda\lib\cudart.lib c:\cuda\lib\libcudart.lib
  72. copy c:\cuda\lib\cublas.lib c:\cuda\lib\libcublas.lib
  73. copy c:\cuda\lib\cufft.lib c:\cuda\lib\libcufft.lib
  74. copy c:\cuda\lib\OpenCL.lib c:\cuda\lib\libOpenCL.lib
  75. (and if the version of your CUDA driver is >= 3.2)
  76. copy c:\cuda\lib\curand.lib c:\cuda\lib\libcurand.lib
  77. Add the CUDA bin directory in your path
  78. export PATH=/cygdrive/c/CUDA/bin:$PATH
  79. Since we build code using CUDA headers with gcc instead of Visual studio,
  80. a fix is needed: c:\cuda\include\host_defines.h has a bogus CUDARTAPI
  81. definition which makes linking fail completely. Replace the first
  82. occurence of
  83. #define CUDARTAPI
  84. with
  85. #ifdef _WIN32
  86. #define CUDARTAPI __stdcall
  87. #else
  88. #define CUDARTAPI
  89. #endif
  90. While at it, you can also comment the __cdecl definition to avoid spurious
  91. warnings.
  92. 5.2 Install OpenCL
  93. http://developer.nvidia.com/object/opencl-download.html
  94. You need to download the NVIDIA Drivers for your version of
  95. Windows. Executing the file will extract all files in a given
  96. directory. The the driver installation will start, it will fail
  97. if no compatibles drivers can be found on your system.
  98. Anyway, you should copy the *.dl_ files from the directory
  99. (extraction path) in the bin directory of the CUDA installation
  100. directory (the directory should be v3.2/bin/)
  101. 5.3 Install MsCompress
  102. http://gnuwin32.sourceforge.net/packages/mscompress.htm
  103. Go in the CUDA bin directory, uncompress .dl_ files and rename
  104. them in .dll files
  105. cp /cygdrive/c/NVIDIA/DisplayDriver/190.89/International/*.dl_ .
  106. for i in *.dl_ ; do /cygdrive/c/Program\ Files/GnuWin32/bin/msexpand.exe $i ; mv ${i%_} ${i%_}l ; done
  107. If you are building from a tarball downloaded from the website, you can skip the
  108. autogen.sh part.
  109. 6. Start autogen.sh from cygwin
  110. cd starpu-trunk
  111. ./autogen.sh
  112. 7. Start a MinGW shell
  113. /cygdrive/c/MinGW/msys/1.0/bin/sh.exe --login -i
  114. 8. Configure, make, install from MinGW
  115. If you have a non-english version of windows, use
  116. export LANG=C
  117. else libtool has troubles parsing the translated output of the toolchain.
  118. cd starpu-trunk
  119. mkdir build
  120. cd build
  121. ../configure --prefix=$PWD/target \
  122. --with-hwloc=<HWLOC installation directory> \
  123. --with-cuda-dir=<CUDA installation directory> \
  124. --with-cuda-lib-dir=<CUDA installation directory>/lib/Win32 \
  125. --with-opencl-dir=<CUDA installation directory>
  126. --disable-build-doc
  127. --disable-build-examples --enable-quick-check
  128. make
  129. make check # not necessary but well advised
  130. make install
  131. The option --disable-build-doc is necessary if you do not have a
  132. working TeX binary installed as it is needed by texi2dvi to build
  133. the documentation.
  134. To fasten the compilation process, the option
  135. --disable-build-examples may also be used to disable the
  136. compilation of the applications in the examples directory. Only the
  137. applications in the test directory will be build.
  138. Also convert a couple of files to CRLF:
  139. sed -e 's/$/'$'\015'/ < README > $prefix/README.txt
  140. sed -e 's/$/'$'\015'/ < AUTHORS > $prefix/AUTHORS.txt
  141. sed -e 's/$/'$'\015'/ < COPYING.LGPL > $prefix/COPYING.LGPL.txt
  142. 9. If you want your StarPU installation to be standalone, you need to
  143. copy the DLL files from hwloc, Cuda, and OpenCL into the StarPU
  144. installation bin directory, as well as MinGW/bin/libpthread*dll
  145. cp <CUDA directory>/bin/*dll target/bin
  146. cp <HWLOC directory>/bin/*dll target/bin
  147. cp /cygdrive/c/MinGW/bin/libpthread*dll target/bin
  148. and set the StarPU bin directory in your path.
  149. export PATH=<StarPU installation directory>/bin:$PATH
  150. Running StarPU Applications on Microsoft Visual C
  151. -------------------------------------------------
  152. Batch files are provided to run StarPU applications under Microsoft
  153. Visual C. They are installed in path_to_starpu/bin/msvc.
  154. To execute a StarPU application, you first need to set the environment
  155. variable STARPUPATH.
  156. cd c:\cygwin\home\ci\starpu\
  157. set STARPUPATH=c:\cygwin\home\ci\starpu\
  158. cd bin\msvc
  159. starpu_exec.bat starpu_simple.c
  160. The batch script will run Microsoft Visual C with a basic project file
  161. to run the given application.
  162. The batch script starpu_clean.bat can be used to delete all
  163. compilation generated files.