super-configure 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. make -j
  50. if test x$arch = xmic ; then
  51. make check > /dev/null 2&>1
  52. fi
  53. make install
  54. cd "${ROOT_DIR}"
  55. done
  56. if [ ! -f "${prefix}/mic/lib/pkgconfig/starpu-1.2-mic.pc" ]
  57. then
  58. ln -s "${prefix}/mic/lib/pkgconfig/starpu-1.2.pc" "${prefix}/mic/lib/pkgconfig/starpu-1.2-mic.pc"
  59. fi