How to add to PATH from user-config.jam?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add to PATH from user-config.jam?

Boost - Build mailing list
Hi,

On Windows, I'm building tests of Boost.GIL using
dependencies like libpng, libjpeg, etc. installed with vcpkg.

In my user-config.jam I have entries like this:

using libjpeg
  :
  : <include>C:/vcpkg/installed/x86-windows/include
<search>C:/vcpkg/installed/x86-windows/lib
  : <address-model>32
  ;

using libjpeg
  :
  : <include>C:/vcpkg/installed/x64-windows/include
<search>C:/vcpkg/installed/x64-windows/lib
  : <address-model>64
  ;


At build time, everything works fine.

For run-time, GIL tests need to load DLLs in C:\vcpkg\installed\x86-windows\bin
If I add this location to PATH manually, everything works at run-time fine.

I'm looking for a way to add that location to PATH from user-config.jam.
Is it possible? How?

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: How to add to PATH from user-config.jam?

Boost - Build mailing list
On Mon, 16 Dec 2019 at 22:35, Mateusz Loskot <[hidden email]> wrote:

>
> On Windows, I'm building tests of Boost.GIL using
> dependencies like libpng, libjpeg, etc. installed with vcpkg.
>
> In my user-config.jam I have entries like this:
>
> using libjpeg
>   :
>   : <include>C:/vcpkg/installed/x86-windows/include
> <search>C:/vcpkg/installed/x86-windows/lib
>   : <address-model>32
>   ;
>
> using libjpeg
>   :
>   : <include>C:/vcpkg/installed/x64-windows/include
> <search>C:/vcpkg/installed/x64-windows/lib
>   : <address-model>64
>   ;
>
>
> At build time, everything works fine.
>
> For run-time, GIL tests need to load DLLs in C:\vcpkg\installed\x86-windows\bin
> If I add this location to PATH manually, everything works at run-time fine.
>
> I'm looking for a way to add that location to PATH from user-config.jam.
> Is it possible? How?

I approached the problem differently and added this at the top of my
user-config.jam

project
  : requirements
    <address-model>32:<dll-path>C:/vcpkg/installed/x86-windows/bin
    <address-model>64:<dll-path>C:/vcpkg/installed/x64-windows/bin
  ;


Now all the DLLs of libjpeg, libpng, etc. can be found when I run
either of these two:

b2.exe toolset=msvc-14.2 address-model=32 libs/gil/test/extension/io//simple
b2.exe toolset=msvc-14.2 address-model=64 libs/gil/test/extension/io//simple

Spectacular success of mine! ;)

Next, I'd like to make this work for request of both at the same time,
that is address-model=32,64  or address-model=64,32

Interestingly, both first target in the list succeeds and the second
fails with  linking
errors due to mismatch of machine type of libraries and build target.
That is, unresolved external symbol errors are described as follows

- for address-model=32,64
  warning LNK4272: library machine type 'x86' conflicts with target
machine type 'x64'

- for address-model=64,32
  warning LNK4272: library machine type 'x64' conflicts with target
machine type 'x86'

For both address models, checks of libraries succeed with yes.

Is there any way to make the multi-model command work?

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Incorrect LIBPATH for address-model=32, 64 on Windows (was: How to add to PATH from user-config.jam?)

Boost - Build mailing list
On Tue, 17 Dec 2019 at 12:14, Mateusz Loskot <[hidden email]> wrote:

> [...]
> Interestingly, both first target in the list succeeds and the second
> fails with  linking
> errors due to mismatch of machine type of libraries and build target.
> That is, unresolved external symbol errors are described as follows
>
> - for address-model=32,64
>   warning LNK4272: library machine type 'x86' conflicts with target
> machine type 'x64'
>
> - for address-model=64,32
>   warning LNK4272: library machine type 'x64' conflicts with target
> machine type 'x86'
>
> For both address models, checks of libraries succeed with yes.

Following further testing, that part above indicates a bug in B2,
so I have reported it
https://github.com/boostorg/build/issues/515

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: How to add to PATH from user-config.jam?

Boost - Build mailing list
In reply to this post by Boost - Build mailing list
On 12/17/2019 6:14 AM, Mateusz Loskot via Boost-build wrote:

> On Mon, 16 Dec 2019 at 22:35, Mateusz Loskot <[hidden email]> wrote:
>>
>> On Windows, I'm building tests of Boost.GIL using
>> dependencies like libpng, libjpeg, etc. installed with vcpkg.
>>
>> In my user-config.jam I have entries like this:
>>
>> using libjpeg
>>    :
>>    : <include>C:/vcpkg/installed/x86-windows/include
>> <search>C:/vcpkg/installed/x86-windows/lib
>>    : <address-model>32
>>    ;
>>
>> using libjpeg
>>    :
>>    : <include>C:/vcpkg/installed/x64-windows/include
>> <search>C:/vcpkg/installed/x64-windows/lib
>>    : <address-model>64
>>    ;
>>
>>
>> At build time, everything works fine.
>>
>> For run-time, GIL tests need to load DLLs in C:\vcpkg\installed\x86-windows\bin
>> If I add this location to PATH manually, everything works at run-time fine.
>>
>> I'm looking for a way to add that location to PATH from user-config.jam.
>> Is it possible? How?
>
> I approached the problem differently and added this at the top of my
> user-config.jam
>
> project
>    : requirements
>      <address-model>32:<dll-path>C:/vcpkg/installed/x86-windows/bin
>      <address-model>64:<dll-path>C:/vcpkg/installed/x64-windows/bin
>    ;
>
>
> Now all the DLLs of libjpeg, libpng, etc. can be found when I run
> either of these two:
>
> b2.exe toolset=msvc-14.2 address-model=32 libs/gil/test/extension/io//simple
> b2.exe toolset=msvc-14.2 address-model=64 libs/gil/test/extension/io//simple
>
> Spectacular success of mine! ;)

According to the Boost Build docs the dll-path feature only affects Unix
compilers. Perhaps the docs are incorrect regarding this feature.

>
> Next, I'd like to make this work for request of both at the same time,
> that is address-model=32,64  or address-model=64,32
>
> Interestingly, both first target in the list succeeds and the second
> fails with  linking
> errors due to mismatch of machine type of libraries and build target.
> That is, unresolved external symbol errors are described as follows
>
> - for address-model=32,64
>    warning LNK4272: library machine type 'x86' conflicts with target
> machine type 'x64'
>
> - for address-model=64,32
>    warning LNK4272: library machine type 'x64' conflicts with target
> machine type 'x86'
>
> For both address models, checks of libraries succeed with yes.
>
> Is there any way to make the multi-model command work?

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: How to add to PATH from user-config.jam?

Boost - Build mailing list
On Tue, 17 Dec 2019 at 21:02, Edward Diener via Boost-build
<[hidden email]> wrote:

> On 12/17/2019 6:14 AM, Mateusz Loskot via Boost-build wrote:
> > On Mon, 16 Dec 2019 at 22:35, Mateusz Loskot <[hidden email]> wrote:
> >>
> >> On Windows, I'm building tests of Boost.GIL using
> >> dependencies like libpng, libjpeg, etc. installed with vcpkg.
> >>
> >> In my user-config.jam I have entries like this:
> >>
> >> using libjpeg
> >>    :
> >>    : <include>C:/vcpkg/installed/x86-windows/include
> >> <search>C:/vcpkg/installed/x86-windows/lib
> >>    : <address-model>32
> >>    ;
> >>
> >> using libjpeg
> >>    :
> >>    : <include>C:/vcpkg/installed/x64-windows/include
> >> <search>C:/vcpkg/installed/x64-windows/lib
> >>    : <address-model>64
> >>    ;
> >>
> >>
> >> At build time, everything works fine.
> >>
> >> For run-time, GIL tests need to load DLLs in C:\vcpkg\installed\x86-windows\bin
> >> If I add this location to PATH manually, everything works at run-time fine.
> >>
> >> I'm looking for a way to add that location to PATH from user-config.jam.
> >> Is it possible? How?
> >
> > I approached the problem differently and added this at the top of my
> > user-config.jam
> >
> > project
> >    : requirements
> >      <address-model>32:<dll-path>C:/vcpkg/installed/x86-windows/bin
> >      <address-model>64:<dll-path>C:/vcpkg/installed/x64-windows/bin
> >    ;
> >
> >
> > Now all the DLLs of libjpeg, libpng, etc. can be found when I run
> > either of these two:
> >
> > b2.exe toolset=msvc-14.2 address-model=32 libs/gil/test/extension/io//simple
> > b2.exe toolset=msvc-14.2 address-model=64 libs/gil/test/extension/io//simple
> >
> > Spectacular success of mine! ;)
>
> According to the Boost Build docs the dll-path feature only affects Unix
> compilers. Perhaps the docs are incorrect regarding this feature.

I missed that bit in the docs on the dll-path being Unix-only feature.

I am certain the dll-path works with MSVC on Windows,
so the docs must be out of date.

I have reported it showing that dll-path works with MSVC:
https://github.com/boostorg/build/issues/516

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build