[Bio] / FigCommon / bootstrap.pl Repository:
ViewVC logotype

Diff of /FigCommon/bootstrap.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Fri Dec 19 22:57:48 2003 UTC revision 1.2, Tue Dec 23 16:10:48 2003 UTC
# Line 107  Line 107 
107  our $env_name = $ENV{FIGCONFIG_ENV};  our $env_name = $ENV{FIGCONFIG_ENV};
108  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";
109  our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";  our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";
110  our $dist_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";  #
111  our $dist_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";  # We are moving to use a symlink in dist/releases/current for these.
112    # This symlink is managed by switch_to_release.
113    #
114    #our $release_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";
115    #our $release_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";
116    
117    our $release_bin = "$fig_disk/dist/releases/current/bin/$ENV{FIGCONFIG_ENV}";
118    our $release_lib = "$fig_disk/dist/releases/current/lib/$ENV{FIGCONFIG_ENV}";
119    
120    our $fig_bin = "$fig_disk/FIG/bin";
121    
122  #  #
123  # Location of start/stop servers scripts.  # Location of start/stop servers scripts.
# Line 131  Line 140 
140      push(@$Config, ["fig_disk", $fig_disk, 1]);      push(@$Config, ["fig_disk", $fig_disk, 1]);
141      push(@$Config, ["blastmast", "$fig_disk/BLASTMAT", 1]);      push(@$Config, ["blastmast", "$fig_disk/BLASTMAT", 1]);
142      push(@$Config, ["fig", $fig, 1]);      push(@$Config, ["fig", $fig, 1]);
143      push(@$Config, ["bin", $dist_bin, 1]);      push(@$Config, ["bin", $fig_bin, 1]);
144      push(@$Config, ["ext_bin", $env_bin, 1]);      push(@$Config, ["ext_bin", $env_bin, 1]);
145      push(@$Config, ["data", $data, 1]);      push(@$Config, ["data", $data, 1]);
146      push(@$Config, ["global", "$data/Global", 1]);      push(@$Config, ["global", "$data/Global", 1]);
# Line 152  Line 161 
161      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);
162      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);
163      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);
164      push(@$Env, ["RTCURRENT", $ENV{FIGCONFIG_RELEASE}, 0]);      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);
165      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);
166    
167      push(@$Env, ["BLASTMAT", "$ENV{FIG_HOME}/BLASTMAT", 0]);      push(@$Env, ["BLASTMAT", "$ENV{FIG_HOME}/BLASTMAT", 0]);
# Line 166  Line 175 
175    
176      my @path = ();      my @path = ();
177      push(@path, $env_bin);      push(@path, $env_bin);
178      push(@path, $dist_bin);      push(@path, $fig_bin);
179      push(@path, "$fig_disk/bin");      push(@path, "$fig_disk/bin");
180    
181      push(@$Env, ["PATH", join(":", @path), 1]);      push(@$Env, ["PATH", join(":", @path), 1]);
182    
183      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}:${dist_lib}", 1]);      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);
184  }  }
185    
186  sub configure_python  sub configure_python
# Line 194  Line 203 
203      chomp $py_version;      chomp $py_version;
204      print "Python version $py_version\n";      print "Python version $py_version\n";
205    
206        $OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";
207    
208      my @path = ();      my @path = ();
209      push(@path, "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages");      push(@path, $OtherConfig->{python_site_path});
210      push(@path, "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}");      push(@path, "$release_lib");
211      push(@path, "$fig_disk/config");      push(@path, "$fig_disk/config");
212      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);
213    
# Line 473  Line 484 
484              next if $inc eq '.';              next if $inc eq '.';
485              print $fh "\t$inc\n";              print $fh "\t$inc\n";
486          }          }
487          print $fh ")\n";          print $fh ");\n";
488          print $fh "}\n";          print $fh "}\n";
489      }      }
490    
491      print $fh "use Data::Dumper;\n";      print $fh "use Data::Dumper;\n";
492      print $fh "use Carp;\n";      print $fh "use Carp;\n";
493    
494      print $fh "use lib \"$dist_lib\";\n";      #
495      print $fh "use lib \"$dist_lib/FigKernelPackages\";\n";      # We generate a comment here that gets expanded by switch_to_release
496        # This is part of the effort in making the environment bootstrapping
497        # code independent of releases.
498        #
499    
500        #print $fh "use lib \"$release_lib\";\n";
501        #print $fh "use lib \"$release_lib/FigKernelPackages\";\n";
502    
503        print $fh "# Following block is expanded by switch_to_release to add use lib directives\n";
504        print $fh "# to point at the correct locations in the release directory.\n";
505        print $fh "#BEGIN switch_to_release generated code\n";
506        print $fh "#END switch_to_release generated code\n";
507        print $fh "\n";
508    
509      print $fh "use lib \"$fig_disk/config\";\n";      print $fh "use lib \"$fig_disk/config\";\n";
510    
511      print $fh "use FIG_Config;\n";      print $fh "use FIG_Config;\n";
# Line 498  Line 522 
522      print $fh "\n";      print $fh "\n";
523    
524      print $fh "import sys\n";      print $fh "import sys\n";
525      my $pp = join(", ", map({ '"' . $_ . '"'} split(":", $OtherConfig->{pythonpath})));  
526      print $fh "sys.path.extend(($pp))\n";  
527        print $fh "sys.path.append('$OtherConfig->{python_site_path}')\n";
528    
529        print $fh "# Following block is expanded by switch_to_release to add use lib directives\n";
530        print $fh "# to point at the correct locations in the release directory.\n";
531        print $fh "#BEGIN switch_to_release generated code\n";
532        print $fh "#END switch_to_release generated code\n";
533        print $fh "\n";
534    
535        print $fh "sys.path.append('$fig_disk/config')\n";
536    
537      print $fh "import FIG_Config\n";      print $fh "import FIG_Config\n";
538      print $fh "\n";      print $fh "\n";
539  }  }
# Line 544  Line 578 
578  # Write the tool headers  # Write the tool headers
579  #  #
580    
581  open(FH, ">$fig_disk/config/tool_hdr") or die "Cannot write $fig_disk/config/tool_hdr: $!";  open(FH, ">$fig_disk/config/base_tool_hdr") or die "Cannot write $fig_disk/config/tool_hdr: $!";
582  write_tool_hdr_perl(\*FH);  write_tool_hdr_perl(\*FH);
583  close(FH);  close(FH);
584    
585  open(FH, ">$fig_disk/config/tool_hdr_py") or die "Cannot write $fig_disk/config/tool_hdr_py: $!";  open(FH, ">$fig_disk/config/base_tool_hdr_py") or die "Cannot write $fig_disk/config/tool_hdr_py: $!";
586  write_tool_hdr_python(\*FH);  write_tool_hdr_python(\*FH);
587  close(FH);  close(FH);
588    
589  #  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");
590  # We have enough environment configured now to do a make.  
591  #  require FigCommon::SwitchRelease;
 # We use system and manually load the environment config so that it will  
 # work properly despite any user settings.  
 #  
592    
593  system("source $fig_disk/config/fig-user-env.sh; cd $ENV{FIGCONFIG_RELEASE_DIR}; make clean; make");  &FigCommon::SwitchRelease::switch_to_release($fig_disk, $ENV{FIGCONFIG_ENV}, $ENV{FIGCONFIG_RELEASE});

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3