public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Help needed with include path precedence order
@ 2019-01-25  8:49 David Aldrich
  2019-01-25 12:44 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: David Aldrich @ 2019-01-25  8:49 UTC (permalink / raw)
  To: gcc-help

Hi

I am using gcc 7.3.0 on Ubuntu 18.04 LTS to build an application that uses
the Boost libraries. I want to use  Boost 1.69, which I have installed on
another server. The Ubuntu machine has  Boost 1.65 installed.  I specify
the remote boost path (to 1.69) in my makefile and 'make' compiles my
source file with:



g++ -c -Wall -m64 -I/net/simdata/OpenSourceLibs/Boost/rel-1.69.0/ -fpic -O3
SINRCalculation.cpp -o _gnuRelease/SINRCalculation.o



Now, that source file uses boost/multi_array.hpp. The above compiler
command gives error:



In file included from /usr/include/boost/multi_array.hpp:30:0,

                 from SINRCalculation.cpp:25:

/net/simdata/Hudson_OpenSourceLibs/Boost/rel-1.69.0/boost/type_traits.hpp:118:10:
fatal error: boost/type_traits/is_nothrow_swappable.hpp: No such file or
directory

 #include <boost/type_traits/is_nothrow_swappable.hpp>

          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.



Now, my copy of boost 1.69 does contain is_nothrow_swappable.hpp so, at
first sight, that error is surprising.



I think what is happening is the is_nothrow_swappable.hpp is being searched
for on the system library path (boost 1.65 does not have that file), not
the one I specified using -I.



Is this possible?  If so, how can I force the compiler to use the boost
1.69 path consistently for all paths?



Best regards



David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help needed with include path precedence order
  2019-01-25  8:49 Help needed with include path precedence order David Aldrich
@ 2019-01-25 12:44 ` Jonathan Wakely
  2019-01-25 13:40   ` David Aldrich
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2019-01-25 12:44 UTC (permalink / raw)
  To: David Aldrich; +Cc: gcc-help

On Fri, 25 Jan 2019 at 08:49, David Aldrich
<david.aldrich.ntml@gmail.com> wrote:
>
> Hi
>
> I am using gcc 7.3.0 on Ubuntu 18.04 LTS to build an application that uses
> the Boost libraries. I want to use  Boost 1.69, which I have installed on
> another server. The Ubuntu machine has  Boost 1.65 installed.  I specify
> the remote boost path (to 1.69) in my makefile and 'make' compiles my
> source file with:
>
>
>
> g++ -c -Wall -m64 -I/net/simdata/OpenSourceLibs/Boost/rel-1.69.0/ -fpic -O3
> SINRCalculation.cpp -o _gnuRelease/SINRCalculation.o
>
>
>
> Now, that source file uses boost/multi_array.hpp. The above compiler
> command gives error:
>
>
>
> In file included from /usr/include/boost/multi_array.hpp:30:0,

This was found in /usr/include

>                  from SINRCalculation.cpp:25:
>
> /net/simdata/Hudson_OpenSourceLibs/Boost/rel-1.69.0/boost/type_traits.hpp:118:10:

But this was found in a different path. One that doesn't look the same
as the -I path you used (where did the "Hudson_" part come from?)

So something is very messed up. Why is the old <boost/multi_array.hpp>
being found in the first place? Is that header missing from your
boost-1.69 installation?


> fatal error: boost/type_traits/is_nothrow_swappable.hpp: No such file or
> directory
>
>  #include <boost/type_traits/is_nothrow_swappable.hpp>
>
>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> compilation terminated.
>
>
>
> Now, my copy of boost 1.69 does contain is_nothrow_swappable.hpp so, at
> first sight, that error is surprising.

Your copy in /net/simdata/OpenSourceLibs/Boost/rel-1.69.0/ or the one
in /net/simdata/Hudson_OpenSourceLibs/Boost/rel-1.69.0/ which is being
found?
Are they the same?

Compile with -save-temps and inspect the SINRCalculation.oii file to
see which boost headers are found, in which locations. That should
help figure out what's going on.

>
>
> I think what is happening is the is_nothrow_swappable.hpp is being searched
> for on the system library path (boost 1.65 does not have that file), not
> the one I specified using -I.

Seems unlikely, I think something else is happening.

>
>
>
> Is this possible?  If so, how can I force the compiler to use the boost
> 1.69 path consistently for all paths?

The -I option you used should already do that, which is why I think
you have something messed up with your Boost installations.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help needed with include path precedence order
  2019-01-25 12:44 ` Jonathan Wakely
@ 2019-01-25 13:40   ` David Aldrich
  0 siblings, 0 replies; 3+ messages in thread
From: David Aldrich @ 2019-01-25 13:40 UTC (permalink / raw)
  To: gcc-help

Hi Jonathan

Thanks very much for your reply.

> But this was found in a different path. One that doesn't look the same
> as the -I path you used (where did the "Hudson_" part come from?)

I'm sorry, that was my error on pasting into the email.

I changed the makefile variable that defines the Boost include path from:

BOOST_INC = $(OPEN_SOURCE_LIBS)/Boost/rel-1.69.0/

to:

BOOST_INC = $(OPEN_SOURCE_LIBS)/Boost/rel-1.69.0

(deleted final '/') and now the compilation is succeeding. I'm not
convinced that that was the reason, but I'm happy that the build is now
working.

Best regards

David


On Fri, Jan 25, 2019 at 12:44 PM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

> On Fri, 25 Jan 2019 at 08:49, David Aldrich
> <david.aldrich.ntml@gmail.com> wrote:
> >
> > Hi
> >
> > I am using gcc 7.3.0 on Ubuntu 18.04 LTS to build an application that
> uses
> > the Boost libraries. I want to use  Boost 1.69, which I have installed on
> > another server. The Ubuntu machine has  Boost 1.65 installed.  I specify
> > the remote boost path (to 1.69) in my makefile and 'make' compiles my
> > source file with:
> >
> >
> >
> > g++ -c -Wall -m64 -I/net/simdata/OpenSourceLibs/Boost/rel-1.69.0/ -fpic
> -O3
> > SINRCalculation.cpp -o _gnuRelease/SINRCalculation.o
> >
> >
> >
> > Now, that source file uses boost/multi_array.hpp. The above compiler
> > command gives error:
> >
> >
> >
> > In file included from /usr/include/boost/multi_array.hpp:30:0,
>
> This was found in /usr/include
>
> >                  from SINRCalculation.cpp:25:
> >
> >
> /net/simdata/Hudson_OpenSourceLibs/Boost/rel-1.69.0/boost/type_traits.hpp:118:10:
>
> But this was found in a different path. One that doesn't look the same
> as the -I path you used (where did the "Hudson_" part come from?)
>
> So something is very messed up. Why is the old <boost/multi_array.hpp>
> being found in the first place? Is that header missing from your
> boost-1.69 installation?
>
>
> > fatal error: boost/type_traits/is_nothrow_swappable.hpp: No such file or
> > directory
> >
> >  #include <boost/type_traits/is_nothrow_swappable.hpp>
> >
> >           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > compilation terminated.
> >
> >
> >
> > Now, my copy of boost 1.69 does contain is_nothrow_swappable.hpp so, at
> > first sight, that error is surprising.
>
> Your copy in /net/simdata/OpenSourceLibs/Boost/rel-1.69.0/ or the one
> in /net/simdata/Hudson_OpenSourceLibs/Boost/rel-1.69.0/ which is being
> found?
> Are they the same?
>
> Compile with -save-temps and inspect the SINRCalculation.oii file to
> see which boost headers are found, in which locations. That should
> help figure out what's going on.
>
> >
> >
> > I think what is happening is the is_nothrow_swappable.hpp is being
> searched
> > for on the system library path (boost 1.65 does not have that file), not
> > the one I specified using -I.
>
> Seems unlikely, I think something else is happening.
>
> >
> >
> >
> > Is this possible?  If so, how can I force the compiler to use the boost
> > 1.69 path consistently for all paths?
>
> The -I option you used should already do that, which is why I think
> you have something messed up with your Boost installations.
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-25 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25  8:49 Help needed with include path precedence order David Aldrich
2019-01-25 12:44 ` Jonathan Wakely
2019-01-25 13:40   ` David Aldrich

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).