Re: [cmake-developers] [CMake] libc++ usage in CMake with Clang?

2018-08-21 Thread Ian Henriksen
On Tue, Aug 21, 2018 at 6:40 PM Craig Scott  wrote:

>
> On Wed, Aug 22, 2018 at 7:18 AM, Robert Dailey 
> wrote:
>
>> On Tue, Aug 21, 2018 at 3:47 PM Craig Scott 
>> wrote:
>> > Excuse the brevity, but it sounds like you might be looking for the
>> CXX_EXTENSIONS target property (sorry if I've misunderstood your problem,
>> let me know why it isn't appropriate if so). See the following article for
>> a more complete overview of this and related properties:
>> >
>> > https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/
>>
>> Unfortunately that's not the same. Extensions manage C++ language
>> features and STL capabilities, but -stdlib is for selecting an STL
>> implementation, AFAIK. Such as GNU STL and LLVM STL (which is libc++
>> to clang).
>>
>
> Sorry, yes I misunderstood your problem. After a little digging, it seems
> like you probably shouldn't be using the -stdlib option on Linux
>  anyway. FWIW, for Android,
> the roadmap
> 
> is converging on a single STL implementation too.
>

All that first link says is that -stdlib is a flag that is specific to
clang and that it shouldn't be used with gcc. You can use clang on Linux
with either libstdc++ or libc++. I often use libc++ on Linux by setting
CMAKE_CXX_FLAGS on the command line, though I'll admit that for me it's
usually just to check if problems that come up are OS dependent, compiler
dependent, or standard library dependent. You have to be careful since
libstdc++ and libc++ have incompatible ABIs, but it's a useful feature.
That said, I have no idea if specifying the standard library implementation
merits handling at the CMake level since only clang supports switching
anyway.

Just my two cents though.

Best,

Ian


> Regarding your earlier comment:
>
> I'll explain a bit why I'm asking. I noticed that for code bases that
>> work on Android plus other UNIX platforms, they unconditionally
>> specify `-stdlib=libc++`, however this doesn't work on Ubuntu by
>> default, which uses gnu stl + gcc/clang. So  you get compiler errors.
>> There's no way for me to "search" a platform to see if it is eligible
>> for the libc++ flag, I simply have to either disable it completely or
>> conditionally include it based on target platform and/or toolchain.
>> None of these really address the root cause.
>
> If you are trying to control which STL to use for Android builds, CMake 
> variables like CMAKE_ANDROID_STL_TYPE are probably the more appropriate way 
> to do that rather than hard-coding compiler flags. This would also mean that 
> non-Android builds won't be affected since they would simply ignore that 
> variable (and target properties it may affect) and should then pick up the 
> right STL implementation automatically.The Android-specific variable would 
> ideally be set in a toolchain file rather than in the project itself.
>
>
> --
>
> Craig Scott
> Melbourne, Australia
> https://crascit.com
>
> New book released: 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
>
-- 

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-developers


Re: [cmake-developers] [CMake] Need ideas/opinions on third party library management

2016-08-13 Thread Ian Henriksen
On Sat, Aug 13, 2016 at 6:43 PM Elizabeth A. Fischer <
elizabeth.fisc...@columbia.edu> wrote:

> I would look into Anaconda, which does work for Windows.  Its version
> management is not as well developed as Spack, but it's more cross-platform.
>
> Auto-builders are just coming into their own, it's a brave new world.  I
> expect things to be more complete in a few years.
>
> -- Elizabeth
>
>
Yes, Anaconda comes with a package manager (conda) that is designed to
manage binary dependencies. You can get a minimal Python install with just
the
package manager by installing miniconda. The package management system is
built in Python, but it can manage C and C++ libraries as well. The support
for
ARM isn't thoroughly built out, so you'll be building all the packages
there for
yourself. The support for Windwos, OS X and Linux is pretty well developed.
You
can look at https://repo.continuum.io/pkgs/ to see the packages available by
default. There is also support for people uploading their own "channels" for
packages on anaconda.org. The conda-forge channel in particular has a lot of
additional packages.
Hopefully that's more like what you're looking for.
Best,
Ian Henriksen
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Question related to Visual Studio 14 2015 [MyTarget]

2016-02-09 Thread Ian Henriksen
On Tue, Feb 9, 2016 at 10:15 AM Gilles Khouzam <gilles.khou...@microsoft.com>
wrote:

> I'm trying to understand what is necessary to make this work. I'll circle
> back when I find out more information.
>
> -Original Message-
> From: Brad King [mailto:brad.k...@kitware.com]
> Sent: Monday, February 8, 2016 10:32
> To: Yi-Hong Lyu <b95705...@ntu.edu.tw>
> Cc: cmake-developers@cmake.org; Gilles Khouzam <
> gilles.khou...@microsoft.com>
> Subject: Re: [cmake-developers] Question related to Visual Studio 14 2015
> [MyTarget]
>
> On 02/05/2016 02:41 PM, Yi-Hong Lyu wrote:
> > 1. What I need to do is to add an option MyTarget for arch of "Visual
> > Studio 14 2015 [arch]", just like "Visual Studio 14 2015 [Win64]"
> > or "Visual Studio 14 2015 [ARM]"?
>
> Naming the architecture as part of the generator name is a legacy behavior.
> See the "-A " option.
>
> > 2. How can I support cl.exe and clang-cl.exe by Visual Studio 14 2015
> [MyTarget]"?
> > Should I add options cl.exe/clang-cl.exe for toolset-name of "-T
> "?
>
> The -T option is indeed the CMake side of it.  I'm not familiar with what
> else has to be done on the host to make VS understand the toolset name
> though.
>
> > 3. Is there any way to make sure that all x86/x64 headers/libraries are
> not included/linked?
> > I'd like only include/link headers/libraries of MyTarget.
>
> CMake doesn't add any system include directories or link directories.  For
> command line builds those need to be part of the environment.  For VS IDE
> builds they are made available by the IDE when running the toolchain based
> on the options discussed above.
>

I've been experimenting with this lately. When building with NMake, adding
the
flag "-fms-compatibility-version=19.00.23506" got clang to act like the
right version
of MSVC. MSVC 2013 is the default right now.
When building with the generator "Visual Studio 14 2015 Win64", adding the
toolset
flag "-TLLVM-vs2014" got clang to work.
https://github.com/boostorg/hana/wiki/Setting-up-Clang-on-Windows was really
helpful in figuring some of this out.
All that aside, seamless interaction between clang-cl and MSVC 2015 is
definitely
still a work in progress.

Best,
-Ian Henriksen


>
> -Brad
>
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Fixing compilation with MinGW-W64

2015-04-22 Thread Ian Henriksen
On Wed, Apr 22, 2015 at 8:23 AM Brad King brad.k...@kitware.com wrote:

 On 04/21/2015 10:13 PM, Ian Henriksen wrote:
  There was an old thread 
 http://public.kitware.com/pipermail/cmake-developers/2014-November/023743.html
 from November of last year discussing fixes for
  compilation with MinGW-W64. As far as I can tell, no patch was ever
  merged. Here's a patch against the current master that fixes the issue.

 Thanks.  I've committed a more local fix:

  cmGeneratorExpressionEvaluationFile: Add missing sys/types.h include
  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c775072a

 We are able to officially support only platforms for which nightly testing
 is available.  Would you be able to run nightly testing for this platform
 as discussed in that thread?

 Thanks,
 -Brad


Thanks for getting that in.
I'm currently a student and don't have the resources to guarantee that a
build is run consistently for that. That said, I'm happy to send back
patches when I find any bugs I can fix.
Thanks!
-Ian
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

[cmake-developers] Fixing compilation with MinGW-W64

2015-04-21 Thread Ian Henriksen
Hi all,
There was an old thread
http://public.kitware.com/pipermail/cmake-developers/2014-November/023743.html
from November of last year discussing fixes for
compilation with MinGW-W64. As far as I can tell, no patch was ever
merged. Here's a patch against the current master that fixes the issue.
Thanks!
-Ian Henriksen


fix_mingw64_compile.patch
Description: Binary data
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers