123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #!/bin/bash
- ROOT_DIR=$(dirname $0)
- cat > ./mic-config.log << EOF
- This file was created by StarPU mic-configure
- $ $0 $*
- EOF
- prefix="/usr/local"
- coi_dir="/opt/intel/mic/coi"
- scif_dir="/opt/intel/mic/scif"
- mic_host="x86_64-k1om-linux"
- for arg in $*
- do
- case $arg in
- --prefix=*)
- prefix="${arg#--prefix=}"
- ;;
- --with-coi-dir=*)
- coi_dir="${arg#--with-coi-dir=}"
- ;;
- --with-scif-dir=*)
- scif_dir="${arg#--with-scif-dir=}"
- ;;
- --mic-host=*)
- mic_host="${arg#--mic-host=}"
- ;;
- esac
- done
- x=$(type -t ${mic_host}-gcc)
- if [ -z "$x" ]
- then
- echo "[error] please add path to ${mic_host}-gcc in your PATH"
- exit 1
- fi
- for arch in mic host
- do
- # We call the configure script from a build directory further in the
- # arborescence
- case $ROOT_DIR in
- /*) command="${ROOT_DIR}/configure";;
- *) command="../${ROOT_DIR}/configure";;
- esac
- params="--enable-mic --with-coi-dir=$coi_dir --with-scif-dir=$scif_dir --prefix=$prefix/$arch"
- if test x$arch = xmic ; then
- # TODO: fix hwloc detection to look for another pkg-config place, and not just believe in the host version of hwloc.pc...
- params="$params --without-hwloc --with-coi-lib-dir=$coi_dir/device-linux-release/lib --with-scif-lib-dir=$scif_dir/device-linux-release/lib --host=$mic_host"
- else
- params="$params --with-coi-lib-dir=$coi_dir/host-linux-release/lib --with-scif-lib-dir=$scif_dir/host-linux-release/lib"
- fi
- # If the build directory doesn't exist yet, create it
- if [ ! -d "build_${arch}" ] ; then
- mkdir "build_${arch}"
- fi
- cd "build_${arch}"
- if test x$arch = xmic ; then
- LDFLAGS=-export-dynamic $command $* $params
- else
- $command $* $params
- fi
- if [ "$?" != 0 ]
- then
- exit $?
- fi
- cd ..
- done
- cat > Makefile << EOF
- all:
- \$(MAKE) -C build_host
- \$(MAKE) -C build_mic
- clean:
- \$(MAKE) -C build_host clean
- \$(MAKE) -C build_mic clean
- distclean: clean
- rm -f Makefile
- check:
- \$(MAKE) -C build_host check
- \$(MAKE) -C build_mic check
- install:
- \$(MAKE) -C build_host install
- \$(MAKE) -C build_mic install
- ln -sf "${prefix}/mic/lib/pkgconfig/starpu-1.2.pc" "${prefix}/mic/lib/pkgconfig/starpu-1.2-mic.pc"
- EOF
|