help-octave
[Top][All Lists]
Advanced

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

Can octave compile Fortran mex-files?


From: Lukas Reichlin
Subject: Can octave compile Fortran mex-files?
Date: Mon, 5 Mar 2012 16:27:21 +0100

Dear Octave Community

I'm trying to compile a mex-file written in Fortran. It is called muHopt.f and 
can be found here [1].

Using makefile_dksyn.m, which consists of the following code …

mex muHopt.f \
    SB10AD.f SB10MD.f AB05MD.f AB07ND.f AB04MD.f \
    SB10PD.f SB10QD.f SB10RD.f SB10LD.f select.f \
    TB05AD.f AB13MD.f SB10YD.f MB01RX.f MB01RU.f \
    SB02RD.f MA02AD.f MB02SZ.f MB02TZ.f MB02RZ.f \
    DG01MD.f SB10ZP.f SB02MS.f MA02ED.f SB02RU.f \
    SB02SD.f SB02QD.f SB02MV.f SB02MW.f SB02MR.f \
    MB02PD.f MB01SD.f MC01PD.f TD04AD.f MB01UD.f \
    SB03SY.f SB03MX.f SB03SX.f MB01RY.f SB03QY.f \
    SB03QX.f SB03MY.f TD03AY.f TB01PD.f TB01XD.f \
    SB04PX.f SB03MV.f SB03MW.f AB07MD.f TB01UD.f \
    TB01ID.f MB01PD.f MB03OY.f MB01QD.f \
    "$(mkoctfile -p LAPACK_LIBS)" \
    "$(mkoctfile -p BLAS_LIBS)" \
    "$(mkoctfile -p FLIBS)"


… I get a couple of errors:

octave:2> makefile_dksyn
Undefined symbols for architecture x86_64:
  "_mxgetm_", referenced from:
      _mexfunction_ in muHopt.o
  "_mexerrmsgtxt_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxgetpr_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxcopyptrtoreal8_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxisnumeric_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxiscomplex_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxgetn_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxcreatedoublematrix_", referenced from:
      _mexfunction_ in muHopt.o
  "_mxcopyreal8toptr_", referenced from:
      _mexfunction_ in muHopt.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
octave:3> 

Now my question is: Does Octave come with these functions? How can I include 
them? Do I have to write a C++ oct-file, rewrite the muHopt.f function and 
include it with extern "C"?

Thanks in advance for any insights.
Lukas


[1]
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-devel/devel/dksyn/

reply via email to

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