How to enable c++11 in a llvm project?

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

How to enable c++11 in a llvm project?

liuml07
Hi,

I'm using the latest LLVM (r168491) built by GCC 4.7.2 (Gentoo masked version). The clang++ runs as expected when I compile a hello program with c++11 enabled.

I created a project (copied from sample/) where there are some C++ source files with c++11 features.  I configured my project using the following command:
$ CXXFLAGS="-std=c++11" ../configure --enable-cxx11
However, I found that the clang++ did not build my project with the "-std=c++" option[1].

Could anyone kindly show me how to enable C++11 in a LLVM project, please?

Thank you.
Miangliang.

[1] I get the detailed options building my project using 'make VERBOSE=1'
--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]


_______________________________________________
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: How to enable c++11 in a llvm project?

liuml07
Hi,

I use the following line to configure, which can enable the c++11 in the project building. However, I don't think it's an elegant way to do the trick.
$ CXX="clang++ -std=c++11" ../configure

I don't know why "-enable-cxx11" doesn't work as expected when I configure the project.

Regards.


On Mon, Nov 26, 2012 at 7:34 PM, Mingliang LIU <[hidden email]> wrote:
Hi,

I'm using the latest LLVM (r168491) built by GCC 4.7.2 (Gentoo masked version). The clang++ runs as expected when I compile a hello program with c++11 enabled.

I created a project (copied from sample/) where there are some C++ source files with c++11 features.  I configured my project using the following command:
$ CXXFLAGS="-std=c++11" ../configure --enable-cxx11
However, I found that the clang++ did not build my project with the "-std=c++" option[1].

Could anyone kindly show me how to enable C++11 in a LLVM project, please?

Thank you.
Miangliang.

[1] I get the detailed options building my project using 'make VERBOSE=1'
--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]




--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]


_______________________________________________
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: How to enable c++11 in a llvm project?

Craig Topper
I've added the missing magic to Makefile.llvm.rules in r168685.

On Tue, Nov 27, 2012 at 12:05 AM, Mingliang LIU <[hidden email]> wrote:
Hi,

I use the following line to configure, which can enable the c++11 in the project building. However, I don't think it's an elegant way to do the trick.
$ CXX="clang++ -std=c++11" ../configure

I don't know why "-enable-cxx11" doesn't work as expected when I configure the project.

Regards.


On Mon, Nov 26, 2012 at 7:34 PM, Mingliang LIU <[hidden email]> wrote:
Hi,

I'm using the latest LLVM (r168491) built by GCC 4.7.2 (Gentoo masked version). The clang++ runs as expected when I compile a hello program with c++11 enabled.

I created a project (copied from sample/) where there are some C++ source files with c++11 features.  I configured my project using the following command:
$ CXXFLAGS="-std=c++11" ../configure --enable-cxx11
However, I found that the clang++ did not build my project with the "-std=c++" option[1].

Could anyone kindly show me how to enable C++11 in a LLVM project, please?

Thank you.
Miangliang.

[1] I get the detailed options building my project using 'make VERBOSE=1'
--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]




--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]


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




--
~Craig

_______________________________________________
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: How to enable c++11 in a llvm project?

liuml07
Hi Craig,

It works! Thank you very much.

Mingliang


On Tue, Nov 27, 2012 at 4:13 PM, Craig Topper <[hidden email]> wrote:
I've added the missing magic to Makefile.llvm.rules in r168685.

On Tue, Nov 27, 2012 at 12:05 AM, Mingliang LIU <[hidden email]> wrote:
Hi,

I use the following line to configure, which can enable the c++11 in the project building. However, I don't think it's an elegant way to do the trick.
$ CXX="clang++ -std=c++11" ../configure

I don't know why "-enable-cxx11" doesn't work as expected when I configure the project.

Regards.


On Mon, Nov 26, 2012 at 7:34 PM, Mingliang LIU <[hidden email]> wrote:
Hi,

I'm using the latest LLVM (r168491) built by GCC 4.7.2 (Gentoo masked version). The clang++ runs as expected when I compile a hello program with c++11 enabled.

I created a project (copied from sample/) where there are some C++ source files with c++11 features.  I configured my project using the following command:
$ CXXFLAGS="-std=c++11" ../configure --enable-cxx11
However, I found that the clang++ did not build my project with the "-std=c++" option[1].

Could anyone kindly show me how to enable C++11 in a LLVM project, please?

Thank you.
Miangliang.

[1] I get the detailed options building my project using 'make VERBOSE=1'
--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]




--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]


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




--
~Craig



--
Mingliang LIU (刘明亮 in Chinese)

PACMAN Group,  Dept. of Computer Science & Technology
Tsinghua University, Beijing 100084, China
Email: [hidden email]


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