mic-configure 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. ROOT_DIR=$(dirname $0)
  3. cat > ./mic-config.log << EOF
  4. This file was created by StarPU mic-configure
  5. $ $0 $*
  6. EOF
  7. prefix="/usr/local"
  8. coi_dir="/opt/intel/mic/coi"
  9. mic_host="x86_64-k1om-linux"
  10. for arg in $*
  11. do
  12. case $arg in
  13. --prefix=*)
  14. prefix="${arg#--prefix=}"
  15. ;;
  16. --with-coi-dir=*)
  17. coi_dir="${arg#--with-coi-dir=}"
  18. ;;
  19. --mic-host=*)
  20. mic_host="${arg#--mic-host=}"
  21. ;;
  22. esac
  23. done
  24. for arch in mic host
  25. do
  26. # We call the configure script from a build directory further in the
  27. # arborescence
  28. case $ROOT_DIR in
  29. /*) command="${ROOT_DIR}/configure";;
  30. *) command="../${ROOT_DIR}/configure";;
  31. esac
  32. params="--enable-mic --with-coi-dir=$coi_dir --prefix=$prefix/$arch"
  33. if test x$arch = xmic ; then
  34. # TODO: fix hwloc detection to look for another pkg-config place, and not just believe in the host version of hwloc.pc...
  35. params="$params --without-hwloc --with-coi-lib-dir=$coi_dir/device-linux-release/lib --host=$mic_host"
  36. else
  37. params="$params --with-coi-lib-dir=$coi_dir/host-linux-release/lib"
  38. fi
  39. # If the build directory doesn't exist yet, create it
  40. if [ ! -d "build_${arch}" ] ; then
  41. mkdir "build_${arch}"
  42. fi
  43. cd "build_${arch}"
  44. if test x$arch = xmic ; then
  45. LDFLAGS=-export-dynamic $command $* $params
  46. else
  47. $command $* $params
  48. fi
  49. if [ "$?" != 0 ]
  50. then
  51. exit $?
  52. fi
  53. cd ..
  54. done
  55. cat > Makefile << EOF
  56. all:
  57. \$(MAKE) -C build_host
  58. \$(MAKE) -C build_mic
  59. clean:
  60. \$(MAKE) -C build_host clean
  61. \$(MAKE) -C build_mic clean
  62. distclean: clean
  63. rm -f Makefile
  64. check:
  65. \$(MAKE) -C build_host check
  66. \$(MAKE) -C build_mic check
  67. install:
  68. \$(MAKE) -C build_host install
  69. \$(MAKE) -C build_mic install
  70. ln -sf "${prefix}/mic/lib/pkgconfig/starpu-1.2.pc" "${prefix}/mic/lib/pkgconfig/starpu-1.2-mic.pc"
  71. EOF