boost

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

boost

ravas
Download boost 1.53 from: boost download. Do not try version 1.54, 1.55 or 1.56 (there are compilation errors as of 12 Oct 2014).
http://wiki.librecad.org/index.php/LibreCAD_Installation_from_Source#Custom_files

I'm curious: has anyone tried building with boost 1.6?
Reply | Threaded
Open this post in threaded view
|

Re: boost

dxli
just tested on my Gentoo, not problem with boost-1.60.0

ravas wrote
Download boost 1.53 from: boost download. Do not try version 1.54, 1.55 or 1.56 (there are compilation errors as of 12 Oct 2014).
http://wiki.librecad.org/index.php/LibreCAD_Installation_from_Source#Custom_files

I'm curious: has anyone tried building with boost 1.6?
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
 Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: boost

dxli
need to figure out why there's a boost problem (1.54.0 and after) on win32

ravas wrote
 Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
I downloaded 1.6 and unzipped it in the same folder as 1.53
then went to custom.pro to find it unedited... so I'm not sure how the boost version is determined.
It built a working installer; however I don't know what version of boost it used (I did edit custom.pro to indicate 1.6).
Reply | Threaded
Open this post in threaded view
|

Re: boost

dxli
better to unzip it to an empty folder.

for example:

for example after unzipping it:

you have something similar to:

~/tmp/boost/boost_1_60_0/boost/version.hpp

for *nix, I found the scripts are looking for: include/boost/version.hpp

then, I rename the folder structure to:

~/tmp/boost/include/boost/version.hpp

to specify boost header location:

specify the variable BOOST_DIR in custom.pri

BOOST_DIR=/home/dli/tmp/boost/






ravas wrote
I downloaded 1.6 and unzipped it in the same folder as 1.53
then went to custom.pro to find it unedited... so I'm not sure how the boost version is determined.
It built a working installer; however I don't know what version of boost it used (I did edit custom.pro to indicate 1.6).
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
Thanks.

I found boost.pri

win32 {

    exists( "$$(BOOST_DIR)" ) { # Is it set in the environment?
        BOOST_DIR = "$$(BOOST_DIR)" # Yes, use
    } else:isEmpty( BOOST_DIR ) { # Is it set in custom.pro?
        BOOST_DIR = "/boost/boost_1_53_0" # No, hardcode
    }

    !exists( "$${BOOST_DIR}/boost/version.hpp" ) {
        error( "Can not find Boost installation in $${BOOST_DIR}" )
    }

    BOOST_INCDIR = "$${BOOST_DIR}"

    INCLUDEPATH += "$${BOOST_INCDIR}"
    HEADERS += "$${BOOST_INCDIR}"

}
I didn't need to edit custom.pro when using 1.53 because it selects 1.53 automatically if custom.pro is not edited.

So I would say my build today did use 1.6 because I edited custom.pro

Note that custom.pro is not ignored by git; my edits show up in the diffs.
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
Is it supposed to be custom.pro or custom.pri?

How is else:isEmpty( BOOST_DIR ) checking custom.pro?
I see in the unix section BOOST_DIR = $$findBoostDirIn( /usr /usr/local /usr/pkg /opt/local )
but there is nothing similar in the win32 section.
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
I found in common.pri

# include user-defined things in every qmake project
exists( custom.pro ):include( custom.pro )
exists( custom.pri ):include( custom.pri )
Is this sufficient or do we need the same in boost.pri?

The contents of the given file are included in the project file at the place where the include function is used.
http://doc.qt.io/qt-4.8/qmake-project-files.html#built-in-functions-and-control-flow
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
I got rid of 1.53 and built again... no problems.
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
This post was updated on .
I don't know how build-windows.bat built an installer without any errors, but...
when I loaded up Qt creator today it complained about not being able to find the 1_53 folder.
It turns out boost.pri does need to include(custom.pro)
https://github.com/LibreCAD/LibreCAD/commit/294a6a4ea87a2177cbf6dc96f62abc2464d44d50

However... it turns out there are building issues with 1.6

C:\boost\boost_1_60_0\boost\math\constants\constants.hpp:278: error: unable to find numeric literal operator 'operator""Q'
   BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333e-01, "3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333e-01")
                                     ^

C:\boost\boost_1_60_0\boost\math\constants\constants.hpp:316: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
   BOOST_DEFINE_MATH_CONSTANT(e_pow_pi, 2.314069263277926900572908636794854738e+01, "2.31406926327792690057290863679485473802661062426002119934450464095243423506904527835169719970675492196759527048e+01")
                                        ^
Note the recommendation: "use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes"

I'm not sure how to set that up for the project.
Possibly relevant links I found:
https://github.com/pcb2gcode/pcb2gcode/pull/19#issuecomment-157070685
http://www.joshuaburkholder.com/blog/2013/09/17/how-to-compile-boost-using-gpp-std-cpp11-from-mingw/
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
Reply | Threaded
Open this post in threaded view
|

Re: boost

ravas
I think I solved it by adding
QMAKE_CXXFLAGS += -fext-numeric-literals
under
CONFIG += c++11
in src.pro
Reply | Threaded
Open this post in threaded view
|

Re: boost

dxli
great!

hope that's not a problem for all platforms (OSX, BSD, even raspberry pi).
ravas wrote
I think I solved it by adding
QMAKE_CXXFLAGS += -fext-numeric-literals
under
CONFIG += c++11
in src.pro