[GenABEL-dev] automake boost
Frank, Alvaro Jesus
alvaro.frank at rwth-aachen.de
Tue Jun 24 14:25:28 CEST 2014
Using any working copy of boost, including the file #include <boost/..../anything.hpp>
will lead to a failed compilation IF the file was NOT included as the first file in the main.cpp
which is ridiculous.
I got it working right now. It could be some kind of redefinition of something relevant only to this code.
________________________________________
From: L.C. Karssen [lennart at karssen.org]
Sent: Tuesday, June 24, 2014 2:21 PM
To: Frank, Alvaro Jesus; genabel-devel at lists.r-forge.r-project.org
Subject: Re: [GenABEL-dev] automake boost
Hi Alvaro,
So if I understand you correctly this is the situation:
- When using my version autoconf doesn't find boost. Correct?
- But nevertheless if you try to include the erf.hpp file (and manually
(?) instruct the compiler where to find the header files, you get the
error below.
How do you compile your code? Manually involing g++ or using a Makefile
generated by automake?
Could you provide me with a minimum working example (actually a minimum
breaking example) of configure.ac, Makefile.am and main.cpp to test?
Lennart.
On 24-06-14 13:19, Frank, Alvaro Jesus wrote:
> Thanks for the info,
>
> I tried my version (which fails to recognize boost at all) and yours (which configure doesnt recognize boost but I can still get the compiler to include the files) and I get the following error (lots of similar ones after this):
>
> /usr/include/boost/iterator/iterator_facade.hpp:43:19: error: expected identifier before ‘(’ token
> template <class I, class V, class TC, class R, class D> class iterator_facade;
>
> by just including once the following:
>
> #include <boost/math/special_functions/erf.hpp>
>
> Any Ideas?
> ________________________________________
> From: genabel-devel-bounces at lists.r-forge.r-project.org [genabel-devel-bounces at lists.r-forge.r-project.org] on behalf of L.C. Karssen [lennart at karssen.org]
> Sent: Tuesday, June 24, 2014 12:02 PM
> To: genabel-devel at lists.r-forge.r-project.org
> Subject: Re: [GenABEL-dev] automake boost
>
> Hi Alvaro,
>
>
> On 24-06-14 11:51, Frank, Alvaro Jesus wrote:
>> Hi Lennart,
>>
>> I am, having trouble with automake recognizing boost root path.
>> I used AX_BOOST_BASE but the root path (/usr/local/) is still not being
>> recognized. and the path $Boost_root is still not helping me, perhaps I
>> am setting it wrong.
>> Do you also compile it all or keep the macros as they are?
>
> I use the Boost package provided by Ubuntu, so I haven't compiled them
> myself. In that case the libraries are installed in /usr/include/boost/.
>
> In ProbABEL's configure.ac I test for boost as follows (see the branch
> at
> https://r-forge.r-project.org/scm/viewvc.php/branches/ProbABEL-pvals/ProbABEL/?root=genabel):
>
> ----------------------------------------
> if test "x$with_boost_math" != "xno"; then
> AC_MSG_NOTICE([building using the Boost Math library enabled])
>
> AC_ARG_WITH([boost-include-path],
> [AS_HELP_STRING([--with-boost-include-path],
> [location of the Boost headers, defaults to /usr/include/boost])],
> [CXXFLAGS+=" -I${withval}"
> CPPFLAGS+=" -I${withval}"],
> [CXXFLAGS+=' -I/usr/include/boost'
> CPPFLAGS+=' -I/usr/include/boost'])
>
> # Check for the Boost Math header files
> AC_CHECK_HEADERS([boost/math/distributions.hpp])
>
> if test x$ac_cv_header_boost_math_distributions_hpp = xno; then
> AC_MSG_ERROR([Could not find the Boost Math header files. Did \
> you specify --with-boost-include-path correctly? Or use --without-boost \
> to disable the calculation of p-values.])
> fi
> else
> AC_MSG_NOTICE([not using the Boost Math libraries, so no p-values in
> the \
> output])
> fi
> AM_CONDITIONAL([WITH_BOOST_MATH], test "x$with_boost_math" != "xno")
> ----------------------------------------
>
> This creates a variable WITH_BOOST_MATH that can be used in AutoMake's
> Makefile.am files:
> ----------------------------------------
> if WITH_BOOST_MATH
> palinear_CXXFLAGS += -DWITH_BOOST_MATH
> endif
> ----------------------------------------
>
> And then in the .cpp files, for example:
> ----------------------------------------
> #if WITH_BOOST_MATH
> std::vector<std::ostringstream *> pval;
> #endif
> ----------------------------------------
>
>
> Hope that helps.
>
> Lennart.
>
>
>>
>> Thanks!
>>
>>
>> _______________________________________________
>> genabel-devel mailing list
>> genabel-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel
>>
>
> --
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> L.C. Karssen
> Utrecht
> The Netherlands
>
> lennart at karssen.org
> http://blog.karssen.org
> GPG key ID: A88F554A
> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
>
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Utrecht
The Netherlands
lennart at karssen.org
http://blog.karssen.org
GPG key ID: A88F554A
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
More information about the genabel-devel
mailing list