[GenABEL-dev] automake boost
L.C. Karssen
lennart at karssen.org
Tue Jun 24 14:27:22 CEST 2014
Hi Alvaro,
A quick follow-up: I dug up the attached file with which I made my first
Boost steps (exploring how to compute p-values for ProbABEL).
If you run
make p-from-chi2
in the directory that contains the .cpp file it should compile if Boost
is in a standard location (no Makefile needed because make will use its
built-in rules). Otherwise
g++ p-from-chi2.cpp -o p-from-chi2
with the appropriate -I lines for the Boost include files should work.
Lennart.
On 24-06-14 14:21, L.C. Karssen wrote:
> 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
>> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
>>
>
>
>
> _______________________________________________
> 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
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p-from-chi2.cpp
Type: text/x-c++src
Size: 1186 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20140624/90071cdb/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20140624/90071cdb/attachment.sig>
More information about the genabel-devel
mailing list