How to build with c++11 flag?

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

How to build with c++11 flag?

Jerry Jin
Hello QuantLib community

I'm building my project on QuantLib1.7.1 QuantLibAddin 1.7

On Windows, everything is fine, my code can be compiled and run.

But on Mac, compile passed, on running, there 'Bus error 10', and when I debug, it points to 'libQuantLib.0.dylib','boost::math::lanczos::lanczos17m64' with 'EXEC_BAD_ACCESS' error.

I googled around, it seems it has something to do with CXXFLAGS

The thing is my project depends on another library which uses c++11 on Mac and Linux, but not on Windows. So on Mac and Linux, I have to use c++11 flag.

What are my options in this situation? 

Thanks!

Regards
Jerry

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to build with c++11 flag?

Peter Caspers-4
Hi Jerry,

I think compiling QuantLib with C++11 will solve the boost issue, i.e.
configure it with something like

./configure CXXFLAGS="-std=c++11 -g -O2 -Wno-deprecated-declarations"
(... your other options, if any ...)

The last flag silences a lot of warnings showing up because auto_ptr
is deprecated in C++11.

Also, here are two links which might be of interest for you in this context.

http://quantlib.10058.n7.nabble.com/c-0x-td14280.html
https://sourceforge.net/p/quantlib/mailman/message/33394785/

Best Regards
Peter

On 9 July 2016 at 15:50, Jerry Jin <[hidden email]> wrote:

> Hello QuantLib community
>
> I'm building my project on QuantLib1.7.1 QuantLibAddin 1.7
>
> On Windows, everything is fine, my code can be compiled and run.
>
> But on Mac, compile passed, on running, there 'Bus error 10', and when I
> debug, it points to
> 'libQuantLib.0.dylib','boost::math::lanczos::lanczos17m64' with
> 'EXEC_BAD_ACCESS' error.
>
> I googled around, it seems it has something to do with CXXFLAGS
>
> The thing is my project depends on another library which uses c++11 on Mac
> and Linux, but not on Windows. So on Mac and Linux, I have to use c++11
> flag.
>
> What are my options in this situation?
>
> Thanks!
>
> Regards
> Jerry
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to build with c++11 flag?

Jerry Jin
Thanks a lot Peter!

I followed your instructions and re-compiled QuantLib, now I can run my project on Mac with no error.

I read some google search result regarding this, and changed CXXFLAGS  to -stdlib=libc++
The configure step passed, but there was error at compile

Thanks again!

Regards
Jerry

On Sun, Jul 10, 2016 at 8:42 PM, Peter Caspers <[hidden email]> wrote:
Hi Jerry,

I think compiling QuantLib with C++11 will solve the boost issue, i.e.
configure it with something like

./configure CXXFLAGS="-std=c++11 -g -O2 -Wno-deprecated-declarations"
(... your other options, if any ...)

The last flag silences a lot of warnings showing up because auto_ptr
is deprecated in C++11.

Also, here are two links which might be of interest for you in this context.

http://quantlib.10058.n7.nabble.com/c-0x-td14280.html
https://sourceforge.net/p/quantlib/mailman/message/33394785/

Best Regards
Peter

On 9 July 2016 at 15:50, Jerry Jin <[hidden email]> wrote:
> Hello QuantLib community
>
> I'm building my project on QuantLib1.7.1 QuantLibAddin 1.7
>
> On Windows, everything is fine, my code can be compiled and run.
>
> But on Mac, compile passed, on running, there 'Bus error 10', and when I
> debug, it points to
> 'libQuantLib.0.dylib','boost::math::lanczos::lanczos17m64' with
> 'EXEC_BAD_ACCESS' error.
>
> I googled around, it seems it has something to do with CXXFLAGS
>
> The thing is my project depends on another library which uses c++11 on Mac
> and Linux, but not on Windows. So on Mac and Linux, I have to use c++11
> flag.
>
> What are my options in this situation?
>
> Thanks!
>
> Regards
> Jerry
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to build with c++11 flag?

Peter Caspers-4
That’s great, Jerry. If you have another minute, please fill the poll about your MSVC version here


Kind Regards
Peter

On 10 Jul 2016, at 17:23, Jerry Jin <[hidden email]> wrote:

Thanks a lot Peter!

I followed your instructions and re-compiled QuantLib, now I can run my project on Mac with no error.

I read some google search result regarding this, and changed CXXFLAGS  to -stdlib=libc++
The configure step passed, but there was error at compile

Thanks again!

Regards
Jerry

On Sun, Jul 10, 2016 at 8:42 PM, Peter Caspers <[hidden email]> wrote:
Hi Jerry,

I think compiling QuantLib with C++11 will solve the boost issue, i.e.
configure it with something like

./configure CXXFLAGS="-std=c++11 -g -O2 -Wno-deprecated-declarations"
(... your other options, if any ...)

The last flag silences a lot of warnings showing up because auto_ptr
is deprecated in C++11.

Also, here are two links which might be of interest for you in this context.

http://quantlib.10058.n7.nabble.com/c-0x-td14280.html
https://sourceforge.net/p/quantlib/mailman/message/33394785/

Best Regards
Peter

On 9 July 2016 at 15:50, Jerry Jin <[hidden email]> wrote:
> Hello QuantLib community
>
> I'm building my project on QuantLib1.7.1 QuantLibAddin 1.7
>
> On Windows, everything is fine, my code can be compiled and run.
>
> But on Mac, compile passed, on running, there 'Bus error 10', and when I
> debug, it points to
> 'libQuantLib.0.dylib','boost::math::lanczos::lanczos17m64' with
> 'EXEC_BAD_ACCESS' error.
>
> I googled around, it seems it has something to do with CXXFLAGS
>
> The thing is my project depends on another library which uses c++11 on Mac
> and Linux, but not on Windows. So on Mac and Linux, I have to use c++11
> flag.
>
> What are my options in this situation?
>
> Thanks!
>
> Regards
> Jerry
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to build with c++11 flag?

Jerry Jin
Hi Peter

I already did the other day, I'm using VS2012 for windows project, XCode 5 on Mac, gcc that comes with centos 7

Regards
Jerry

On Sun, Jul 10, 2016 at 11:48 PM, Peter Caspers <[hidden email]> wrote:
That’s great, Jerry. If you have another minute, please fill the poll about your MSVC version here


Kind Regards
Peter


On 10 Jul 2016, at 17:23, Jerry Jin <[hidden email]> wrote:

Thanks a lot Peter!

I followed your instructions and re-compiled QuantLib, now I can run my project on Mac with no error.

I read some google search result regarding this, and changed CXXFLAGS  to -stdlib=libc++
The configure step passed, but there was error at compile

Thanks again!

Regards
Jerry

On Sun, Jul 10, 2016 at 8:42 PM, Peter Caspers <[hidden email]> wrote:
Hi Jerry,

I think compiling QuantLib with C++11 will solve the boost issue, i.e.
configure it with something like

./configure CXXFLAGS="-std=c++11 -g -O2 -Wno-deprecated-declarations"
(... your other options, if any ...)

The last flag silences a lot of warnings showing up because auto_ptr
is deprecated in C++11.

Also, here are two links which might be of interest for you in this context.

http://quantlib.10058.n7.nabble.com/c-0x-td14280.html
https://sourceforge.net/p/quantlib/mailman/message/33394785/

Best Regards
Peter

On 9 July 2016 at 15:50, Jerry Jin <[hidden email]> wrote:
> Hello QuantLib community
>
> I'm building my project on QuantLib1.7.1 QuantLibAddin 1.7
>
> On Windows, everything is fine, my code can be compiled and run.
>
> But on Mac, compile passed, on running, there 'Bus error 10', and when I
> debug, it points to
> 'libQuantLib.0.dylib','boost::math::lanczos::lanczos17m64' with
> 'EXEC_BAD_ACCESS' error.
>
> I googled around, it seems it has something to do with CXXFLAGS
>
> The thing is my project depends on another library which uses c++11 on Mac
> and Linux, but not on Windows. So on Mac and Linux, I have to use c++11
> flag.
>
> What are my options in this situation?
>
> Thanks!
>
> Regards
> Jerry
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>




------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users