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

2004-05-04 Thread Gerrit P. Haase
Hi David,

you can try to build FFTW with the MinGW GCC compiler, though I'm not
sure that it is possible at all ( http://www.mingw.org/ ).
The MinGW compiler doesn't use Cygwin but MSVCRT as C library.


Gerrit


David wrote:

 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.



-- 
=^..^= http://nyckelpiga.de/donate.html


--
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/



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

2004-05-04 Thread Larry Hall
At 04:00 AM 5/4/2004, you wrote:
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!


Try using 'gcc -mno-cygwin'.  Since you're firmly in the Win32 environment
with your Win32 Fortran compiler, you're better off not mixing the 
Cygwin POSIX DLL into the equation.  This may cause you to do some porting
perhaps, depending on the features in FFTW.  Still, their web site claims
that FFTW will build with VC++ 6 or Intel's compiler so there must not be
much reliance on POSIX APIs. 


--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
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/