This is the mail archive of the cygwin 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]
Other format: [Raw text]

fortran and C mixed-language program - cygwin the way to go?


Hi,

I don't know if this is the right list to post this question to, but please bear
with me.

I'm using cygwin on windows XP.  I have a large fortran 95 program that I
compile with Compaq Visual Fortran 6.6.  There is no way g77 will handle the
fortran 9x features I'm using, and g95 is still larval.  So let's take the
fortran compiler as fixed.

I want to use FFTW, the open-source fft library from mit (www.fftw.org), in the
code.  FFTW is written in C.  Its make process can setup wrapper functions for
calling FFTW routines from fortran.  I think I figured out the right way to
configure the wrappers for my fortran compiler.

The problem is linking it all togheter.  I'm using DF (the compaq visual fortran
command-line compiler) to control the compilation of the fortran, and the
linking of the final exe.  I setup a small test suite of a fortran caller and C
function, and DF compiles them correctly.  Not quite there with fftw.

I can compile the fortran with DF, and the C with gcc under cygwin.  I then try
linking them together.  If I don't include libfftw.a in the linking, DF can't
find the fftw routines.  If I include libfftw.a, then it can.

BUT, df can then not find what look like low-level C routines, like ___getreent
and ___gettimeofday.  From poking around on the web I found out that ___getreent
is in libpthread.a on cygwin.  I can't get the others to work.


I have no idea if my approach (compile fortran and link w/ df, compile the fftw
C library w/ gcc for cygwin) is a good idea, or possible at all.  Any advice on
a good approach would be very greatly appreciated.  I'm not an expert on
compilers, all I want is something that'll let me use a C library in fortran. 
And hopefully not make me buy a C compiler!

Thanks very much.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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