← Back to team overview

dolfin team mailing list archive

Re: Armadillo pkgconfig generator

 

On Wed, May 26, 2010 at 12:07 PM, Harish Narayanan
<harish.mlists@xxxxxxxxx> wrote:
> I have attached the changes I needed to make to the Armadillo pkgconfig
> generator to get it working on my mac. Johannes, could you replace the
> /opt/local hard-coded paths with more generic paths and apply the changes?

Yes, I will look at your changes.

> === modified file
> 'scons/simula-scons/simula_scons/pkgconfiggenerators/armadillo.py'
> --- scons/simula-scons/simula_scons/pkgconfiggenerators/armadillo.py
> 2010-05-25 10:36:03 +0000
> +++ scons/simula-scons/simula_scons/pkgconfiggenerators/armadillo.py
> 2010-05-26 10:04:16 +0000
> @@ -20,7 +20,7 @@
>         libs = pkgLibs(sconsEnv=sconsEnv)
>
>     cpp_version_str = r"""
> -#include "armadillo"
> +#include <armadillo>
>  #include <iostream>
>  using namespace arma;
>  int main() {
> @@ -59,7 +59,7 @@
>         cflags = pkgCflags(sconsEnv=sconsEnv)
>
>     cpp_test_libs_str = r"""
> -#include "armadillo"
> +#include <armadillo>
>  #include <iostream>
>  using namespace arma;
>  int main(int argc, char** argv) {
> @@ -87,14 +87,14 @@
>                                        errormsg=cmdoutput)
>
>     # test that we can link
> -    libs = "-L%s -larmadillo" % \
> +    libs = "-L%s -larmadillo -L/opt/local/lib -llapack" % \
>            os.path.join(getArmadilloDir(sconsEnv=sconsEnv), "lib")
>     cmdstr = "%s %s -o a.out %s" % \
>            (linker, cpp_file.replace('.cpp', '.o'), libs)
>     linkFailed, cmdoutput = getstatusoutput(cmdstr)
>     if linkFailed:
>         # try adding -lgfortran to get around Hardy libatlas-base-dev issue
> -        libs += " -lgfortran"
> +        # libs += " -lgfortran"

Why is this needed? If the first link attempt failed, then this
wouldn't help either?

Johannes

>         cmdstr = "%s %s -o a.out %s" % \
>                  (linker, cpp_file.replace('.cpp', '.o'), libs)
>         linkFailed, cmdoutput = getstatusoutput(cmdstr)
> @@ -113,7 +113,7 @@
>     return libs
>
>  def pkgCflags(sconsEnv=None):
> -    return "-I%s" % os.path.join(getArmadilloDir(sconsEnv=sconsEnv),
> "include")
> +    return "-I%s -I%s" %
> (os.path.join(getArmadilloDir(sconsEnv=sconsEnv), "include"),
> "/opt/local/include")
>
>  def pkgTests(forceCompiler=None, sconsEnv=None,
>              cflags=None, libs=None, version=None, **kwargs):
>
>
> Harish
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp
>



Follow ups

References