super-configure 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. echo "This file was created by StarPU super-configure 0.0.1." > ./super-config.log
  9. echo "" >> ./super-config.log
  10. echo " $ $0 $*" >> ./super-config.log
  11. for arch in mic host
  12. do
  13. # We call the configure script from a build directory further in the
  14. # arborescence
  15. command="${ROOT_DIR}/configure --enable-mic --with-coi-dir=$COI_DIR"
  16. prefix_found=no
  17. if test x$arch = xmic ; then
  18. command="$command --without-hwloc --with-coi-lib-dir=$COI_DIR/device-linux-release/lib --host=$MIC_HOST"
  19. else
  20. command="$command --with-coi-lib-dir=$COI_DIR/host-linux-release/lib"
  21. fi
  22. for arg in $*
  23. do
  24. if [ ${arg:0:9} = '--prefix=' ]
  25. then
  26. prefix_found=yes
  27. prefix="${arg:9}"
  28. command="$command ${arg}/${arch}"
  29. else
  30. command="$command $arg"
  31. fi
  32. done
  33. # If the user didn't specify a directory where to install the library
  34. # we apply the default one
  35. if test x$prefix_found = xno ; then
  36. command="$command --prefix=${DEFAULT_PREFIX}/$arch"
  37. prefix=${DEFAULT_PREFIX}
  38. fi
  39. # If the build directory doesn't exist yet, create it
  40. if [ ! -d "${ROOT_DIR}/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
  46. else
  47. $command
  48. fi
  49. if [ "$?" != 0 ]
  50. then
  51. exit $?
  52. fi
  53. cd "${ROOT_DIR}"
  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