Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicts with SuperLU-6.0.0 #272

Closed
sagitter opened this issue May 25, 2023 · 18 comments
Closed

Conflicts with SuperLU-6.0.0 #272

sagitter opened this issue May 25, 2023 · 18 comments

Comments

@sagitter
Copy link

Hi all.

I'm rebuilding freefem-4.12 against SuperLU-6.0.0 but i get these errors:

In file included from SuperLu.cpp:32:
/usr/include/SuperLU/slu_zdefs.h: At global scope:
/usr/include/SuperLU/slu_zdefs.h:239:17: error: conflicting declaration of C function 'double* doubleMalloc(int)'
  239 | extern double  *doubleMalloc(int);
      |                 ^~~~~~~~~~~~
In file included from SuperLu.cpp:29:
/usr/include/SuperLU/slu_ddefs.h:236:17: note: previous declaration 'double* doubleMalloc(size_t)'
  236 | extern double  *doubleMalloc(size_t);
      |                 ^~~~~~~~~~~~
/usr/include/SuperLU/slu_zdefs.h:240:17: error: conflicting declaration of C function 'double* doubleCalloc(int)'
  240 | extern double  *doubleCalloc(int);
      |                 ^~~~~~~~~~~~
/usr/include/SuperLU/slu_ddefs.h:237:17: note: previous declaration 'double* doubleCalloc(size_t)'
  237 | extern double  *doubleCalloc(size_t);
      |                 ^~~~~~~~~~~~
tetgen.cpp: In function 'Fem2D::Mesh3* Convexhull_3Dpoints(char*, const int&, const double*, const double*, const double*, const int&, const int&)':
tetgen.cpp:872:13: warning: variable 'jtet' set but not used [-Wunused-but-set-variable]
  872 |   int itet, jtet;
      |             ^~~~
tetgen.cpp: In function 'Fem2D::Mesh3* RemplissageSurf3D_tetgen(char*, const Fem2D::Mesh3&, const int&)':
tetgen.cpp:939:13: warning: variable 'jtet' set but not used [-Wunused-but-set-variable]
  939 |   int itet, jtet;
      |             ^~~~
tetgen.cpp: In function 'Fem2D::Mesh3* RemplissageSurf3D_tetgen_new(char*, const Fem2D::MeshS&, const int&, const int&, const double*, const int&, const double*, const int&, const double*)':
tetgen.cpp:1037:13: warning: variable 'jtet' set but not used [-Wunused-but-set-variable]
 1037 |   int itet, jtet;
      |             ^~~~
tetgen.cpp: In function 'Fem2D::Mesh3* RemplissageSurf3D_tetgen_new(char*, const Fem2D::Mesh3&, const int&, const int&, const double*, const int&, const double*, const int&, const double*, const int&, const double*, const int&, const double*)':
tetgen.cpp:1163:13: warning: variable 'jtet' set but not used [-Wunused-but-set-variable]
 1163 |   int itet, jtet;
      |             ^~~~
tetgen.cpp: In function 'Fem2D::Mesh3* ReconstructionRefine_tetgen(char*, const Fem2D::Mesh3&, const int&, const double*, const int&, const double*, const int&, const double*, const double*)':
tetgen.cpp:1309:9: warning: unused variable 'lenswitch' [-Wunused-variable]
 1309 |     int lenswitch;
      |         ^~~~~~~~~
tetgen.cpp:1346:13: warning: variable 'jtet' set but not used [-Wunused-but-set-variable]
 1346 |   int itet, jtet;
      |             ^~~~
tetgen.cpp: In function 'Fem2D::Mesh3* ReconstructionRefine_tetgen(char*, const Fem2D::Mesh3&, const int&, const double*, const int&, const double*, const int&, const double*, const double*, const int&, const double*)':
tetgen.cpp:1475:9: warning: unused variable 'lenswitch' [-Wunused-variable]
 1475 |     int lenswitch;
      |         ^~~~~~~~~
tetgen.cpp:1512:13: warning: variable 'jtet' set but not used [-Wunused-but-set-variable]
 1512 |   int itet, jtet;
      |             ^~~~
tetgen.cpp: In member function 'virtual AnyType Remplissage_Op::operator()(Stack) const':
tetgen.cpp:1792:7: warning: unused variable 'sizeofmetric' [-Wunused-variable]
 1792 |   int sizeofmetric = metric.N( ) / Th.nv;
      |       ^~~~~~~~~~~~
tetgen.cpp:1899:7: warning: unused variable 'nbinside' [-Wunused-variable]
 1899 |   int nbinside = InsidePoint.N( ) / 3;

The full build log: here

@prj-
Copy link
Member

prj- commented May 25, 2023

You should reconfigure with --disable-superlu.

@sagitter
Copy link
Author

I skip the problem in this way, cant it be resolved yet?

@prj-
Copy link
Member

prj- commented May 25, 2023

You'll have to ask SuperLU developers why we can't include both headers while we previously could.

@gruenich
Copy link

gruenich commented Jun 4, 2023

Looks like an oversight to me. Can you give xiaoyeli/superlu#100 a try and confirm, whether this fixes your issue?

@aszaboa
Copy link
Contributor

aszaboa commented Jun 8, 2023

I just tried to compile FreeFem, and ran into the same issue. For me, the configure option --disable-superlu fixed the issue

@gruenich
Copy link

gruenich commented Jun 8, 2023

@aszaboa Can you please double-check that you are using SuperLU Git master and not the 6.0 release? Further, can you share the compiler output?

@aszaboa
Copy link
Contributor

aszaboa commented Jun 12, 2023

@gruenich I tried to configure PETSc with the option --download-superlu --download-superlu-commit=4e88a0b, but it did not work. I am sharing the config.log file.
configure.log

@prj-
Copy link
Member

prj- commented Jun 12, 2023

Do not waste your time, just disable SuperLU. For some weeks now, it looks like every merged PR on either SuperLU or SuperLU_DIST repository is breaking something, so frustrating.

@gruenich
Copy link

Sorry @aszaboa , for systems with broken or missing Doxygen, I introduced a regression. Your run was plagued by my mistaken. Can you please retry with commit d812a001a6d8e16906fe7376c1688d605391c368 which includes a fix?

@gruenich
Copy link

@prj- Sorry for the inconvenience my contributions might cause. I see some room for improving SuperLU, this includes a better system to detect regressions. I hope I will find to address this.

@aszaboa
Copy link
Contributor

aszaboa commented Jun 13, 2023

@gruenich I tried it and it does not work for me. I think you can sort this issue out on your own. To compile PETSc/FreeFem, I use the following tutorial: https://joliv.et/FreeFem-tutorial/main.html#[197,%22XYZ%22,28.35,272.13,null] (the compilation is in the appendix)

@gruenich
Copy link

gruenich commented Jun 13, 2023

I need your assistance. I cloned PETSc, configured it (./configure --dowload=superlu --download-superlu-commit=d812a001a6d8e16906fe7376c1688d605391c368 --with-mpi=0), make all, make check. It just worked. I need your configure.log file.

@aszaboa
Copy link
Contributor

aszaboa commented Jun 14, 2023

These are the exact commands that I use to compile FreeFem+PETSc. These should reproduce the issue.
----------------------------
export FF_DIR=${PWD}/FreeFem-sources
export PETSC_DIR=${PWD}/petsc
export PETSC_ARCH=arch-FreeFem
export PETSC_VAR=${PETSC_DIR}/${PETSC_ARCH}
git clone https://github.com/FreeFem/FreeFem-sources.git
git clone https://gitlab.com/petsc/petsc
cd ${PETSC_DIR} && ./configure --download-mumps --download-parmetis --download-metis --download-hypre --download-superlu --download-slepc --download-hpddm --download-ptscotch --download-suitesparse --download-scalapack --download-tetgen --with-fortran-bindings=no --with-scalar-type=real --with-debugging=no
make -j5
export PETSC_ARCH=arch-FreeFem-complex
./configure --with-mumps-dir=arch-FreeFem --with-parmetis-dir=arch-FreeFem --with-metis-dir=arch-FreeFem --with-superlu-dir=arch-FreeFem --download-slepc --download-hpddm --with-ptscotch-dir=arch-FreeFem --with-suitesparse-dir=arch-FreeFem --with-scalapack-dir=arch-FreeFem --with-tetgen-dir=arch-FreeFem --with-fortran-bindings=no --with-scalar-type=complex --with-debugging=no
make -j5
cd ${FF_DIR}
git checkout develop
autoreconf -i
./configure --without-hdf5 --disable-superlu --enable-download_metis --enable-download_parmetis --enable-download_mmg --enable-download_mmg3d --enable-download_parmmg --enable-download_mshmet --enable-download_nlopt --enable-optim --with-petsc=${PETSC_VAR}/lib --with-petsc_complex=${PETSC_VAR}-complex/lib
make -j5
----------------------------

I have a very shallow understanding but I think the difference may be related to --with-mpi=0. My guess is that the overwhelming majority of PETSc users uses it with mpi.

@gruenich
Copy link

You are not downloading the right version of SuperLU. You need to have -download-superlu-commit=d812a001a6d8e16906fe7376c1688d605391c368 in you PETSc configure call. Not sure how to achieve this for FreeFem.

I configured PETSc with my locally installed OpenMPI. It passes make all (I had to remove two configure checks), so I cannt reproduce the problem.

@aszaboa
Copy link
Contributor

aszaboa commented Jun 16, 2023

I think I was not precise enough. The error occurs in the FreeFem configuration - there, the --disable-superlu ˛ flag circumvents the issue. So actually the commands above may reproduce the issue if you skip the --disable-superlu ˛ flag. Anyway, as I do not use superlu, I will just continue excluding it from the compilation.

@gruenich
Copy link

Probably I did not make clear what I expected from you. I understand that it did not work with SuperLU and disabling SuperLU made it working for you. I think I fixed the issue. I was hoping that you can try your setup with the latest SuperLU master and confirm that this fixes your SuperLU issue, too.

@sagitter
Copy link
Author

sagitter commented Jul 7, 2023

xiaoyeli/superlu#100 fixes this issue for me

@prj-
Copy link
Member

prj- commented Jul 8, 2023

I will close this issue, it's not related to FreeFEM, hopefully PETSc 3.20.0 (scheduled this September) will ship a functioning SuperLU version...

@prj- prj- closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants