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: Eugenio Gianniti
Subject: Re: configure.ac and Dolfin.h
Date: Wed, 5 Mar 2014 01:50:13 +0000


On 02 Mar 2014, at 08:10, c. <address@hidden> wrote:


On 2 Mar 2014, at 07:58, c. <address@hidden> wrote:


On 1 Mar 2014, at 15:56, c. <address@hidden> wrote:


On 1 Mar 2014, at 15:31, Juan Pablo Carbajal <ajuanpi+address@hidden> wrote:


Why not instead (or in addition to that) use the output of pkg-config?
This is the standard way to detect flags to be added when
compiling/linking against a library.

On my Debian unstable system, the eigen3 include directory is included
in the output of "pkg-config --cflags dolfin".

--
.''`.    Sébastien Villemot
: :' :    Debian Developer
`. `'     http://www.dynare.org/sebastien
`-      GPG Key: 4096R/381A7594


Sebastien,

Because I do not know how to do that. Autotools and friends are not
the easiest tools to learn how to use...
If you have an example that shows what you mean, then I would be happy
to fix the code.

I can do that, I'll prepare a patch, but nontheless it's good to be able
to manually tell configure where libraries are, so I will leave your option too.

c.

Actually, 

Now that I think better about it, while I COULD, prepare this patch, working
on this sounds like a nice little project for a would-be GSoC student willing 
to work on fem-fenics.

So, Eugenio, would you like to give it a try yourself?

I prepared a patch, that I hereby attach, to address the issue. Currently I can’t test it because the version of FEniCS I installed crashes python, leading to the failure of the build. Anyway, since the problem is related to the flags passed to mkoctfile and those rules work for me, I would ask you to try to apply the patch and build to test it.

A couple of considerations:
     - if you installed FEniCS in a non-standard location you should add its lib/pkgconfig to the environment variable PKG_CONFIG_PATH [1]. The same applies to eigen, in case.
     - if you downloaded a binary distribution of FEniCS there could be troubles with absolute paths written on another system in the .pc files. I had to manually correct them to fit in my computer.
     - as of now my proposal with macros and the previous commit by Juan Pablo should "work together" with the meaning that if pkg-config does its work the package will successfully configure and both approaches will cooperate, otherwise ./configure will just error out. Maybe tomorrow with further study of the issue I might come up with a solution, anyway suggestions are welcome!
     - using PKG_CHECK_MODULES requires the use of Automake. At least this is what I got from the Octave core configure.ac and Makefile.am, which use the @var@ substitution to access variables obtained from the macro. I also added the files that Automake requires to the patch.

I’m looking forward to having your feedback on this preliminary patch.
Bye,
Eugenio

Attachment: patch_configure.diff
Description: patch_configure.diff


You can find some interesting information to use as a starting point for autotools+pkg
config here:

https://www.flameeyes.eu/autotools-mythbuster/pkgconfig/index.html

Also, 
Octave itself uses pkg-config to discover configuration options for some of its dependencies
like freetype or Qt, so you can find usage examples for the PKG_CHECK_MODULES macro in Octave's
own configure.ac:

http://hg.savannah.gnu.org/hgweb/octave/file/f958e8cd6348/configure.ac

Feel free to ask if you need more directions.

HTH,
c.


reply via email to

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