On Tue, Jun 05, 2018 at 11:47:21PM -0700, Steve Kargl wrote:
> I have not looked at the source code, but do have a question.
> With -fopenmp, gfortran automatically adds -lpthread to
> the command line.  Is it possible during the parsing 

Even if it wouldn't, libgomp.so.1 depends on libpthread.so.0 and thus
it will be around.

> phase to detect an async structure and on the fly add
> -lpthread to the loader options?
> 
> I do note that if one has, say, 8 files and only one
> file uses async IO, then during linking of the 8 *.o
> files to make the final execute -lpthread must be added.
> How doesn't gfortran communicate that to the loader?

ELF doesn't a way to do this, you'd need to add a special linker plugin for
that.  But is that really necessary?
Simply let the users link with -lpthread or -pthread if they want real
asynchronous IO, or without it if they are ok with the gcc <= 8
behavior and document it.

        Jakub

Reply via email to