1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #!/bin/bash
- ROOT_DIR=$PWD
- cat > ./mic-config.log << EOF
- This file was created by StarPU mic-configure
- $ $0 $*
- EOF
- prefix="/usr/local"
- coi_dir="/opt/intel/mic/coi"
- 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=}"
- ;;
- --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
- # arborescence
- command="${ROOT_DIR}/configure"
- params="--enable-mic --with-coi-dir=$coi_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 --host=$mic_host"
- else
- params="$params --with-coi-lib-dir=$coi_dir/host-linux-release/lib"
- fi
- # If the build directory doesn't exist yet, create it
- if [ ! -d "${ROOT_DIR}/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 "${ROOT_DIR}"
- 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
|