Browse Source

Rework the way to pass parameters to ./mic-configure: parse them once for all, to pick up the already-existing prefix and coi-dir, add mic-host, and assume the user has the cross-compilation tools in PATH, which he already has to do anyway.

Samuel Thibault 12 years ago
parent
commit
e0f117f5c6

+ 16 - 0
doc/doxygen/chapters/configure_options.doxy

@@ -329,6 +329,22 @@ Use the compiler <c>mpicc</c> at <c>path</c>, for StarPU-MPI.
 Enable the activity polling method for StarPU-MPI.
 Enable the activity polling method for StarPU-MPI.
 </dd>
 </dd>
 
 
+<dt>--with-coi-dir</dt>
+<dd>
+\anchor with-coi-dir
+\addindex __configure__--with-coi-dir
+Specify the directory to the COI library for MIC support.
+The default value is <c>/opt/intel/mic/coi</c>
+</dd>
+
+<dt>--mic-host</dt>
+<dd>
+\anchor mic-host
+\addindex __configure__--mic-host
+Specify the precise MIC architecture host identifier.
+The default value is <c>x86_64-k1om-linux</c>
+</dd>
+
 \section AdvancedConfiguration Advanced Configuration
 \section AdvancedConfiguration Advanced Configuration
 
 
 <dl>
 <dl>

+ 0 - 25
doc/doxygen/chapters/environment_variables.doxy

@@ -345,31 +345,6 @@ to 0. It is enabled by default or for any other values of the variable
 \ref STARPU_MPI_CACHE.
 \ref STARPU_MPI_CACHE.
 </dd>
 </dd>
 
 
-<dt>STARPU_MIC_HOST</dt>
-<dd>
-\anchor STARPU_MIC_HOST
-\addindex __env__STARPU_MIC_HOST
-Defines the value of the parameter <c>--host</c> passed to
-<c>configure</c> for the cross-compilation. The current default is
-<c>x86_64-k1om-linux</c>.
-</dd>
-
-<dt>STARPU_MIC_CC_PATH</dt>
-<dd>
-\anchor STARPU_MIC_CC_PATH
-\addindex __env__STARPU_MIC_CC_PATH
-Defines the path to the MIC cross-compiler. The current default is
-<c>/usr/linux-k1om-4.7/bin/</c>
-</dd>
-
-<dt>STARPU_COI_DIR</dt>
-<dd>
-\anchor STARPU_COI_DIR
-\addindex __env__STARPU_COI_DIR
-Defines the path to the COI library. The current default is
-<c>/opt/intel/mic/coi</c>.
-</dd>
-
 </dl>
 </dl>
 
 
 \section MiscellaneousAndDebug Miscellaneous And Debug
 \section MiscellaneousAndDebug Miscellaneous And Debug

+ 9 - 9
doc/doxygen/chapters/mic_scc_support.doxy

@@ -13,19 +13,13 @@
 SCC support just needs the presence of the RCCE library.
 SCC support just needs the presence of the RCCE library.
 
 
 MIC support actually needs two compilations of StarPU, one for the host and one for
 MIC support actually needs two compilations of StarPU, one for the host and one for
-the device. The script <c>mic-configure</c> can be used to achieve this: it basically
+the device. The PATH environment variable has to include the path to the
+cross-compilation toolchain, for instance <c>/usr/linux-k1om-4.7/bin</c>
+The script <c>mic-configure</c> can then be used to achieve the two compilations: it basically
 calls <c>configure</c> as appropriate from two new directories: <c>build_mic</c> and
 calls <c>configure</c> as appropriate from two new directories: <c>build_mic</c> and
 <c>build_host</c>. <c>make</c> and <c>make install</c> can then be used as usual and will
 <c>build_host</c>. <c>make</c> and <c>make install</c> can then be used as usual and will
 recurse into both directories.
 recurse into both directories.
 
 
-\internal
-TODO: move to configuration section?
-\endinternal
-
-It can be parameterized with the environment variables \ref
-STARPU_MIC_HOST, \ref STARPU_MIC_CC_PATH and \ref STARPU_COI_DIR.
-
-
 \section PortingApplicationsToMICSCC Porting Applications To MIC/SCC
 \section PortingApplicationsToMICSCC Porting Applications To MIC/SCC
 
 
 The simplest way to port an application to MIC/SCC is to set the field
 The simplest way to port an application to MIC/SCC is to set the field
@@ -53,4 +47,10 @@ starpu_conf::mic_sink_program_path. It will also look in the current
 directory for the same binary name plus the suffix <c>-mic</c> or
 directory for the same binary name plus the suffix <c>-mic</c> or
 <c>_mic</c>.
 <c>_mic</c>.
 
 
+The testsuite can be started by simply running <c>make check</c> from the
+top directory. It will recurse into both <c>build_host</c> to run tests with only
+the host, and into <c>build_mic</c> to run tests with both the host and the MIC
+devices. Single tests with the host and the MIC can be run by starting
+<c>./loader-cross.sh ./the_test</c> from <c>build_mic/tests</c>.
+
 */
 */

+ 27 - 33
mic-configure

@@ -1,12 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
 ROOT_DIR=$PWD
 ROOT_DIR=$PWD
-[ -n "$STARPU_MIC_HOST" ] || STARPU_MIC_HOST=x86_64-k1om-linux
-[ -n "$STARPU_MIC_CC_PATH" ] || STARPU_MIC_CC_PATH=/usr/linux-k1om-4.7/bin/
-[ -n "$STARPU_COI_DIR" ] || STARPU_COI_DIR=/opt/intel/mic/coi
-DEFAULT_PREFIX=/usr/local
-
-export PATH=${STARPU_MIC_CC_PATH}${PATH:+:${PATH}}
 
 
 cat > ./mic-config.log << EOF
 cat > ./mic-config.log << EOF
 This file was created by StarPU mic-configure
 This file was created by StarPU mic-configure
@@ -14,38 +8,38 @@ This file was created by StarPU mic-configure
  $ $0 $*
  $ $0 $*
 EOF
 EOF
 
 
-for arch in mic host
+prefix="/usr/local"
+coi_dir="/opt/intel/mic/coi"
+mic_host="x86_64-k1om-linux"
+
+for arg in $*
 do
 do
+	case $arg in 
+		--prefix=*)
+			prefix="${arg#--prefix=}"
+			;;
+		--with-coi-dir=*)
+			coi_dir="${arg#--with-coi-dir=}"
+			;;
+		--mic-host=*)
+			mic_host="${arg#--mic-host=}"
+			;;
+	esac
+
+done
 
 
+for arch in mic host
+do
 	# We call the configure script from a build directory further in the
 	# We call the configure script from a build directory further in the
 	# arborescence
 	# arborescence
-	command="${ROOT_DIR}/configure --enable-mic --with-coi-dir=$STARPU_COI_DIR"
-	prefix_found=no
+
+	command="${ROOT_DIR}/configure"
+	params="--enable-mic --with-coi-dir=$coi_dir --prefix=$prefix/$arch"
 
 
 	if test x$arch = xmic ; then
 	if test x$arch = xmic ; then
-		command="$command --without-hwloc --with-coi-lib-dir=$STARPU_COI_DIR/device-linux-release/lib --host=$STARPU_MIC_HOST"
+		params="$params --without-hwloc --with-coi-lib-dir=$coi_dir/device-linux-release/lib --host=$mic_host"
 	else
 	else
-		command="$command --with-coi-lib-dir=$STARPU_COI_DIR/host-linux-release/lib"
-	fi
-
-	for arg in $*
-	do
-		if [ ${arg:0:9} = '--prefix=' ]
-		then
-			prefix_found=yes
-			prefix="${arg:9}"
-			command="$command ${arg}/${arch}"
-		else
-			command="$command $arg"
-		fi
-
-	done
-
-	# If the user didn't specify a directory where to install the library
-	# we apply the default one
-	if test x$prefix_found = xno ; then
-		command="$command --prefix=${DEFAULT_PREFIX}/$arch"
-		prefix=${DEFAULT_PREFIX}
+		params="$params --with-coi-lib-dir=$coi_dir/host-linux-release/lib"
 	fi
 	fi
 
 
 	# If the build directory doesn't exist yet, create it
 	# If the build directory doesn't exist yet, create it
@@ -56,9 +50,9 @@ do
 	cd "build_${arch}"
 	cd "build_${arch}"
 
 
 	if test x$arch = xmic ; then
 	if test x$arch = xmic ; then
-		LDFLAGS=-export-dynamic $command
+		LDFLAGS=-export-dynamic $command $* $params
 	else
 	else
-		$command
+		$command $* $params
 	fi
 	fi
 	if [ "$?" != 0 ]
 	if [ "$?" != 0 ]
 	then
 	then