You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Thorsten Schöning <ts...@am-soft.de> on 2021/12/29 09:41:46 UTC

[log4cxx] How to run the throughput test?

Hi everyone,

I just tried to run the throughput test: Installed FMT using VCPKG,
changed CMAKE to option that test ON and things built successfully.
Though, running fails because log4cxx.dll can't be found. In theory
CMAKE should already handle that using the following line:

> set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")

Though, doesn't seem to work for my Windows and Visual Studio 2022.
The actual path of that DLL is the following:

> [...]\master\src\out\build\x64-Debug\src\main\cpp\log4cxx.dll

Using PROCMON I can see that the test tries to load the file from the
following LOG4CXX-specific directories instead:

> [...]\master\src\out\build\x64-Debug\src\test\cpp\throughput\log4cxx.dll
> [...]\master\src\out\build\x64-Debug\src\test\cpp\helpers\log4cxx.dll

Looking at the CMAKE file this somewhat makes sense, because at least
the first line is the target directory of the throughput test.

How is your setup? Do you manually copy the DLL or are executing the
throughput test differently and Visual Studio makes a difference here?

Mit freundlichen Grüßen

Thorsten Schöning

-- 
AM-SoFT IT-Service - Bitstore Hameln GmbH
Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und TK

E-Mail: Thorsten.Schoening@AM-SoFT.de
Web:    http://www.AM-SoFT.de/

Tel:   05151-  9468- 0
Tel:   05151-  9468-55
Fax:   05151-  9468-88
Mobil:  0178-8 9468-04

AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska





Re: [log4cxx] How to run the throughput test?

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Robert Middleton,
am Donnerstag, 30. Dezember 2021 um 00:24 schrieben Sie:

> After taking a look at this, maybe the best option is to add the
> throughput as a unit test so that we can set the path the same as the
> other unit tests?

If it fixes the path issue and enabling/disabling through the already
existing option works, sounds good to me.

> [...]You can
> also run individual tests through visual studio, so that might solve
> the problem.

This is possible with simply opening the source file of the throughput
test and choose to run it as well. Though, I wonder if CMAKE doesn't
properly take things like the "$<TARGET_FILE_DIR:log4cxx>" into
account then, because that part is simply not built when directly
running the throughput test as app only.

That might be different in the context of running all or individual
unit tests.

> On Windows, I manually copied troughputtests.exe to the installation
> directory (so log4cxx.dll is in the same directory).

I would like to avoid that and instead either copy the DLL into the
working dir of the throughput test or preferrably adopt the path to
the DLL based on that working dir. Something like the following:

> [...]\master\src\out\build\x64-Debug\src\main\cpp\log4cxx.dll
> set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")

vs.

> [...]\master\src\out\build\x64-Debug\src\test\cpp\throughput\log4cxx.dll
> set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:throughput???>\..\..\..\main\cpp>;")

Mit freundlichen Grüßen

Thorsten Schöning

-- 
AM-SoFT IT-Service - Bitstore Hameln GmbH
Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und TK

E-Mail: Thorsten.Schoening@AM-SoFT.de
Web:    http://www.AM-SoFT.de/

Tel:   05151-  9468- 0
Tel:   05151-  9468-55
Fax:   05151-  9468-88
Mobil:  0178-8 9468-04

AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska





Re: [log4cxx] How to run the throughput test?

Posted by Stephen Webb <sw...@gmail.com>.
On Windows, I manually copied troughputtests.exe to the installation
directory (so log4cxx.dll is in the same directory).

Perhaps it should be installed by cmake when BUILD_THROUGHPUT_TESTS is on.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Dec 30, 2021 at 10:25 AM Robert Middleton <rm...@apache.org>
wrote:

> After taking a look at this, maybe the best option is to add the
> throughput as a unit test so that we can set the path the same as the
> other unit tests?  If it is not added as a unit test it won't be
> run(which is good), but if we enable the option it will run.  You can
> also run individual tests through visual studio, so that might solve
> the problem.  Looking at the CMakeLists.txt, it doesn't actually do
> anything with the path that it calculates, it's only building the exe.
>
> I did try to add a custom target, but that does not let you set the
> environment(which needs to be set for us to load the required DLLs
> from the PATH).
>
> -Robert Middleton
>
> On Wed, Dec 29, 2021 at 5:27 PM Stephen Webb <sw...@gmail.com> wrote:
> >
> > That looks like a cmake issue - could you try cmake version 3.22?
> >
> > I am still using Visual Studio 2019 Community Edition.
> >
> > <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> > Virus-free.
> > www.avast.com
> > <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> > On Thu, Dec 30, 2021 at 4:30 AM Robert Middleton <rm...@apache.org>
> > wrote:
> >
> > > Perhaps we need to add a custom target to CMake to make it runnable?
> > > I think that would then hook into visual studio to make it easy to
> > > run; I'll try to take a look at it tonight.
> > >
> > > The part of the CMakeLists.txt file that does that was copy&pasted
> > > from one directory up, so it could be a directory level issue that I
> > > missed.
> > >
> > > -Robert Middleton
> > >
> > > On Wed, Dec 29, 2021 at 7:15 AM Thorsten Schöning <
> tschoening@am-soft.de>
> > > wrote:
> > > >
> > > > Hi everyone,
> > > >
> > > > I just tried to run the throughput test: Installed FMT using VCPKG,
> > > > changed CMAKE to option that test ON and things built successfully.
> > > > Though, running fails because log4cxx.dll can't be found. In theory
> > > > CMAKE should already handle that using the following line:
> > > >
> > > > > set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")
> > > >
> > > > Though, doesn't seem to work for my Windows and Visual Studio 2022.
> > > > The actual path of that DLL is the following:
> > > >
> > > > > [...]\master\src\out\build\x64-Debug\src\main\cpp\log4cxx.dll
> > > >
> > > > Using PROCMON I can see that the test tries to load the file from the
> > > > following LOG4CXX-specific directories instead:
> > > >
> > > > >
> > >
> [...]\master\src\out\build\x64-Debug\src\test\cpp\throughput\log4cxx.dll
> > > > >
> [...]\master\src\out\build\x64-Debug\src\test\cpp\helpers\log4cxx.dll
> > > >
> > > > Looking at the CMAKE file this somewhat makes sense, because at least
> > > > the first line is the target directory of the throughput test.
> > > >
> > > > How is your setup? Do you manually copy the DLL or are executing the
> > > > throughput test differently and Visual Studio makes a difference
> here?
> > > >
> > > > Mit freundlichen Grüßen
> > > >
> > > > Thorsten Schöning
> > > >
> > > > --
> > > > AM-SoFT IT-Service - Bitstore Hameln GmbH
> > > > Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT
> und
> > > TK
> > > >
> > > > E-Mail: Thorsten.Schoening@AM-SoFT.de
> > > > Web:    http://www.AM-SoFT.de/
> > > >
> > > > Tel:   05151-  9468- 0
> > > > Tel:   05151-  9468-55
> > > > Fax:   05151-  9468-88
> > > > Mobil:  0178-8 9468-04
> > > >
> > > > AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c,
> 31789
> > > Hameln
> > > > AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska
> > > >
> > > >
> > > >
> > > >
> > >
>

Re: [log4cxx] How to run the throughput test?

Posted by Robert Middleton <rm...@apache.org>.
After taking a look at this, maybe the best option is to add the
throughput as a unit test so that we can set the path the same as the
other unit tests?  If it is not added as a unit test it won't be
run(which is good), but if we enable the option it will run.  You can
also run individual tests through visual studio, so that might solve
the problem.  Looking at the CMakeLists.txt, it doesn't actually do
anything with the path that it calculates, it's only building the exe.

I did try to add a custom target, but that does not let you set the
environment(which needs to be set for us to load the required DLLs
from the PATH).

-Robert Middleton

On Wed, Dec 29, 2021 at 5:27 PM Stephen Webb <sw...@gmail.com> wrote:
>
> That looks like a cmake issue - could you try cmake version 3.22?
>
> I am still using Visual Studio 2019 Community Edition.
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Thu, Dec 30, 2021 at 4:30 AM Robert Middleton <rm...@apache.org>
> wrote:
>
> > Perhaps we need to add a custom target to CMake to make it runnable?
> > I think that would then hook into visual studio to make it easy to
> > run; I'll try to take a look at it tonight.
> >
> > The part of the CMakeLists.txt file that does that was copy&pasted
> > from one directory up, so it could be a directory level issue that I
> > missed.
> >
> > -Robert Middleton
> >
> > On Wed, Dec 29, 2021 at 7:15 AM Thorsten Schöning <ts...@am-soft.de>
> > wrote:
> > >
> > > Hi everyone,
> > >
> > > I just tried to run the throughput test: Installed FMT using VCPKG,
> > > changed CMAKE to option that test ON and things built successfully.
> > > Though, running fails because log4cxx.dll can't be found. In theory
> > > CMAKE should already handle that using the following line:
> > >
> > > > set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")
> > >
> > > Though, doesn't seem to work for my Windows and Visual Studio 2022.
> > > The actual path of that DLL is the following:
> > >
> > > > [...]\master\src\out\build\x64-Debug\src\main\cpp\log4cxx.dll
> > >
> > > Using PROCMON I can see that the test tries to load the file from the
> > > following LOG4CXX-specific directories instead:
> > >
> > > >
> > [...]\master\src\out\build\x64-Debug\src\test\cpp\throughput\log4cxx.dll
> > > > [...]\master\src\out\build\x64-Debug\src\test\cpp\helpers\log4cxx.dll
> > >
> > > Looking at the CMAKE file this somewhat makes sense, because at least
> > > the first line is the target directory of the throughput test.
> > >
> > > How is your setup? Do you manually copy the DLL or are executing the
> > > throughput test differently and Visual Studio makes a difference here?
> > >
> > > Mit freundlichen Grüßen
> > >
> > > Thorsten Schöning
> > >
> > > --
> > > AM-SoFT IT-Service - Bitstore Hameln GmbH
> > > Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und
> > TK
> > >
> > > E-Mail: Thorsten.Schoening@AM-SoFT.de
> > > Web:    http://www.AM-SoFT.de/
> > >
> > > Tel:   05151-  9468- 0
> > > Tel:   05151-  9468-55
> > > Fax:   05151-  9468-88
> > > Mobil:  0178-8 9468-04
> > >
> > > AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789
> > Hameln
> > > AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska
> > >
> > >
> > >
> > >
> >

Re: [log4cxx] How to run the throughput test?

Posted by Stephen Webb <sw...@gmail.com>.
That looks like a cmake issue - could you try cmake version 3.22?

I am still using Visual Studio 2019 Community Edition.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Dec 30, 2021 at 4:30 AM Robert Middleton <rm...@apache.org>
wrote:

> Perhaps we need to add a custom target to CMake to make it runnable?
> I think that would then hook into visual studio to make it easy to
> run; I'll try to take a look at it tonight.
>
> The part of the CMakeLists.txt file that does that was copy&pasted
> from one directory up, so it could be a directory level issue that I
> missed.
>
> -Robert Middleton
>
> On Wed, Dec 29, 2021 at 7:15 AM Thorsten Schöning <ts...@am-soft.de>
> wrote:
> >
> > Hi everyone,
> >
> > I just tried to run the throughput test: Installed FMT using VCPKG,
> > changed CMAKE to option that test ON and things built successfully.
> > Though, running fails because log4cxx.dll can't be found. In theory
> > CMAKE should already handle that using the following line:
> >
> > > set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")
> >
> > Though, doesn't seem to work for my Windows and Visual Studio 2022.
> > The actual path of that DLL is the following:
> >
> > > [...]\master\src\out\build\x64-Debug\src\main\cpp\log4cxx.dll
> >
> > Using PROCMON I can see that the test tries to load the file from the
> > following LOG4CXX-specific directories instead:
> >
> > >
> [...]\master\src\out\build\x64-Debug\src\test\cpp\throughput\log4cxx.dll
> > > [...]\master\src\out\build\x64-Debug\src\test\cpp\helpers\log4cxx.dll
> >
> > Looking at the CMAKE file this somewhat makes sense, because at least
> > the first line is the target directory of the throughput test.
> >
> > How is your setup? Do you manually copy the DLL or are executing the
> > throughput test differently and Visual Studio makes a difference here?
> >
> > Mit freundlichen Grüßen
> >
> > Thorsten Schöning
> >
> > --
> > AM-SoFT IT-Service - Bitstore Hameln GmbH
> > Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und
> TK
> >
> > E-Mail: Thorsten.Schoening@AM-SoFT.de
> > Web:    http://www.AM-SoFT.de/
> >
> > Tel:   05151-  9468- 0
> > Tel:   05151-  9468-55
> > Fax:   05151-  9468-88
> > Mobil:  0178-8 9468-04
> >
> > AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789
> Hameln
> > AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska
> >
> >
> >
> >
>

Re: [log4cxx] How to run the throughput test?

Posted by Robert Middleton <rm...@apache.org>.
Perhaps we need to add a custom target to CMake to make it runnable?
I think that would then hook into visual studio to make it easy to
run; I'll try to take a look at it tonight.

The part of the CMakeLists.txt file that does that was copy&pasted
from one directory up, so it could be a directory level issue that I
missed.

-Robert Middleton

On Wed, Dec 29, 2021 at 7:15 AM Thorsten Schöning <ts...@am-soft.de> wrote:
>
> Hi everyone,
>
> I just tried to run the throughput test: Installed FMT using VCPKG,
> changed CMAKE to option that test ON and things built successfully.
> Though, running fails because log4cxx.dll can't be found. In theory
> CMAKE should already handle that using the following line:
>
> > set(LOG4CXX_DLL_DIR "$<SHELL_PATH:$<TARGET_FILE_DIR:log4cxx>>;")
>
> Though, doesn't seem to work for my Windows and Visual Studio 2022.
> The actual path of that DLL is the following:
>
> > [...]\master\src\out\build\x64-Debug\src\main\cpp\log4cxx.dll
>
> Using PROCMON I can see that the test tries to load the file from the
> following LOG4CXX-specific directories instead:
>
> > [...]\master\src\out\build\x64-Debug\src\test\cpp\throughput\log4cxx.dll
> > [...]\master\src\out\build\x64-Debug\src\test\cpp\helpers\log4cxx.dll
>
> Looking at the CMAKE file this somewhat makes sense, because at least
> the first line is the target directory of the throughput test.
>
> How is your setup? Do you manually copy the DLL or are executing the
> throughput test differently and Visual Studio makes a difference here?
>
> Mit freundlichen Grüßen
>
> Thorsten Schöning
>
> --
> AM-SoFT IT-Service - Bitstore Hameln GmbH
> Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und TK
>
> E-Mail: Thorsten.Schoening@AM-SoFT.de
> Web:    http://www.AM-SoFT.de/
>
> Tel:   05151-  9468- 0
> Tel:   05151-  9468-55
> Fax:   05151-  9468-88
> Mobil:  0178-8 9468-04
>
> AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska
>
>
>
>