Re: Binding name
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Binding name         

Group: comp.lang.fortran · Group Profile
Author: James Van Buskirk
Date: May 30, 2008 23:45

"FX" alussinan.org> wrote in message
news:g18gn2$a1j$1@nef.ens.fr...
>> It would have been easy for the mingw 64 crew to discover the unfixed
>> failures as well.
> They have a different problem than you: they know nada about Fortran :)

Playing around some more with NightStrike's builds: there was a build
entitled mingw-w64-bin_x86-64-mingw_20080528.zip that doesn't work
quite right: if you compile a single file everything is OK:

C:\gcc_mingw64\test>gfortran -v
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with:
../gcc/configure -q --prefix=/var/tmp/w64 --with-sysroot=/var/t
mp/w64 --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 --silent
Thread model: win32
gcc version 4.4.0 20080528 (experimental) (GCC)

C:\gcc_mingw64\test>type hello.f90
print*, 'Hello, world';end

C:\gcc_mingw64\test>gfortran hello.f90 -ohello

C:\gcc_mingw64\test>hello
Hello, world

Even if you compile two C source files together it works:

C:\gcc_mingw64\test>gcc -v
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with:
../gcc/configure -q --prefix=/var/tmp/w64 --with-sysroot=/var/t
mp/w64 --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 --silent
Thread model: win32
gcc version 4.4.0 20080528 (experimental) (GCC)

C:\gcc_mingw64\test>type hello3.c
void hello4();

int main()
{
hello4();
return 0;
}

C:\gcc_mingw64\test>type hello4.c
#include

void hello4()
{
printf("Hello, world\n");
return;
}

C:\gcc_mingw64\test>gcc hello3.c hello4.c -ohello3

C:\gcc_mingw64\test>hello3
Hello, world

But if you compile two Fortran source files together...

C:\gcc_mingw64\test>type hello1.f90
program hello1
call hello2
end program hello1

C:\gcc_mingw64\test>type hello2.f90
subroutine hello2
write(*,*) 'Hello, world'
end subroutine hello2

C:\gcc_mingw64\test>gfortran hello1.f90 hello2.f90 -ohello1
c:/gcc_mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.4.0/../../../../x86_64-pc-ming
w32/lib/crt2.o: In function `__tmainCRTStartup':
/var/tmp/build/mingw/build-x86_64-pc-linux/../mingw-w64-crt/crt64/crtexe.c:175:
undefined reference to `__imp__Sleep'
/var/tmp/build/mingw/build-x86_64-pc-linux/../mingw-w64-crt/crt64/crtexe.c:219:
undefined reference to `__imp__AddVectoredExceptionHandler'
/var/tmp/build/mingw/build-x86_64-pc-linux/../mingw-w64-crt/crt64/crtexe.c:220:
undefined reference to `__imp__SetUnhandledExceptionFilter'
/var/tmp/build/mingw/build-x86_64-pc-linux/../mingw-w64-crt/crt64/crtexe.c:167:
undefined reference to `__imp__GetStartupInfoA'

With several hundred lines of errors to follow. Instead, it works
to add a couple of libraries:

C:\gcc_mingw64\test>gfortran hello1.f90
hello2.f90 -lkernel32 -luser32 -ohello1

C:\gcc_mingw64\test>hello1
Hello, world

The problem doesn't occur for the i686-pc-mingw32 hosted version
of mingw-w64-bin_i686-mingw_20080524.zip :

C:\gcc_mingw64a\test\hello>x86_64-pc-mingw32-gfortran -v
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with:
../gcc/configure --prefix=/var/tmp/rt --with-sysroot=/var/tmp/r
t --host=i686-pc-mingw32 --target=x86_64-pc-mingw32 -q --silent
Thread model: win32
gcc version 4.4.0 20080523 (experimental) (GCC)

C:\gcc_mingw64a\test\hello>x86_64-pc-mingw32-gfortran hello1.f90
hello2.f90 -ohe
llo1

C:\gcc_mingw64a\test\hello>hello1
Hello, world

So is this a problem that can be sorted out from the gfortran end
or is it something only the mingw 64 guys can do anything about?

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
no comments
diggit! del.icio.us! reddit!