Problems linking to Armadillo and BLAS on hpc

Asked by Torbjørn Bækø Ness

Hi,
I'm trying to install FEniCS on the supercomputer Stallo in Tromsø which uses the Linux operation system Rocks
(http://docs.notur.no/uit/stallo_documentation/user_guide/key-numbers-about-stallo).
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/hds/home/install/cmake/2.8.9/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
   Armadillo could not be found. Be sure to set ARMADILLO_DIR. (missing:
   ARMADILLO_LIBRARIES ARMADILLO_INCLUDE_DIRS ARMADILLO_TEST_RUNS)
 Call Stack (most recent call first):
/global/hds/home/install/cmake/2.8.9/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
   cmake/modules/FindArmadillo.cmake:220 (find_package_handle_standard_args)
   CMakeLists.txt:246 (find_package)

I do not have root access and I'm trying to install dolfin to /home/torbness/.local/
There is an armadillo installation in /global/apps/armadillo which I have tried to link to, but I'm getting nowhere
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/apps/armadillo/3.6.0/)
in the file ./cmake/modules/FindArmadillo.cmake

I have pasted this from the ccmake menu,

ARMADILLO_INCLUDE_DIRS /global/apps/armadillo/3.6.0/include
 ARMADILLO_LIBRARIES /global/apps/armadillo/3.6.0/lib
 ARMADILLO_VERSION 3.6.0
 BLAS_Accelerate_LIBRARY BLAS_Accelerate_LIBRARY-NOTFOUND
 BLAS_acml_LIBRARY BLAS_acml_LIBRARY-NOTFOUND
 BLAS_acml_mp_LIBRARY BLAS_acml_mp_LIBRARY-NOTFOUND
 BLAS_atlas_LIBRARY /global/apps/atlas/3.8.2/lib/libatlas.a
 BLAS_blas_LIBRARY /usr/lib64/libblas.so
 BLAS_cblas_LIBRARY /global/apps/atlas/3.8.2/lib/libcblas.a
 BLAS_complib.sgimath_LIBRARY BLAS_complib.sgimath_LIBRARY-NOTFOUND
 BLAS_cxml_LIBRARY BLAS_cxml_LIBRARY-NOTFOUND
 BLAS_dxml_LIBRARY BLAS_dxml_LIBRARY-NOTFOUND
 BLAS_essl_LIBRARY BLAS_essl_LIBRARY-NOTFOUND
 BLAS_f77blas_LIBRARY /global/apps/atlas/3.8.2/lib/libf77blas.a
 BLAS_goto2_LIBRARY BLAS_goto2_LIBRARY-NOTFOUND
 BLAS_scsl_LIBRARY BLAS_scsl_LIBRARY-NOTFOUND
 BLAS_sgemm_LIBRARY BLAS_sgemm_LIBRARY-NOTFOUND
 BLAS_sunperf_LIBRARY BLAS_sunperf_LIBRARY-NOTFOUND
 BLAS_vecLib_LIBRARY BLAS_vecLib_LIBRARY-NOTFOUND

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
Johannes Ring (johannr) said :
#1

CMakeFiles/CMakeError.log in the build directory should give you information about why the Armadillo test didn't run correctly.

FOO_DIR variables can either be set as environment variables or by running cmake with -DFOO_DIR:PATH=/path/to/foo, but they are not cached and therefore not available in ccmake.

Revision history for this message
Torbjørn Bækø Ness (torbjorn-ness) said :
#2

Her is the output of "cat applications/dolfin-1.1.0/CMakeFiles/CMakeError.log"

Determining if the Fortran dgemm exists failed with the following output:
Change Dir: /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec3567976272/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3567976272.dir/build.make CMakeFiles/cmTryCompileExec3567976272.dir/build
gmake[1]: Entering directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_progress_report /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building Fortran object CMakeFiles/cmTryCompileExec3567976272.dir/testFortranCompiler.f.o
/usr/bin/gfortran -c /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTryCompileExec3567976272.dir/testFortranCompiler.f.o
Linking Fortran executable cmTryCompileExec3567976272
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3567976272.dir/link.txt --verbose=1
/usr/bin/gfortran CMakeFiles/cmTryCompileExec3567976272.dir/testFortranCompiler.f.o -o cmTryCompileExec3567976272 -rdynamic /global/apps/atlas/3.8.2/lib/libcblas.a /global/apps/atlas/3.8.2/lib/libf77blas.a /global/apps/atlas/3.8.2/lib/libatlas.a
/global/apps/atlas/3.8.2/lib/libf77blas.a(xerbla.o): In function `xerbla_':
xerbla.f:(.text+0x18): undefined reference to `s_wsfe'
xerbla.f:(.text+0x2f): undefined reference to `do_fio'
xerbla.f:(.text+0x46): undefined reference to `do_fio'
xerbla.f:(.text+0x50): undefined reference to `e_wsfe'
xerbla.f:(.text+0x64): undefined reference to `s_stop'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3567976272] Error 1
gmake[1]: Leaving directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3567976272/fast] Error 2

Performing C++ SOURCE FILE Test ARMADILLO_TEST_RUNS failed with the following output:
Change Dir: /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec1831763656/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1831763656.dir/build.make CMakeFiles/cmTryCompileExec1831763656.dir/build
gmake[1]: Entering directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_progress_report /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1831763656.dir/src.cxx.o
/usr/bin/c++ -DARMADILLO_TEST_RUNS -fopenmp -I/global/apps/armadillo/3.6.0/include -I/global/apps/boost/1.52.0/intel/13.0/openmpi/1.6.2/include -o CMakeFiles/cmTryCompileExec1831763656.dir/src.cxx.o -c /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec1831763656
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1831763656.dir/link.txt --verbose=1
/usr/bin/c++ -DARMADILLO_TEST_RUNS -fopenmp CMakeFiles/cmTryCompileExec1831763656.dir/src.cxx.o -o cmTryCompileExec1831763656 -rdynamic
CMakeFiles/cmTryCompileExec1831763656.dir/src.cxx.o: In function `void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gesvIdEEvPiS2_PT_S2_S2_S4_S2_S2_[void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)]+0x57): undefined reference to `wrapper_dgesv_'
CMakeFiles/cmTryCompileExec1831763656.dir/src.cxx.o: In function `void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gelsIdEEvPcPiS3_S3_PT_S3_S5_S3_S5_S3_S3_[void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)]+0x72): undefined reference to `wrapper_dgels_'
CMakeFiles/cmTryCompileExec1831763656.dir/src.cxx.o: In function `void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack5getrfIdEEvPiS2_PT_S2_S2_S2_[void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)]+0x46): undefined reference to `wrapper_dgetrf_'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec1831763656] Error 1
gmake[1]: Leaving directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec1831763656/fast] Error 2

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*exp(-beta*x);
  }
  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_LAPACK_TEST_RUNS failed with the following output:
Change Dir: /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec3074592263/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3074592263.dir/build.make CMakeFiles/cmTryCompileExec3074592263.dir/build
gmake[1]: Entering directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_progress_report /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec3074592263.dir/src.cxx.o
/usr/bin/c++ -DARMADILLO_LAPACK_TEST_RUNS -fopenmp -I/global/apps/armadillo/3.6.0/include -I/global/apps/boost/1.52.0/intel/13.0/openmpi/1.6.2/include -o CMakeFiles/cmTryCompileExec3074592263.dir/src.cxx.o -c /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec3074592263
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3074592263.dir/link.txt --verbose=1
/usr/bin/c++ -DARMADILLO_LAPACK_TEST_RUNS -fopenmp CMakeFiles/cmTryCompileExec3074592263.dir/src.cxx.o -o cmTryCompileExec3074592263 -rdynamic -llapack -lblas
CMakeFiles/cmTryCompileExec3074592263.dir/src.cxx.o: In function `void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gesvIdEEvPiS2_PT_S2_S2_S4_S2_S2_[void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)]+0x57): undefined reference to `wrapper_dgesv_'
CMakeFiles/cmTryCompileExec3074592263.dir/src.cxx.o: In function `void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gelsIdEEvPcPiS3_S3_PT_S3_S5_S3_S5_S3_S3_[void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)]+0x72): undefined reference to `wrapper_dgels_'
CMakeFiles/cmTryCompileExec3074592263.dir/src.cxx.o: In function `void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack5getrfIdEEvPiS2_PT_S2_S2_S2_[void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)]+0x46): undefined reference to `wrapper_dgetrf_'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3074592263] Error 1
gmake[1]: Leaving directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3074592263/fast] Error 2

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*exp(-beta*x);
  }
  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_BLAS_TEST_RUNS failed with the following output:
Change Dir: /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec3868868439/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3868868439.dir/build.make CMakeFiles/cmTryCompileExec3868868439.dir/build
gmake[1]: Entering directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_progress_report /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec3868868439.dir/src.cxx.o
/usr/bin/c++ -DARMADILLO_BLAS_TEST_RUNS -fopenmp -I/global/apps/armadillo/3.6.0/include -I/global/apps/boost/1.52.0/intel/13.0/openmpi/1.6.2/include -o CMakeFiles/cmTryCompileExec3868868439.dir/src.cxx.o -c /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec3868868439
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3868868439.dir/link.txt --verbose=1
/usr/bin/c++ -DARMADILLO_BLAS_TEST_RUNS -fopenmp CMakeFiles/cmTryCompileExec3868868439.dir/src.cxx.o -o cmTryCompileExec3868868439 -rdynamic -llapack -lblas -lblas
CMakeFiles/cmTryCompileExec3868868439.dir/src.cxx.o: In function `void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gesvIdEEvPiS2_PT_S2_S2_S4_S2_S2_[void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)]+0x57): undefined reference to `wrapper_dgesv_'
CMakeFiles/cmTryCompileExec3868868439.dir/src.cxx.o: In function `void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gelsIdEEvPcPiS3_S3_PT_S3_S5_S3_S5_S3_S3_[void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)]+0x72): undefined reference to `wrapper_dgels_'
CMakeFiles/cmTryCompileExec3868868439.dir/src.cxx.o: In function `void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack5getrfIdEEvPiS2_PT_S2_S2_S2_[void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)]+0x46): undefined reference to `wrapper_dgetrf_'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3868868439] Error 1
gmake[1]: Leaving directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3868868439/fast] Error 2

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*exp(-beta*x);
  }
  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_GFORTRAN_TEST_RUNS failed with the following output:
Change Dir: /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec3470588091/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3470588091.dir/build.make CMakeFiles/cmTryCompileExec3470588091.dir/build
gmake[1]: Entering directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_progress_report /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec3470588091.dir/src.cxx.o
/usr/bin/c++ -DARMADILLO_GFORTRAN_TEST_RUNS -fopenmp -I/global/apps/armadillo/3.6.0/include -I/global/apps/boost/1.52.0/intel/13.0/openmpi/1.6.2/include -o CMakeFiles/cmTryCompileExec3470588091.dir/src.cxx.o -c /home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec3470588091
/global/hds/home/install/cmake/2.8.9/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3470588091.dir/link.txt --verbose=1
/usr/bin/c++ -DARMADILLO_GFORTRAN_TEST_RUNS -fopenmp CMakeFiles/cmTryCompileExec3470588091.dir/src.cxx.o -o cmTryCompileExec3470588091 -rdynamic -llapack -lblas -lblas -lgfortran
CMakeFiles/cmTryCompileExec3470588091.dir/src.cxx.o: In function `void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gesvIdEEvPiS2_PT_S2_S2_S4_S2_S2_[void arma::lapack::gesv<double>(int*, int*, double*, int*, int*, double*, int*, int*)]+0x57): undefined reference to `wrapper_dgesv_'
CMakeFiles/cmTryCompileExec3470588091.dir/src.cxx.o: In function `void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack4gelsIdEEvPcPiS3_S3_PT_S3_S5_S3_S5_S3_S3_[void arma::lapack::gels<double>(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*)]+0x72): undefined reference to `wrapper_dgels_'
CMakeFiles/cmTryCompileExec3470588091.dir/src.cxx.o: In function `void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)':
src.cxx:(.text._ZN4arma6lapack5getrfIdEEvPiS2_PT_S2_S2_S2_[void arma::lapack::getrf<double>(int*, int*, double*, int*, int*, int*)]+0x46): undefined reference to `wrapper_dgetrf_'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3470588091] Error 1
gmake[1]: Leaving directory `/home/torbness/applications/dolfin-1.1.0/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3470588091/fast] Error 2

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*exp(-beta*x);
  }
  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
Andy R Terrel (andy-terrel) said :
#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_INSTALL_PREFIX=${INSTALL_DIR} \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_CXX_COMPILER=mpicxx \
      -DCMAKE_CXX_FLAGS="-mkl" \
      -DCMAKE_C_COMPILER=mpicc \
      -DCMAKE_C_FLAGS="-mkl" \
      -DCMAKE_FORTRAN_COMPILER=mpif90 \
      -DCMAKE_FORTRAN_FLAGS="-mkl" \
      -DCMAKE_VERBOSE_MAKEFILE=ON \
      -DARMADILLO_INCLUDE_DIRS=${ARMADILLO_DIR}/include \
      -DARMADILLO_LIBRARIES=${ARMADILLO_DIR}/lib/libarmadillo.so \
      -DHDF5_DIR=${TACC_HDF5_DIR} \
      -DHDF5_LIBRARIES=${TACC_HDF5_LIB}/libphdf5.so \
      -DPARMETIS_INCLUDE_DIRS=${PETSC_DIR}/externalpackages/parmetis-4.0.2-p3/${PETSC_ARCH}/include
\
      -DPARMETIS_LIBRARY=${PETSC_DIR}/externalpackages/parmetis-4.0.2-p3/${PETSC_ARCH}/libparmetis/libparmetis.so
\
      -DMETIS_LIBRARY=${PETSC_DIR}/externalpackages/metis-5.0.2-p3/${PETSC_ARCH}/libmetis/libmetis.so
\
      -DPYTHON_INCLUDE_DIR=${TACC_PYTHON_DIR}/include/python2.7/ \
      -DPYTHON_LIBRARY=${TACC_PYTHON_LIB}/libpython2.7.so \
      -DPETSC_DIR=${PETSC_DIR} \
      -DPETSC_ARCH=${PETSC_ARCH} \
      -DSCOTCH_INCLUDE_DIRS=${SCOTCH_DIR}/include \
      -DSCOTCH_LIBRARY=${SCOTCH_DIR}/lib/libscotch.a \
      -DSCOTCH_DIR=${SCOTCH_DIR} \
      -DSLEPC_DIR=${SLEPC_DIR} \
      -DSLEPC_INCLUDE_DIRS=${SLEPC_DIR}/${PETSC_ARCH}/include \
      -DSLEPC_LIBRARY=${TACC_SLEPC_DIR}/${PETSC_ARCH}/lib/libslepc.so \
      -DZLIB_LIBRARY=/usr/lib64/libz.so \
      .. 2>&1 | tee ${LOGFILE}

Revision history for this message
Torbjørn Bækø Ness (torbjorn-ness) said :
#4

Thanks for the feedback. I tried to change to this instead,

 ARMADILLO_INCLUDE_DIRS /global/apps/armadillo/3.6.0/include
 ARMADILLO_LIBRARIES /global/apps/armadillo/3.6.0/lib/libarmadillo.so

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://fenicsproject.org/download/snapshot_releases.html#snapshot-releases
but I don't know how I would try to install the linux version without root?

Thanks,
Torbjørn

Revision history for this message
Garth Wells (garth-wells) said :
#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://answers.launchpad.net/dolfin/+question/224136
>
> 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_INCLUDE_DIRS /global/apps/armadillo/3.6.0/include
> ARMADILLO_LIBRARIES /global/apps/armadillo/3.6.0/lib/libarmadillo.so
>
> 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://fenicsproject.org/download/snapshot_releases.html#snapshot-releases
> 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
Torbjørn Bækø Ness (torbjorn-ness) said :
#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/apps/FEniCS/1.0.0/include/trilinos

   I'm locally setting Trilinos_DIR to

     /global/apps/FEniCS/1.0.0/include/lib/cmake/Trilinos

There is no folder called /global/apps/FEniCS/1.0.0/include/lib so I'm not sure why cmake wants to link there. Do you have any suggesting on what I should do here?

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_BACKWARDS_COMPATIBILITY to 1.6 or less. If you are writing a CMake listfile, you should change the variable reference to use the case of the argument to
 FIND_PACKAGE.

 CMake Warning at /global/apps/FEniCS/1.0.0/include/trilinos/TrilinosConfig.cmake:59 (MESSAGE):
   TrilinosConfig.cmake has moved. It now exists at a location under the
   installation prefix where the find_package command looks by default
   (<prefix>/lib/cmake/Trilinos). This compatibility file exists at the old
   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/apps/FEniCS/1.0.0/include/trilinos

   I'm locally setting Trilinos_DIR to

     /global/apps/FEniCS/1.0.0/include/lib/cmake/Trilinos

   and loading TrilinosConfig.cmake from its new location. One may suppress
   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_package(Trilinos REQUIRED PATHS ${TRILINOS_PATH}/include)

   Change it to the form

     set(CMAKE_PREFIX_PATH ${TRILINOS_PATH} ${CMAKE_PREFIX_PATH})
     find_package(Trilinos REQUIRED)

   to find TrilinosConfig.cmake in its new location in future builds while
   still honoring the TRILINOS_PATH option for this application.
 Call Stack (most recent call first):
   CMakeLists.txt:323 (find_package)

 CMake Error at /global/apps/FEniCS/1.0.0/include/trilinos/TrilinosConfig.cmake:81 (INCLUDE):
   include could not find load file:

     /global/apps/FEniCS/1.0.0/include/lib/cmake/Trilinos/TrilinosConfig.cmake
 Call Stack (most recent call first):
   CMakeLists.txt:323 (find_package)

 CMake Warning at CMakeLists.txt:328 (message):
   Unable to find Trilinos (>= 11.0.0)

 CMake Warning at cmake/modules/FindCGAL.cmake:46 (find_package):
   Could not find a package configuration file provided by "CGAL" with any of
   the following names:

     CGALConfig.cmake
     cgal-config.cmake

   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.txt:395 (find_package)

 CMake Warning at dolfin/CMakeLists.txt:263 (message):
   QVTK not found, disabling QT for plotting

 CMake Warning at demo/undocumented/plot-qt/cpp/CMakeLists.txt:67 (message):
   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
Torbjørn Bækø Ness (torbjorn-ness) said :
#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@stallo-1:~$ python
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
Best Garth Wells (garth-wells) said :
#8

On 21 March 2013 23:11, Torbjørn Bækø Ness
<email address hidden> wrote:
> Question #224136 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/224136
>
> 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@stallo-1:~$ python
> 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

    http://www.dabeaz.com/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
Torbjørn Bækø Ness (torbjorn-ness) said :
#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(10,10,10)
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
Torbjørn Bækø Ness (torbjorn-ness) said :
#10

Thanks Garth Wells, that solved my question.