Re: Allocatable arrays and shared libraries: help needed
- From: "James Van Buskirk" <not_valid@xxxxxxxxxxx>
- Date: Wed, 5 Dec 2007 12:40:07 -0700
<sgiannerini@xxxxxxxxx> wrote in message
news:ba0d3c16-9069-41f2-a767-99599d5560c7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In brief, in order to be able to use the -lLIBRARYNAME command in
linux you have to name the library as libLIBRARYNAME.a whereas in Win
you have to specify it as LIBRARYNAME.dll.
I have to say that I had to struggle a bit through the gcc docs to
find it out.
Is this difference expected?
Oh man, if you said you understood anything about building libraries
and linking with gfortran it would have been evidence that you were
delusional. First off, why does a shared library correspond to a *.a
file in LINUX? I thought it should have been a *.so (or maybe *.so.1,
what is the difference?) Now that you have seen the depths of my
ignorance about LINUX, I hasten to add that I am just about as
clueless regarding the Windows way of doing things.
Anything but the gcc family of compilers makes *.dll files for
dynamic linking or *.lib files for static linking. For some reason
gcc uses lib*.a files sort of like the rest of the world uses *.lib
files. Indeed, if you sniff around the directory structure
installed by gfortran, you will see a massive directory with files
such as libkernel32.a, which gcc &c. use for linking for some
reason when the program needs procedures from a subroutine in a *.dll
file such as kernel32.dll.
Any other compiler would use a *.lib file such as kernel32.lib for
this purpose. What all these files are for and how you make them
and how you can interconvert them is poorly documented, not just due
to the gnu cultural tradition of obsessively inadequte documentation
but in fact even MSDN doesn't have a whole lot of good dirt on this
kind of thing. And it would be a moot point if it weren't for the
fact that things can go wrong in this process and then you don't
know what to do to fix it. On 32-bit Windows, for some reason the
libkernel32.a file only has references to decorated version of the
procedure names such as _GetModuleFileName@12 but gfortran won't
create these decorated names, it only gives you GetModuleFileName
and if you try to create a binding name it gets rejected for not
being a good C name! And some decorated procedures can be made to
work via a gfortran switch, whose name I forget just now, but for
some reason most of them can't be fixed like this. It's probably a
simple fix if you knew what you were doing, after all gfortran can
make the decoration in a limited number of cases, but the
documentation is so lacking that when a little thing like this goes
wrong you are just dead in the water.
Hope you enjoyed my rant.
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
.
- References:
- Allocatable arrays and shared libraries: help needed
- From: sgiannerini
- Re: Allocatable arrays and shared libraries: help needed
- From: Tobias Burnus
- Re: Allocatable arrays and shared libraries: help needed
- From: fj
- Re: Allocatable arrays and shared libraries: help needed
- From: sgiannerini
- Allocatable arrays and shared libraries: help needed
- Prev by Date: Re: checking if file exists in user's home directory
- Next by Date: Re: gfortran read of hex values
- Previous by thread: Re: Allocatable arrays and shared libraries: help needed
- Next by thread: Re: Allocatable arrays and shared libraries: help needed
- Index(es):
Relevant Pages
|