octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configure.ac and Dolfin.h


From: Juan Pablo Carbajal
Subject: Re: configure.ac and Dolfin.h
Date: Sat, 1 Mar 2014 04:51:29 +0100

On Wed, Feb 19, 2014 at 5:43 PM, Rik <address@hidden> wrote:
> On 02/19/2014 01:13 AM, address@hidden wrote:
>> Message: 1
>> Date: Tue, 18 Feb 2014 19:00:11 +0100
>> From: Juan Pablo Carbajal <address@hidden>
>> To: Marco Vassallo <address@hidden>
>> Cc: Octave Maintainers List <address@hidden>,  "c."
>>       <address@hidden>
>> Subject: Re: [FORGE] Fem-fenics installation fails
>> Message-ID:
>>       <address@hidden>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> On Tue, Feb 18, 2014 at 6:13 PM, Marco Vassallo
>> <address@hidden> wrote:
>>> >
>>> > On Tue, Feb 18, 2014 at 5:08 PM, Juan Pablo Carbajal <address@hidden>
>>> > wrote:
>>>> >>
>>>> >> On Tue, Feb 18, 2014 at 6:03 PM, Marco Vassallo
>>>> >> <address@hidden> wrote:
>>>>> >> >
>>>>> >> >
>>>>> >> >
>>>>> >> > On Tue, Feb 18, 2014 at 4:42 PM, Juan Pablo Carbajal
>>>>> >> > <address@hidden>
>>>>> >> > wrote:
>>>>>> >> >>
>>>>>> >> >> It seems to work. It installs and all examples run.
>>>>>> >> >>
>>>>> >> > Thanks for testing. Now I should figure out if it is possible to
>>>>> >> > use a different code depending on the FeniCS version used.
>>>>> >> >
>>>>> >> > You are also able to plot everything? Which version of Octave are you
>>>>> >> > using?
>>>>> >> > For me, with the octave-gui sometimes crashes.
>>>>> >> >
>>>>>> >> >>
>>>>>> >> >> On Tue, Feb 18, 2014 at 4:44 PM, Marco Vassallo
>>>>>> >> >> <address@hidden> wrote:
>>>>>>> >> >> > (Is there any way in which I can automatize it ? )
>>>>>> >> >>
>>>>>> >> >> Can we not just add Dense to the ac_check in the configure ac?
>>>>>> >> >> something like
>>>>>> >> >> AC_CHECK_HEADERs([Dense.h dolfin.h],
>>>>>> >> >>  ...
>>>>>> >> >>
>>>>>> >> >>
>>>>>> >> >> Also I think you shouldn't need to define -DHAVE_DOLFIN_H since 
>>>>>> >> >> this
>>>>>> >> >> is exactly what AC_CHECK_HEADERS do, isn't it?
>>>>>> >> >> What you could do is to check compilation by adding
>>>>>> >> >>
>>>>> >> >
>>>>> >> > -DHAVE_DOLFIN_H is used only for the msh pkg, which I will try to 
>>>>> >> > fix in
>>>>> >> > the
>>>>> >> > next few days.
>>>>> >> > We were using HAVE_DOLFIN_H as you suggest, but there was some 
>>>>> >> > problem,
>>>>> >> > and I and Carne during the OctConf decided to use -DHAVE_DOLFIN_H.
>>>>> >> > Please give a look here [1] and tell me if you have any suggestion 
>>>>> >> > and
>>>>> >> > if it
>>>>> >> > can be
>>>>> >> > done in a better way.
>>>>> >> >
>>>>> >> > Thanks a lot
>>>>> >> >
>>>>> >> > Marco
>>>>> >> >
>>>>> >> > [1] http://gedeone-gsoc.blogspot.co.uk/2013/07/update-7.html
>>>>> >> >
>>>>>> >> >> #ifdef HAVE_DOLFIN_H
>>>>>> >> >> #include <dolfin.h>
>>>>>> >> >> #endif
>>>>>> >> >>
>>>>>> >> >> This will check that dolfin.h is compilable (I guess the API errors
>>>>>> >> >> will jump up here).
>>>>> >> >
>>>>> >> >
>>>> >>
>>>> >> Hi Marco,
>>>> >>
>>>> >> Indeed, example 4 sometimes crashes
>>>> >> octave-cli-3.8.0: ../../stable/libinterp/parse-tree/lex.ll:2489: void
>>>> >> octave_base_lexer::handle_number(): Assertion `nread == 1' failed.
>>>> >> panic: Aborted -- stopping myself...
>>>> >> Aborted (core dumped)
>>>> >>
>>>> >> The plots work, yes.
>>>> >>
>>>> >> I recommend you just support the latest version of fenics.
>>> >
>>> >
>>> > Ok thanks. I will do a new release of the pkg supporting FEniCS 1.3.0 very
>>> > soon.
>>> >
>>> > Marco
>> Great, I will try to see if I can help you with the configure.ac.
>> As I see it, the trick you are doing might be ok, though it seems
>> something is wrong with autotiols, then cause it should define
>> HAVE_DOLFINN_H only if the header was found. Also one could check for
>> Eigen/Dense and modify CPPFLAGS to include  path to system location,
>> e.g. using locate or other trick @Rik?
>> I have sen many examples where the action_if_found is a small program
>> that includes the file and checks some feature. Example
>>
>> AC_PREREQ([2.67])
>> AC_INIT([tmp], [0.0])
>>
>> AC_PROG_CXX
>>
>> AC_LANG(C++)
>>
>> AC_CHECK_HEADERS([eigen3/Eigen/Dense],
>>                  [*** Here modify the ncludes path so dolfin.h knows
>> where to find dense***],
>>                  [AC_MSG_ERROR([Dofin won't compile])])
>>
>> AC_CHECK_HEADERS([dolfin.h],
>>       [#ifdef HAVE_DOLFIN_H
>>        #include<dolfin.h>
>>        #endif],
>>       [AC_MSG_WARN([dolfin headers could not be found,
>>                     some functionalities will be disabled,
>>                     don't worry your package will still be
>>                     working, though.])])
>
> Juan,
>
> I'm really busy at the moment so this can be my only contribution on this
> subject.
>
> AC_CHECK_HEADERS will find files that are in an ordinary location such as
> /usr/include, /usr/local/include, etc.  If you have something that is in a
> weird location you can do a few things.  The first would be to override the
> environment variable CPPFLAGS when calling configure.
>
> CPPFLAGS="-I/weird/directory" ./configure
>
> A second approach is to ask the user to specify where cpp should look.  For
> example, Octave's configure supports '--with-pkg-includedir=DIR' for a
> number of packages like Qhull, curl, etc.  The autoconf code can be
> extracted from m4/acinclude.m4 OCTAVE_CHECK_LIB macro.  Look for the
> AC_ARG_WITH macro.
>
> A third approach depends on having a pkg-config working for the Dense
> package.  If that were the case you could directly query the package about
> where to look.  This example is taken from the GraphicsMagick setup
>
> MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $magick++`
>
> Finally, I think you want to write the last code stanza as
>
> AC_CHECK_HEADERS([dolfin.h], [], [],
>   [#ifdef HAVE_DOLFIN_H
>    #include<dolfin.h>
>    #endif])
>
> if test |a dolfin variable, maybe HAVE_DOLFIN_H|; then
>   AC_MSG_WARN([dolfin headers could not be found,
>                 some functionalities will be disabled,
>                 don't worry your package will still be
>                 working, though.])
> fi
>
> See the bottom of AC_CHECK_HEADERS here
> http://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Generic-Headers.html
> for an example.
>
> Good luck,
> Rik

I just committed a change to bootstrap and configure.ac such that it
accepts --with-dense-includedir to indicate special locations for
Eigen/Dense. Only then checks are performed. Please verify that it
works.

If more options like this are expected then we can reuse Rik's m4
AC_DEFUN to generalize for any --with-XXX-includedir.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]