Using Intel® MKL in GNU Octave

Overview

This guide is intended to help the current Octave users to potentialy improve performance by utilizing Intel® Math Kernel Library (Intel® MKL). It explains how to build 64-bit Octave with Intel MKL for Intel64 based applications.

GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab*. It may also be used as a batch-oriented language.

Octave has extensive tools for solving common numerical linear algebra problems, finding the roots of nonlinear equations, integrating ordinary functions, manipulating polynomials, and integrating ordinary differential and differential-algebraic equations. It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages.

[Reference: http://www.gnu.org/software/octave/about.html*]

Version Information

This application note was created to help users who use Octave to also incorporate the latest versions of Intel MKL 10.3.2 or higher on Linux* platforms on Intel® Xeon® *processor-based systems. Specifically, we'll address Intel MKL version 10.3.2.

This application note applies to Intel Composer XE 2011 and Octave 3.2.4

Note: One can use Intel MKL FFTW3 wrappers in Octave only with Intel MKL 10.3.2 or higher. For using the previous versions please contact the Intel MKL team.
 

Downloading Intel tools & Octave source code


Prerequisites: 

  1. Intel® MKL contains highly optimized BLAS, LAPACK, and FFT and also the wrappers for FFTW, which can be obtained at: Intel® Math Kernel Library Product Page.
  2. Obtain Intel® C++ and Fortran compilers (Intel MKL and Intel Compilers are now available in a single package - Intel Composer XE ).
  3. To get Octave - http://www.gnu.org/software/octave/

Note: This application note is written specifically for use with the Intel® compilers. Though using Intel MKL with Octave built with other compilers is also possible.

Unpack:

  • Use the following commands to extract the Octave files: 
tar -xf octave-x.x.x.tar.gz  

This will create a directory called octave-x.x.x.

Building Octave

Update configure:

  • Change configure.in. Please find in the file the lines below and change them  from
1.	if test "$with_fftw" = yes; then   
2.	  have_fftw3_header=no   
3.	  with_fftw3=no   
4.	  AC_CHECK_HEADER(fftw3.h, [have_fftw3_header=yes])   
5.	  if test "$have_fftw3_header" = yes; then   
6.	    AC_CHECK_LIB(fftw3, fftw_plan_dft_1d, [   
7.	      AC_CHECK_LIB(fftw3f, fftwf_plan_dft_1d, [FFTW_LIBS="-lfftw3 -lfftw3f"; with_fftw3=yes])])   
8.	  fi   
9.	fi  


to

1.	if test "$with_fftw" = yes; then   
2.	  have_fftw3_header=no   
3.	  with_fftw3=no   
4.	  AC_CHECK_HEADER(fftw3.h, [have_fftw3_header=yes])   
5.	  if test "$have_fftw3_header" = yes; then   
6.	    AC_CHECK_LIB(fftw3, fftw_plan_dft_1d, [   
7.	      AC_CHECK_LIB(fftw3f, fftwf_plan_dft_1d, [FFTW_LIBS="-lfftw3 -lfftw3f"; with_fftw3=yes])])   
8.	# Add MKL check   
9.	    AC_CHECK_LIB(mkl_intel_lp64, fftw_plan_dft_1d, [FFTW_LIBS="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -WI, --end-group -liomp5 -lpthread"; with_fftw3=yes],AC_MSG_RESULT("MKL library not found.  Octave will use the FFTW3 instead."),[-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread])   
10.	  fi   
11.	fi  

  

Set environment:

  • Make sure that C/C++ and Fortran compilers are installed and in the PATH. Set LD_LIBRARY_PATH to your compiler (C/C++ and Fortran), and Intel MKL libraries. Also set MKLROOT to you MKL directory.
    There are environment setters in both Intel MKL and Intel CCompiler installation directories: source  .../mkl/bin/mklvars.sh intel64 or like that
  • Set next environment variable: CC, CXX, F77, CFLAGS, CPPFLAGS, LDFLAGS as follow
1.	export CC=icc   
2.	export CXX=icc   
3.	export F77=ifort   
4.	export CFLAGS="-O3 -ipo- -std=c99 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384"  
5.	export CPPFLAGS="-I$MKLROOT/include -I$MKLROOT/include/fftw"  
6.	export LDFLAGS="-L$MKLROOT/lib/intel64 -L$MKLROOT/../compiler/lib/intel64"  
7.	export LD_LIBRARY_PATH="$MKLROOT/lib/intel64:$MKLROOT/../compiler/lib/intel64:$LD_LIBRARY_PATH"


Configure and make

Build Octave and install it in the standard place

1.	configure --with-blas="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread" --with-lapack="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread" 

2.	make   
3.	make install   

 

Running Octave


Add Octave path to environment variable PATH
Then, you should be able to run Octave

 

Link/Build Latest Octave with latest MKL

The latest released version of Octave like Octave 4.0.3 haven't provided the same configuration like no option in configure.in.  Developer can still build the Octave with latest MKL version as below

Install parallel_studio_xe_2017_composer_edition,which include Intel C compiler, Intel Fortran compiler and Intel MKL

source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh intel64

export CC=icc  

export CXX=icc  

export F77=ifort  

export CFLAGS="-O3 -ipo- -std=c99 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384" 

export CPPFLAGS="-I$MKLROOT/include -I$MKLROOT/include/fftw" 

export LDFLAGS="-L$MKLROOT/lib/intel64 -L$MKLROOT/../compiler/lib/intel64" 

export LD_LIBRARY_PATH="$MKLROOT/lib/intel64:$MKLROOT/../compiler/lib/intel64:$LD_LIBRARY_PATH"

./configure --sysconfdir=/etc --with-blas="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread -lm" --with-lapack="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread -lm" --with-fftw3="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread -lm" --with-fftw3f="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread -lm" 

make -j8

./run-octave  (try first without install)

When build octave (which depends on much third party software and dependencies), you may run into all kind of build errors, please refer to http://wiki.octave.org/Octave_for_Red_Hat_Linux_systems.

In general, a few failures are probably normal. you may go to try use the Octave by ./run-octave and check if simple octave program are work or not.

and please check if intel MKL library are linked in by

[root@hsw-ep01 octave-4.0.3]# source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh intel64
[root@hsw-ep01 octave-4.0.3]# ldd liboctave/.libs/liboctave.so.3.0.2
        linux-vdso.so.1 =>  (0x00007ffe7b7f9000)
        libmkl_intel_lp64.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007fb6d3717000)
        libmkl_intel_thread.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_intel_thread.so (0x00007fb6d1cab000)
        libmkl_core.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_core.so (0x00007fb6d01bc000)
        libpcre.so.0 => /usr/local/lib/libpcre.so.0 (0x00007fb6cffa0000)
        libifport.so.5 => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libifport.so.5 (0x00007fb6cfd71000)
        libifcoremt.so.5 => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libifcoremt.so.5 (0x00007fb6cf9e3000)
        libirc.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libirc.so (0x00007fb6cf778000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007fb6cf555000)
        libimf.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libimf.so (0x00007fb6cf069000)
        libirng.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libirng.so (0x00007fb6cece1000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fb6ce9df000)
        libiomp5.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libiomp5.so (0x00007fb6ce698000)
        libcilkrts.so.5 => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libcilkrts.so.5 (0x00007fb6ce45c000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fb6ce153000)
        libintlc.so.5 => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libintlc.so.5 (0x00007fb6cdee9000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb6cdccc000)
        libsvml.so => /opt/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64/libsvml.so (0x00007fb6ccdb6000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb6ccba0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fb6cc99b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb6cc5da000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb6d6154000)

And some developer may see other libraries like  libblas.so.3,  libfftw3_threads.so.3  are listed before the intel MKL library. If you still hope to use Intel MKL FFTW, BLAS, LAPACK etc,  you may need build the link manually like

sudo mv /usr/lib64/atlas/libtatlas.so.3 /usr/lib64/atlas/libtatlas.so.3.keep
sudo mv /usr/lib64/atlas/libsatlas.so.3 /usr/lib64/atlas/libsatlas.so.3.keep
sudo mv /lib64/libblas.so.3    /lib64/libblas.so.3.keep
sudo mv /lib64/liblapack.so.3 /lib64/liblapack.so.3.keep

sudo mv /lib64/libfftw3_threads.so.3    /lib64/libfftw3_threads.so.3.keep
sudo mv /lib64/libfftw3.so.3 /lib64/libfftw3.so.3.keep

sudo mv /lib64/libfftw3f_threads.so.3    /lib64/libfftw3f_threads.so.3.keep
sudo mv /lib64/libfftw3f.so.3 /lib64/libfftw3f.so.3.keep

sudo rm -rf /usr/lib64/atlas/libtatlas.so.3 /usr/lib64/atlas/libsatlas.so.3 /lib64/libblas.so.3 /lib64/liblapack.so.3  /lib64/libfftw3f.so.3 /lib64/libfftw3f_threads.so.3 /lib64/libfftw3_threads.so.3 /lib64/libfftw3_threads.so.3
sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /usr/lib64/atlas/libtatlas.so.3
sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /usr/lib64/atlas/libsatlas.so.3
sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /lib64/libblas.so.3
sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /lib64/liblapack.so.3

sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /lib64/libfftw3.so.3
sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /lib64/libfftw3_threads.so.3

sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /lib64/libfftw3f.so.3
sudo ln -s /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so /lib64/libfftw3f_threads.so.3

For more complete information about compiler optimizations, see our Optimization Notice.

Comments

I have used Remi Payan

I have used Remi Payan settings:

export JAVA_HOME="/usr/lib/jvm/default-java"
export CFLAGS="-O2 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384"
export FFLAGS="-O2 -fPIC"
export CPPFLAGS="-I/opt/intel/mkl/include/ -I/opt/intel/mkl/include/fftw/"
export LDFLAGS="-L/opt/intel/mkl/lib/intel64 -L/opt/intel/lib/intel64"
export LD_LIBRARY_PATH="/usr/lib/gcc:/usr/lib/gcc/x86_64-linux-gnu/:/opt/intel/lib/intel64:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH"

./configure --prefix=/opt/octave4_2_mkl --with-blas="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-lapack="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-fftw3="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm" --with-fftw3f="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm"

to configure octave 4.2.1 on Ubuntu 16.04LTS. Although, I had no error and libraries seems to be linked correctly:

Octave is now configured for x86_64-pc-linux-gnu

  Source directory:              .
  Installation prefix:           /opt/octave4_2_mkl
  C compiler:                    gcc  -pthread -fopenmp  -Wall -W -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -O2 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384
  C++ compiler:                  g++ -std=gnu++11  -pthread -fopenmp  -Wall -W -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2
  Fortran compiler:              gfortran -O2 -fPIC
  Fortran libraries:              -L/opt/intel/mkl/lib/intel64 -L/opt/intel/lib/intel64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lgfortran -lm -lquadmath
  Lex libraries:                 
  LIBS:                          -lutil -lm  
  Extra LDFLAGS:                 

  AMD CPPFLAGS:                  
  AMD LDFLAGS:                   
  AMD libraries:                 -lamd
  ARPACK CPPFLAGS:               
  ARPACK LDFLAGS:                
  ARPACK libraries:              -larpack
  BLAS libraries:                -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread
  BZ2 CPPFLAGS:                  
  BZ2 LDFLAGS:                   
  BZ2 libraries:                 -lbz2
  CAMD CPPFLAGS:                 
  CAMD LDFLAGS:                  
  CAMD libraries:                -lcamd
  CARBON libraries:              
  CCOLAMD CPPFLAGS:              
  CCOLAMD LDFLAGS:               
  CCOLAMD libraries:             -lccolamd
  CHOLMOD CPPFLAGS:              
  CHOLMOD LDFLAGS:               
  CHOLMOD libraries:             -lcholmod
  COLAMD CPPFLAGS:               
  COLAMD LDFLAGS:                
  COLAMD libraries:              -lcolamd
  CURL CPPFLAGS:                 
  CURL LDFLAGS:                  
  CURL libraries:                -lcurl
  CXSPARSE CPPFLAGS:             
  CXSPARSE LDFLAGS:              
  CXSPARSE libraries:            -lcxsparse
  DL libraries:                  -ldl
  FFTW3 CPPFLAGS:                
  FFTW3 LDFLAGS:                 
  FFTW3 libraries:               -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm
  FFTW3F CPPFLAGS:               
  FFTW3F LDFLAGS:                
  FFTW3F libraries:              -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm
  FLTK CPPFLAGS:                  -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2
  FLTK LDFLAGS:                  -Wl,-Bsymbolic-functions -lfltk_gl -lfltk -lX11
  FLTK libraries:                
  fontconfig CPPFLAGS:           -I/usr/include/freetype2
  fontconfig libraries:          -lfontconfig -lfreetype
  FreeType2 CPPFLAGS:            -I/usr/include/freetype2
  FreeType2 libraries:           -lfreetype
  GLPK CPPFLAGS:                 
  GLPK LDFLAGS:                  
  GLPK libraries:                -lglpk
  HDF5 CPPFLAGS:                 -I/usr/include/hdf5/serial
  HDF5 LDFLAGS:                  -L/usr/lib/x86_64-linux-gnu/hdf5/serial
  HDF5 libraries:                -lhdf5
  Java home:                     /usr/lib/jvm/default-java
  Java JVM path:                 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
  Java CPPFLAGS:                 -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux
  Java libraries:                
  LAPACK libraries:              -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread
  LLVM CPPFLAGS:                 
  LLVM LDFLAGS:                  
  LLVM libraries:                
  Magick++ CPPFLAGS:             -I/usr/include/GraphicsMagick
  Magick++ LDFLAGS:              
  Magick++ libraries:            -lGraphicsMagick++ -lGraphicsMagick
  OPENGL libraries:              -lGL -lGLU
  OSMesa CPPFLAGS:               
  OSMesa LDFLAGS:                
  OSMesa libraries:              -lOSMesa
  PCRE CPPFLAGS:                 
  PCRE libraries:                -lpcre
  PortAudio CPPFLAGS:            
  PortAudio LDFLAGS:             
  PortAudio libraries:           -lportaudio -lasound -lm -lpthread
  PTHREAD flags:                 -pthread
  PTHREAD libraries:             
  QHULL CPPFLAGS:                
  QHULL LDFLAGS:                 
  QHULL libraries:               -lqhull
  QRUPDATE CPPFLAGS:             
  QRUPDATE LDFLAGS:              
  QRUPDATE libraries:            -lqrupdate
  Qt CPPFLAGS:                   -I/usr/include/qt4 -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtCore
  Qt LDFLAGS:                    
  Qt libraries:                  -lQtNetwork -lQtOpenGL -lQtGui -lQtCore -lqscintilla2
  Qt moc:                        moc-qt4 
  Qt uic:                        uic-qt4 
  Qt rcc:                        rcc -qt4
  Qt lrelease:                   lrelease-qt4 
  READLINE libraries:            -lreadline
  Sndfile CPPFLAGS:              
  Sndfile LDFLAGS:               
  Sndfile libraries:             -lsndfile
  SuiteSparse config libraries:  -lsuitesparseconfig
  TERM libraries:                -lncurses
  UMFPACK CPPFLAGS:              
  UMFPACK LDFLAGS:               
  UMFPACK libraries:             -lumfpack
  X11 include flags:             
  X11 libraries:                 -lX11
  Z CPPFLAGS:                    
  Z LDFLAGS:                     
  Z libraries:                   -lz

  Default pager:                 less
  gnuplot:                       gnuplot

  Build Octave Qt GUI:                yes
  JIT compiler for loops:             no
  Build Java interface:               yes
  Do internal array bounds checking:  no
  Build static libraries:             no
  Build shared libraries:             yes
  Dynamic Linking:                    yes (dlopen)
  Include support for GNU readline:   yes
  64-bit array dims and indexing:     no
  OpenMP SMP multithreading:          yes
  Build cross tools:                  no
  Build docs:                         yes
  Truncate intermediate FP results:   yes

I have an error when I run 'make' and 'make check'. It exits after few passed tests with Signal 6.


hi,

hi,

 

I am getting the following error at the time of make,

libtool: compile:  mpiicpc -DHAVE_CONFIG_H -I. -I../.. -I../../libgnu -I../../libgnu -I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/fftw -I/home/vishal/octave/pcre_install/include -g -O2 -MT misc/libcruft_la-f77-extern.lo -MD -MP -MF misc/.deps/libcruft_la-f77-extern.Tpo -c misc/f77-extern.cc  -fPIC -DPIC -o misc/.libs/libcruft_la-f77-extern.o

In file included from misc/quit.h(31),
                 from misc/f77-fcn.h(26),
                 from misc/f77-extern.cc(28):
../../libgnu/stdio.h(948): error: declaration is incompatible with previous "getchar" (declared at line 542 of "/usr/include/stdio.h")
  _GL_CXXALIAS_SYS (getchar, int, (void));
  ^

In file included from misc/quit.h(31),
                 from misc/f77-fcn.h(26),
                 from misc/f77-extern.cc(28):
../../libgnu/stdio.h(1222): error: declaration is incompatible with previous "putchar" (declared at line 584 of "/usr/include/stdio.h")
  _GL_CXXALIAS_SYS (putchar, int, (int c));
  ^

In file included from misc/quit.h(31),
                 from misc/f77-fcn.h(26),
                 from misc/f77-extern.cc(28):
../../libgnu/stdio.h(1576): error: declaration is incompatible with previous "vprintf" (declared at line 376 of "/usr/include/stdio.h")
  _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
  ^

compilation aborted for misc/f77-extern.cc (code 2)
make[4]: *** [misc/libcruft_la-f77-extern.lo] Error 1
make[4]: Leaving directory `/home/vishal/octave/octave-3.8.2/liboctave/cruft'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/vishal/octave/octave-3.8.2/liboctave'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/vishal/octave/octave-3.8.2/liboctave'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vishal/octave/octave-3.8.2'
make: *** [all] Error 2

Configure Command is:

./configure --prefix=/home/vishal/octave/octave_install CC=mpiicc CXX=mpiicpc F77=mpiifort CFLAGS="-O3 -ipo-  -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384" CPPFLAGS="-I$MKLROOT/include -I$MKLROOT/include/fftw -I/home/vishal/octave/pcre_install/include" LDFLAGS="-L$MKLROOT/lib/intel64 -L$MKLROOT/../compiler/lib/intel64 -L/home/vishal/octave/pcre_install/lib" --with-blas="-Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread" --with-lapack="-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -liomp5 -lpthread" FFLAGS="-O3 -fPIC"

Does anybody know the solutoin??

Rahul:Did you get the solution as you were getting the same error

Thanks in advance

 


Hi,

Hi,

I'm new in building and compiling packages on Linux. I successfully installed Intel Intel® Composer XE Suites 2013 on Ubuntu 12.04, and able to compile a simple ¨Hello World¨ using ¨icc¨. Now Iḿ trying to build Octave-3.8.1 with new Intel compiler and MKL library. When I run ./configure, the it works well except few warning of libraries required. But when I try to compile using ¨make¨, I get following error message:

In file included from misc/quit.h(31),
                 from misc/f77-fcn.h(26),
                 from misc/f77-extern.cc(28):
../../libgnu/stdio.h(948): error: declaration is incompatible with previous "getchar" (declared at line 544 of "/usr/include/stdio.h")
  _GL_CXXALIAS_SYS (getchar, int, (void));
  ^

In file included from misc/quit.h(31),
                 from misc/f77-fcn.h(26),
                 from misc/f77-extern.cc(28):
../../libgnu/stdio.h(1222): error: declaration is incompatible with previous "putchar" (declared at line 586 of "/usr/include/stdio.h")
  _GL_CXXALIAS_SYS (putchar, int, (int c));
  ^

In file included from misc/quit.h(31),
                 from misc/f77-fcn.h(26),
                 from misc/f77-extern.cc(28):
../../libgnu/stdio.h(1576): error: declaration is incompatible with previous "vprintf" (declared at line 378 of "/usr/include/stdio.h")
  _GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
  ^

compilation aborted for misc/f77-extern.cc (code 2)
make[4]: *** [misc/libcruft_la-f77-extern.lo] Error 1
make[4]: Leaving directory `/home/rahul/Downloads/octave-3.8.1/liboctave/cruft'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/rahul/Downloads/octave-3.8.1/liboctave'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/rahul/Downloads/octave-3.8.1/liboctave'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rahul/Downloads/octave-3.8.1'
make: *** [all] Error 2

Did someone already face such error? What will be solution for this?  Will Naveen Gv shed some light on this?


Anybody knows if the

Anybody knows if the comtination MKL+Octave+Xeon Phi really works. Looks like Intel is not giving enough information about this, if you follow those links:

http://software.intel.com/en-us/forums/topic/401205

http://software.intel.com/es-es/forums/topic/401081

Javi Roman




I'm sorry, but could someone please help. I have followed the steps given and advice given later, but configure still aborts with " error: A BLAS library was detected but found incompatible with your Fortran 77 compiler settings."


Hi,

I have tried the above procedure and consistently failed to build...
i got the following error:

oct-alloc.h(33): error: identifier "size_t" is undefined
octave_allocator (size_t item_sz, int grow_sz = 256)
^
oct-alloc.h(40): error: identifier "size_t" is undefined
void *alloc (size_t size);
^

oct-alloc.h(43): error: identifier "size_t" is undefined
void free (void *p, size_t size);
^

oct-alloc.h(58): error: identifier "size_t" is undefined
size_t item_size;
^

oct-alloc.cc(33): error: identifier "size_t" is undefined
octave_allocator::alloc (size_t size)
^

oct-alloc.cc(53): error: identifier "size_t" is undefined
octave_allocator::free (void *p, size_t size)
^
Has anyone had any similar problems ?

Please HELP..

Cheers

laszlo



Hi,
I managed to get the MKL libraries (v10.3.5) fully linked in today, so I thought I'd put a comment here.
I actually started from this page (most useful, thanks!) and digged into the new configure script to find out how to explicitely specify the libraries.

I am using local versions of gcc/gfortran v4.6.1 and Octave 3.4.2.

Here is my config:

// FLAGS
export F77=gfortran
export CFLAGS="-O2 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384"
export FFLAGS="-O2 -fPIC"
export CPPFLAGS="-I/home/rpayan/intel/mkl/include -I/home/rpayan/intel/mkl/include/fftw"
export LDFLAGS="-L/home/rpayan/intel/mkl/lib/intel64 -L/home/rpayan/intel/lib/intel64"
export LD_LIBRARY_PATH="/home/rpayan/local/gcc-4.6.1/lib:/home/rpayan/local/gcc-4.6.1/lib64:/home/rpayan/intel/lib/intel64:/home/rpayan/intel/mkl/lib/intel64:$LD_LIBRARY_PATH"

// Configure command
./configure --prefix=/home/rpayan/local/octave-3.4.2 --enable-docs=no --without-curl --with-blas="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-lapack="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-fftw3="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm" --with-fftw3f="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm"

Once configure is completed, you can check it has reported correctly the linked libraries for BLAS, LAPACK, FFTW3 and FFTW3F.

When this is done, build your Octave with a simple "make" (multi-thread works fine with -j X where X is the number of parallel threads you want).

Then you can try "make check" to make sure your build is functional, and finally, "make install".

Hope this helps!


Pages