[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.21, Mon Mar 7 17:23:31 2005 UTC revision 1.27, Mon May 23 14:49:28 2005 UTC
# Line 143  Line 143 
143      push(@$Config, ["ext_bin", $env_bin, 1]);      push(@$Config, ["ext_bin", $env_bin, 1]);
144      push(@$Config, ["common_runtime", $env_dir, 1]);      push(@$Config, ["common_runtime", $env_dir, 1]);
145      push(@$Config, ["arch", $ENV{FIGCONFIG_ENV}, 1]);      push(@$Config, ["arch", $ENV{FIGCONFIG_ENV}, 1]);
146        push(@$Config, ["var", "$fig/var", 1]);
147      push(@$Config, ["data", $data, 1]);      push(@$Config, ["data", $data, 1]);
148      push(@$Config, ["global", "$data/Global", 1]);      push(@$Config, ["global", "$data/Global", 1]);
149      push(@$Config, ["organisms", "$data/Organisms", 1]);      push(@$Config, ["organisms", "$data/Organisms", 1]);
# Line 178  Line 179 
179    
180      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);      push(@$Env, ["RTROOT", $ENV{FIG_HOME}, 0]);
181      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);      push(@$Env, ["RTDIST", "\$RTROOT/dist", 0]);
182        push(@$Env, ["RTSITECONFIGDIR", "\$RTROOT/config", 0]);
183      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);      push(@$Env, ["RTARCH", $ENV{FIGCONFIG_ENV}, 0]);
184      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);      push(@$Env, ["RTCURRENT", "`cat \$RTROOT/CURRENT_RELEASE`", 0]);
185      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);      push(@$Env, ["FIG_HOME", $ENV{FIG_HOME}, 0]);
# Line 192  Line 194 
194      #      #
195    
196      my @path = ();      my @path = ();
     push(@path, $env_bin);  
197      push(@path, $fig_bin);      push(@path, $fig_bin);
198        push(@path, $env_bin);
199      push(@path, "$fig_disk/bin");      push(@path, "$fig_disk/bin");
200    
201      push(@$Env, ["PATH", join(":", @path), 1]);      push(@$Env, ["PATH", join(":", @path), 1]);
202    
203      push(@$Env, ["LD_LIBRARY_PATH", "${env_lib}", 1]);      #
204        # Compute  LD_LIBRARY_PATH.
205        #
206        # Some packages, like mysql, place their shared libs in subdirectories
207        # of the libdir.
208        #
209    
210        my @ld_path = ($env_lib);
211    
212        my $dh;
213        if (!opendir($dh, $env_lib))
214        {
215            warn "Could not opendir $env_lib: $!";
216        }
217    
218        while ($_ = readdir($dh))
219        {
220            next if /^\./;
221    
222      my @perllib = grep({ $_ ne "." } @INC, "$fig_disk/config", $release_lib,          my $path = "$env_lib/$_";
223                        "$release_lib/FigKernelPackages");          next unless -d $path;
224    
225            #
226            # See if there are any .so's in here.
227            #
228    
229            my @solist = <$path/*.so*>;
230            if (@solist > 0)
231            {
232                push(@ld_path, $path);
233            }
234        }
235        closedir($dh);
236    
237        #
238        # And if perl is dynamically linked, we need to add the perl core directory
239        # to the path too.
240        #
241    
242        my @coredir = <$env_lib/perl5/*/*/CORE>;
243        if (@coredir)
244        {
245            if ( -f "$coredir[0]/libperl.so" )
246            {
247                print "Found libperl in $coredir[0]\n";
248                push(@ld_path, $coredir[0]);
249            }
250        }
251    
252        my $ld_path = join(":", @ld_path);
253        $OtherConfig->{ld_library_path} = $ld_path;
254    
255        push(@$Env, ["LD_LIBRARY_PATH", $ld_path, 1]);
256    
257        my @perllib = grep({ $_ ne "." } @INC,
258                           $release_lib,
259                           "$release_lib/FigKernelPackages",
260                           "$fig_disk/config");
261    
262      push(@$Env, ["PERL5LIB", join(":", @perllib), 1]);      push(@$Env, ["PERL5LIB", join(":", @perllib), 1]);
263  }  }
# Line 226  Line 282 
282      chomp $py_version;      chomp $py_version;
283      print "Python version $py_version\n";      print "Python version $py_version\n";
284    
285      $OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";      #
286        # Python figures this out for us.
287        #$OtherConfig->{python_site_path} = "$ENV{FIGCONFIG_ENV_DIR}/lib/python$py_version/site-packages";
288    
289      my @path = ();      my @path = ();
290      push(@path, $OtherConfig->{python_site_path});      #push(@path, $OtherConfig->{python_site_path});
291      push(@path, "$release_lib");      push(@path, "$release_lib");
292      push(@path, "$fig_disk/config");      push(@path, "$fig_disk/config");
293      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);      push(@$Env, ["PYTHONPATH", join(":", @path), 1]);
# Line 593  Line 651 
651      # Append the perl path to the environment, for use later with CallPerl.      # Append the perl path to the environment, for use later with CallPerl.
652      #      #
653    
654      my $perlpath = join(":", @INC, "$fig_disk/config", $release_lib, "$release_lib/FigKernelPackages");      my $perlpath = join(":", @INC, $release_lib, "$release_lib/FigKernelPackages", "$fig_disk/config");
655      print $fh <<END;      print $fh <<END;
656  if os.getenv("PERL5LIB", "") != "":  if os.getenv("PERL5LIB", "") != "":
657      _delim = ":"      _delim = ":"
# Line 616  Line 674 
674      print $fh "#### END tool_hdr_py ####\n\n"      print $fh "#### END tool_hdr_py ####\n\n"
675  }  }
676    
677    sub write_rtconfig
678    {
679        my($fh) = @_;
680    
681        my $python = find_python();
682        my $perl = find_perl();
683    
684        print $fh "RTPYTHON=$python\n";
685        print $fh "RTPERL=$perl\n";
686        print $fh "RTPYTHONPATH=$OtherConfig->{pythonpath}\n";
687    
688        my %seen;
689        my @perlpath;
690        for (@INC, "$fig_disk/config")
691        {
692            next if $seen{$_};
693            push(@perlpath, $_);
694            $seen{$_}++;
695        }
696        my $perlpath = join(":", @perlpath);
697    
698        print $fh "RTPERL5LIB=$perlpath\n";
699    
700        print $fh "RTPYTHONIMPORTS=FIG_Config\n";
701        print $fh "RTPERLIMPORTS=FIG_Config\n";
702        print $fh "RTSETENV=BLASTMAT=$fig_disk/BLASTMAT\n";
703        print $fh "RTSETENV=FIG_HOME=$fig_disk\n";
704        print $fh "#RTLD_LDPATH=$OtherConfig->{ld_library_path}\n";
705    }
706    
707  setup_directories("$fig_disk/bin",  setup_directories("$fig_disk/bin",
708                    "$fig_disk/config");                    "$fig_disk/config");
709    
# Line 667  Line 755 
755  write_tool_hdr_python(\*FH);  write_tool_hdr_python(\*FH);
756  close(FH);  close(FH);
757    
758    open(FH, ">$fig_disk/config/RTConfig") or die "Cannot write $fig_disk/config/RTConfig: $!";
759    write_rtconfig(\*FH);
760    close(FH);
761    
762  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");  unshift(@INC, "$ENV{FIGCONFIG_RELEASE_DIR}");
763    
764  require FigCommon::SwitchRelease;  require FigCommon::SwitchRelease;

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.27

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3