Dolfin build can't find armadillo

Asked by Derek Thomas on 2012-08-22

I'm trying to build dolfin on arch linux. The build fails trying to find armadillo. I've copied the armadillo test file and can compile it with clang++ test.cpp -llapack -lblas -L /usr/local/lib -larmadillo. I can't get cmake to use the correct flags. How do I give the correct flags to cmake? Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Last query:
2012-08-23
Last reply:
2012-08-23
Myles English (mylesenglish) said : #1

Hi Derek,

Derek Thomas writes:

> New question #206520 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/206520
>
> I'm trying to build dolfin on arch linux. The build fails trying to
> find armadillo. I've copied the armadillo test file and can compile
> it with clang++ test.cpp -llapack -lblas -L /usr/local/lib
> -larmadillo. I can't get cmake to use the correct flags. How do I
> give the correct flags into cmake? Thanks.

Are you using packages from the AUR? Do you have $TRILINOS_DIR set?

Myles

Derek Thomas (derekcthomas) said : #2

Yes, it's set to /usr. The problem seems to be that the cmake test
doesn't include /usr/local/lib, the location of libarmadillo.so.

On Wed, Aug 22, 2012 at 4:26 PM, Myles English
<email address hidden> wrote:
> Your question #206520 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/206520
>
> Status: Open => Answered
>
> Myles English proposed the following answer:
>
> Hi Derek,
>
> Derek Thomas writes:
>
>> New question #206520 on FEniCS Project:
>> https://answers.launchpad.net/fenics/+question/206520
>>
>> I'm trying to build dolfin on arch linux. The build fails trying to
>> find armadillo. I've copied the armadillo test file and can compile
>> it with clang++ test.cpp -llapack -lblas -L /usr/local/lib
>> -larmadillo. I can't get cmake to use the correct flags. How do I
>> give the correct flags into cmake? Thanks.
>
> Are you using packages from the AUR? Do you have $TRILINOS_DIR set?
>
> Myles
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/fenics/+question/206520/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/fenics/+question/206520
>
> You received this question notification because you asked the question.

Myles English (mylesenglish) said : #3

Derek Thomas writes:

> Derek Thomas is still having a problem:
> Yes, it's set to /usr. The problem seems to be that the cmake test
> doesn't include /usr/local/lib, the location of libarmadillo.so.

Okay, and if it turns out that the problem is elsewhere then may be this
bug is relevant?:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679762

> On Wed, Aug 22, 2012 at 4:26 PM, Myles English
>> Are you using packages from the AUR? Do you have $TRILINOS_DIR set?

For some reason, every time I read 'Armadillo', my brain says
'Trilinos'.

You don't say if you are using the AUR package scripts, but if you need
anything adding to the package build let me know.

Myles

Derek Thomas (derekcthomas) said : #4

I'm using the aur tarball with makepkg. Right now I'm trying to
figure out what to add to the cmake command so that it recognizes that
armadillo is installed. Setting armadillo_dir with a
-DARMADILLO_DIR:PATH=/usr/local or /usr/local/lib doesn't work. Any
other ideas? Thanks,

Derek

On Wed, Aug 22, 2012 at 5:56 PM, Myles English
<email address hidden> wrote:
> Your question #206520 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/206520
>
> Status: Open => Answered
>
> Myles English proposed the following answer:
>
> Derek Thomas writes:
>
>> Derek Thomas is still having a problem:
>> Yes, it's set to /usr. The problem seems to be that the cmake test
>> doesn't include /usr/local/lib, the location of libarmadillo.so.
>
> Okay, and if it turns out that the problem is elsewhere then may be this
> bug is relevant?:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679762
>
>> On Wed, Aug 22, 2012 at 4:26 PM, Myles English
>>> Are you using packages from the AUR? Do you have $TRILINOS_DIR set?
>
> For some reason, every time I read 'Armadillo', my brain says
> 'Trilinos'.
>
> You don't say if you are using the AUR package scripts, but if you need
> anything adding to the package build let me know.
>
> Myles
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/fenics/+question/206520/+confirm?answer_id=2
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/fenics/+question/206520
>
> You received this question notification because you asked the question.

Johannes Ring (johannr) said : #5

Look in <dolfin-build-dir>/CMakeFiles/CMakeError.log, it should give you a hint of why the Armadillo test fails.

Have you set CMake to use clang++? If not, it will probably use g++ and then it doesn't make sense to run the Armadillo test program (test.cpp) with clang++. Try using g++ instead. If test.cpp fails with g++, then you probably have the GCC 4.7 bug that Myles mentioned.

BTW, you can specify the path to libarmadillo.so by running cmake with -DARMADILLO_LIBRARIES:FILEPATH=/usr/local/lib/libarmadillo.so.

Derek Thomas (derekcthomas) said : #6

I definitely have the gcc 4.7.1/armadillo bug. That's why I switched
to clang/clang++. Unfortunately, even with setting
ARMADILLO_LIBRARIES the build still can't find armadillo.

On Thu, Aug 23, 2012 at 12:21 AM, Johannes Ring
<email address hidden> wrote:
> Your question #206520 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/206520
>
> Status: Open => Answered
>
> Johannes Ring proposed the following answer:
> Look in <dolfin-build-dir>/CMakeFiles/CMakeError.log, it should give you
> a hint of why the Armadillo test fails.
>
> Have you set CMake to use clang++? If not, it will probably use g++ and
> then it doesn't make sense to run the Armadillo test program (test.cpp)
> with clang++. Try using g++ instead. If test.cpp fails with g++, then
> you probably have the GCC 4.7 bug that Myles mentioned.
>
> BTW, you can specify the path to libarmadillo.so by running cmake with
> -DARMADILLO_LIBRARIES:FILEPATH=/usr/local/lib/libarmadillo.so.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/fenics/+question/206520/+confirm?answer_id=4
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/fenics/+question/206520
>
> You received this question notification because you asked the question.

Derek Thomas (derekcthomas) said : #7

I definitely have the gcc 4.7.1/armadillo bug. That's why I switched
to clang/clang++. Unfortunately, even with setting
ARMADILLO_LIBRARIES the build still can't find armadillo.

On Thu, Aug 23, 2012 at 12:21 AM, Johannes Ring
<email address hidden> wrote:
> Your question #206520 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/206520
>
> Status: Open => Answered
>
> Johannes Ring proposed the following answer:
> Look in <dolfin-build-dir>/CMakeFiles/CMakeError.log, it should give you
> a hint of why the Armadillo test fails.
>
> Have you set CMake to use clang++? If not, it will probably use g++ and
> then it doesn't make sense to run the Armadillo test program (test.cpp)
> with clang++. Try using g++ instead. If test.cpp fails with g++, then
> you probably have the GCC 4.7 bug that Myles mentioned.
>
> BTW, you can specify the path to libarmadillo.so by running cmake with
> -DARMADILLO_LIBRARIES:FILEPATH=/usr/local/lib/libarmadillo.so.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/fenics/+question/206520/+confirm?answer_id=4
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/fenics/+question/206520
>
> You received this question notification because you asked the question.

Garth Wells (garth-wells) said : #8

On 23 August 2012 18:16, Derek Thomas
<email address hidden> wrote:
> Question #206520 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/206520
>
> Status: Answered => Open
>
> Derek Thomas is still having a problem:
> I definitely have the gcc 4.7.1/armadillo bug. That's why I switched
> to clang/clang++. Unfortunately, even with setting
> ARMADILLO_LIBRARIES the build still can't find armadillo.
>

The build system doesn't just look for and find libraries. It tests
them. That's why you need to look in CMakeError.log, as suggested by
Johannes. Armadillo is delicate, and my experience is that it is easy
to find, but often not easy to link. Any linking issues will be
apparent in CMakeError.log.

Garth

> On Thu, Aug 23, 2012 at 12:21 AM, Johannes Ring
> <email address hidden> wrote:
>> Your question #206520 on FEniCS Project changed:
>> https://answers.launchpad.net/fenics/+question/206520
>>
>> Status: Open => Answered
>>
>> Johannes Ring proposed the following answer:
>> Look in <dolfin-build-dir>/CMakeFiles/CMakeError.log, it should give you
>> a hint of why the Armadillo test fails.
>>
>> Have you set CMake to use clang++? If not, it will probably use g++ and
>> then it doesn't make sense to run the Armadillo test program (test.cpp)
>> with clang++. Try using g++ instead. If test.cpp fails with g++, then
>> you probably have the GCC 4.7 bug that Myles mentioned.
>>
>> BTW, you can specify the path to libarmadillo.so by running cmake with
>> -DARMADILLO_LIBRARIES:FILEPATH=/usr/local/lib/libarmadillo.so.
>>
>> --
>> If this answers your question, please go to the following page to let us
>> know that it is solved:
>> https://answers.launchpad.net/fenics/+question/206520/+confirm?answer_id=4
>>
>> If you still need help, you can reply to this email or go to the
>> following page to enter your feedback:
>> https://answers.launchpad.net/fenics/+question/206520
>>
>> You received this question notification because you asked the question.
>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.

Can you help with this problem?

Provide an answer of your own, or ask Derek Thomas for more information if necessary.

To post a message you must log in.