2 #Version 2.01 (25/02/03)
10 our (%MODE, %PG, %ENV_SET, %SUPPORTED_OS);
18 our $CP="cp "; #was causing a crash on MacOSX
19 our $SILENT=">/dev/null 2>/dev/null";
20 our $WEB_BASE="http://www.tcoffee.org";
21 our $TCLINKDB_ADDRESS="$WEB_BASE/Resources/tclinkdb.txt";
23 our $ROOT=&get_root();
26 our $HOME=$ENV{'HOME'};
28 our $OSNAME=$ENV{'OSNAME'};
29 our $OSARCH=$ENV{'OSARCH'};
41 ########### DEFINITIONS ##############################
57 my $default_update_action="no_update";
58 ########################################################
59 my @required_applications=("wget_OR_curl");
60 ########### Mode Definitions ##############################
63 my @smode=("all", "clean", "install");
65 ########################################################
68 #Parse The Command Line
69 my $cl=join( " ", @ARGV);
70 if ($#ARGV==-1 || ($cl=~/-h/) ||($cl=~/-H/) )
72 print "\n!!!!!!! ./install t_coffee --> installs t_coffee only";
73 print "\n!!!!!!! ./install all --> installs all the modes [mcoffee, expresso, psicoffee,rcoffee..]";
74 print "\n!!!!!!! ./install [mcoffee|rcoffee|..] --> installs the specified mode";
75 print "\n!!!!!!! ./install -h --> print usage\n\n";
76 if ( $#ARGV==-1){exit ($EXIT_FAILURE);}
79 if (($cl=~/-h/) ||($cl=~/-H/) )
82 print "\n\n!!!!!!! advanced mode\n";
83 foreach $m ((keys (%MODE)),@smode)
85 print "!!!!!!! ./install $m\n";
88 print "!!!!!!! ./install [target:package|mode|] [-update|-force|-exec=dir|-dis=dir|-root|-tclinkdb=file|-] [CC=|FCC=|CXX=|CFLAGS=|CXXFLAGS=]\n";
89 print "!!!!!!! ./install clean [removes all executables]\n";
90 print "!!!!!!! ./install [optional:target] -update [updates package already installed]\n";
91 print "!!!!!!! ./install [optional:target] -force [Forces recompilation over everything]\n";
93 print "!!!!!!! ./install [optional:target] -root [You are running as root]\n";
94 print "!!!!!!! ./install [optional:target] -exec=/foo/bar/ [address for the T-Coffee executable]\n";
95 print "!!!!!!! ./install [optional:target] -dis=/foo/bar/ [Address where distributions should be stored]\n";
96 print "!!!!!!! ./install [optional:target] -tclinkdb=foo|update [file containing all the packages to be installed]\n";
97 print "!!!!!!! ./install [optional:target] -clean [clean everything]\n";
98 print "!!!!!!! ./install [optional:target] -plugins [plugins directory]\n";
99 print "!!!!!!! ./install [optional:target] -tcdir=/foor/bar [base path where T-Coffee will be installed]\n";
100 print "!!!!!!! ./install [optional:target] -repo=/path/to/repo [binaries repository root directory]\n";
101 print "!!!!!!! mode:";
102 foreach $m (keys(%MODE)){print "$m ";}
104 print "!!!!!!! Packages:";
105 foreach $m (keys (%PG)){print "$m ";}
109 exit ($EXIT_FAILURE);
114 # parse compiler flags
115 my (@argl)=($cl=~/(\S+=[^=]+)\s\w+=/g);
116 push (@argl, ($cl=~/(\S+=[^=]+\S)\s*$/g));
120 if ( ($cl=~/CXX=(.*)/)){$CXX=$1;}
121 if ( ($cl=~/-CC=(.*)/ )){$CC=$1;}
122 if ( ($cl=~/-FC=(.*)/ )){$FC=$1;}
123 if ( ($cl=~/-CFLAGS=(.*)/)){$CFLAGS=$1;}
124 if ( ($cl=~/-CXXFLAGS=(.*)/)){$CXXFLAGS=$1;}
127 our ($ROOT_INSTALL, $NO_QUESTION, $default_update_action,$BINARIES_ONLY,$force, $default_update_action, $INSTALL_DIR, $PLUGINS_DIR, $DISTRIBUTIONS,$tclinkdb, $proxy, $clean);
128 if ( ($cl=~/-root/)){$ROOT_INSTALL=1;}
129 if ( ($cl=~/-no_question/)){$NO_QUESTION=1;}
130 if ( ($cl=~/-update/)){$default_update_action="update";}
131 if ( ($cl=~/-binaries/)){$BINARIES_ONLY=1;}
132 if ( ($cl=~/-force/)){$force=1;$default_update_action="update"}
133 if ( ($cl=~/-exec=\s*(\S+)/)){$INSTALL_DIR=$1;}
134 if ( ($cl=~/-plugins=\s*(\S+)/)){$PLUGINS_DIR=$1;}
135 if ( ($cl=~/-dis=\s*(\S+)/)){$DISTRIBUTIONS=$1;}
137 if ( ($cl=~/-tclinkdb=\s*(\S+)/)){$tclinkdb=$1;}
138 if ( ($cl=~/-proxy=\s*(\S+)/)){$proxy=$1;}
139 if ( ($cl=~/-clean/)){$clean=1;}
140 if ( ($cl=~/-repo=\s*(\S+)/)){ $REPO_ROOT=$1; }
141 if ( ($cl=~/-tcdir=\s*(\S+)/)){ $TCDIR=$1; }
143 if ($tclinkdb){&update_tclinkdb ($tclinkdb);}
146 if( $REPO_ROOT ne "" ) {
147 if( $OSNAME eq "" ) { print "You have specified the repository folder but the required \"OSNAME\" enviroment variable is missing. \n"; exit 1; }
148 if( $OSARCH eq "" ) { print "You have specified the repository folder but the required \"OSARCH\" enviroment variable is missing. \n"; exit 1; }
151 #Prepare the T-Coffee directory structure
153 if(!$TCDIR) { $TCDIR="$HOME/.t_coffee"; }
155 &add_dir ($TCCACHE="$TCDIR/cache");
156 &add_dir ($TCTMP="$CDIR/tmp");
157 &add_dir ($TCM="$TCDIR/mcoffee");
158 &add_dir ($TCMETHODS="$TCDIR/methods");
159 &add_dir ($TCPLUGINS="$TCDIR/plugins/$OS");
161 #Prepare the Installation Structure
164 our $BIN="$BASE/binaries/$OS";
165 our $DOWNLOAD_DIR="$BASE/download";
166 our $DOWNLOAD_FILE="$DOWNLOAD_DIR/files";
167 our $TMP="$BASE/tmp";
171 &add_dir($DOWNLOAD_DIR);
172 &add_dir($DOWNLOAD_FILE);
173 if (!$DISTRIBUTIONS){$DISTRIBUTIONS="$DOWNLOAD_DIR/distributions";}
174 &add_dir ($DISTRIBUTIONS);
178 #set the directory for the plugins
179 if (!$PLUGINS_DIR && !$ROOT_INSTALL){$PLUGINS_DIR=$TCPLUGINS;}
180 elsif (!$PLUGINS_DIR && $ROOT_INSTALL){$PLUGINS_DIR="/usr/local/bin/";}
182 #set the directory for t_coffee
183 if (!$INSTALL_DIR && !$ROOT_INSTALL){$INSTALL_DIR="$HOME/bin/";mkpath ($INSTALL_DIR);}
184 elsif (!$INSTALL_DIR && $ROOT_INSTALL){$INSTALL_DIR="/usr/local/bin/";}
186 #prepare mcoffee files [Only if vanilla installation]
187 if (-d "mcoffee"){`cp mcoffee/* $TCM`;}
190 #prepare the environement
191 our $ENV_FILE="$TCDIR/t_coffee_env";
192 &env_file2putenv ($ENV_FILE);
194 my ($target, $p, $r);
197 foreach $p ( ((keys (%PG)),(keys(%MODE)),(@smode)) )
199 if ($ARGV[0] eq $p && $target eq ""){$target=$p;}
201 if ($target eq ""){exit ($EXIT_FAILURE);}
204 # Check the basic requirements are met
205 foreach $r (@required_applications)
211 @app_list=split (/_OR_/, $r);
212 foreach my $pg (@app_list)
214 $i+=&pg_is_installed ($pg);
218 print "One of the following packages must be installed to proceed: ";
219 foreach my $pg (@app_list)
228 # Set the mains paths and create directories
229 # distrib_dir/install/bin
230 # distrib_dir/install/Downloads
231 # distrib_dir/install/Downloads/Files
232 # distrib_dir/install/Downloads/Distributions
235 #Directory structure of the installation WITHIN the distribution dir
243 #Configure the copilers and their optins
244 $PG{C}{compiler}=get_C_compiler($CC);
245 $PG{Fortran}{compiler}=get_F_compiler($FC);
246 $PG{CXX}{compiler}=$PG{CPP}{compiler}=$PG{GPP}{compiler}=get_CXX_compiler($CXX);
247 if ($CXXFLAGS){$PG{CPP}{options}=$PG{GPP}{options}=$PG{CXX}{options}=$CXXFLAGS;}
248 if ($CFLAGS){$PG{C}{options}=$CFLAGS;}
249 foreach my $c (keys(%PG))
252 if ($PG{$c}{compiler})
254 $arguments="$PG{$c}{compiler_flag}=$PG{$c}{compiler} ";
255 if ($PG{$c}{options})
257 $arguments.="$PG{$c}{options_flag}=$PG{$c}{options} ";
259 $PG{$c}{arguments}=$arguments;
263 # select the list of packages to update
264 if ($PG{$target}){$PG{$target}{install}=1;}
267 foreach my $pg (keys(%PG))
269 if ( $target eq "all" || ($PG{$pg}{mode}=~/$target/))
271 $PG{$pg} {install}=1;
276 foreach my $pg (keys(%PG))
278 if (!$PG{$pg}{update_action}){$PG{$pg}{update_action}=$default_update_action;}
279 elsif ($PG{$pg}{update_action} eq "never"){$PG{$pg}{install}=0;}
280 if ( $force && $PG{$pg}{install})
282 `rm $BIN/$pg $BIN/$pg.exe $SILENT`;
284 if ($PG{$pg}{update_action} eq "update" && $PG{$pg}{install}){$PG{$pg}{update}=1;}
287 #Execute the target: install/remove all the selected components
288 if (($target=~/clean/))
290 print "------- cleaning executables -----\n";
292 exit ($EXIT_SUCCESS);
295 if ( !$PG{$target}){print "------- Installing T-Coffee Modes\n";}
297 #1 - Installing various modes
298 foreach my $m (keys(%MODE))
300 if ( $target eq "all" || $target eq $m)
302 print "\n------- The installer will now install the $m components $MODE{$m}{description}\n";
303 foreach my $pg (keys(%PG))
305 if ( $PG{$pg}{mode} =~/$m/ && $PG{$pg}{install})
307 if ($PG{$pg}{touched}){print "------- $PG{$pg}{dname}: already processed\n";}
308 else {$PG{$pg}{success}=&install_pg($pg);$PG{$pg}{touched}=1;}
314 #2 - Installing Various Packages
315 if ( $PG{$target}){print "------- Installing Individual Package\n";}
316 foreach my $pg (keys (%PG))
319 if ( $PG{$pg}{install} && !$PG{$pg}{touched})
321 print "\n------- Install $pg\n";
322 $PG{$pg}{success}=&install_pg($pg);$PG{$pg}{touched}=1;
325 print "------- Finishing The installation\n";
326 my $final_report=&install ($INSTALL_DIR);
329 print "*********************************************************************\n";
330 print "******** INSTALLATION SUMMARY *****************\n";
331 print "*********************************************************************\n";
332 print "------- SUMMARY package Installation:\n";
333 print "------- Executable Installed in: $PLUGINS_DIR\n";
335 foreach my $pg (keys(%PG))
337 if ( $PG{$pg}{install})
339 my $bin_status=($PG{$pg}{from_binary} && $PG{$pg}{success})?"[from binary]":"";
340 if ( $PG{$pg}{new} && !$PG{$pg}{old}) {print "*------ $PG{$pg}{dname}: installed $bin_status\n"; $PG{$pg}{status}=1;}
341 elsif ( $PG{$pg}{new} && $PG{$pg}{old}) {print "*------ $PG{$pg}{dname}: updated $bin_status\n" ; $PG{$pg}{status}=1;}
342 elsif (!$PG{$pg}{new} && $PG{$pg}{old} && !$PG{$pg}{update}){print "*------ $PG{$pg}{dname}: previous\n" ; $PG{$pg}{status}=1;}
343 elsif (!$PG{$pg}{new} && $PG{$pg}{old} && $PG{$pg}{update}){print "*------ $PG{$pg}{dname}: failed update (previous installation available)\n";$PG{$pg}{status}=0;}
344 else {print "*------ $PG{$pg}{dname}: failed installation\n";$PG{$pg}{status}=0;}
349 if ( !$PG{$target}){print "*------ SUMMARY mode Installation:\n";}
350 foreach my $m (keys(%MODE))
353 if ( $target eq "all" || $target eq $m)
356 foreach my $pg (keys(%PG))
358 if (($PG{$pg}{mode}=~/$m/) && $PG{$pg}{install} && $PG{$pg}{status}==0)
361 print "*!!!!!! $PG{$pg}{dname}: Missing\n";
367 print "*------ MODE $MODE{$m}{dname} SUCCESSFULLY installed\n";
373 print "*!!!!!! MODE $MODE{$m}{dname} UNSUCCESSFULLY installed\n";
380 if ($clean==1 && ($BASE=~/install4tcoffee/) ){print "*------ Clean Installation Directory: $BASE\n";`rm -rf $BASE`;}
381 #failure if one program was not well installed
382 foreach my $pg (keys(%PG)){if ($PG{$pg}{install} && $PG{$pg}{status}==0){exit ($EXIT_FAILURE);}}
386 print "*********************************************************************\n";
387 print "******** SOME PACKAGES FAILED TO INSTALL *****************\n";
388 print "*********************************************************************\n";
389 print "\nSome of the reported failures may be due to connectivity problems";
390 print "\nRerun the installation and the installer will specifically try to install the missing packages";
391 print "\nIf this Fails, go to the original website and install the package manually";
394 print "*********************************************************************\n";
395 print "******** FINALIZE YOUR INSTALLATION *****************\n";
396 print "*********************************************************************\n";
397 print "------- Your executables are in:\n";
398 print "------- $PLUGINS_DIR:\n";
399 print "------- Add this directory to your path with the following command:\n";
400 print "------- export PATH=$PLUGINS_DIR:\$PATH\n";
401 print "------- Make this permanent by adding this line to the file:\n";
402 print "------- $HOME/.bashrc\n";
403 exit ($EXIT_SUCCESS);
405 #################################################################################
409 # GENERIC INSTALLATION #
413 #################################################################################
419 return get_compil ($c, @clist);
424 my (@clist)=("gcc", "cc", "icc");
426 return get_compil ($c, @clist);
432 my @clist=("f77", "g77","g95", "gfortran", "ifort");
433 return get_compil ($c, @clist);
438 my ($fav,@clist)=(@_);
440 #return the first compiler found installed in the system. Check first the favorite
441 foreach my $c ($fav,@clist)
443 if (&pg_is_installed ($c)){return $c;}
447 sub exit_if_pg_not_installed
453 if ( !&pg_is_installed ($p))
455 print "!!!!!!!! The $p utility must be installed for this installation to proceed [FATAL]\n";
466 @list= ("HTTP_proxy", "http_proxy", "HTTP_PROXY", "ALL_proxy", "all_proxy","HTTP_proxy_4_TCOFFEE","http_proxy_4_TCOFFEE");
470 foreach my $p (@list)
472 if ( ($ENV_SET{$p}) || $ENV{$p}){$proxy=$ENV{$p};}
475 foreach my $p(@list){$ENV{$p}=$proxy;}
478 sub check_internet_connection
482 if ( -e "x"){unlink ("x");}
483 if (&pg_is_installed ("wget")){`wget www.google.com -Ox >/dev/null 2>/dev/null`;}
484 elsif (&pg_is_installed ("curl")){`curl www.google.com -ox >/dev/null 2>/dev/null`;}
487 printf stderr "\nERROR: No pg for remote file fetching [wget or curl][FATAL]\n";
488 exit ($EXIT_FAILURE);
491 if ( !-e "x" || -s "x" < 10){$internet=0;}
493 if (-e "x"){unlink "x";}
498 my ($cmd, $file,$wget_arg, $curl_arg)=(@_);
499 my ($exit,$flag, $pg, $arg);
501 if ($INTERNET || check_internet_connection ()){$INTERNET=1;}
504 print STDERR "ERROR: No Internet Connection [FATAL:install.pl]\n";
505 exit ($EXIT_FAILURE);
508 if (&pg_is_installed ("wget")){$pg="wget"; $flag="-O";$arg="--tries=2 --connect-timeout=10 $wget_arg";}
509 elsif (&pg_is_installed ("curl")){$pg="curl"; $flag="-o";$arg=$curl_arg;}
512 printf stderr "\nERROR: No pg for remote file fetching [wget or curl][FATAL]\n";
513 exit ($EXIT_FAILURE);
517 if (-e $file){unlink($file);}
518 $exit=system "$pg $cmd $flag$file $arg";
526 my ($supported, $language, $compil);
531 $language=$PG{$p}{language2};
532 $compil=$PG{$language}{compiler};
535 if ( $compil eq "CPAN")
537 if ( system ("perl -M$p -e 1")==$EXIT_SUCCESS){$ret=1;}
542 if (-e "$dir/$p" || -e "$dir/$p\.exe"){$ret=1;}
545 elsif (-e "$PLUGINS_DIR/$p" || -e "$PLUGINS_DIR/$p.exe"){$ret=1;}
548 $r=`which $p 2>/dev/null`;
549 if ($r eq ""){$ret=0;}
558 my ($copied, $report);
564 if (-e "$BIN/t_coffee"){`$CP $BIN/t_coffee $INSTALL_DIR`};
565 `cp $BIN/* $PLUGINS_DIR`;
570 $copied=&root_run ("You must be root to finalize the installation", "$CP $BIN/* $INSTALL_DIR $SILENT");
576 $report="*!!!!!! Installation unsuccesful. The executables have been left in $BASE/bin\n";
578 elsif ( $copied && $ROOT)
580 $report="*------ Installation succesful. Your executables have been copied in $new_bin and are on your PATH\n";
582 elsif ( $copied && !$ROOT)
584 $report= "*!!!!!! T-Coffee and associated packages have been copied in: $new_bin\n";
585 $report.="*!!!!!! This address is NOT in your PATH sytem variable\n";
586 $report.="*!!!!!! You can do so by adding the following line in your ~/.bashrc file:\n";
587 $report.="*!!!!!! export PATH=$new_bin:\$PATH\n";
594 my $F=new FileHandle;
595 open ($F, "license.txt");
604 #################################################################################
608 # INDIVIDUAL MULTIPLE SEQUENCE ALIGNMNT PACKAGES INSTALLATION #
612 #################################################################################
617 my ($report, $previous, $language, $compiler, $return);
619 if (!$PG{$pg}{install}){return 1;}
621 $previous=&pg_is_installed ($pg);
623 if ($PG{$pg}{update_action} eq "no_update" && $previous)
631 $PG{$pg}{old}=$previous;
633 if ($PG{$pg} {language2} eq "Perl"){&install_perl_package ($pg);}
634 elsif ($BINARIES_ONLY && &install_binary_package ($pg)){$PG{$pg}{from_binary}=1;}
635 elsif (&install_source_package ($pg)){;}
639 if (!&supported_os($OS))
641 print "!!!!!!!! $pg compilation failed, binary unsupported for $OS\n";
643 elsif (!($PG{$pg}{from_binary}=&install_binary_package ($pg)))
645 print "!!!!!!!! $pg compilation and binary installation failed\n";
648 $PG{$pg}{new}=$return=&pg_is_installed ($pg,$BIN);
654 sub install_perl_package
657 my ($report, $language, $compiler);
659 $language=$PG{$pg} {language2};
660 $compiler=$PG{$language}{compiler};
662 if (!&pg_is_installed ($pg))
664 if ( $OS eq "windows"){`perl -M$compiler -e 'install $pg'`;}
665 elsif ( $ROOT eq "sudo"){system ("sudo perl -M$compiler -e 'install $pg'");}
666 else {system ("su root -c perl -M$compiler -e 'install $pg'");}
668 return &pg_is_installed ($pg);
673 sub install_source_package
676 my ($report, $download, $arguments, $language, $address, $name, $ext, $main_dir, $distrib);
677 my $wget_tmp="$TMP/wget.tmp";
679 if ( -e "$BIN/$pg" || -e "$BIN/$pg.exe"){return 1;}
682 # check if the module exists in the repository cache
684 if( repo_load($pg) ) {
688 if ($pg eq "t_coffee") {return &install_t_coffee ($pg);}
689 elsif ($pg eq "TMalign"){return &install_TMalign ($pg);}
691 chdir $DISTRIBUTIONS;
693 $download=$PG{$pg}{source};
695 if (($download =~/tgz/))
697 ($address,$name,$ext)=($download=~/(.+\/)([^\/]+)(\.tgz).*/);
699 elsif (($download=~/tar\.gz/))
701 ($address,$name,$ext)=($download=~/(.+\/)([^\/]+)(\.tar\.gz).*/);
703 elsif (($download=~/tar/))
705 ($address,$name,$ext)=($download=~/(.+\/)([^\/]+)(\.tar).*/);
709 ($address,$name)=($download=~/(.+\/)([^\/]+)/);
712 $distrib="$name$ext";
714 if ( !-d $pg){mkdir $pg;}
717 #get the distribution if available
718 if ( -e "$DOWNLOAD_DIR/$distrib")
720 `$CP $DOWNLOAD_DIR/$distrib .`;
722 #UNTAR and Prepare everything
723 if (!-e "$name.tar" && !-e "$name")
725 &check_rm ($wget_tmp);
726 print "\n------- Downloading/Installing $pg\n";
728 if (!-e $distrib && &url2file ("$download", "$wget_tmp")==$EXIT_SUCCESS)
731 `mv $wget_tmp $distrib`;
732 `$CP $distrib $DOWNLOAD_DIR/`;
737 print "!!!!!!! Download of $pg distribution failed\n";
738 print "!!!!!!! Check Address: $PG{$pg}{source}\n";
741 print "\n------- unzipping/untaring $name\n";
744 &flush_command ("gunzip $name$ext");
747 if (($ext =~/tar/) || ($ext =~/tgz/))
749 &flush_command("tar -xvf $name.tar");
752 #Guess and enter the distribution directory
767 print "Error: $main_dir does not exist";
769 print "\n------- Compiling/Installing $pg\n";
770 `make clean $SILENT`;
778 if (-e "./configure")
780 #new sap distribution
783 &replace_line_in_file ("./src/galloc.h", "malloc.h", "");
784 &replace_line_in_file ("./src/pdbprot.h", "malloc.h", "");
785 &replace_line_in_file ("./src/pdbprot.c", "malloc.h", "");
788 &flush_command ("./configure");
789 &flush_command ("make clean");
790 &flush_command ("make");
791 &check_cp ("./src/$pg", "$BIN");
792 repo_store("./src/$pg");
796 #old style distribution
797 `rm *.o sap sap.exe ./util/aa/*.o ./util/wt/.o $SILENT`;
798 &flush_command ("make $arguments sap");
799 &check_cp ($pg, "$BIN");
807 elsif ($pg eq "clustalw2")
809 &flush_command("./configure");
810 &flush_command("make $arguments");
811 &check_cp ("./src/$pg", "$BIN");
812 repo_store("./src/$pg");
820 &flush_command("./configure --prefix=$BIN");
821 &flush_command("make $arguments");
822 &flush_command ("make install");
824 repo_store("fsa", "$BIN/bin");
825 `mv $BIN/bin/* $BIN`;
832 elsif ($pg eq "clustalw")
834 &flush_command("make $arguments clustalw");
835 `$CP $pg $BIN $SILENT`;
842 elsif ($pg eq "mafft")
848 mkpath ("./mafft/bin");
849 mkpath ("./mafft/lib");
851 `make clean $SILENT`;
852 &flush_command ("make $arguments");
853 &flush_command ("make install LIBDIR=../mafft/lib BINDIR=../mafft/bin");
856 chdir "$base/extensions";
857 `make clean $SILENT`;
858 &flush_command ("make $arguments");
859 &flush_command ("make install LIBDIR=../mafft/lib BINDIR=../mafft/bin");
861 #put everything in mafft and copy the compiled stuff in bin
865 &root_run ("You Must be Root to Install MAFFT\n", "mkdir /usr/local/mafft/;$CP mafft/lib/* /usr/local/mafft;$CP mafft/lib/mafft* /usr/local/bin ;$CP mafft/bin/mafft /usr/local/bin/; ");
869 `$CP mafft/lib/* $BIN`;
870 `$CP mafft/bin/mafft $BIN`;
872 `tar -cvf mafft.tar mafft`;
874 `mv mafft.tar.gz $BIN`;
876 repo_store("mafft/bin/mafft", "mafft/lib/", "$BIN/mafft.tar.gz");
882 elsif ( $pg eq "dialign-tx" )
888 if ($OS eq "macosx"){&flush_command ("cp makefile.MAC_OS makefile");}
890 &flush_command (" make CPPFLAGS='-O3 -funroll-loops' all");
893 &check_cp ("./source/$pg", "$BIN");
894 repo_store("./source/$pg");
899 # (is the same as dialign-tx, but it is mantained for backward name compatibility with tcoffee)
901 elsif ( $pg eq "dialign-t" )
907 if ($OS eq "macosx"){&flush_command ("cp makefile.MAC_OS makefile");}
909 &flush_command (" make CPPFLAGS='-O3 -funroll-loops' all");
912 &check_cp ("./source/dialign-tx", "$BIN/dialign-t");
913 repo_store("$BIN/dialign-t");
921 &flush_command ("make $arguments poa");
922 &check_cp ("$pg", "$BIN");
930 elsif ( $pg eq "probcons")
932 &add_C_libraries("./ProbabilisticModel.h", "list", "cstring");
935 &flush_command ("make $arguments probcons");
936 &check_cp("$pg", "$BIN/$pg");
941 # PROBCONS RNA module
943 elsif ( $pg eq "probconsRNA")
945 &add_C_libraries("./ProbabilisticModel.h", "list", "cstring");
946 &add_C_libraries("./Main.cc", "iomanip", "cstring","climits");
948 &flush_command ("make $arguments probcons");
949 &check_cp("probcons", "$BIN/$pg");
950 repo_store("$BIN/$pg");
956 elsif ( $pg eq "muscle")
958 `rm *.o muscle muscle.exe $SILENT`;
959 if ($OS eq "macosx" || $OS eq "linux")
961 &replace_line_in_file ("./Makefile", "LDLIBS = -lm -static", "LDLIBS = -lm");
963 elsif ($OS eq "windows")
965 &replace_line_in_file ("./intmath.cpp", "double log2e", "double cedric_log");
966 &replace_line_in_file ("./intmath.cpp", "double log2", "double log_notuse");
967 &replace_line_in_file ("./intmath.cpp", "double cedric_log", "double log2e");
969 &flush_command ("make $arguments all");
970 &check_cp("$pg", "$BIN");
977 elsif ( $pg eq "mus4")
979 `rm *.o muscle muscle.exe $SILENT`;
980 &flush_command ("./mk");
981 &check_cp("$pg", "$BIN");
988 elsif ( $pg eq "pcma")
992 &replace_line_in_file ("./alcomp2.c", "malloc.h", "");
994 &flush_command ("make $arguments pcma");
995 &check_cp("$pg", "$BIN");
1002 elsif ($pg eq "kalign")
1004 &flush_command ("./configure");
1005 &flush_command("make $arguments");
1006 &check_cp ("$pg",$BIN);
1013 elsif ( $pg eq "amap")
1015 &add_C_libraries("./Amap.cc", "iomanip", "cstring","climits");
1016 `make clean $SILENT`;
1017 &flush_command ("make $arguments all");
1018 &check_cp ("$pg", $BIN);
1025 elsif ( $pg eq "proda")
1027 &add_C_libraries("AlignedFragment.h", "vector", "iostream", "cstring","cstdlib");
1028 &add_C_libraries("Main.cc", "vector", "climits");
1029 &add_C_libraries("Sequence.cc", "stdlib.h", "cstdio");
1030 &flush_command ("make $arguments all");
1031 &check_cp ("$pg", $BIN);
1038 elsif ( $pg eq "prank")
1040 &flush_command ("make $arguments all");
1041 &check_cp ("$pg", $BIN);
1046 # !!!! MUSTANG module
1048 elsif ( $pg eq "mustang")
1050 &flush_command ("rm ./bin/*");
1051 &flush_command ("make $arguments all");
1053 if ( $OS=~/windows/){&flush_command("cp ./bin/* $BIN/mustang.exe");}
1054 else {&flush_command("cp ./bin/* $BIN/mustang");}
1056 repo_store("$BIN/mustang");
1062 elsif ( $pg eq "RNAplfold")
1064 &flush_command("./configure");
1065 &flush_command ("make $arguments all");
1066 &check_cp("./Progs/RNAplfold", "$BIN");
1067 &check_cp("./Progs/RNAalifold", "$BIN");
1068 &check_cp("./Progs/RNAfold", "$BIN");
1070 repo_store("./Progs/RNAplfold", "./Progs/RNAalifold", "./Progs/RNAfold");
1076 elsif ( $pg eq "retree")
1079 &flush_command ("make $arguments all");
1080 &flush_command ("make put");
1081 system "cp ../exe/* $BIN";
1083 repo_store("retree", "../exe");
1087 return &pg_is_installed ($pg, $BIN);
1090 sub install_t_coffee
1093 my ($report,$cflags, $arguments, $language, $compiler) ;
1095 chdir "t_coffee_source";
1096 &flush_command ("make clean");
1097 print "\n------- Compiling T-Coffee\n";
1098 $language=$PG{$pg} {language2};
1099 $arguments=$PG{$language}{arguments};
1100 if (!($arguments =~/CFLAGS/)){$arguments .= " CFLAGS=-O2 ";}
1102 if ( $CC ne ""){&flush_command ("make -i $arguments t_coffee");}
1103 &check_cp ($pg, $BIN);
1106 return &pg_is_installed ($pg, $BIN);
1112 chdir "t_coffee_source";
1113 print "\n------- Compiling TMalign\n";
1114 `rm TMalign TMalign.exe $SILENT`;
1115 if ( $FC ne ""){&flush_command ("make -i $PG{Fortran}{arguments} TMalign");}
1116 &check_cp ($pg, $BIN);
1119 if ( !-e "$BIN/$pg" && pg_has_binary_distrib ($pg))
1121 print "!!!!!!! Compilation of $pg impossible. Will try to install from binary\n";
1122 return &install_binary_package ($pg);
1125 return &pg_is_installed ($pg, $BIN);
1128 sub pg_has_binary_distrib
1131 if ($PG{$pg}{windows}){return 1;}
1132 elsif ($PG{$pg}{osx}){return 1;}
1133 elsif ($PG{$pg}{linux}){return 1;}
1136 sub install_binary_package
1139 my ($base,$report,$name, $download, $arguments, $language, $dir);
1143 if (!&supported_os($OS)){return 0;}
1144 if ( $PG{$pg}{binary}){$name=$PG{$pg}{binary};}
1148 if ( $OS eq "windows"){$name.=".exe";}
1151 $download="$WEB_BASE/Packages/Binaries/$OS/$name";
1159 if ( url2file("$download","x")==$EXIT_SUCCESS)
1167 print "!!!!!!! $PG{$pg}{dname}: Download of $pg binary failed\n";
1168 print "!!!!!!! $PG{$pg}{dname}: Check Address: $download\n";
1171 print "\n------- Installing $pg\n";
1173 if ($name =~/tar\.gz/)
1178 if ( $pg eq "mafft")
1182 &root_run ("You Must be Roor to Install MAFFT\n", "$CP mafft/bin/* /usr/local/mafft;mkdir /usr/local/mafft/; $CP mafft/lib/* /usr/local/bin/");
1186 `$CP $TMP/$pg/bin/* $BIN $SILENT`;
1187 `$CP $TMP/$pg/lib/* $BIN $SILENT`;
1192 if (-e "$TMP/$pg/data"){`$CP $TMP/$pg/data/* $TCM $SILENT`;}
1193 if (!($pg=~/\*/)){`rm -rf $pg`;}
1198 &check_cp ("$pg", "$BIN");
1199 `chmod u+x $BIN/$pg`;
1203 $PG{$pg}{from_binary}=1;
1204 return &pg_is_installed ($pg, $BIN);
1207 ################################################################################
1211 # Simple Utilities #
1215 #################################################################################
1220 if (!-e $dir && !-d $dir)
1224 @l=mkpath ($dir,{mode => 0777});
1238 return unlink($file);
1244 my ($from, $to)=(@_);
1245 if ( !-e $from && -e "$from\.exe"){$from="$from\.exe";}
1246 if ( !-e $from){return 0;}
1253 # Cache the specified package
1255 # - path (mandatory): the source path to be cached
1256 # - pg (optional): the package name
1260 # check that all required data are available
1261 if( $REPO_ROOT eq "" ) { return; }
1264 # extract the package name from the specified path
1265 my $pg =`basename $_[0]`;
1268 my $VER = $PG{$pg}{version};
1269 my $CACHE = "$REPO_ROOT/$pg/$VER/$OSNAME-$OSARCH";
1271 print "-------- Storing package: \"$pg\" to path: $CACHE\n";
1273 # clean the cache path if exists and create it again
1279 # check if it is a single file
1283 # .. or a directory, in this case copy all the content
1285 opendir(IMD, $path);
1286 my @thefiles= readdir(IMD);
1289 for my $_file (@thefiles) {
1290 if( $_file ne "." && $_file ne "..") {
1291 `cp $path/$_file $CACHE`;
1301 # Retrieve a target object from the build binary repository
1302 # - pg (mandatory): a know target package name, it will be used to access to the $PG packages map
1308 # check that all required data are available
1309 if( $REPO_ROOT eq "" ) { return 0; }
1311 my $VER = $PG{$pg}{version};
1312 my $CACHE = "$REPO_ROOT/$pg/$VER/$OSNAME-$OSARCH";
1313 if( !-e "$CACHE/$pg" ) {
1314 print "-------- Module \"$pg\" NOT found on repository cache.\n";
1318 print "-------- Module \"$pg\" found on repository cache. Using copy on path: $CACHE\n";
1323 sub check_file_list_exists
1325 my ($base, @flist)=(@_);
1330 if ( !-e "$base/$f"){return 0;}
1338 chomp(@fl=`ls -1 $f`);
1344 my $F=new FileHandle;
1345 open ($F, "$command|");
1346 while (<$F>){print " --- $_";}
1350 sub input_installation_directory
1355 print "------- The current installation directory is: [$dir]\n";
1356 print "??????? Return to keep the default or new value:";
1358 if ($NO_QUESTION==0)
1360 chomp ($new=<stdin>);
1361 while ( $new ne "" && !input_yes ("You have entered $new. Is this correct? ([y]/n):"))
1363 print "???????New installation directory:";
1364 chomp ($new=<stdin>);
1366 $dir=($new eq "")?$dir:$new;
1370 if ( -d $dir){return $dir;}
1371 elsif (&root_run ("You must be root to create $dir","mkdir $dir")==$EXIT_SUCCESS){return $dir;}
1374 print "!!!!!!! $dir could not be created\n";
1379 elsif ( &input_yes ("??????? Do you want to provide a new directory([y]/n)?:"))
1381 return input_installation_directory ($dir);
1392 my $question =@_[0];
1395 if ($NO_QUESTION==1){return 1;}
1397 if ($question eq ""){$question="??????? Do you wish to proceed ([y]/n)?:";}
1399 chomp($answer=lc(<STDIN>));
1400 if (($answer=~/^y/) || $answer eq ""){return 1;}
1401 elsif ( ($answer=~/^n/)){return 0;}
1404 return input_yes($question);
1409 my ($txt, $cmd)=(@_);
1411 if ( system ($cmd)==$EXIT_SUCCESS){return $EXIT_SUCCESS;}
1414 print "------- $txt\n";
1415 if ( $ROOT eq "sudo"){return system ("sudo $cmd");}
1416 else {return system ("su root -c \"$cmd\"");}
1419 #analyze environement
1422 if (&pg_is_installed ("sudo")){return "sudo";}
1431 $raw_os=lc ($raw_os);
1433 if ($raw_os =~/cygwin/){$os="windows";}
1434 elsif ($raw_os =~/linux/){$os="linux";}
1435 elsif ($raw_os =~/osx/){$os="macosx";}
1436 elsif ($raw_os =~/darwin/){$os="macosx";}
1446 if ($OS) {return $OS;}
1448 print "??????? which os do you use: [w]indows, [l]inux, [m]acosx:?";
1449 $answer=lc(<STDIN>);
1451 if (($answer=~/^m/)){$OS="macosx";}
1452 elsif ( ($answer=~/^w/)){$OS="windows";}
1453 elsif ( ($answer=~/^linux/)){$OS="linux";}
1465 return $SUPPORTED_OS{$os};
1469 ################################################################################
1473 # update/initialize links #
1477 #################################################################################
1484 my $F=new FileHandle;
1485 my ($download, $address, $name, $l, $db);
1487 if ( $file eq "update"){$file=$TCLINKDB_ADDRESS;}
1489 if ( $file =~/http:\/\// || $file =~/ftp:\/\//)
1491 ($address, $name)=($download=~/(.*)\/([^\/]+)$/);
1493 if (&url2file ($file,"x")==$EXIT_SUCCESS)
1495 print "------- Susscessful upload of $name";
1504 if (($l =~/^\/\//) || ($db=~/^#/)){;}
1505 elsif ( !($l =~/\w/)){;}
1508 my @v=split (/\s+/, $l);
1511 $MODE{$v[1]}{$v[2]}=$v[3];
1515 $PG{$v[1]}{$v[2]}=$v[3];
1528 #TclinkdbStart End tag for the list updating
1530 $PG{"t_coffee"}{"4_TCOFFEE"}="TCOFFEE";
1531 $PG{"t_coffee"}{"type"}="sequence_multiple_aligner";
1532 $PG{"t_coffee"}{"ADDRESS"}="http://www.tcoffee.org";
1533 $PG{"t_coffee"}{"language"}="C";
1534 $PG{"t_coffee"}{"language2"}="C";
1535 $PG{"t_coffee"}{"source"}="http://www.tcoffee.org/Packages/T-COFFEE_distribution.tar.gz";
1536 $PG{"t_coffee"}{"update_action"}="always";
1537 $PG{"t_coffee"}{"mode"}="tcoffee,mcoffee,rcoffee,expresso,3dcoffee";
1538 $PG{"clustalw2"}{"4_TCOFFEE"}="CLUSTALW2";
1539 $PG{"clustalw2"}{"type"}="sequence_multiple_aligner";
1540 $PG{"clustalw2"}{"ADDRESS"}="http://www.clustal.org";
1541 $PG{"clustalw2"}{"language"}="C++";
1542 $PG{"clustalw2"}{"language2"}="CXX";
1543 $PG{"clustalw2"}{"source"}="http://www.clustal.org/download/2.0.10/clustalw-2.0.10-src.tar.gz";
1544 $PG{"clustalw2"}{"mode"}="mcoffee,rcoffee";
1545 $PG{"clustalw2"}{"version"}="2.0.10";
1546 $PG{"clustalw"}{"4_TCOFFEE"}="CLUSTALW";
1547 $PG{"clustalw"}{"type"}="sequence_multiple_aligner";
1548 $PG{"clustalw"}{"ADDRESS"}="http://www.clustal.org";
1549 $PG{"clustalw"}{"language"}="C";
1550 $PG{"clustalw"}{"language2"}="C";
1551 $PG{"clustalw"}{"source"}="http://www.clustal.org/download/1.X/ftp-igbmc.u-strasbg.fr/pub/ClustalW/clustalw1.82.UNIX.tar.gz";
1552 $PG{"clustalw"}{"mode"}="mcoffee,rcoffee";
1553 $PG{"clustalw"}{"version"}="1.82";
1554 $PG{"dialign-t"}{"4_TCOFFEE"}="DIALIGNT";
1555 $PG{"dialign-t"}{"type"}="sequence_multiple_aligner";
1556 $PG{"dialign-t"}{"ADDRESS"}="http://dialign-tx.gobics.de/";
1557 $PG{"dialign-t"}{"DIR"}="/usr/share/dialign-tx/";
1558 $PG{"dialign-t"}{"language"}="C";
1559 $PG{"dialign-t"}{"language2"}="C";
1560 $PG{"dialign-t"}{"source"}="http://dialign-tx.gobics.de/DIALIGN-TX_1.0.2.tar.gz";
1561 $PG{"dialign-t"}{"mode"}="mcoffee";
1562 $PG{"dialign-t"}{"binary"}="dialign-t";
1563 $PG{"dialign-t"}{"version"}="1.0.2";
1564 $PG{"dialign-tx"}{"4_TCOFFEE"}="DIALIGNTX";
1565 $PG{"dialign-tx"}{"type"}="sequence_multiple_aligner";
1566 $PG{"dialign-tx"}{"ADDRESS"}="http://dialign-tx.gobics.de/";
1567 $PG{"dialign-tx"}{"DIR"}="/usr/share/dialign-tx/";
1568 $PG{"dialign-tx"}{"language"}="C";
1569 $PG{"dialign-tx"}{"language2"}="C";
1570 $PG{"dialign-tx"}{"source"}="http://dialign-tx.gobics.de/DIALIGN-TX_1.0.2.tar.gz";
1571 $PG{"dialign-tx"}{"mode"}="mcoffee";
1572 $PG{"dialign-tx"}{"binary"}="dialign-tx";
1573 $PG{"dialign-tx"}{"version"}="1.0.2";
1574 $PG{"poa"}{"4_TCOFFEE"}="POA";
1575 $PG{"poa"}{"type"}="sequence_multiple_aligner";
1576 $PG{"poa"}{"ADDRESS"}="http://www.bioinformatics.ucla.edu/poa/";
1577 $PG{"poa"}{"language"}="C";
1578 $PG{"poa"}{"language2"}="C";
1579 $PG{"poa"}{"source"}="http://downloads.sourceforge.net/poamsa/poaV2.tar.gz";
1580 $PG{"poa"}{"DIR"}="/usr/share/";
1581 $PG{"poa"}{"FILE1"}="blosum80.mat";
1582 $PG{"poa"}{"mode"}="mcoffee";
1583 $PG{"poa"}{"binary"}="poa";
1584 $PG{"poa"}{"version"}="2.0";
1585 $PG{"probcons"}{"4_TCOFFEE"}="PROBCONS";
1586 $PG{"probcons"}{"type"}="sequence_multiple_aligner";
1587 $PG{"probcons"}{"ADDRESS"}="http://probcons.stanford.edu/";
1588 $PG{"probcons"}{"language2"}="CXX";
1589 $PG{"probcons"}{"language"}="C++";
1590 $PG{"probcons"}{"source"}="http://probcons.stanford.edu/probcons_v1_12.tar.gz";
1591 $PG{"probcons"}{"mode"}="mcoffee";
1592 $PG{"probcons"}{"binary"}="probcons";
1593 $PG{"probcons"}{"version"}="1.12";
1594 $PG{"mafft"}{"4_TCOFFEE"}="MAFFT";
1595 $PG{"mafft"}{"type"}="sequence_multiple_aligner";
1596 $PG{"mafft"}{"ADDRESS"}="http://align.bmr.kyushu-u.ac.jp/mafft/online/server/";
1597 $PG{"mafft"}{"language"}="C";
1598 $PG{"mafft"}{"language"}="C";
1599 $PG{"mafft"}{"source"}="http://align.bmr.kyushu-u.ac.jp/mafft/software/mafft-6.603-with-extensions-src.tgz";
1600 $PG{"mafft"}{"windows"}="http://align.bmr.kyushu-u.ac.jp/mafft/software/mafft-6.603-mingw.tar";
1601 $PG{"mafft"}{"mode"}="mcoffee,rcoffee";
1602 $PG{"mafft"}{"binary"}="mafft.tar.gz";
1603 $PG{"mafft"}{"version"}="6.603";
1604 $PG{"muscle"}{"4_TCOFFEE"}="MUSCLE";
1605 $PG{"muscle"}{"type"}="sequence_multiple_aligner";
1606 $PG{"muscle"}{"ADDRESS"}="http://www.drive5.com/muscle/";
1607 $PG{"muscle"}{"language"}="C++";
1608 $PG{"muscle"}{"language2"}="GPP";
1609 $PG{"muscle"}{"source"}="http://www.drive5.com/muscle/downloads3.7/muscle3.7_src.tar.gz";
1610 $PG{"muscle"}{"windows"}="http://www.drive5.com/muscle/downloads3.7/muscle3.7_win32.zip";
1611 $PG{"muscle"}{"linux"}="http://www.drive5.com/muscle/downloads3.7/muscle3.7_linux_ia32.tar.gz";
1612 $PG{"muscle"}{"mode"}="mcoffee,rcoffee";
1613 $PG{"muscle"}{"version"}="3.7";
1614 $PG{"mus4"}{"4_TCOFFEE"}="MUS4";
1615 $PG{"mus4"}{"type"}="sequence_multiple_aligner";
1616 $PG{"mus4"}{"ADDRESS"}="http://www.drive5.com/muscle/";
1617 $PG{"mus4"}{"language"}="C++";
1618 $PG{"mus4"}{"language2"}="GPP";
1619 $PG{"mus4"}{"source"}="http://www.drive5.com/muscle/muscle4.0_src.tar.gz";
1620 $PG{"mus4"}{"mode"}="mcoffee,rcoffee";
1621 $PG{"mus4"}{"version"}="4.0";
1622 $PG{"pcma"}{"4_TCOFFEE"}="PCMA";
1623 $PG{"pcma"}{"type"}="sequence_multiple_aligner";
1624 $PG{"pcma"}{"ADDRESS"}="ftp://iole.swmed.edu/pub/PCMA/";
1625 $PG{"pcma"}{"language"}="C";
1626 $PG{"pcma"}{"language2"}="C";
1627 $PG{"pcma"}{"source"}="ftp://iole.swmed.edu/pub/PCMA/pcma.tar.gz";
1628 $PG{"pcma"}{"mode"}="mcoffee";
1629 $PG{"pcma"}{"version"}="1.0";
1630 $PG{"kalign"}{"4_TCOFFEE"}="KALIGN";
1631 $PG{"kalign"}{"type"}="sequence_multiple_aligner";
1632 $PG{"kalign"}{"ADDRESS"}="http://msa.cgb.ki.se";
1633 $PG{"kalign"}{"language"}="C";
1634 $PG{"kalign"}{"language2"}="C";
1635 $PG{"kalign"}{"source"}="http://msa.cgb.ki.se/downloads/kalign/current.tar.gz";
1636 $PG{"kalign"}{"mode"}="mcoffee";
1637 $PG{"kalign"}{"version"}="1.0";
1638 $PG{"amap"}{"4_TCOFFEE"}="AMAP";
1639 $PG{"amap"}{"type"}="sequence_multiple_aligner";
1640 $PG{"amap"}{"ADDRESS"}="http://bio.math.berkeley.edu/amap/";
1641 $PG{"amap"}{"language"}="C++";
1642 $PG{"amap"}{"language2"}="CXX";
1643 $PG{"amap"}{"source"}="http://amap-align.googlecode.com/files/amap.2.0.tar.gz";
1644 $PG{"amap"}{"mode"}="mcoffee";
1645 $PG{"amap"}{"version"}="2.0";
1646 $PG{"proda"}{"4_TCOFFEE"}="PRODA";
1647 $PG{"proda"}{"type"}="sequence_multiple_aligner";
1648 $PG{"proda"}{"ADDRESS"}="http://proda.stanford.edu";
1649 $PG{"proda"}{"language"}="C++";
1650 $PG{"proda"}{"language2"}="CXX";
1651 $PG{"proda"}{"source"}="http://proda.stanford.edu/proda_1_0.tar.gz";
1652 $PG{"proda"}{"mode"}="mcoffee";
1653 $PG{"proda"}{"version"}="1.0";
1654 $PG{"fsa"}{"4_TCOFFEE"}="FSA";
1655 $PG{"fsa"}{"type"}="sequence_multiple_aligner";
1656 $PG{"fsa"}{"ADDRESS"}="http://fsa.sourceforge.net/";
1657 $PG{"fsa"}{"language"}="C++";
1658 $PG{"fsa"}{"language2"}="CXX";
1659 $PG{"fsa"}{"source"}="http://sourceforge.net/projects/fsa/files/fsa-1.15.3.tar.gz/download/";
1660 $PG{"fsa"}{"mode"}="mcoffee";
1661 $PG{"fsa"}{"version"}="1.15.3";
1662 $PG{"prank"}{"4_TCOFFEE"}="PRANK";
1663 $PG{"prank"}{"type"}="sequence_multiple_aligner";
1664 $PG{"prank"}{"ADDRESS"}="http://www.ebi.ac.uk/goldman-srv/prank/";
1665 $PG{"prank"}{"language"}="C++";
1666 $PG{"prank"}{"language2"}="CXX";
1667 $PG{"prank"}{"source"}="http://www.ebi.ac.uk/goldman-srv/prank/src/prank/prank.src.100303.tgz";
1668 $PG{"prank"}{"mode"}="mcoffee";
1669 $PG{"prank"}{"version"}="100303";
1670 $PG{"sap"}{"4_TCOFFEE"}="SAP";
1671 $PG{"sap"}{"type"}="structure_pairwise_aligner";
1672 $PG{"sap"}{"ADDRESS"}="http://mathbio.nimr.mrc.ac.uk/wiki/Software";
1673 $PG{"sap"}{"language"}="C";
1674 $PG{"sap"}{"language2"}="C";
1675 $PG{"sap"}{"source"}="http://mathbio.nimr.mrc.ac.uk/download/sap-1.1.1.tar.gz";
1676 $PG{"sap"}{"mode"}="expresso,3dcoffee";
1677 $PG{"sap"}{"version"}="1.1.1";
1678 $PG{"TMalign"}{"4_TCOFFEE"}="TMALIGN";
1679 $PG{"TMalign"}{"type"}="structure_pairwise_aligner";
1680 $PG{"TMalign"}{"ADDRESS"}="http://zhang.bioinformatics.ku.edu/TM-align/TMalign.f";
1681 $PG{"TMalign"}{"language"}="Fortran";
1682 $PG{"TMalign"}{"language2"}="Fortran";
1683 $PG{"TMalign"}{"source"}="http://zhang.bioinformatics.ku.edu/TM-align/TMalign.f";
1684 $PG{"TMalign"}{"linux"}="http://zhang.bioinformatics.ku.edu/TM-align/TMalign_32.gz";
1685 $PG{"TMalign"}{"mode"}="expresso,3dcoffee";
1686 $PG{"TMalign"}{"version"}="1.0";
1687 $PG{"mustang"}{"4_TCOFFEE"}="MUSTANG";
1688 $PG{"mustang"}{"type"}="structure_pairwise_aligner";
1689 $PG{"mustang"}{"ADDRESS"}="http://www.cs.mu.oz.au/~arun/mustang";
1690 $PG{"mustang"}{"language"}="C++";
1691 $PG{"mustang"}{"language2"}="CXX";
1692 $PG{"mustang"}{"source"}="http://ww2.cs.mu.oz.au/~arun/mustang/mustang_v3.2.1.tgz";
1693 $PG{"mustang"}{"mode"}="expresso,3dcoffee";
1694 $PG{"mustang"}{"version"}="3.2.1";
1695 $PG{"lsqman"}{"4_TCOFFEE"}="LSQMAN";
1696 $PG{"lsqman"}{"type"}="structure_pairwise_aligner";
1697 $PG{"lsqman"}{"ADDRESS"}="empty";
1698 $PG{"lsqman"}{"language"}="empty";
1699 $PG{"lsqman"}{"language2"}="empty";
1700 $PG{"lsqman"}{"source"}="empty";
1701 $PG{"lsqman"}{"update_action"}="never";
1702 $PG{"lsqman"}{"mode"}="expresso,3dcoffee";
1703 $PG{"align_pdb"}{"4_TCOFFEE"}="ALIGN_PDB";
1704 $PG{"align_pdb"}{"type"}="structure_pairwise_aligner";
1705 $PG{"align_pdb"}{"ADDRESS"}="empty";
1706 $PG{"align_pdb"}{"language"}="empty";
1707 $PG{"align_pdb"}{"language2"}="empty";
1708 $PG{"align_pdb"}{"source"}="empty";
1709 $PG{"align_pdb"}{"update_action"}="never";
1710 $PG{"align_pdb"}{"mode"}="expresso,3dcoffee";
1711 $PG{"fugueali"}{"4_TCOFFEE"}="FUGUE";
1712 $PG{"fugueali"}{"type"}="structure_pairwise_aligner";
1713 $PG{"fugueali"}{"ADDRESS"}="http://www-cryst.bioc.cam.ac.uk/fugue/download.html";
1714 $PG{"fugueali"}{"language"}="empty";
1715 $PG{"fugueali"}{"language2"}="empty";
1716 $PG{"fugueali"}{"source"}="empty";
1717 $PG{"fugueali"}{"update_action"}="never";
1718 $PG{"fugueali"}{"mode"}="expresso,3dcoffee";
1719 $PG{"dalilite.pl"}{"4_TCOFFEE"}="DALILITEc";
1720 $PG{"dalilite.pl"}{"type"}="structure_pairwise_aligner";
1721 $PG{"dalilite.pl"}{"ADDRESS"}="built_in";
1722 $PG{"dalilite.pl"}{"ADDRESS2"}="http://www.ebi.ac.uk/Tools/webservices/services/dalilite";
1723 $PG{"dalilite.pl"}{"language"}="Perl";
1724 $PG{"dalilite.pl"}{"language2"}="Perl";
1725 $PG{"dalilite.pl"}{"source"}="empty";
1726 $PG{"dalilite.pl"}{"update_action"}="never";
1727 $PG{"dalilite.pl"}{"mode"}="expresso,3dcoffee";
1728 $PG{"probconsRNA"}{"4_TCOFFEE"}="PROBCONSRNA";
1729 $PG{"probconsRNA"}{"type"}="RNA_multiple_aligner";
1730 $PG{"probconsRNA"}{"ADDRESS"}="http://probcons.stanford.edu/";
1731 $PG{"probconsRNA"}{"language"}="C++";
1732 $PG{"probconsRNA"}{"language2"}="CXX";
1733 $PG{"probconsRNA"}{"source"}="http://probcons.stanford.edu/probconsRNA.tar.gz";
1734 $PG{"probconsRNA"}{"mode"}="mcoffee,rcoffee";
1735 $PG{"probconsRNA"}{"version"}="1.0";
1736 $PG{"sfold"}{"4_TCOFFEE"}="CONSAN";
1737 $PG{"sfold"}{"type"}="RNA_pairwise_aligner";
1738 $PG{"sfold"}{"ADDRESS"}="http://selab.janelia.org/software/consan/";
1739 $PG{"sfold"}{"language"}="empty";
1740 $PG{"sfold"}{"language2"}="empty";
1741 $PG{"sfold"}{"source"}="empty";
1742 $PG{"sfold"}{"update_action"}="never";
1743 $PG{"sfold"}{"mode"}="rcoffee";
1744 $PG{"RNAplfold"}{"4_TCOFFEE"}="RNAPLFOLD";
1745 $PG{"RNAplfold"}{"type"}="RNA_secondarystructure_predictor";
1746 $PG{"RNAplfold"}{"ADDRESS"}="http://www.tbi.univie.ac.at/~ivo/RNA/";
1747 $PG{"RNAplfold"}{"language"}="C";
1748 $PG{"RNAplfold"}{"language2"}="C";
1749 $PG{"RNAplfold"}{"source"}="http://www.tbi.univie.ac.at/~ivo/RNA/ViennaRNA-1.7.2.tar.gz";
1750 $PG{"RNAplfold"}{"mode"}="rcoffee,";
1751 $PG{"RNAplfold"}{"version"}="1.7.2";
1752 $PG{"retree"}{"4_TCOFFEE"}="PHYLIP";
1753 $PG{"retree"}{"type"}="RNA_secondarystructure_predictor";
1754 $PG{"retree"}{"ADDRESS"}="http://evolution.gs.washington.edu/phylip/";
1755 $PG{"retree"}{"language"}="C";
1756 $PG{"retree"}{"language2"}="C";
1757 $PG{"retree"}{"source"}="http://evolution.gs.washington.edu/phylip/download/phylip-3.69.tar.gz";
1758 $PG{"retree"}{"mode"}="trmsd,";
1759 $PG{"retree"}{"version"}="3.69";
1760 $PG{"hmmtop"}{"4_TCOFFEE"}="HMMTOP";
1761 $PG{"hmmtop"}{"type"}="protein_secondarystructure_predictor";
1762 $PG{"hmmtop"}{"ADDRESS"}="www.enzim.hu/hmmtop/";
1763 $PG{"hmmtop"}{"language"}="C";
1764 $PG{"hmmtop"}{"language2"}="C";
1765 $PG{"hmmtop"}{"source"}="empty";
1766 $PG{"hmmtop"}{"update_action"}="never";
1767 $PG{"hmmtop"}{"mode"}="tcoffee";
1768 $PG{"gorIV"}{"4_TCOFFEE"}="GOR4";
1769 $PG{"gorIV"}{"type"}="protein_secondarystructure_predictor";
1770 $PG{"gorIV"}{"ADDRESS"}="http://mig.jouy.inra.fr/logiciels/gorIV/";
1771 $PG{"gorIV"}{"language"}="C";
1772 $PG{"gorIV"}{"language2"}="C";
1773 $PG{"gorIV"}{"source"}="http://mig.jouy.inra.fr/logiciels/gorIV/GOR_IV.tar.gz";
1774 $PG{"gorIV"}{"update_action"}="never";
1775 $PG{"gorIV"}{"mode"}="tcoffee";
1776 $PG{"wublast.pl"}{"4_TCOFFEE"}="EBIWUBLASTc";
1777 $PG{"wublast.pl"}{"type"}="protein_homology_predictor";
1778 $PG{"wublast.pl"}{"ADDRESS"}="built_in";
1779 $PG{"wublast.pl"}{"ADDRESS2"}="http://www.ebi.ac.uk/Tools/webservices/services/wublast";
1780 $PG{"wublast.pl"}{"language"}="Perl";
1781 $PG{"wublast.pl"}{"language2"}="Perl";
1782 $PG{"wublast.pl"}{"source"}="empty";
1783 $PG{"wublast.pl"}{"update_action"}="never";
1784 $PG{"wublast.pl"}{"mode"}="psicoffee,expresso,accurate";
1785 $PG{"blastpgp.pl"}{"4_TCOFFEE"}="EBIBLASTPGPc";
1786 $PG{"blastpgp.pl"}{"type"}="protein_homology_predictor";
1787 $PG{"blastpgp.pl"}{"ADDRESS"}="built_in";
1788 $PG{"blastpgp.pl"}{"ADDRESS2"}="http://www.ebi.ac.uk/Tools/webservices/services/blastpgp";
1789 $PG{"blastpgp.pl"}{"language"}="Perl";
1790 $PG{"blastpgp.pl"}{"language2"}="Perl";
1791 $PG{"blastpgp.pl"}{"source"}="empty";
1792 $PG{"blastpgp.pl"}{"update_action"}="never";
1793 $PG{"blastpgp.pl"}{"mode"}="psicoffee,expresso,accurate";
1794 $PG{"blastcl3"}{"4_TCOFFEE"}="NCBIWEBBLAST";
1795 $PG{"blastcl3"}{"type"}="protein_homology_predictor";
1796 $PG{"blastcl3"}{"ADDRESS"}="ftp://ftp.ncbi.nih.gov/blast/executables/LATEST";
1797 $PG{"blastcl3"}{"language"}="C";
1798 $PG{"blastcl3"}{"language2"}="C";
1799 $PG{"blastcl3"}{"source"}="empty";
1800 $PG{"blastcl3"}{"update_action"}="never";
1801 $PG{"blastcl3"}{"mode"}="psicoffee,expresso,3dcoffee";
1802 $PG{"blastall"}{"4_TCOFFEE"}="blastall";
1803 $PG{"blastall"}{"type"}="protein_homology_predictor";
1804 $PG{"blastall"}{"ADDRESS"}="ftp://ftp.ncbi.nih.gov/blast/executables/LATEST";
1805 $PG{"blastall"}{"language"}="C";
1806 $PG{"blastall"}{"language2"}="C";
1807 $PG{"blastall"}{"source"}="empty";
1808 $PG{"blastall"}{"update_action"}="never";
1809 $PG{"blastall"}{"mode"}="psicoffee,expresso,3dcoffee";
1810 $PG{"legacy_blast.pl"}{"4_TCOFFEE"}="NCBIBLAST";
1811 $PG{"legacy_blast.pl"}{"type"}="protein_homology_predictor";
1812 $PG{"legacy_blast.pl"}{"ADDRESS"}="ftp://ftp.ncbi.nih.gov/blast/executables/LATEST";
1813 $PG{"legacy_blast.pl"}{"language"}="C";
1814 $PG{"legacy_blast.pl"}{"language2"}="C";
1815 $PG{"legacy_blast.pl"}{"source"}="empty";
1816 $PG{"legacy_blast.pl"}{"update_action"}="never";
1817 $PG{"legacy_blast.pl"}{"mode"}="psicoffee,expresso,3dcoffee";
1818 $PG{"SOAP::Lite"}{"4_TCOFFEE"}="SOAPLITE";
1819 $PG{"SOAP::Lite"}{"type"}="library";
1820 $PG{"SOAP::Lite"}{"ADDRESS"}="http://cpansearch.perl.org/src/MKUTTER/SOAP-Lite-0.710.08/Makefile.PL";
1821 $PG{"SOAP::Lite"}{"language"}="Perl";
1822 $PG{"SOAP::Lite"}{"language2"}="Perl";
1823 $PG{"SOAP::Lite"}{"source"}="empty";
1824 $PG{"blastpgp"}{"update_action"}="never";
1825 $PG{"SOAP::Lite"}{"mode"}="none";
1826 $PG{"XML::Simple"}{"4_TCOFFEE"}="XMLSIMPLE";
1827 $PG{"XML::Simple"}{"type"}="library";
1828 $PG{"XML::Simple"}{"ADDRESS"}="http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm";
1829 $PG{"XML::Simple"}{"language"}="Perl";
1830 $PG{"XML::Simple"}{"language2"}="Perl";
1831 $PG{"XML::Simple"}{"source"}="empty";
1832 $PG{"XML::Simple"}{"mode"}="psicoffee,expresso,accurate";
1833 $MODE{"tcoffee"}{"name"}="tcoffee";
1834 $MODE{"rcoffee"}{"name"}="rcoffee";
1835 $MODE{"3dcoffee"}{"name"}="3dcoffee";
1836 $MODE{"mcoffee"}{"name"}="mcoffee";
1837 $MODE{"expresso"}{"name"}="expresso";
1838 $MODE{"trmsd"}{"name"}="trmsd";
1839 $MODE{"accurate"}{"name"}="accurate";
1840 $MODE{"seq_reformat"}{"name"}="seq_reformat";
1841 #TclinkdbEnd End tag for the list updating
1843 ########### Compilers ##############################
1847 $PG{C}{compiler}="gcc";
1848 $PG{C}{compiler_flag}="CC";
1850 $PG{C}{options_flag}="CFLAGS";
1851 $PG{C}{type}="compiler";
1853 $PG{"CXX"}{compiler}="g++";
1854 $PG{"CXX"}{compiler_flag}="CXX";
1855 $PG{"CXX"}{options}="";
1856 $PG{"CXX"}{options_flag}="CXXFLAGS";
1857 $PG{CXX}{type}="compiler";
1859 $PG{"CPP"}{compiler}="g++";
1860 $PG{"CPP"}{compiler_flag}="CPP";
1861 $PG{"CPP"}{options}="";
1862 $PG{"CPP"}{options_flag}="CPPFLAGS";
1863 $PG{CPP}{type}="compiler";
1865 $PG{"GPP"}{compiler}="g++";
1866 $PG{"GPP"}{compiler_flag}="GPP";
1867 $PG{"GPP"}{options}="";
1868 $PG{"GPP"}{options_flag}="CFLAGS";
1869 $PG{GPP}{type}="compiler";
1871 $PG{Fortran}{compiler}="g77";
1872 $PG{Fortran}{compiler_flag}="FCC";
1873 $PG{Fortran}{type}="compiler";
1875 $PG{Perl}{compiler}="CPAN";
1876 $PG{Perl}{type}="compiler";
1878 $SUPPORTED_OS{macox}="Macintosh";
1879 $SUPPORTED_OS{linux}="Linux";
1880 $SUPPORTED_OS{windows}="Cygwin";
1884 $MODE{t_coffee}{description}=" for regular multiple sequence alignments";
1885 $MODE{rcoffee} {description}=" for RNA multiple sequence alignments";
1887 $MODE{psicoffee} {description}=" for Homology Extended multiple sequence alignments";
1888 $MODE{expresso}{description}=" for very accurate structure based multiple sequence alignments";
1889 $MODE{"3dcoffee"}{description}=" for multiple structure alignments";
1890 $MODE{mcoffee} {description}=" for combining alternative multiple sequence alignment packages\n------- into a unique meta-package. The installer will upload several MSA packages and compile them\n
1902 %PG=&name2dname (%PG);
1903 %MODE=&name2dname(%MODE);
1904 foreach $p (keys(%PG)){if ( $PG{$p}{type} eq "compiler"){$PG{$p}{update_action}="never";}}
1913 foreach my $pg (keys(%L))
1916 if ( $l>$ml){$ml=$l;}
1919 foreach my $pg (keys(%L))
1922 $l=$ml-length ($pg);
1924 for ( $b=0; $b<$l; $b++)
1928 $L{$pg}{dname}=$name;
1936 my $F=new FileHandle;
1943 my($var, $value)=($_=~/(\S+)\=(\S*)/);
1952 sub replace_line_in_file
1954 my ($file, $wordin, $wordout)=@_;
1955 my $O=new FileHandle;
1956 my $I=new FileHandle;
1958 if (!-e $file){return;}
1960 system ("mv $file $file.old");
1961 open ($O, ">$file");
1962 open ($I, "$file.old");
1966 if (!($l=~/$wordin/)){print $O "$l";}
1967 elsif ( $wordout ne ""){$l=~s/$wordin/$wordout/g;print $O "$l";}
1976 my ($file,$first,@list)=@_;
1978 my $O=new FileHandle;
1979 my $I=new FileHandle;
1981 if (!-e $file){return;}
1983 $anchor="#include <$first>";
1985 system ("mv $file $file.old");
1986 open ($O, ">$file");
1987 open ($I, "$file.old");
1992 if (!($l=~/$anchor/))
1995 foreach my $lib (@list)
1997 print $O "#include <$lib>\n";