VTK forces -std=c++11 ?

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

VTK forces -std=c++11 ?

Sean McBride
Hi all,

In cmake I set CMAKE_CXX_FLAGS to "-std=c++2a" but when I do "make VERBOSE=1" I see that something is passing -std=c++11:

cd /Users/sean/external/VTK-8bin/Common/Core && /Users/sean/llvm/llvm-rel-install/bin/clang++  -DVTK_IN_VTK -DvtkCommonCore_EXPORTS -I/Users/sean/external/VTK-8bin/Common/DataModel -I/Users/sean/external/VTK-8bin/Common/Core -I/Users/sean/external/VTK/Common/Core -I/Users/sean/external/VTK-8bin/Utilities/KWIML -I/Users/sean/external/VTK/Utilities/KWIML -I/Users/sean/external/VTK-8bin/Utilities/KWSys -I/Users/sean/external/VTK/Utilities/KWSys -I/Users/sean/external/VTK-8bin/ThirdParty/utf8 -I/Users/sean/external/VTK/ThirdParty/utf8  -std=c++2a  -g -fPIC -fvisibility=hidden   -std=c++11 -o CMakeFiles/vtkCommonCore.dir/vtkAbstractArray.cxx.o -c /Users/sean/external/VTK/Common/Core/vtkAbstractArray.cxx

Is this a bug?  If not, how do I specify the language variant?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK forces -std=c++11 ?

VTK - Dev mailing list
On 1/11/19 2:59 PM, Sean McBride wrote:
> In cmake I set CMAKE_CXX_FLAGS to "-std=c++2a" but when I do "make VERBOSE=1"
> I see that something is passing -std=c++11:
>
> Is this a bug?  If not, how do I specify the language variant?

It's likely CMake adding it based on Common/Core/CMakeLists.txt:

```
vtk_module_compile_features(VTK::CommonCore
  PUBLIC
    cxx_std_11
    cxx_nullptr
    cxx_override)
```

There is an open CMake issue about handling future standards:

  https://gitlab.kitware.com/cmake/cmake/issues/17146#note_300071

Lacking a full solution in CMake, VTK could gain an option to not
specify these feature requirements.

-Brad
_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK forces -std=c++11 ?

VTK - Dev mailing list
Adding an option to VTK to not specify these features will also need to be propagated to all thirdpary libraries that use things such as `cxx_std_11` ( aka VTK-m ).



On Fri, Jan 11, 2019 at 3:04 PM Brad King via vtk-developers <[hidden email]> wrote:
On 1/11/19 2:59 PM, Sean McBride wrote:
> In cmake I set CMAKE_CXX_FLAGS to "-std=c++2a" but when I do "make VERBOSE=1"
> I see that something is passing -std=c++11:
>
> Is this a bug?  If not, how do I specify the language variant?

It's likely CMake adding it based on Common/Core/CMakeLists.txt:

```
vtk_module_compile_features(VTK::CommonCore
  PUBLIC
    cxx_std_11
    cxx_nullptr
    cxx_override)
```

There is an open CMake issue about handling future standards:

  https://gitlab.kitware.com/cmake/cmake/issues/17146#note_300071

Lacking a full solution in CMake, VTK could gain an option to not
specify these feature requirements.

-Brad
_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers


_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK forces -std=c++11 ?

Sean McBride
In reply to this post by VTK - Dev mailing list
On Fri, 11 Jan 2019 15:04:21 -0500, Brad King said:

>On 1/11/19 2:59 PM, Sean McBride wrote:
>> In cmake I set CMAKE_CXX_FLAGS to "-std=c++2a" but when I do "make
>VERBOSE=1"
>> I see that something is passing -std=c++11:
>>
>> Is this a bug?  If not, how do I specify the language variant?
>
>It's likely CMake adding it based on Common/Core/CMakeLists.txt:
>
>```
>vtk_module_compile_features(VTK::CommonCore
>  PUBLIC
>    cxx_std_11
>    cxx_nullptr
>    cxx_override)
>```
>
>There is an open CMake issue about handling future standards:
>
>  https://gitlab.kitware.com/cmake/cmake/issues/17146#note_300071

It doesn't seem to matter that I've specified a 'future standard', even if I use -std=c++14 I get:

cd /Users/sean/external/VTK-8bin/Utilities/KWIML/vtkkwiml/test && /Users/sean/llvm/llvm-rel-install/bin/clang++  -DKWIML_LANGUAGE_C -DKWIML_LANGUAGE_CXX -DVTK_IN_VTK -I/Users/sean/external/VTK-8bin/Utilities/KWIML -I/Users/sean/external/VTK/Utilities/KWIML  -std=c++14  -g   -std=c++11 -o CMakeFiles/kwiml_test.dir/test_include_CXX.cxx.o -c /Users/sean/external/VTK/Utilities/KWIML/vtkkwiml/test/test_include_CXX.cxx

Sean


_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK forces -std=c++11 ?

Sean McBride
In reply to this post by VTK - Dev mailing list
On Fri, 11 Jan 2019 15:04:21 -0500, Brad King said:

>It's likely CMake adding it based on Common/Core/CMakeLists.txt:
>
>```
>vtk_module_compile_features(VTK::CommonCore
>  PUBLIC
>    cxx_std_11
>    cxx_nullptr
>    cxx_override)
>```

So all this time I thought some of my bots were building as C++11, some C++14, some C++17, I have in fact been doing no such thing. :(

As a hack, I did a global replace of cxx_std_11 with cxx_std_14/17, and it turns out VTK 8.2 doesn't even build as either:

ThirdParty/lz4/vtklz4/lib/lz4.h:439:12: error: an attribute list cannot appear here
LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_default() instead") int LZ4_compress               (const char* source, char* dest, int sourceSize);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Filters/Core/vtkCellDataToPointData.cxx:85:31: error: no member named 'bind2nd' in namespace 'std'
                         std::bind2nd(std::divides<T>(), denom));
                         ~~~~~^

IO/XML/vtkXMLReader.cxx:1002:39: error: no member named 'ptr_fun' in namespace 'std'
                       std::not1(std::ptr_fun<int, int>(isspace))));
                                 ~~~~~^

Filters/FlowPaths/vtkTemporalStreamTracer.cxx:301:12: error: no member named 'bind2nd' in namespace 'std'
      std::bind2nd( WithinTolerance( ), requestedTimeValue ))
      ~~~~~^

Sean


_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK forces -std=c++11 ?

Elvis Stansvik
In reply to this post by Sean McBride
Den fre 11 jan. 2019 kl 21:14 skrev Sean McBride <[hidden email]>:

>
> On Fri, 11 Jan 2019 15:04:21 -0500, Brad King said:
>
> >On 1/11/19 2:59 PM, Sean McBride wrote:
> >> In cmake I set CMAKE_CXX_FLAGS to "-std=c++2a" but when I do "make
> >VERBOSE=1"
> >> I see that something is passing -std=c++11:
> >>
> >> Is this a bug?  If not, how do I specify the language variant?
> >
> >It's likely CMake adding it based on Common/Core/CMakeLists.txt:
> >
> >```
> >vtk_module_compile_features(VTK::CommonCore
> >  PUBLIC
> >    cxx_std_11
> >    cxx_nullptr
> >    cxx_override)
> >```
> >
> >There is an open CMake issue about handling future standards:
> >
> >  https://gitlab.kitware.com/cmake/cmake/issues/17146#note_300071
>
> It doesn't seem to matter that I've specified a 'future standard', even if I use -std=c++14 I get:
>
> cd /Users/sean/external/VTK-8bin/Utilities/KWIML/vtkkwiml/test && /Users/sean/llvm/llvm-rel-install/bin/clang++  -DKWIML_LANGUAGE_C -DKWIML_LANGUAGE_CXX -DVTK_IN_VTK -I/Users/sean/external/VTK-8bin/Utilities/KWIML -I/Users/sean/external/VTK/Utilities/KWIML  -std=c++14  -g   -std=c++11 -o CMakeFiles/kwiml_test.dir/test_include_CXX.cxx.o -c /Users/sean/external/VTK/Utilities/KWIML/vtkkwiml/test/test_include_CXX.cx,

Just a wild guess, try -DCMAKE_CXX_STANDARD=14 instead of
-DCMAKE_CXX_FLAGS="-std=c++14"? Maybe CMake will consider
CMAKE_CXX_STANDARD=14 as having the cxx_std_11 compile feature and not
"downgrade" you?

Elvis

>
> Sean
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>
_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK forces -std=c++11 ?

VTK - Dev mailing list
On 1/11/19 6:56 PM, Elvis Stansvik wrote:
> Just a wild guess, try -DCMAKE_CXX_STANDARD=14 instead of
> -DCMAKE_CXX_FLAGS="-std=c++14"? Maybe CMake will consider
> CMAKE_CXX_STANDARD=14 as having the cxx_std_11 compile feature and not
> "downgrade" you?

Yes, that is the intended way.  I should have mentioned it.
The CMake issue I linked is about support for standards that
CMake does not yet know about, but CMake already has C++20.

-Brad
_______________________________________________
Powered by www.kitware.com

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

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers