mkoctfile man page

mkoctfile — Compile dynamic-load modules for GNU Octave


mkoctfile [OPTION]... file...


mkoctfile is used to compile C, C++, or Fortran source code in to a dynamically loadable .oct file for octave(1).


-h, -?, --help

Print help message.


Add include directory dir to compile commands.


Add include directory to second include search path after '-I'.


Add definition def to compiler command.


Add library lib to link command.


Add library directory dir to link command.


Pass -Rdir to link command.


Enable debugging option for all compilers.


Add -pthread to link command.


Pass flags to the compiler such as -Wa,OPTION.


Pass flags to the linker such as -Wl,-rpath=...

-M, --depend

Generate dependency files (.d) for C and C++ source files.


Compile but do not link.


Link a stand-alone executable file.

-s, --strip

Strip the output file.


Create a MEX file.  Set the default output extension to .mex.

-o file, --output file

Output filename.  Default extension is .oct (or .mex if --mex is specified) unless linking a stand-alone executable.

-p VAR, --print VAR

Print configuration variable VAR.  Recognized variables are:

    ALL_CFLAGS                FFTW3F_LDFLAGS
    ALL_CXXFLAGS              FFTW3F_LIBS
    ALL_FFLAGS                FLIBS
    ALL_LDFLAGS               FPICFLAG
    AR                        INCFLAGS
    BLAS_LIBS                 LAPACK_LIBS
    CC                        LDFLAGS
    CFLAGS                    LD_CXX
    CPICFLAG                  LD_STATIC_FLAG
    CPPFLAGS                  LFLAGS
    CXX                       LIBOCTAVE
    CXXFLAGS                  LIBOCTINTERP
    CXXPICFLAG                LIBS
    DL_LD                     OCT_LINK_DEPS
    DL_LDFLAGS                RANLIB
    EXEEXT                    RDYNAMIC_FLAG
    F77                       READLINE_LIBS
    F77_INTEGER_8_FLAG        SED
    FFLAGS                    XTRA_CFLAGS
-v, --verbose

Echo commands as they are executed.


Compile or link file.  Recognized file types are

   .c    C source
   .cc   C++ source
   .cp   C++ source
   .cpp  C++ source
   .CPP  C++ source
   .cxx  C++ source
   .c++  C++ source
   .C    C++ source
   .f    Fortran source (fixed form)
   .F    Fortran source (fixed form)
   .f90  Fortran source (free form)
   .F90  Fortran source (free form)
   .o    object file
   .a    library file


John W. Eaton <>

This manual page was contributed by Dirk Eddelbuettel <> for the Debian GNU/Linux distribution but may be used by others.

See Also

octave (1).


3 January 2014 GNU Octave