Commit 87d5e99e authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 13.30.0.6a5203f

parent c1276b4a
Loading
Loading
Loading
Loading

bin/linux/t_coffee

0 → 100755
+4.33 MiB

File added.

No diff preview for this file type.

+145 −42
Original line number Diff line number Diff line
@@ -9,7 +9,11 @@ use strict;

our (%MODE, %PG, %ENV_SET, %SUPPORTED_OS);


#DO NOT EDIT MANUALLY START
#To be populated with edit_version.pl
our $VERSION="0";
our $VERSION="Version_13.30.0.6a5203f";#POPULATED by edit_version.pl from #_#UPDATE_VERSION
#DO NOT EDIT MANUALLY END
our $EXIT_SUCCESS=0;
our $EXIT_FAILURE=1;
our $INTERNET=0;
@@ -37,6 +41,8 @@ our $TCMETHODS;
our $TCPLUGINS;
our $PLUGINS_DIR="";
our $INSTALL_DIR="";
our $email;
our $recompile;

###########   DEFINITIONS ##############################
#
@@ -64,7 +70,6 @@ my @smode=("all", "clean", "install");

########################################################
&initialize_PG();

#Parse The Command Line
my $cl=join( " ", @ARGV);
if ($#ARGV==-1 || ($cl=~/-h/) ||($cl=~/-H/) )
@@ -88,6 +93,8 @@ if (($cl=~/-h/) ||($cl=~/-H/) )
    print "!!!!!!! ./install [target:package|mode|] [-update|-force|-exec=dir|-dis=dir|-root|-tclinkdb=file|-] [CC=|FCC=|CXX=|CFLAGS=|CXXFLAGS=]\n";
    print "!!!!!!! ./install clean    [removes all executables]\n";
    print "!!!!!!! ./install [optional:target] -update               [updates package already installed]\n";
    print "!!!!!!! ./install [optional:target] -recompile            [forces the recompilation of T-Coffee]\n";

    print "!!!!!!! ./install [optional:target] -force                [Forces recompilation over everything]\n";
    
    print "!!!!!!! ./install [optional:target] -root                 [You are running as root]\n";
@@ -96,8 +103,11 @@ if (($cl=~/-h/) ||($cl=~/-H/) )
    print "!!!!!!! ./install [optional:target] -tclinkdb=foo|update  [file containing all the packages to be installed]\n";
    print "!!!!!!! ./install [optional:target] -clean                [clean everything]\n";
    print "!!!!!!! ./install [optional:target] -plugins              [plugins directory]\n";
    print "!!!!!!! ./install [optional:target] -tcdir=/foor/bar      [base path where T-Coffee will be installed]\n";
    print "!!!!!!! ./install [optional:target] -tcdir=/foor/bar      [base path where T-Coffee will be installed - default ~/.t_coffee]\n";
    print "!!!!!!! ./install [optional:target] -repo=/path/to/repo   [binaries repository root directory]\n";
    print "!!!!!!! ./install [optional:target] -email=<your email>   [needed for remote BLAST]\n";
    print "!!!!!!! ./install [optional:target] -proxy=<proxy>   [may be needed to access remote services]\n";
    
    print "!!!!!!! mode:";
    foreach $m (keys(%MODE)){print "$m ";}
    print "\n";
@@ -128,7 +138,12 @@ our ($ROOT_INSTALL, $NO_QUESTION, $default_update_action,$BINARIES_ONLY,$force,
if ( ($cl=~/-root/)){$ROOT_INSTALL=1;}
if ( ($cl=~/-no_question/)){$NO_QUESTION=1;}
if ( ($cl=~/-update/)){$default_update_action="update";}
if ( ($cl=~/-recompile/)){$recompile=1;}


#By defualt the program will attempt to install packages from binaries maintained on www.tcoffee.org
$BINARIES_ONLY=1;

if ( ($cl=~/-nobinaries/)){$BINARIES_ONLY=0;}
if ( ($cl=~/-force/)){$force=1;$default_update_action="update"}
if ( ($cl=~/-exec=\s*(\S+)/)){$INSTALL_DIR=$1;}
@@ -140,6 +155,10 @@ if ( ($cl=~/-proxy=\s*(\S+)/)){$proxy=$1;}
if ( ($cl=~/-clean/)){$clean=1;}
if ( ($cl=~/-repo=\s*(\S+)/)){ $REPO_ROOT=$1; }
if ( ($cl=~/-tcdir=\s*(\S+)/)){ $TCDIR=$1; }

if ( ($cl=~/-email=\s*(\S+)/)){$email=$1;}


#automated update
if ($tclinkdb){&update_tclinkdb ($tclinkdb);}

@@ -162,10 +181,10 @@ if(!$TCDIR) { $TCDIR="$HOME/.t_coffee"; }
#Prepare the Installation Structure

our $BASE="$CD/bin";
our $BIN="$BASE/binaries/$OS";
our $DOWNLOAD_DIR="$BASE/download";
our $BIN="$BASE/cache/binaries/$OS";
our $DOWNLOAD_DIR="$BASE/cache/download";
our $DOWNLOAD_FILE="$DOWNLOAD_DIR/files";
our $TMP="$BASE/tmp";
our $TMP="$BASE/cache/tmp";

&add_dir($BASE);
&add_dir($BIN);
@@ -181,7 +200,7 @@ if (!$PLUGINS_DIR && !$ROOT_INSTALL){$PLUGINS_DIR=$TCPLUGINS;}
elsif (!$PLUGINS_DIR &&  $ROOT_INSTALL){$PLUGINS_DIR="/usr/local/bin/";}

#set the directory for t_coffee
if    (!$INSTALL_DIR && !$ROOT_INSTALL){$INSTALL_DIR="$HOME/bin/";mkpath ($INSTALL_DIR);}
if    (!$INSTALL_DIR && !$ROOT_INSTALL){$INSTALL_DIR="$TCDIR/bin/$OS";mkpath ($INSTALL_DIR);}
elsif (!$INSTALL_DIR &&  $ROOT_INSTALL){$INSTALL_DIR="/usr/local/bin/";}

#prepare mcoffee files [Only if vanilla installation]
@@ -189,9 +208,15 @@ if (-d "mcoffee"){`cp mcoffee/* $TCM`;}


#prepare the environement
our $ENV_FILE="$TCDIR/t_coffee_env";
our $ENV_FILE="$TCDIR/.t_coffee_env";
unlink ($ENV_FILE);
&add2env_file ($ENV_FILE,"EMAIL_4_TCOFFEE", $email);
&add2env_file ($ENV_FILE,"http_proxy_4_TCOFFEE", $proxy);
&env_file2putenv ($ENV_FILE);
&set_proxy($proxy);



my ($target, $p, $r);
$target=$p;

@@ -395,12 +420,21 @@ if ($failure)
print "*********************************************************************\n";
print "********              FINALIZE YOUR INSTALLATION    *****************\n";
print "*********************************************************************\n";
print "------- Your executables are in:\n"; 
print "------- Your third party executables are in:\n"; 
print "-------       $PLUGINS_DIR:\n";
print "------- Add this directory to your path with the following command:\n";
print "-------       export PATH=$PLUGINS_DIR:\$PATH\n";
print "------- Make this permanent by adding this line to the file:\n";
print "-------       $HOME/.bashrc\n";
print "------- Your t_coffee exccutable is in\n";
print "-------       $INSTALL_DIR:\n";
print "------- In order to make your installation permanent add these two lines\n";
print "-------       export PATH=$INSTALL_DIR:\$PATH\n";
print "-------       export PLUGINS_4_TCOFFEE=$PLUGINS_DIR:\n";
if ($OS eq "linux")
  {
    print "-------       to the file: $HOME/.bashrc\n";
  }
else 
  {
    print "-------       to the file: $HOME/.profile\n";
  }
exit ($EXIT_SUCCESS);  
  
#################################################################################
@@ -506,7 +540,7 @@ sub url2file
	exit ($EXIT_FAILURE);
      }
    
    if     (&pg_is_installed    ("wget")){$pg="wget"; $flag="-O";$arg="--tries=2 --connect-timeout=10 $wget_arg";}
    if     (&pg_is_installed    ("wget")){$pg="wget"; $flag="-O";$arg="--tries=2 --connect-timeout=10 --no-check-certificate $wget_arg";}
    elsif  (&pg_is_installed    ("curl")){$pg="curl"; $flag="-o";$arg=$curl_arg;}
    else
      {
@@ -561,14 +595,22 @@ sub install
    
    if (!$ROOT_INSTALL)
      {
	
	if (-e "$BIN/t_coffee"){`$CP $BIN/t_coffee $INSTALL_DIR`};
	`cp $BIN/* $PLUGINS_DIR`;
	`$CP $BIN/* $PLUGINS_DIR`;
	if (-e "$BIN/t_coffee")
	  {
	    `$CP $BIN/t_coffee $INSTALL_DIR`;
	      unlink("$PLUGINS_DIR/t_coffee");
	  }
	$copied=1;
      }
    else
      {
	$copied=&root_run ("You must be root to finalize the installation", "$CP $BIN/* $INSTALL_DIR $SILENT");
	$copied=&root_run ("You must be root to finalize the installation", "$CP $BIN/* $PLUGINS_DIR $SILENT");
	if (-e "$BIN/t_coffee")
	  {
	    &root_run ("You must be root to finalize the installation", "$CP $BIN/t_coffee $INSTALL_DIR");
	    &root_run ("You must be root to finalize the installation", "rm  $PLUGINS_DIR/t_coffee");
	  }
      }
    
     
@@ -582,10 +624,18 @@ sub install
    }
  elsif ( $copied && !$ROOT)
    {
      $report= "*!!!!!! T-Coffee and associated packages have been copied in: $new_bin\n";
      $report.="*!!!!!! This address is NOT in your PATH sytem variable\n";
      $report= "*!!!!!! T-Coffee has been installed in $INSTALL_DIR\n";
      $report= "*!!!!!! T-Coffee and associated packages have been copied in: $PLUGINS_DIR\n";
      $report.="*!!!!!! This T-Coffee location is NOT on your PATH sytem variable\n";
      if ( $OS eq "linux")
	{
	  $report.="*!!!!!! You can do so by adding the following line in your ~/.bashrc file:\n";
      $report.="*!!!!!! export PATH=$new_bin:\$PATH\n";
	}
      else
	{
	  $report.="*!!!!!! You can do so by adding the following line in your ~/.profile file:\n";
	}
      $report.="*!!!!!! export PATH=$INSTALL_DIR:\$PATH\n";
    }
  return $report;
}
@@ -606,7 +656,7 @@ sub sign_license_ni
#                                                                               #
#                                                                               #
#                                                                               #
#                   INDIVIDUAL MULTIPLE SEQUENCE ALIGNMNT PACKAGES INSTALLATION #
#                  INDIVIDUAL MULTIPLE SEQUENCE ALIGNMENT PACKAGES INSTALLATION #
#                                                                               #
#                                                                               #
#                                                                               #
@@ -632,7 +682,7 @@ sub install_pg
	$PG{$pg}{old}=$previous;
	
	if ($PG{$pg} {language2} eq "Perl"){&install_perl_package ($pg);}
	elsif ($pg ne "t_coffee" && $BINARIES_ONLY && &install_binary_package ($pg)){$PG{$pg}{from_binary}=1;}
	elsif ($BINARIES_ONLY && &install_binary_package ($pg)){$PG{$pg}{from_binary}=1;}
	elsif (&install_source_package ($pg)){;}
	else 
	  {
@@ -677,7 +727,7 @@ sub install_source_package
    my ($report, $download, $arguments, $language, $address, $name, $ext, $main_dir, $distrib);
    my $wget_tmp="$TMP/wget.tmp";
    my (@fl);
    if ( -e "$BIN/$pg" || -e "$BIN/$pg.exe"){return 1;}
    if ( $default_update_action ne "update" && (-e "$BIN/$pg" || -e "$BIN/$pg.exe" )  ){return 1;}
    
    #
    # check if the module exists in the repository cache 
@@ -686,7 +736,7 @@ sub install_source_package
		return 1;
	}
    
    if ($pg eq "t_coffee")  {return   &install_t_coffee ($pg);}
    if ($pg eq "t_coffee")  {return   &install_t_coffee_source ($pg);}
    elsif ($pg eq "TMalign"){return   &install_TMalign ($pg);}
    
    chdir $DISTRIBUTIONS;
@@ -742,7 +792,7 @@ sub install_source_package
	print "\n------- unzipping/untaring $name\n";
	if (($ext =~/z/))
	  { 
	    &flush_command ("gunzip $name$ext");
	    &flush_command ("gunzip -f $name$ext");
	    
	  }
	if (($ext =~/tar/) || ($ext =~/tgz/))
@@ -1105,10 +1155,11 @@ sub install_source_package
    return &pg_is_installed ($pg, $BIN);
  }

sub install_t_coffee
sub install_t_coffee_source
  {
    my ($pg)=(@_);
    my ($report,$cflags, $arguments, $language, $compiler) ;

    #1-Install T-Coffee
    chdir "t_coffee_source";
    &flush_command ("make clean");
@@ -1116,7 +1167,8 @@ sub install_t_coffee
    $language=$PG{$pg} {language2};
    $arguments=$PG{$language}{arguments};
    
    if ( $CC ne ""){
    if ( $CC ne "")
      {
	print "make -i $arguments t_coffee \n";
	&flush_command ("make -i $arguments t_coffee");
      }
@@ -1150,6 +1202,8 @@ sub pg_has_binary_distrib
    my ($pg)=(@_);
    if ($PG{$pg}{windows}){return 1;}
    elsif ($PG{$pg}{osx}){return 1;}
    elsif ($PG{$pg}{macosx}){return 1;}

    elsif ($PG{$pg}{linux}){return 1;}
    return 0;
  }
@@ -1172,8 +1226,26 @@ sub install_binary_package
    if (!&supported_os($OS)){return 0;}
    if ( $PG{$pg}{binary}){$name=$PG{$pg}{binary};}
    else {$name=$pg;}
    
    $download="$WEB_BASE/Packages/Binaries/$OS/$name";
    if ($name eq "t_coffee")
      {
	#check if local bin is there
	if (-e "./bin/$OS/t_coffee")
	  {
	    print "\n------- Installing  T-Coffee from Pre-Compiled/Pre-Downloaded $OS binary\n";
	    print "\n------- If you want to trigger a fresh compilation use -recompile\n";
	    &check_cp ("./bin/$OS/t_coffee", $BIN);
	    return &pg_is_installed ($pg, $BIN);
	  }
	#try to get precompiled binary -- available from MAC is distribution from MAC
	else
	  {
	    $download="$WEB_BASE/Packages/Binaries/tcoffee/$OS/$name.$VERSION";
	  }
      }
    else
      {
	$download="$WEB_BASE/Packages/Binaries/plugins/$OS/$name";
      }
    
    $base=cwd();
    chdir $TMP;
@@ -1191,13 +1263,14 @@ sub install_binary_package
      {
	print "!!!!!!! $PG{$pg}{dname}: Download of $pg binary failed\n";
	print "!!!!!!! $PG{$pg}{dname}: Check Address: $download\n";
	chdir $base;
	return 0;
      }
    print "\n------- Installing $pg\n";
    
    if ($name =~/tar\.gz/)
      {
	`gunzip  $name`;
	`gunzip  -f $name`;
	`tar -xvf $pg.tar`;
	chdir $pg;
	`chmod u+x *`;
@@ -1212,9 +1285,11 @@ sub install_binary_package
      }
    chdir $base;
    $PG{$pg}{from_binary}=1;

    return &pg_is_installed ($pg, $BIN);
  }

	
################################################################################
#                                                                               #
#                                                                               #
@@ -1478,6 +1553,29 @@ sub supported_os
    return $SUPPORTED_OS{$os};
  }

sub add2env_file
  {
    my ($env, $var, $value)=(@_);
    my $F = new FileHandle;
    my $t;
    if (!$value){return;}
    #make sure new variables do not get duplicated
    if ( -e $env)
      {
	open ($F, "$env");
	while (<$F>)
	  {
	    my $line=$_;
	    if (!($line=~/$var/)){$t.=$line;}
	  }
	close ($F);
      }
    $t.="$var=$value\n";
    open ($F, ">$env");
    print $F "$t";
    $ENV{$var}=$value;
    close ($F);
  }    
    
################################################################################
#                                                                               #
@@ -1545,8 +1643,9 @@ $PG{"t_coffee"}{"type"}="sequence_multiple_aligner";
$PG{"t_coffee"}{"ADDRESS"}="http://www.tcoffee.org";
$PG{"t_coffee"}{"language"}="C++";
$PG{"t_coffee"}{"language2"}="CXX";
$PG{"t_coffee"}{"source"}="http://www.tcoffee.org/Packages/Stable/Latest/T-COFFEE_distribution.tar.gz";
$PG{"t_coffee"}{"source"}="http://www.tcoffee.org/Packages/sources/tcoffee/stable/T-COFFEE_distribution.tar.gz";
$PG{"t_coffee"}{"update_action"}="always";
$PG{"t_coffee"}{"binary"}="t_coffee";
$PG{"t_coffee"}{"mode"}="tcoffee,mcoffee,rcoffee,expresso,3dcoffee";
$PG{"clustalo"}{"4_TCOFFEE"}="CLUSTALO";
$PG{"clustalo"}{"type"}="sequence_multiple_aligner";
@@ -1565,6 +1664,7 @@ $PG{"strike"}{"language2"}="CXX";
$PG{"strike"}{"source"}="http://www.tcoffee.org/Projects/strike/strike_v1.2.tar.bz2";
$PG{"strike"}{"mode"}="tcoffee,expresso";
$PG{"strike"}{"version"}="1.2";
$PG{"strike"}{"binary"}="strike";
$PG{"clustalw2"}{"4_TCOFFEE"}="CLUSTALW2";
$PG{"clustalw2"}{"type"}="sequence_multiple_aligner";
$PG{"clustalw2"}{"ADDRESS"}="http://www.clustal.org";
@@ -1572,6 +1672,7 @@ $PG{"clustalw2"}{"language"}="C++";
$PG{"clustalw2"}{"language2"}="CXX";
$PG{"clustalw2"}{"source"}="http://www.clustal.org/download/2.0.10/clustalw-2.0.10-src.tar.gz";
$PG{"clustalw2"}{"mode"}="mcoffee,rcoffee";
$PG{"clustalw2"}{"binary"}="clustalw2";
$PG{"clustalw2"}{"version"}="2.0.10";
$PG{"clustalw"}{"4_TCOFFEE"}="CLUSTALW";
$PG{"clustalw"}{"type"}="sequence_multiple_aligner";
@@ -1581,6 +1682,7 @@ $PG{"clustalw"}{"language2"}="C";
$PG{"clustalw"}{"source"}="http://www.clustal.org/download/1.X/ftp-igbmc.u-strasbg.fr/pub/ClustalW/clustalw1.82.UNIX.tar.gz";
$PG{"clustalw"}{"mode"}="mcoffee,rcoffee";
$PG{"clustalw"}{"version"}="1.82";
$PG{"clustalw"}{"binary"}="clustalw";
$PG{"dialign-t"}{"4_TCOFFEE"}="DIALIGNT";
$PG{"dialign-t"}{"type"}="sequence_multiple_aligner";
$PG{"dialign-t"}{"ADDRESS"}="http://dialign-tx.gobics.de/";
@@ -1729,6 +1831,7 @@ $PG{"sap"}{"language2"}="C";
$PG{"sap"}{"source"}="https://github.com/jkleinj/SAP/archive/v.1.1.3.tar.gz";
$PG{"sap"}{"mode"}="expresso,3dcoffee";
$PG{"sap"}{"version"}="1.1.3";
$PG{"sap"}{"binary"}="sap";
$PG{"TMalign"}{"4_TCOFFEE"}="TMALIGN";
$PG{"TMalign"}{"type"}="structure_pairwise_aligner";
$PG{"TMalign"}{"ADDRESS"}="http://zhanglab.ccmb.med.umich.edu/TM-align/TMalign.f";
@@ -1821,7 +1924,7 @@ $PG{"hmmtop"}{"language2"}="C";
$PG{"hmmtop"}{"source"}="http://www.tcoffee.org/Packages/mirrors/hmmtop2.1.tgz";
$PG{"hmmtop"}{"binary"}="hmmtop";
$PG{"hmmtop"}{"update_action"}="never";
$PG{"hmmtop"}{"mode"}="tcoffee";
$PG{"hmmtop"}{"mode"}="psicoffee";
$PG{"hmmtop"}{"version"}="2.1";
$PG{"gorIV"}{"4_TCOFFEE"}="GOR4";
$PG{"gorIV"}{"type"}="protein_secondarystructure_predictor";
@@ -1880,7 +1983,7 @@ $PG{"XML::Simple"}{"language"}="Perl";
$PG{"XML::Simple"}{"language2"}="Perl";
$PG{"XML::Simple"}{"source"}="empty";
$PG{"XML::Simple"}{"mode"}="psicoffee,expresso,accurate";
$PG{"x3dna"}{"4_TCOFFEE"}="x3dna-ssr";
$PG{"x3dna"}{"4_TCOFFEE"}="x3dna";
$PG{"x3dna"}{"type"}="RNA_secondarystructure_predictor";
$PG{"x3dna"}{"ADDRESS"}="http://x3dna.bio.columbia.edu/";
$PG{"x3dna"}{"source"}="http://www.tcoffee.org/Packages/mirrors/source/x3dna-v2.3-linux-64bit.tar.gz";
@@ -1949,7 +2052,7 @@ $PG{Fortran}{type}="compiler";
$PG{Perl}{compiler}="CPAN";
$PG{Perl}{type}="compiler";

$SUPPORTED_OS{macox}="Macintosh";
$SUPPORTED_OS{macosx}="Macintosh";
$SUPPORTED_OS{linux}="Linux";
$SUPPORTED_OS{windows}="Cygwin";

+1 −1
Original line number Diff line number Diff line
-------------------------------COPYRIGHT NOTICE------------------------------/
  ACADEMIC LICENCE AGREEMENT

  © Centro de Regulacio Genomica and Cedric Notredame  ( 11 Dec 2018 - 09:27). 
  © Centro de Regulacio Genomica and Cedric Notredame  ( 30 Jul 2019 - 01:49). 
		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*  (c) Centro de Regulacio Genomica                                                        */
/*  and                                                                                     */
/*  Cedric Notredame                                                                        */
/*  11 Dec 2018 - 09:27.                                                                    */
/*  30 Jul 2019 - 01:49.                                                                    */
/*All rights reserved.                                                                      */
/*This file is part of T-COFFEE.                                                            */
/*                                                                                          */
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*  (c) Centro de Regulacio Genomica                                                        */
/*  and                                                                                     */
/*  Cedric Notredame                                                                        */
/*  11 Dec 2018 - 09:27.                                                                    */
/*  30 Jul 2019 - 01:49.                                                                    */
/*All rights reserved.                                                                      */
/*This file is part of T-COFFEE.                                                            */
/*                                                                                          */
Loading