help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trying to compile 3.6.1


From: Sergei Steshenko
Subject: Re: trying to compile 3.6.1
Date: Fri, 10 Aug 2012 09:41:33 -0700 (PDT)

>________________________________
> From: Rita <address@hidden>
>To: Sergei Steshenko <address@hidden> 
>Cc: Mike Miller <address@hidden>; help <address@hidden> 
>Sent: Friday, August 10, 2012 7:33 PM
>Subject: Re: trying to compile 3.6.1
> 
>
[snip]
>
>really, the challenge is to compile against BLAS and LAPACK 
[snip]

Rita,

I directed you to 
AppsFromScratch/20120503_old/include/perl/project_specific/default_build_data_sub.prl
 file for a reason.

It's difficult to explain in words what's already coded.

Fundamentally, what I'm doing, I first "cheat" 'configure' and then correct the 
Makefiles "poisoned" by the cheating. The order of libraries is also taken care 
of.


The file contains the details.

Regards,
  Sergei.


P.S., FWIW, here is 'octave' target stuff:


      octave => # !!! -l:liblapack.a !!!
        do{
          my $major_ver = '3';
          my $minor_ver = '6';
          my $micro_ver = '2';

          $shadow_targets_hash_refs{octave} =
            {
            major_ver => $major_ver,
            minor_ver => $minor_ver,
            micro_ver => $micro_ver,

            base_urls =>
              [
          qw(
                http://ftp.gnu.org/gnu/octave
        http://artax.karlin.mff.cuni.cz/~hajej2am/ulozna/octave
            ftp://ftp.u-aizu.ac.jp/pub/SciEng/numanal/Octave
            ftp://neacm.fe.up.pt/pub/octave
            ftp://ftp.octave.org/pub/octave/bleeding-edge
            http://jbrwww.che.wisc.edu/home/jwe
        http://mirror.anl.gov/pub/gnu/octave
        http://mirrors.usc.edu/pub/gnu/octave
        http://ftp.download-by.net/gnu/gnu/octave
        http://ftp.heanet.ie/mirrors/ftp.gnu.org/gnu/octave
            )
              ],

            configure_args =>
              do{
                my $lapack_major_ver = 
$shadow_targets_hash_refs{lapack}{major_ver};
                my $lapack_minor_ver = 
$shadow_targets_hash_refs{lapack}{minor_ver};
                #my $lapack_micro_ver = 
$shadow_targets_hash_refs{lapack}{micro_ver};

                my $lapack_install_prefix =
                exists $shadow_targets_hash_refs{lapack}{install_prefix}
                ? $shadow_targets_hash_refs{lapack}{install_prefix}
                #: 
"${$cmdline_args_hash_ref}{install_prefix}/lapack-$lapack_major_ver.$lapack_minor_ver.$lapack_micro_ver"
                : 
"${$cmdline_args_hash_ref}{install_prefix}/lapack-$lapack_major_ver.$lapack_minor_ver"
                ;
                my $lapack = 
"$lapack_install_prefix/lib/lapack_$capitalized_os_name.a";

                my $atlas_major_ver = 
$shadow_targets_hash_refs{atlas}{major_ver};
                my $atlas_minor_ver = 
$shadow_targets_hash_refs{atlas}{minor_ver};
                my $atlas_micro_ver = 
$shadow_targets_hash_refs{atlas}{micro_ver};

                my $atlas_install_prefix =
                exists $shadow_targets_hash_refs{atlas}{install_prefix}
                ? $shadow_targets_hash_refs{atlas}{install_prefix}
                : 
"${$cmdline_args_hash_ref}{install_prefix}/atlas-$atlas_major_ver.$atlas_minor_ver.$atlas_micro_ver"
                ;                
                #my $lapack_atlas = "$atlas_install_prefix/lib/liblapack.a";
                my $lapack_atlas = "$atlas_install_prefix/lib/liblapack.so";
        
                #my $blas_atlas = "$atlas_install_prefix/lib/libf77blas.a";
                my $blas_atlas = "$atlas_install_prefix/lib/libptf77blas.so";

                #my $flags = '-march=native -mtune=native -ftree-vectorize 
-mfpmath=sse,387 -O2';
                my $flags = '-march=native -mtune=native -ftree-vectorize -O2';
                #"--enable-shared --enable-dl --enable-static 
--with-blas=$shadow_targets_hash_refs{blas_generic}{install_prefix}/lib/blas_$capitalized_os_name.a
 --with-lapack=$lapack",
                #"CPPFLAGS=\"-DH5_USE_16_API \$CPPFLAGS\" LDFLAGS=\"\$LDFLAGS 
-lmetis -l:lapack_$capitalized_os_name.a\" CFLAGS='$flags' CXXFLAGS='$flags' 
--enable-shared --enable-dl --enable-static --with-blas=$blas_atlas 
--with-lapack=$lapack_atlas",
                #"LDFLAGS=\"\$LDFLAGS -lmetis 
-l:lapack_$capitalized_os_name.a\" CFLAGS='$flags' CXXFLAGS='$flags' 
--enable-shared --enable-dl --enable-static --with-blas=$blas_atlas 
--with-lapack=$lapack_atlas",
                "LDFLAGS=\"\$LDFLAGS -lmetis -l:liblapack.a\" CFLAGS='$flags' 
CXXFLAGS='$flags' --enable-shared --enable-dl --enable-static 
--with-blas=$blas_atlas --with-lapack=$lapack_atlas",
                },

            make_targets => ['-y -w', 'check', 'install'],

            'pre_make_-y -w_sub' =>
              sub
                {
                my %this_sub_args = @_;

                foreach my $makefile(split("\n", `find 
$this_sub_args{target_build_dir} -name Makefile -type f -follow`))
                  {
                  if(
                    $_edit_file_sub->
                      (
                      $info_marker,                                # 
$info_marker,
                      $error_marker,                               # 
$error_marker,
                      $system_wrapper_sub,                         # 
$system_wrapper_sub,
                      $makefile,                                   # $file,
                      sub
                        {
                        my ($line) = @_;

                        if($line =~ m/^\s*BLAS_LIBS\s*=/)
                          {
                          $line = "BLAS_LIBS = -ltatlas -lptcblas 
-lptf77blas\n";
                          }

                        $line =~ s|-l\:lapack_$capitalized_os_name\.a||;
                        $line =~ s|-l\:liblapack\.a||;

                        $line;
                        }                                          # 
$line_editing_sub
                      ) != 0
                    )
                    {
                    warn "$error_marker problems while editing '$makefile' 
file\n";
                    return 1;
                    }                  
                  }

#                if(
#                  $_edit_file_sub->
#                    (
#                    $info_marker,                                              
       # $info_marker,
#                    $error_marker,                                             
       # $error_marker,
#                    $system_wrapper_sub,                                       
       # $system_wrapper_sub,
#                    
"$this_sub_args{target_build_dir}/src/DLD-FUNCTIONS/urlwrite.cc", # $file,
#                    sub
#                      {
#                      my ($line) = @_;
#
#                      if($line =~ m|\bcurl/types\.h\b|)
#                       {
#                       $line = '';
#                       }
#                      
#                      $line;
#                      }                                                        
       # $line_editing_sub
#                    ) != 0
#                 )
#                 {
#                 return 1;
#                 }
#
                return 1 unless($system_wrapper_sub->($info_marker, "\\cp -p -f 
$this_sub_args{target_build_dir}/scripts/pkg/pkg.m 
$this_sub_args{target_build_dir}/scripts/pkg/pkg.m.original") == 0);
                return 1 unless($system_wrapper_sub->($info_marker, "\\cp -p -f 
$tool_path/../include/perl/project_specific/$this_sub_args{versioned_target}/share/octave/$major_ver.$minor_ver.$micro_ver/m/pkg/pkg.m
 $this_sub_args{target_build_dir}/scripts/pkg/") == 0);

                0;
                },

            depends_on =>
              {
              targets =>
                {
                remake => $shadow_targets_hash_refs{remake},
                qrupdate => $shadow_targets_hash_refs{qrupdate},
                fltk => $shadow_targets_hash_refs{fltk},
                blas_generic => $shadow_targets_hash_refs{blas_generic},
                lapack => $shadow_targets_hash_refs{lapack},
                atlas => $shadow_targets_hash_refs{atlas},
                gnuplot => $shadow_targets_hash_refs{gnuplot},
                fftw3_sse2 => $shadow_targets_hash_refs{fftw3_sse2},
                fftw3_sse => $shadow_targets_hash_refs{fftw3_sse},
                curl => $shadow_targets_hash_refs{curl},
                glpk => $shadow_targets_hash_refs{glpk},
                pcre => $shadow_targets_hash_refs{pcre},
                hdf5 => $shadow_targets_hash_refs{hdf5},
                SuiteSparse => $shadow_targets_hash_refs{SuiteSparse},
                qhull => $shadow_targets_hash_refs{qhull},
                GraphicsMagick => $shadow_targets_hash_refs{GraphicsMagick},
                arpack => $shadow_targets_hash_refs{arpack},

                # for octave-forge-bundle:

                ginac => $shadow_targets_hash_refs{ginac},
                gsl => $shadow_targets_hash_refs{gsl},
                netcdf => $shadow_targets_hash_refs{netcdf}                
                }
              },

            ignore_make_errors =>
              {
              check => 1
              }
            }
          }, # do
             # octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]