mic-configure 1.9 KB

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