Unable to evaluate clang on linux or windows

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

Unable to evaluate clang on linux or windows

C K Kashyap
Hi,
I'd like to try out the new c++11 features using clang. However, I am running into some issue or the other on both Windows and Linux. In both cases, it looks like the problem is due to headers from VC/g++.
I was wondering if someone can point me to some steps on setting up a Windows or Linux(ubuntu 12.04 LTS) box for exploring clang.
I was able to successfully build clang on my ubuntu but that did not help in building my sample CPP files.
Regards,
Kashyap

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to evaluate clang on linux or windows

Ben Pope
On 15/10/13 22:22, C K Kashyap wrote:
> Hi,
> I'd like to try out the new c++11 features using clang. However, I am
> running into some issue or the other on both Windows and Linux. In both
> cases, it looks like the problem is due to headers from VC/g++.
> I was wondering if someone can point me to some steps on setting up a
> Windows or Linux(ubuntu 12.04 LTS) box for exploring clang.
> I was able to successfully build clang on my ubuntu but that did not
> help in building my sample CPP files.

It might help if you give us the compiler error and version of clang
you've compiled.

I can compile C++ programs with libstdc++ or libc++ without issue.

Windows support is experimental at the moment, so let's stick with
Ubuntu for now.

Ben


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to evaluate clang on linux or windows

C K Kashyap
Sorry ... I missed mentioning the details - 

this is the error I get - 

root@no1slu398:~/Documents/LLVM/tmp# clang++ -std=c++0x  hello.cpp
In file included from hello.cpp:1:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/thread:38:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:535:6: error: no matching constructor for initialization of 'duration' (aka
      'std::chrono::duration<long, std::ratio<1, 1000000> >')
          : __d(__t.time_since_epoch())
            ^   ~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/condition_variable:106:42: note: in instantiation of function template specialization
      'std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long, std::ratio<1, 1000000> > >::time_point<std::chrono::duration<long,
      std::ratio<1, 1000000000> > >' requested here
        const __clock_t::time_point __s_atime = __s_entry + __delta;
                                                ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:234:12: note: candidate constructor not viable: no known conversion from
      'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st argument
        constexpr duration(const duration&) = default;
                  ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:237:19: note: candidate template ignored: disabled by 'enable_if' [with _Rep2 =
      std::chrono::duration<long, std::ratio<1, 1000000000> >]
               enable_if<is_convertible<_Rep2, rep>::value
                         ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:244:19: note: candidate template ignored: disabled by 'enable_if' [with _Rep2 = long, _Period2
      = std::ratio<1, 1000000000>]
               enable_if<treat_as_floating_point<rep>::value
                         ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:232:12: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        constexpr duration() : __r() { }
                  ^
1 error generated.
root@no1slu398:~/Documents/LLVM/tmp# cat hello.cpp
#include <thread>

int main() {
  return 0;
}


Regards,
Kashyap



On Wed, Oct 16, 2013 at 7:40 AM, Ben Pope <[hidden email]> wrote:
On 15/10/13 22:22, C K Kashyap wrote:
> Hi,
> I'd like to try out the new c++11 features using clang. However, I am
> running into some issue or the other on both Windows and Linux. In both
> cases, it looks like the problem is due to headers from VC/g++.
> I was wondering if someone can point me to some steps on setting up a
> Windows or Linux(ubuntu 12.04 LTS) box for exploring clang.
> I was able to successfully build clang on my ubuntu but that did not
> help in building my sample CPP files.

It might help if you give us the compiler error and version of clang
you've compiled.

I can compile C++ programs with libstdc++ or libc++ without issue.

Windows support is experimental at the moment, so let's stick with
Ubuntu for now.

Ben


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to evaluate clang on linux or windows

C K Kashyap
Hi,
I'd really appreciate some pointers in this regard.
Regards,
Kashyap


On Wed, Oct 16, 2013 at 5:43 PM, C K Kashyap <[hidden email]> wrote:
Sorry ... I missed mentioning the details - 

this is the error I get - 

root@no1slu398:~/Documents/LLVM/tmp# clang++ -std=c++0x  hello.cpp
In file included from hello.cpp:1:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/thread:38:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:535:6: error: no matching constructor for initialization of 'duration' (aka
      'std::chrono::duration<long, std::ratio<1, 1000000> >')
          : __d(__t.time_since_epoch())
            ^   ~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/condition_variable:106:42: note: in instantiation of function template specialization
      'std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long, std::ratio<1, 1000000> > >::time_point<std::chrono::duration<long,
      std::ratio<1, 1000000000> > >' requested here
        const __clock_t::time_point __s_atime = __s_entry + __delta;
                                                ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:234:12: note: candidate constructor not viable: no known conversion from
      'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st argument
        constexpr duration(const duration&) = default;
                  ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:237:19: note: candidate template ignored: disabled by 'enable_if' [with _Rep2 =
      std::chrono::duration<long, std::ratio<1, 1000000000> >]
               enable_if<is_convertible<_Rep2, rep>::value
                         ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:244:19: note: candidate template ignored: disabled by 'enable_if' [with _Rep2 = long, _Period2
      = std::ratio<1, 1000000000>]
               enable_if<treat_as_floating_point<rep>::value
                         ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:232:12: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        constexpr duration() : __r() { }
                  ^
1 error generated.
root@no1slu398:~/Documents/LLVM/tmp# cat hello.cpp
#include <thread>

int main() {
  return 0;
}


Regards,
Kashyap



On Wed, Oct 16, 2013 at 7:40 AM, Ben Pope <[hidden email]> wrote:
On 15/10/13 22:22, C K Kashyap wrote:
> Hi,
> I'd like to try out the new c++11 features using clang. However, I am
> running into some issue or the other on both Windows and Linux. In both
> cases, it looks like the problem is due to headers from VC/g++.
> I was wondering if someone can point me to some steps on setting up a
> Windows or Linux(ubuntu 12.04 LTS) box for exploring clang.
> I was able to successfully build clang on my ubuntu but that did not
> help in building my sample CPP files.

It might help if you give us the compiler error and version of clang
you've compiled.

I can compile C++ programs with libstdc++ or libc++ without issue.

Windows support is experimental at the moment, so let's stick with
Ubuntu for now.

Ben


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to evaluate clang on linux or windows

James Courtier-Dutton-4
I think there might be something wrong with your installation.

clang++ -std=c++0x hello.cpp
clang++ -std=c++11 hello.cpp

Both works fine here and creates an exe a.out
Which version of clang/llvm are you using?




On 18 October 2013 13:33, C K Kashyap <[hidden email]> wrote:
Hi,
I'd really appreciate some pointers in this regard.
Regards,
Kashyap


On Wed, Oct 16, 2013 at 5:43 PM, C K Kashyap <[hidden email]> wrote:
Sorry ... I missed mentioning the details - 

this is the error I get - 

root@no1slu398:~/Documents/LLVM/tmp# clang++ -std=c++0x  hello.cpp
In file included from hello.cpp:1:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/thread:38:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:535:6: error: no matching constructor for initialization of 'duration' (aka
      'std::chrono::duration<long, std::ratio<1, 1000000> >')
          : __d(__t.time_since_epoch())
            ^   ~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/condition_variable:106:42: note: in instantiation of function template specialization
      'std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long, std::ratio<1, 1000000> > >::time_point<std::chrono::duration<long,
      std::ratio<1, 1000000000> > >' requested here
        const __clock_t::time_point __s_atime = __s_entry + __delta;
                                                ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:234:12: note: candidate constructor not viable: no known conversion from
      'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st argument
        constexpr duration(const duration&) = default;
                  ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:237:19: note: candidate template ignored: disabled by 'enable_if' [with _Rep2 =
      std::chrono::duration<long, std::ratio<1, 1000000000> >]
               enable_if<is_convertible<_Rep2, rep>::value
                         ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:244:19: note: candidate template ignored: disabled by 'enable_if' [with _Rep2 = long, _Period2
      = std::ratio<1, 1000000000>]
               enable_if<treat_as_floating_point<rep>::value
                         ^
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/chrono:232:12: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        constexpr duration() : __r() { }
                  ^
1 error generated.
root@no1slu398:~/Documents/LLVM/tmp# cat hello.cpp
#include <thread>

int main() {
  return 0;
}


Regards,
Kashyap



On Wed, Oct 16, 2013 at 7:40 AM, Ben Pope <[hidden email]> wrote:
On 15/10/13 22:22, C K Kashyap wrote:
> Hi,
> I'd like to try out the new c++11 features using clang. However, I am
> running into some issue or the other on both Windows and Linux. In both
> cases, it looks like the problem is due to headers from VC/g++.
> I was wondering if someone can point me to some steps on setting up a
> Windows or Linux(ubuntu 12.04 LTS) box for exploring clang.
> I was able to successfully build clang on my ubuntu but that did not
> help in building my sample CPP files.

It might help if you give us the compiler error and version of clang
you've compiled.

I can compile C++ programs with libstdc++ or libc++ without issue.

Windows support is experimental at the moment, so let's stick with
Ubuntu for now.

Ben


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to evaluate clang on linux or windows

Óscar Fuentes
In reply to this post by C K Kashyap
C K Kashyap <[hidden email]> writes:

> I'd really appreciate some pointers in this regard.

Possibly gcc 4.6 libstdc++ is incompatible with Clang's C++11 mode. I
remember having problems with Clang, C++11 and libstdc++ until some
Kubuntu release "fixed" them.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Unable to evaluate clang on linux or windows

Richard Smith-33
[Dropping llvmdev via BCC, moving to cfe-dev]

This is a bug in libstdc++. More information and a patch to fix it here: http://gcc.gnu.org/PR53841


On Fri, Oct 18, 2013 at 7:24 AM, Óscar Fuentes <[hidden email]> wrote:
C K Kashyap <[hidden email]> writes:

> I'd really appreciate some pointers in this regard.

Possibly gcc 4.6 libstdc++ is incompatible with Clang's C++11 mode. I
remember having problems with Clang, C++11 and libstdc++ until some
Kubuntu release "fixed" them.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev