Problems linking to Armadillo and BLAS on hpc
Hi,
I'm trying to install FEniCS on the supercomputer Stallo in Tromsø which uses the Linux operation system Rocks
(http://
I had it working quasi-successfully earlier, however after a hardware upgrade, I had to retry, and neither I, nor
the stallo support team is getting anywhere. I am installing manually from source to be able to use the prebuilt libraries.
Everything except dolfin seems to work at this point (I can import to python at least)
When I try to compile dolfin with ccmake . I get this error:
CMake Error at /global/
Armadillo could not be found. Be sure to set ARMADILLO_DIR. (missing:
ARMADILLO_
Call Stack (most recent call first):
/global/
cmake/
CMakeLists.
I do not have root access and I'm trying to install dolfin to /home/torbness/
There is an armadillo installation in /global/
I'm not sure how I'm supposed to set ARMADILLO_DIR since it's not a variable in "ccmake ."
but I have tried adding e.g.
set(ARMADILLO_DIR /global/
in the file ./cmake/
I have pasted this from the ccmake menu,
ARMADILLO_
ARMADILLO_
ARMADILLO_VERSION 3.6.0
BLAS_Accelerat
BLAS_acml_LIBRARY BLAS_acml_
BLAS_acml_
BLAS_atlas_LIBRARY /global/
BLAS_blas_LIBRARY /usr/lib64/
BLAS_cblas_LIBRARY /global/
BLAS_complib.
BLAS_cxml_LIBRARY BLAS_cxml_
BLAS_dxml_LIBRARY BLAS_dxml_
BLAS_essl_LIBRARY BLAS_essl_
BLAS_f77blas_
BLAS_goto2_LIBRARY BLAS_goto2_
BLAS_scsl_LIBRARY BLAS_scsl_
BLAS_sgemm_LIBRARY BLAS_sgemm_
BLAS_sunperf_
BLAS_vecLib_
Does anybody know how I can link to Armadillo?
How about BLAS?
Any help would be greatly appreciated!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Garth Wells
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
CMakeFiles/
FOO_DIR variables can either be set as environment variables or by running cmake with -DFOO_DIR:
Revision history for this message
|
#2 |
Her is the output of "cat applications/
Determining if the Fortran dgemm exists failed with the following output:
Change Dir: /home/torbness/
Run Build Command:
/usr/bin/gmake -f CMakeFiles/
gmake[1]: Entering directory `/home/
/global/
Building Fortran object CMakeFiles/
/usr/bin/gfortran -c /home/torbness/
Linking Fortran executable cmTryCompileExe
/global/
/usr/bin/gfortran CMakeFiles/
/global/
xerbla.
xerbla.
xerbla.
xerbla.
xerbla.
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileEx
gmake[1]: Leaving directory `/home/
gmake: *** [cmTryCompileEx
Performing C++ SOURCE FILE Test ARMADILLO_TEST_RUNS failed with the following output:
Change Dir: /home/torbness/
Run Build Command:
/usr/bin/gmake -f CMakeFiles/
gmake[1]: Entering directory `/home/
/global/
Building CXX object CMakeFiles/
/usr/bin/c++ -DARMADILLO_
Linking CXX executable cmTryCompileExe
/global/
/usr/bin/c++ -DARMADILLO_
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileEx
gmake[1]: Leaving directory `/home/
gmake: *** [cmTryCompileEx
Return value: 1
Source file was:
#include <armadillo>
using namespace arma;
int main()
{
int n = 20;
double h = 1.0/(n-1);
mat A(n, n);
vec b(n);
vec u(n);
double beta = 0.2;
double gamma = 1000;
A.fill(0.0);
b.fill(0.0);
double x; int i;
i = 0;
A(i, i) = 1;
b(i) = 0;
for (i=1; i<n-1; i++) {
x = (i-1)*h;
A(i, i-1) = 1; A(i, i) = -2; A(i, i+1) = 1;
b(i) = - h*h*gamma*
}
i = n-1; x = (i-1)*h;
A(i, i-1) = 2; A(i, i) = -2;
u = solve(A, b);
return 0;
}
Performing C++ SOURCE FILE Test ARMADILLO_
Change Dir: /home/torbness/
Run Build Command:
/usr/bin/gmake -f CMakeFiles/
gmake[1]: Entering directory `/home/
/global/
Building CXX object CMakeFiles/
/usr/bin/c++ -DARMADILLO_
Linking CXX executable cmTryCompileExe
/global/
/usr/bin/c++ -DARMADILLO_
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileEx
gmake[1]: Leaving directory `/home/
gmake: *** [cmTryCompileEx
Return value: 1
Source file was:
#include <armadillo>
using namespace arma;
int main()
{
int n = 20;
double h = 1.0/(n-1);
mat A(n, n);
vec b(n);
vec u(n);
double beta = 0.2;
double gamma = 1000;
A.fill(0.0);
b.fill(0.0);
double x; int i;
i = 0;
A(i, i) = 1;
b(i) = 0;
for (i=1; i<n-1; i++) {
x = (i-1)*h;
A(i, i-1) = 1; A(i, i) = -2; A(i, i+1) = 1;
b(i) = - h*h*gamma*
}
i = n-1; x = (i-1)*h;
A(i, i-1) = 2; A(i, i) = -2;
u = solve(A, b);
return 0;
}
Performing C++ SOURCE FILE Test ARMADILLO_
Change Dir: /home/torbness/
Run Build Command:
/usr/bin/gmake -f CMakeFiles/
gmake[1]: Entering directory `/home/
/global/
Building CXX object CMakeFiles/
/usr/bin/c++ -DARMADILLO_
Linking CXX executable cmTryCompileExe
/global/
/usr/bin/c++ -DARMADILLO_
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileEx
gmake[1]: Leaving directory `/home/
gmake: *** [cmTryCompileEx
Return value: 1
Source file was:
#include <armadillo>
using namespace arma;
int main()
{
int n = 20;
double h = 1.0/(n-1);
mat A(n, n);
vec b(n);
vec u(n);
double beta = 0.2;
double gamma = 1000;
A.fill(0.0);
b.fill(0.0);
double x; int i;
i = 0;
A(i, i) = 1;
b(i) = 0;
for (i=1; i<n-1; i++) {
x = (i-1)*h;
A(i, i-1) = 1; A(i, i) = -2; A(i, i+1) = 1;
b(i) = - h*h*gamma*
}
i = n-1; x = (i-1)*h;
A(i, i-1) = 2; A(i, i) = -2;
u = solve(A, b);
return 0;
}
Performing C++ SOURCE FILE Test ARMADILLO_
Change Dir: /home/torbness/
Run Build Command:
/usr/bin/gmake -f CMakeFiles/
gmake[1]: Entering directory `/home/
/global/
Building CXX object CMakeFiles/
/usr/bin/c++ -DARMADILLO_
Linking CXX executable cmTryCompileExe
/global/
/usr/bin/c++ -DARMADILLO_
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
CMakeFiles/
src.cxx:
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileEx
gmake[1]: Leaving directory `/home/
gmake: *** [cmTryCompileEx
Return value: 1
Source file was:
#include <armadillo>
using namespace arma;
int main()
{
int n = 20;
double h = 1.0/(n-1);
mat A(n, n);
vec b(n);
vec u(n);
double beta = 0.2;
double gamma = 1000;
A.fill(0.0);
b.fill(0.0);
double x; int i;
i = 0;
A(i, i) = 1;
b(i) = 0;
for (i=1; i<n-1; i++) {
x = (i-1)*h;
A(i, i-1) = 1; A(i, i) = -2; A(i, i+1) = 1;
b(i) = - h*h*gamma*
}
i = n-1; x = (i-1)*h;
A(i, i-1) = 2; A(i, i) = -2;
u = solve(A, b);
return 0;
}
Revision history for this message
|
#3 |
You have to list the actual library. Notice for ARMADILLO_LIBRARIES
you only list the lib directory.
For me, I just add -mkl to the flags to link to blas but that is only
for the Intel 13 compiler
Here is my cmake call for the TACC machines:
cmake -DCMAKE_
-
-
-
-
-
-
-
-
-
-
-
-
-
\
-
\
-
\
-
-
-
-
-
-
-
-
-
-
-
.. 2>&1 | tee ${LOGFILE}
Revision history for this message
|
#4 |
Thanks for the feedback. I tried to change to this instead,
ARMADILLO_
ARMADILLO_
but the error message seems to be the same no matter what I do.
I tried installing Armadillo by myself, seemingly successfully, but I got the same error when I tried to link to this as well.
Although I would of course prefer to have a fully optimized version running, does anybody know if there is a possibility
to try a binary version? For windows and mac it seems easy enough to get it from this page,
http://
but I don't know how I would try to install the linux version without root?
Thanks,
Torbjørn
Revision history for this message
|
#5 |
Armadillo is hard to link properly.. I do:
1. Set ARMA_USE_WRAPPER to false
2. Comment out all the FindFooBlas lines in the armadillo CMakeLists.txt
This tells armadillo not to link with BLAS, but that it will be linked
later. DOLFIN then provides the BLAS libs. This is particularly
helpful if you want to build against different BLAS versions.
Garth
On 18 March 2013 08:11, Torbjørn Bækø Ness
<email address hidden> wr do:ote:
> Question #224136 on DOLFIN changed:
> https:/
>
> Status: Answered => Open
>
> Torbjørn Bækø Ness is still having a problem:
> Thanks for the feedback. I tried to change to this instead,
>
> ARMADILLO_
> ARMADILLO_LIBRARIES /global/
>
> but the error message seems to be the same no matter what I do.
> I tried installing Armadillo by myself, seemingly successfully, but I got the same error when I tried to link to this as well.
>
> Although I would of course prefer to have a fully optimized version running, does anybody know if there is a possibility
> to try a binary version? For windows and mac it seems easy enough to get it from this page,
> http://
> but I don't know how I would try to install the linux version without root?
>
> Thanks,
> Torbjørn
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
Revision history for this message
|
#6 |
Thank you Garth Wells, that got me quite a bit further.
I'm not completely there yet though, as Trilinos and CGAL is causing some problems, as seen beneath.
CGAL does not seem to be preinstalled, so I will try installing that my self, but Trilinos seems to be doing something strange:
The find_package() call that loaded this file did so because its cached
result variable, Trilinos_DIR, is set to
/global/
I'm locally setting Trilinos_DIR to
/global/
There is no folder called /global/
Complete error message:
CMake Error: An attempt was made to access a variable: TRILINOS_DIR that has not been defined. This variable is created by the FIND_PACKAGE command. CMake version 1.6
always converted the variable name to upper-case, but this behavior is no longer the case. To fix this you might need to set the cache value of
CMAKE_
FIND_PACKAGE.
CMake Warning at /global/
TrilinosConf
installation prefix where the find_package command looks by default
(<prefix>
location (<prefix>/include) to present this message and load the file from
its new location.
The find_package() call that loaded this file did so because its cached
result variable, Trilinos_DIR, is set to
/global/
I'm locally setting Trilinos_DIR to
/global/
and loading TrilinosConfig.
this warning by setting the above value in the cache. However, the
application needs modification permanently fix the issue. The
find_package() call that loaded this file may have the form
find_
Change it to the form
set(
find_
to find TrilinosConfig.
still honoring the TRILINOS_PATH option for this application.
Call Stack (most recent call first):
CMakeLists.
CMake Error at /global/
include could not find load file:
/global/
Call Stack (most recent call first):
CMakeLists.
CMake Warning at CMakeLists.txt:328 (message):
Unable to find Trilinos (>= 11.0.0)
CMake Warning at cmake/modules/
Could not find a package configuration file provided by "CGAL" with any of
the following names:
CGALConfig
cgal-
Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set
"CGAL_DIR" to a directory containing one of the above files. If "CGAL"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.
CMake Warning at dolfin/
QVTK not found, disabling QT for plotting
CMake Warning at demo/undocument
QT not found, or QT/VTK not enabled in DOLFIN. Not building demo_plot-qt
Disabling generation of documentation because Sphinx is missing.
Revision history for this message
|
#7 |
I tried to disable both CGAL and Trilinos, and I got through the installation of dolfin.
However when I now try to import dolfin i get this message:
torbness@
Python 2.7.3 (default, Nov 2 2012, 14:13:48)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dolfin
-------
DOLFIN runtime dependency is not met.
Install the following python module: 'ply.lex'
and make sure its location is listed in PYTHONPATH.
-------
Any idea what this is about?
Revision history for this message
|
#8 |
On 21 March 2013 23:11, Torbjørn Bækø Ness
<email address hidden> wrote:
> Question #224136 on DOLFIN changed:
> https:/
>
> Torbjørn Bækø Ness gave more information on the question:
>
> I tried to disable both CGAL and Trilinos, and I got through the installation of dolfin.
> However when I now try to import dolfin i get this message:
>
> torbness@
> Python 2.7.3 (default, Nov 2 2012, 14:13:48)
> [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import dolfin
>
> -------
> DOLFIN runtime dependency is not met.
> Install the following python module: 'ply.lex'
> and make sure its location is listed in PYTHONPATH.
> -------
>
> Any idea what this is about?
>
You need to install the Python package ply
Garth
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
Revision history for this message
|
#9 |
Thanks Garth. In retrospect I should maybe have guessed that...
So I did that, and I can now import dolfin into python without any error, however it's not
fully functional jet. If I try to run this simple program
from dolfin import *
mesh = UnitCubeMesh(
V = FunctionSpace(mesh, "CG", 1)
I get this error
python fem_test.py
-------
An MPI process has executed an operation involving a call to the
"fork()" system call to create a child process. Open MPI is currently
operating in a condition that could result in memory corruption or
other system errors; your MPI job may hang, crash, or produce silent
data corruption. The use of fork() (or system() or other calls that
create child processes) is strongly discouraged.
The process that invoked fork was:
Local host: stallo-1.local (PID 18304)
MPI_COMM_WORLD rank: 0
If you are *absolutely sure* that your application will successfully
and correctly survive a call to fork(), you may disable this warning
by setting the mpi_warn_on_fork MCA parameter to 0.
-------
Calling FFC just-in-time (JIT) compiler, this may take some time.
and then it just hangs there forever. I wasn't actually trying to run anything in parallel here so I'm not sure where MPI comes in.
Do you think this can be related to that I didn't install CGAL (or Trilinos)?
Cheers Torbjørn
Revision history for this message
|
#10 |
Thanks Garth Wells, that solved my question.