Octave and separate toolchain: Difference between revisions

Jump to navigation Jump to search
no edit summary
(gcc toolchain)
 
No edit summary
Line 61: Line 61:
  ../gcc-6.2.0/configure --prefix=/usr/local/gcc-6.2.0_binutils-2.27_isl --disable-nls --enable-languages=c,c++,fortran,java --disable-multilib
  ../gcc-6.2.0/configure --prefix=/usr/local/gcc-6.2.0_binutils-2.27_isl --disable-nls --enable-languages=c,c++,fortran,java --disable-multilib
  make -j 6 bootstrap
  make -j 6 bootstrap
sudo make install
# see what has been installed
ls /usr/local/gcc-6.2.0_binutils-2.27_isl/bin


== OpenBLAS ==
We need an optimized BLAS library, such as [http://www.openblas.net/ OpenBLAS]
cd $downloads
wget -O OpenBLAS-0.2.19.tar.gz http://github.com/xianyi/OpenBLAS/archive/v0.2.19.tar.gz
cd $buildroot
tar --no-same-owner -xvf $downloads/OpenBLAS-0.2.19.tar.gz
cd OpenBLAS-0.2.19/
bash
export PATH=/usr/local/gcc-6.2.0_binutils-2.27_isl/bin:$PATH
# check
which gcc
# should be /usr/local/gcc-6.2.0_binutils-2.27_isl/bin/gcc
which gfortran
# should be /usr/local/gcc-6.2.0_binutils-2.27_isl/bin/gfortran
# do not use threads
# (because I use pararrayfun from the parallel package)
make USE_THREAD=0 CPPFLAGS="-I/usr/local/gcc-6.2.0_binutils-2.27_isl/include" CFLAGS="-O2 -march=native -L/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64" CXXFLAGS="-O2 -march=native -L/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64" FFLAGS="-O2 -march=native -L/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64" LDFLAGS=-Wl,-rpath,/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64
One should get
OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)
  OS              ... Linux           
  Architecture    ... x86_64             
  BINARY          ... 64bit               
  C compiler      ... GCC  (command line : gcc)
  Fortran compiler ... GFORTRAN  (command line : gfortran)
  Library Name    ... libopenblas_haswell-r0.2.19.a (Single threaded) 
Checking the runpath:
ldd libopenblas.so
        linux-vdso.so.1 (0x00007fff961fc000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f3ee88cb000)
        libgfortran.so.3 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/libgfortran.so.3 (0x00007f3ee85a3000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f3ee81f9000)
        libquadmath.so.0 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/../lib64/libquadmath.so.0 (0x00007f3ee7fb9000)
        libgcc_s.so.1 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/../lib64/libgcc_s.so.1 (0x00007f3ee7da2000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3ee9ad6000)
Manual installation
sudo cp libopenblas.a libopenblas_haswell-r0.2.19.a libopenblas_haswell-r0.2.19.so /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64
cd /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/
sudo ln -s libopenblas_haswell-r0.2.19.so libopenblas.so.0
sudo ln -s libopenblas.so.0 libopenblas.so
== arpack-ng ==
https://github.com/opencollab/arpack-ng/releases
cd $downloads
wget -O arpack-ng-3.4.0.tar.gz https://github.com/opencollab/arpack-ng/archive/3.4.0.tar.gz
Start from a clean state
exit
bash
export PATH=/usr/local/gcc-6.2.0_binutils-2.27_isl/bin:$PATH
which gfortran
# should be /usr/local/gcc-6.2.0_binutils-2.27_isl/bin/gfortran
cd $buildroot
tar --no-same-owner -xvf $downloads/arpack-ng-3.4.0.tar.gz
cd arpack-ng-3.4.0
./bootstrap
./configure CPPFLAGS="-I/usr/local/gcc-6.2.0_binutils-2.27_isl/include" CFLAGS="-O2 -march=native -L/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64" CXXFLAGS="-O2 -march=native -L/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64" FFLAGS="-O2 -march=native -L/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64" LDFLAGS=-Wl,-rpath,/usr/local/gcc-6.2.0_binutils-2.27_isl/lib64 --prefix=/usr/local/gcc-6.2.0_binutils-2.27_isl
make -j 6
make check
  # TOTAL: 12
  # PASS:  12
# check libraries
ldd ./SRC/.libs/libarpack.so
        linux-vdso.so.1 (0x00007fff1f38c000)
        libopenblas.so.0 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/libopenblas.so.0 (0x00007f80c79d8000)
        libgfortran.so.3 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/libgfortran.so.3 (0x00007f80c76b0000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f80c7368000)
        libgcc_s.so.1 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/libgcc_s.so.1 (0x00007f80c7151000)
        libquadmath.so.0 => /usr/local/gcc-6.2.0_binutils-2.27_isl/lib64/libquadmath.so.0 (0x00007f80c6f11000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f80c6b67000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f80c892e000)
as root ({{codeline|su}}, not {{codeline|sudo}},  because we want PATH to contain {{Path|/usr/local/gcc-6.2.0_binutils-2.27_isl/bin}})
make install


To be continued...
To be continued...
32

edits

Navigation menu