You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linux-compile-itpp.pl 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/perl
  2. # Intended to be run from linux-install_dependencies.pl
  3. #
  4. # Variables are wrt that parent scope
  5. #
  6. # Installation of packages not available in the apt database or PPA
  7. # Eigen installation
  8. if (!$no_install && $distribution eq 'Fedora') {
  9. #if (1) {
  10. my $old_dir = Cwd::getcwd();
  11. my $itpp_build_dir = $dependencies_dir . "/itpp-build";
  12. my $itppe_src_dir = $dependencies_arch_dir . "/itpp-external-3.0.0";
  13. my $itpp_src_dir = $dependencies_arch_dir . "/itpp-4.0.7";
  14. if (! -e $itpp_build_dir) {
  15. mkdir($itpp_build_dir) or die("Failed to create directory [$itpp_build_dir]");
  16. }
  17. # fetch the packages
  18. chdir "$dependencies_arch_dir";
  19. if (! -e "itpp-external-3.0.0.tar.bz2") {
  20. system('wget "http://openvibe.inria.fr/dependencies/linux-x86/itpp-external-3.0.0.tar.bz2"');
  21. ($CHILD_ERROR != 0) and die ("Could not download the itpp external sources [$CHILD_ERROR]");
  22. }
  23. if (! -e $itppe_src_dir) {
  24. system('tar -xjf "itpp-external-3.0.0.tar.bz2"');
  25. ($CHILD_ERROR != 0) and die ("Could not extract the itpp external archive");
  26. }
  27. if (! -e "itpp-4.0.7.tar.bz2") {
  28. system('wget "http://openvibe.inria.fr/dependencies/linux-x86/itpp-4.0.7.tar.bz2"');
  29. ($CHILD_ERROR != 0) and die ("Could not download the itpp sources [$CHILD_ERROR]");
  30. }
  31. if (! -e $itpp_src_dir) {
  32. system('tar -xjf "itpp-4.0.7.tar.bz2"');
  33. ($CHILD_ERROR != 0) and die ("Could not extract the itpp archive");
  34. }
  35. # compile
  36. # external
  37. print "Compiling itpp external ...\n";
  38. chdir $itppe_src_dir;
  39. system('sed -i "s/_EXT_ETIME/_INT_ETIME/g" patches/lapack-3.1.1-autotools.patch');
  40. system('sed -i "s/_EXT_ETIME/_INT_ETIME/g" src/lapack-lite-3.1.1/SRC/Makefile.in');
  41. system('sed -i "s/_EXT_ETIME/_INT_ETIME/g" src/lapack-lite-3.1.1/SRC/Makefile.am');
  42. system("./configure --prefix=$dependencies_dir/ >$itpp_build_dir/itppe-configure.log 2>&1");
  43. system("make >$itpp_build_dir/itpp-external-build.log 2>&1");
  44. ($CHILD_ERROR != 0) and die("Failed to run make for itpp-external [$CHILD_ERROR]");
  45. system('make install');
  46. ($CHILD_ERROR != 0) and die("Failed to run make install for itpp-external [$CHILD_ERROR]");
  47. # main pkg
  48. print "Compiling itpp ...\n";
  49. chdir $itpp_src_dir;
  50. system("./configure --prefix=$dependencies_dir/ CPPFLAGS=\"-I$dependencies_dir/include\" LDFLAGS=\"-L$dependencies_dir/lib -L$dependencies_dir/lib64\" >$itpp_build_dir/itpp-configure.log 2>&1");
  51. system("make >$itpp_build_dir/itpp-build.log 2>&1");
  52. ($CHILD_ERROR != 0) and die("Failed to run make for itpp [$CHILD_ERROR]");
  53. system("make install");
  54. ($CHILD_ERROR != 0) and die("Failed to run make install for itpp [$CHILD_ERROR]");
  55. chdir $old_dir
  56. };