public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ryofurue at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/94931] request: print include path
Date: Mon, 04 May 2020 08:23:17 +0000	[thread overview]
Message-ID: <bug-94931-4-FdPQK1Cexo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94931-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94931

--- Comment #6 from Ryo Furue <ryofurue at gmail dot com> ---
Thanks again for your comments!

> For a software developer, I
> would put the libraries in ${INSTALLDIR}/lib and modules
> in ${INSTALLDIR?/modules.  INSTALLDIR could be /usr/local,
> and, of course, you would describe this in the user and
> installation manuals.

I see.  So, the directory gfortran searches by default is not intended for
non-gfortran libraries.

I'm definitely drifting off-topic, but my question/request stemmed from the
fact that I initially didn't know why 

    gfortran mysourcefile.f -lnetcdff -netcdff

didn't find /usr/include/netcdf.inc . I thought somethig was wrong.  In
hindsight, it's because gfortran doesn't search /usr/include/ .  So, eventually
I learned that

    gfortran -I/usr/include mysourcefile.f -lnetcdff -lnetcdf

is the answer.

But, then the question is, why don't you need the -L option? as in

    gfortran -I/usr/include mysourcefile.f -L/usr/lib -lnetcdff -netcdf


Why is this asymmetry?  It seems that there are "standard" places to place
libraries but not include files . . . 

I'm not blaming gfortran at all. I'm just wondering what I should say to the
packager of the netCDF library (or what I should do, if I were to package this
library).


Returning to the original issue: Although I led you in the wrong direction
(--print-search-dir, and I'm sorry about that), my original request may not be
invalid: I think it would be nice if the answer(*) is available somewhere,
either in the form of an output from a command line option or in the official
document or somewhere.


(*) the answer to the question: where does gfortran search for include files by
default?  (Answer: the current directory and an internal directory where
gfortran's internal modules are stored.)

  parent reply	other threads:[~2020-05-04  8:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03  5:28 [Bug fortran/94931] New: " ryofurue at gmail dot com
2020-05-03 15:54 ` [Bug fortran/94931] " kargl at gcc dot gnu.org
2020-05-04  1:13 ` ryofurue at gmail dot com
2020-05-04  1:27 ` sgk at troutmask dot apl.washington.edu
2020-05-04  1:33 ` ryofurue at gmail dot com
2020-05-04  3:22 ` sgk at troutmask dot apl.washington.edu
2020-05-04  8:23 ` ryofurue at gmail dot com [this message]
2020-05-04 16:27 ` sgk at troutmask dot apl.washington.edu
2020-07-20 10:43 ` dominiq at lps dot ens.fr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94931-4-FdPQK1Cexo@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).