dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #18376
Re: Armadillo pkgconfig generator
On 5/26/10 12:26 PM, Johannes Ring wrote:
> 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?
It is not needed. Initially I didn't have the -latlas and that brought
it into this linkfailed block. (And I don't have libgfortran.)
Harish
Follow ups
References