Просмотр исходного кода

mscv: new batch file to execute starpu applications from command prompt

Nathalie Furmento лет назад: 11
Родитель
Сommit
23afae6c80
4 измененных файлов с 80 добавлено и 4 удалено
  1. 2 0
      ChangeLog
  2. 20 4
      INSTALL
  3. 2 0
      tools/Makefile.am
  4. 56 0
      tools/msvc/starpu_exec.bat

+ 2 - 0
ChangeLog

@@ -59,6 +59,8 @@ Small features:
   * New function starpu_perfmodel_directory() to print directory
     storing performance models. Available through the new option -d of
     the tool starpu_perfmodel_display
+  * New batch files to execute StarPU applications under Microsoft
+    Visual Studio (They are installed in path_to_starpu/bin/msvc)/
 
 Changes:
   * Fix of the livelock issue discovered while executing applications

+ 20 - 4
INSTALL

@@ -225,10 +225,10 @@ Visual C. They are installed in path_to_starpu/bin/msvc.
 To execute a StarPU application, you first need to set the environment
 variable STARPUPATH.
 
-cd c:\cygwin\home\ci\starpu\
-set STARPUPATH=c:\cygwin\home\ci\starpu\
-cd bin\msvc
-starpu_open.bat starpu_simple.c
+c:\....> cd c:\cygwin\home\ci\starpu\
+c:\....> set STARPUPATH=c:\cygwin\home\ci\starpu\
+c:\....> cd bin\msvc
+c:\....> starpu_open.bat starpu_simple.c
 
 The batch script will run Microsoft Visual C with a basic project file
 to run the given application.
@@ -236,3 +236,19 @@ to run the given application.
 The batch script starpu_clean.bat can be used to delete all
 compilation generated files.
 
+The batch script starpu_exec.bat can be used to compile and execute a
+StarPU application from the command prompt.
+
+c:\....> cd c:\cygwin\home\ci\starpu\
+c:\....> set STARPUPATH=c:\cygwin\home\ci\starpu\
+c:\....> cd bin\msvc
+c:\....> starpu_exec.bat ..\..\..\..\examples\basic_examples\hello_world.c
+
+MSVS StarPU Execution
+...
+/out:hello_world.exe
+...
+Hello world (params = {1, 2.00000})
+Callback function got argument 0000042
+c:\....>
+

+ 2 - 0
tools/Makefile.am

@@ -31,6 +31,7 @@ EXTRA_DIST =				\
 	dev/rename.sh			\
 	msvc/starpu_clean.bat		\
 	msvc/starpu_open.bat		\
+	msvc/starpu_exec.bat		\
 	msvc/starpu.sln			\
 	msvc/starpu/starpu.vcxproj
 
@@ -127,6 +128,7 @@ STARPU_MSVC_dir		 =	$(bindir)
 nobase_STARPU_MSVC__DATA =		\
 	msvc/starpu_clean.bat		\
 	msvc/starpu_open.bat		\
+	msvc/starpu_exec.bat		\
 	msvc/starpu.sln			\
 	msvc/starpu/starpu.vcxproj
 endif

+ 56 - 0
tools/msvc/starpu_exec.bat

@@ -0,0 +1,56 @@
+@ECHO OFF
+
+REM StarPU --- Runtime system for heterogeneous multicore architectures.
+REM
+REM Copyright (C) 2013  Centre National de la Recherche Scientifique
+REM
+REM StarPU is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU Lesser General Public License as published by
+REM the Free Software Foundation; either version 2.1 of the License, or (at
+REM your option) any later version.
+REM
+REM StarPU is distributed in the hope that it will be useful, but
+REM WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+REM
+REM See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+TITLE MSVC StarPU Execution
+ECHO.
+ECHO MSVC StarPU Execution
+ECHO.
+ECHO Using StarPU in %STARPUPATH%
+
+IF "%1" == "" GOTO invalidparam
+IF NOT EXIST %1 GOTO invalidparam
+IF NOT EXIST %STARPUPATH%\AUTHORS GOTO starpunotfound
+
+mkdir starpu
+FOR %%F IN (%STARPUPATH%\bin\*dll) DO COPY %%F starpu\%%~nF
+FOR %%F IN (%STARPUPATH%\bin\*dll) DO COPY %%F starpu
+COPY c:\MinGW\bin\pthreadGC2.dll starpu
+COPY %STARPUPATH%\lib\libstarpu-1.0.lib starpu
+
+set OLDPATH=%PATH%
+call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
+echo cd starpu
+echo dir %STARPUPATH%\include\starpu\1.0
+cl %1 /I%STARPUPATH%\include\starpu\1.0 /link starpu\libstarpu-1.0.lib
+
+set PATH=starpu;%PATH%
+.\%~n1.exe
+
+set PATH=%OLDPATH%
+GOTO end
+
+:invalidparam
+  ECHO.
+  ECHO Syntax error. You need to give the name of a StarPU application
+  GOTO end
+
+:starpunotfound
+  ECHO.
+  ECHO You need to set the variable STARPUPATH to a valid StarPU installation directory
+  GOTO end
+
+:end