Re: [CMake] ctest // fixtures and --repeat-until-fail

2019-04-26 Thread Craig Scott
On Tue, Apr 16, 2019 at 11:36 PM Sergei Nikulov 
wrote:

> >
> > On Tue, Apr 16, 2019 at 10:07 PM Sergei Nikulov <
> sergey.niku...@gmail.com> wrote:
> >>
> >> Hello All,
> >>
> >> Has anybody knows how FIXTURES_SETUP/FIXTURES_CLEANUP should work with
> >> --repeat-until-fail  option?
> >>
> >> My expectation, if I requesting a test run for example 10 times, the
> >> sequence should be as follows:
> >>
> >> fixture_setup, then test, then fixture_cleanup repeats 10 times
> >>
> >> But in practice, I've got following sequence
> >>
> >> 1. fixture_setup runs 10 times
> >> 2. test runs 10 times
> >> 3. fixture_cleanup runs 10 times
> >>
> >> Is it expected behavior?
> >> I'm using ctest version 3.14.2
> >
> >
> > The documentation for the --repeat-until-fail option says "Require each
> test to run  times without failing in order to pass". A fixture setup or
> cleanup test is still a test, so they will also be run  times. The logic
> that implements repeating tests sets up a counter on each test and it runs
> that test  times before marking that test as complete. This is why you
> see fixture_setup run 10 times, then test runs 10 times and lastly
> fixture_cleanup runs 10 times.
> >
>
> I understand that fixture is still a test.
> To achieve repeatable behavior -R "test_continues_*" is enough.
>
> But if it calls FIXTURE why not apply the specific behavior as
> expected from fixture (init/teardown)?
>

It's mostly related to the way it is implemented internally. Because a
fixture setup/cleanup is still just another test, it has all the features
of a regular test, including honouring the option that tells ctest to run
it multiple times. For some projects, it may be desirable for the fixture
setup/cleanup to run only once but re-run the fixture-requiring test(s) to
run multiple times. For other projects, it might be desirable for the
fixture setup/cleanup tests to also run multiple times (a setup test might
simply be polling a service to confirm it is up, for example). Since ctest
cannot know which of the two scenarios the project wants, it simply treats
all tests the same, whether they are fixture setup/cleanup tests or not.

Perhaps one way of dealing with this might be to add a new boolean test
property which, when set, has the meaning of "only run once" when the
--repeat-until-fail option is used.

-- 
Craig Scott
Melbourne, Australia
https://crascit.com

Get the hand-book for every CMake user: Professional CMake: A Practical
Guide 
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] How does IMPLICIT_DEPENDS work?

2019-04-26 Thread Paul Smith
We're trying to implement precompiled headers (yes, I've seen all the
various github projects around this).  As part of this we need to make
sure the precompiled header is rebuilt whenever any of the headers that
it includes changes: this seems like exactly the job for
add_custom_command's IMPLICIT_DEPENDS.

But, it doesn't seem to be doing anything at all for me so I wonder
what I'm doing wrong.

I'm using CMake 3.13.4 on GNU/Linux with GCC C++ and Makefile
generators (we also will have support for MSVC but I'm not worried
about that here).

I have a function to deal with PCH generation:

  function(add_precompiled_header _target _header)
...
  # This is the actual command that does the precompiling
  add_custom_command(
  OUTPUT "${_pch_file}"
  COMMAND "${CMAKE_COMMAND}" -E make_directory "${_pch_dir}"
  COMMAND "${CMAKE_CXX_COMPILER}" "${_flags}" -x c++-header -o
"${_pch_file}" "${_header}"
  COMMAND_EXPAND_LISTS
  IMPLICIT_DEPENDS CXX "${_header}"
  COMMENT "Precompiling ${_header} for ${_target} (C++)")
...
  get_property(_sources TARGET ${_target} PROPERTY SOURCES)
  foreach(_source ${_sources})
...
  set_property(SOURCE ${_source} APPEND PROPERTY
  OBJECT_DEPENDS "${_pch_file}")
...
  endforeach()

Obviously there're a lot of other things here I'm leaving out, but
basically there's a custom command that compiles the header into a PCH
and lists the header as an IMPLICIT_DEPENDS, and adds that PCH as an
OBJECT_DEPENDS to the source files.

When I change the PCH file, the source files are rebuilt so that works.

If I change the header the PCH file is rebuilt so that works too.

But if I change a header file that the PCH includes, the PCH is NOT
rebuilt.  Not only that but if I use "make -d" I can see that the PCH
target never even considers any of the included files when determining
out-of-date-ness of the PCH file.

It seems like IMPLICIT_DEPENDS is behaving identically to DEPENDS here:
only listing the header as a dependency but not trying to determine
what it, itself, depends on.

What am I doing wrong?  Is there some subtlety to IMPLICIT_DEPENDS that
I'm missing?

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Support of compile features for Fujitsu C++ Compiler

2019-04-26 Thread Robert Maynard via CMake
For an initial implementation I would base the work on the PGI
compiler module (
https://gitlab.kitware.com/cmake/cmake/blob/v3.14.3/Modules/Compiler/PGI-CXX.cmake
) not the GNU-CXX module.
This will allow you to add a new compiler with only meta-language
flags ( cxx_std_11, cxx_std_14, ... ) and you avoid the complexity of
having to manually build the feature tables.

On Fri, Apr 26, 2019 at 3:58 AM Zehner Paul  wrote:
>
> Kai,
>
>
> Thanks for your answer and for your presentation. So, I will try to add 
> support for this Fujitsu compiler. Is there a list of the common compile 
> features that I can base me upon? I plan use `GNU-CXX.cmake` as a source of 
> inspiration.
>
>
> If I succeed to complete the `Fujitsu-CXX.cmake` file, I will propose it as a 
> merge request.
>
>
> --
>
> Paul Zehner, Ph. D.
>
> Invited Researcher
>
> Numerical Simulation Research Unit
>
> Japan Aerospace Exploration Agency
>
> 7-44-1 Jindaiji Higashi-machi, Chofu-shi, Tokyo
>
> 182-8522, Japan
>
> Tel. +81-50-3362-7933
>
> Fax. +81-422-40-3327
>
> zehner.p...@jaxa.jp
>
> www.jaxa.jp
>
>
>
> 
> From: Kai Wolf 
> Sent: Friday, April 26, 2019 16:22
> To: Zehner Paul
> Cc: cmake@cmake.org
> Subject: Re: [CMake] Support of compile features for Fujitsu C++ Compiler
>
> If you want to add support to your specific compiler, you could add or extend 
> another Fujitsu-DetermineCompiler.cmake
> file and append your CMAKE_MODULE_PATH in order to CMake to find it. You 
> probably also need to adjust
> *Fujitsu-CXX.cmake, Fujitsu-CXX-FeatureTests.cmake and so on.
>
> I gave a talk a few years ago that shortly explains the whole process of 
> CMake initialization and compiler verification which
> you can find here: 
> https://github.com/NewProggie/Talks/blob/master/2017-06-dep-management-with-cmake-MUC%2B%2B.pdf
>
>
> Greetings,
>
> Kai
>
> http://kai-wolf.me
> http://effective-cmake.com
>
> Am 26.04.2019 um 07:35 schrieb Zehner Paul :
>
> Hello Cmake community,
>
> I would like to use Cmake to build research simulation programs in a Fujitsu 
> supercomputer environment. Unfortunately, it seems that Cmake (version 3.14) 
> does not support any compile feature for the Fujitsu C++ compiler (FCCpx, 
> version 2.0.0 P-id: T01815-02 (Jul 12 2018 13:13:18)). I add I am pretty new 
> to Cmake. Searching for similar issues, I found only this 
> [thread](https://cmake.org/pipermail/cmake-developers/2014-August/010989.html),
>  which talk about basic support of the compiler.
>
> I tested it on a simple project, and the line:
>
> ```cmake
> target_compile_features(test PUBLIC cxx_std_11)
> ```
>
> fails with this message:
>
> ```
> CMake Error at CMakeLists.txt:15 (target_compile_features):
>   target_compile_features no known features for CXX compiler
>
>   "Fujitsu"
>
>   version .
>
> ```
>
> So, it seems that the compiler is detected (without its version), but compile 
> features are not known. To be sure, I ran this simple test to list any 
> supported features:
>
> ```cmake
> cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
> project(foobar CXX)
> message("Your C++ compiler supports these C++ features:")
> foreach(i ${CMAKE_CXX_COMPILE_FEATURES})
> message("${i}")
> endforeach()
> ```
>
> and no feature are listed.
>
> So, what should I do from now on? Are there some people here using Cmake with 
> Fujitsu who could help me? Should I propose a patch with the different 
> compile features of the compiler? Or should I address it to Fujitsu?
>
> Thanks for your help,
>
> --
> Paul Zehner, Ph. D.
> Invited Researcher
> Numerical Simulation Research Unit
> Japan Aerospace Exploration Agency
> 7-44-1 Jindaiji Higashi-machi, Chofu-shi, Tokyo
> 182-8522, Japan
> Tel. +81-50-3362-7933
> Fax. +81-422-40-3327
> zehner.p...@jaxa.jp
> www.jaxa.jp
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.

Re: [CMake] Support of compile features for Fujitsu C++ Compiler

2019-04-26 Thread Zehner Paul
Kai,


Thanks for your answer and for your presentation. So, I will try to add support 
for this Fujitsu compiler. Is there a list of the common compile features that 
I can base me upon? I plan use `GNU-CXX.cmake` as a source of inspiration.


If I succeed to complete the `Fujitsu-CXX.cmake` file, I will propose it as a 
merge request.


--

Paul Zehner, Ph. D.

Invited Researcher

Numerical Simulation Research Unit

Japan Aerospace Exploration Agency

7-44-1 Jindaiji Higashi-machi, Chofu-shi, Tokyo

182-8522, Japan

Tel. +81-50-3362-7933

Fax. +81-422-40-3327

zehner.p...@jaxa.jp

www.jaxa.jp



From: Kai Wolf 
Sent: Friday, April 26, 2019 16:22
To: Zehner Paul
Cc: cmake@cmake.org
Subject: Re: [CMake] Support of compile features for Fujitsu C++ Compiler

If you want to add support to your specific compiler, you could add or extend 
another Fujitsu-DetermineCompiler.cmake
file and append your CMAKE_MODULE_PATH in order to CMake to find it. You 
probably also need to adjust
*Fujitsu-CXX.cmake, Fujitsu-CXX-FeatureTests.cmake and so on.

I gave a talk a few years ago that shortly explains the whole process of CMake 
initialization and compiler verification which
you can find here: 
https://github.com/NewProggie/Talks/blob/master/2017-06-dep-management-with-cmake-MUC%2B%2B.pdf


Greetings,

Kai

http://kai-wolf.me
http://effective-cmake.com

Am 26.04.2019 um 07:35 schrieb Zehner Paul 
mailto:zehner.p...@jaxa.jp>>:

Hello Cmake community,

I would like to use Cmake to build research simulation programs in a Fujitsu 
supercomputer environment. Unfortunately, it seems that Cmake (version 3.14) 
does not support any compile feature for the Fujitsu C++ compiler (FCCpx, 
version 2.0.0 P-id: T01815-02 (Jul 12 2018 13:13:18)). I add I am pretty new to 
Cmake. Searching for similar issues, I found only this 
[thread](https://cmake.org/pipermail/cmake-developers/2014-August/010989.html), 
which talk about basic support of the compiler.

I tested it on a simple project, and the line:

```cmake
target_compile_features(test PUBLIC cxx_std_11)
```

fails with this message:

```
CMake Error at CMakeLists.txt:15 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Fujitsu"

  version .

```

So, it seems that the compiler is detected (without its version), but compile 
features are not known. To be sure, I ran this simple test to list any 
supported features:

```cmake
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(foobar CXX)
message("Your C++ compiler supports these C++ features:")
foreach(i ${CMAKE_CXX_COMPILE_FEATURES})
message("${i}")
endforeach()
```

and no feature are listed.

So, what should I do from now on? Are there some people here using Cmake with 
Fujitsu who could help me? Should I propose a patch with the different compile 
features of the compiler? Or should I address it to Fujitsu?

Thanks for your help,

--
Paul Zehner, Ph. D.
Invited Researcher
Numerical Simulation Research Unit
Japan Aerospace Exploration Agency
7-44-1 Jindaiji Higashi-machi, Chofu-shi, Tokyo
182-8522, Japan
Tel. +81-50-3362-7933
Fax. +81-422-40-3327
zehner.p...@jaxa.jp
www.jaxa.jp
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Support of compile features for Fujitsu C++ Compiler

2019-04-26 Thread Kai Wolf
If you want to add support to your specific compiler, you could add or extend 
another Fujitsu-DetermineCompiler.cmake
file and append your CMAKE_MODULE_PATH in order to CMake to find it. You 
probably also need to adjust
*Fujitsu-CXX.cmake, Fujitsu-CXX-FeatureTests.cmake and so on.

I gave a talk a few years ago that shortly explains the whole process of CMake 
initialization and compiler verification which
you can find here: 
https://github.com/NewProggie/Talks/blob/master/2017-06-dep-management-with-cmake-MUC%2B%2B.pdf
 



Greetings,

Kai

http://kai-wolf.me
http://effective-cmake.com

> Am 26.04.2019 um 07:35 schrieb Zehner Paul :
> 
> Hello Cmake community,
> 
> I would like to use Cmake to build research simulation programs in a Fujitsu 
> supercomputer environment. Unfortunately, it seems that Cmake (version 3.14) 
> does not support any compile feature for the Fujitsu C++ compiler (FCCpx, 
> version 2.0.0 P-id: T01815-02 (Jul 12 2018 13:13:18)). I add I am pretty new 
> to Cmake. Searching for similar issues, I found only this 
> [thread](https://cmake.org/pipermail/cmake-developers/2014-August/010989.html 
> ), 
> which talk about basic support of the compiler.
> 
> I tested it on a simple project, and the line:
> 
> ```cmake
> target_compile_features(test PUBLIC cxx_std_11)
> ```
> 
> fails with this message:
> 
> ```
> CMake Error at CMakeLists.txt:15 (target_compile_features):
>   target_compile_features no known features for CXX compiler
> 
>   "Fujitsu"
> 
>   version .
> 
> ```
> 
> So, it seems that the compiler is detected (without its version), but compile 
> features are not known. To be sure, I ran this simple test to list any 
> supported features:
> 
> ```cmake
> cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
> project(foobar CXX)
> message("Your C++ compiler supports these C++ features:")
> foreach(i ${CMAKE_CXX_COMPILE_FEATURES})
> message("${i}")
> endforeach()
> ```
> 
> and no feature are listed.
> 
> So, what should I do from now on? Are there some people here using Cmake with 
> Fujitsu who could help me? Should I propose a patch with the different 
> compile features of the compiler? Or should I address it to Fujitsu?
> 
> Thanks for your help,
> 
> --
> Paul Zehner, Ph. D.
> Invited Researcher
> Numerical Simulation Research Unit
> Japan Aerospace Exploration Agency
> 7-44-1 Jindaiji Higashi-machi, Chofu-shi, Tokyo
> 182-8522, Japan
> Tel. +81-50-3362-7933
> Fax. +81-422-40-3327
> zehner.p...@jaxa.jp 
> www.jaxa.jp 
> --
> 
> Powered by www.kitware.com 
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ 
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html 
> 
> CMake Consulting: http://cmake.org/cmake/help/consulting.html 
> 
> CMake Training Courses: http://cmake.org/cmake/help/training.html 
> 
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html 
> 
> 
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake 
> 


signature.asc
Description: Message signed with OpenPGP
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake