[Getdp] GetDP compilation problem "cannot find -lGetDPLegacy"

Olivier Castany castany at quatramaran.ens.fr
Mon Aug 24 22:00:12 CEST 2009


Hello,
 
> Usually "/usr/bin/ld: cannot find -lGetDPLegacy" means that getdp compiled with an error but did not stop compiling. Have you set the PETSC_DIR and PETSC_ARCH variables? 

I think I did, because I configured the compilation with : ./configure --with-petsc-prefix=/usr/lib/petscdir/3.0.0 --with-petsc-arch=linux-gnu-c-opt

During compilation, I got the following error :
"""
LinAlg_PETSC.cpp: In function `void LinAlg_SetComplexInVector(double, double, gVector*, int, int)':
LinAlg_PETSC.cpp:451: error: `ti' was not declared in this scope
LinAlg_PETSC.cpp:453: error: `tj' was not declared in this scope
make[1]: *** [LinAlg_PETSC.o] Erreur 1
"""

Consequently, I modified LinAlg_PETSC.cpp in order to achieve the compilation. My modification was to move one line out of a (#if,#else,#endif) block. The patch is the following (diff -c LinAlg_PETSC.cpp LinAlg_PETSC.cpp.bak) :

**********************************************************************
*** LinAlg_PETSC.cpp    2009-08-24 21:46:08.000000000 +0200
--- LinAlg_PETSC.cpp.bak        2009-07-10 14:57:22.000000000 +0200
***************
*** 442,450 ****
  void LinAlg_SetComplexInVector(double d1, double d2, gVector *V, int i, int j)
  {
    PetscScalar tmp;
-   PetscInt ti = i, tj = j;
  #if defined(PETSC_USE_COMPLEX)
    tmp = d1 + PETSC_i * d2;
    ierr = VecSetValues(V->V, 1, &ti, &tmp, INSERT_VALUES); MYCHECK(ierr);
  #else
    tmp = d1;
--- 442,450 ----
  void LinAlg_SetComplexInVector(double d1, double d2, gVector *V, int i, int j)
  {
    PetscScalar tmp;
  #if defined(PETSC_USE_COMPLEX)
    tmp = d1 + PETSC_i * d2;
+   PetscInt ti = i, tj = j;
    ierr = VecSetValues(V->V, 1, &ti, &tmp, INSERT_VALUES); MYCHECK(ierr);
  #else
    tmp = d1;
**************************************************************

The compilation works fine then. Maybe this patch should be applied ?

Best regards,

O.C.