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-lsl.pl 1.2KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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) {
  9. my $old_dir = Cwd::getcwd();
  10. my $lsl_src_dir = $dependencies_arch_dir . "/LSL";
  11. # fetch the packages
  12. chdir "$dependencies_arch_dir";
  13. if (! -e "liblsl-1.12.ov1-src.tar.bz2") {
  14. system('wget "http://openvibe.inria.fr/dependencies/linux-x86/liblsl-1.12.ov1-src.tar.bz2"');
  15. ($CHILD_ERROR != 0) and die ("Could not download the lsl sources [$CHILD_ERROR]");
  16. }
  17. if (! -e $lsl_src_dir) {
  18. system('tar xjf "liblsl-1.12.ov1-src.tar.bz2"');
  19. ($CHILD_ERROR != 0) and die ("Could not extract the lsl archive");
  20. }
  21. # compile
  22. # external
  23. print "Compiling lsl ...\n";
  24. chdir($lsl_src_dir);
  25. mkdir("liblsl/build");
  26. system("cd liblsl/build && cmake .. >cmake-liblsl.log 2>&1");
  27. system("cd liblsl/build && make >make-liblsl.log 2>&1");
  28. mkdir("$dependencies_dir/lib");
  29. mkdir("$dependencies_dir/include");
  30. system("cp liblsl/build/src/liblsl.so $dependencies_dir/lib");
  31. system("cp -R liblsl/include/* $dependencies_dir/include");
  32. chdir $old_dir
  33. };