This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

problems creating fortran mex functions with cygwin-b20



To all,

i've recently downloaded the Cygwin B.20 and the following from Khan
Munit's ftp site:

gcc-2.95.2-cygb20.tar.gz
gcc-2.95.2-dev-ss.tar.gz
gcc-2.95.2-mingw-extra.tar.gz

and have installed the cygwin tools, and extracted the contents of the
aforementioned gcc-* files.  I have done some baseline testing - simple
compiles, built some libraries, etc. and it seems as though everything is
happy.  Have mounted root (/), /usr/local, /tmp, /bin.

Following the instructions for creating mex functions using the Cygwin
tools from http://www.mrc-cbu.cam.ac.uk/Imaging/gnumex20.html, i am now
able to succesfully build the C version of yprime.dll using:

mex -f mexopts.bat yprime.c

note:  in looking into the linkmex.sh file, i see that a "fixup" file
(fixup.c) is created which supposedly properly terminates the import list.
i tried building without this fix and it seemed to work just fine.

In trying to build the fortran version, i execute the following:

	mex -f mexopts.bat yprimef.f yprimefg.f

which, unfortunately leads to the following errors:

yprimefg.obj(.text+0xea):d:\matlabr11\e: undefined reference to
`mexerrmsgtxt_'
yprimefg.obj(.text+0xf9):d:\matlabr11\e: undefined reference to `mxgetm_'
yprimefg.obj(.text+0x105):d:\matlabr11\e: undefined reference to `mxgetn_'
yprimefg.obj(.text+0x138):d:\matlabr11\e: undefined reference to
`mexerrmsgtxt_'
yprimefg.obj(.text+0x150):d:\matlabr11\e: undefined reference to
`mxcreatefull_'
yprimefg.obj(.text+0x15b):d:\matlabr11\e: undefined reference to `mxgetpr_'
yprimefg.obj(.text+0x16a):d:\matlabr11\e: undefined reference to `mxgetpr_'
yprimefg.obj(.text+0x176):d:\matlabr11\e: undefined reference to `mxgetpr_'
yprimefg.obj(.text+0x191):d:\matlabr11\e: undefined reference to
`mxcopyptrtoreal8_'
yprimefg.obj(.text+0x1a6):d:\matlabr11\e: undefined reference to
`mxcopyptrtoreal8_'
yprimefg.obj(.text+0x1c9):d:\matlabr11\e: undefined reference to
`mxcopyreal8toptr_'
collect2: ld returned 1 exit status
dllwrap: g77 exited with status 1
Deleting temporary base file C:\TEMP\cc001273.base
 
  D:\MATLABR11\BIN\MEX.BAT: Link of 'yprimef.dll' failed. 

ironically, all the files which should be available through the import
library created based on MATLAB.DEF during the build process.  So what is
the problem with the import??

Another issue is that in referring to the MATLAB Mex-function manual
(RTFM!!), i noticed that in creating the .def file for export of the MEX
entry point, it is necessary to use EXPORTS MEXFUNCTION@16 for FORTRAN
rather than EXPORTS mexFunction which is the C convention.  Making this
change to the linkmex.sh script, however, did little to rectify the
situation, producing identical errors to those listed above.

So the question is, what am i missing?  Any help would be greatly
appreciated.  

Thanks!!
BC


                          ****
        --------------^^^--00--^^^---------------
                      | |  <   | |
                       \ \    / /

           e-mail:  capozzi@aa.washington.edu
           office:  Aerosonde Development Lab
                    101 Kirsten Wind Tunnel 
           phone:   (206) 616-0579
           fax:     (206) 543-0217

                       ^^      ^^
        --------------ooo      ooo----------------


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]