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

PETSc configure and geosx linking #63

Open
andrea-franceschini opened this issue Sep 16, 2019 · 21 comments
Open

PETSc configure and geosx linking #63

andrea-franceschini opened this issue Sep 16, 2019 · 21 comments
Assignees

Comments

@andrea-franceschini
Copy link
Contributor

With the current CMakeLists.txt, I'm not able to compile PETSc.
I have an error during the PETSc configure:

Warning! Incorrect argument type specified: -with-mpi=0 --download-ptscotch --with-superlu_dist-dir=/home/franc90/code/geosx/thirdPartyLibs/install-default-release/superlu_dist --with-parmetis-dir=/home/franc90/code/geosx/thirdPartyLibs/install-default-release/parmetis --with-hypre-dir=/home/franc90/code/geosx/thirdPartyLibs/install-default-release/hypre --with-blaslapack-dir= - expecting type Bool.

Then, everything compiles but, when linking geosx, it looks for PCHYPRESetType and it is missing (I think it should be in the PETSc lib). A ldd of the PETSc lib doesn't show any hypre contents.

According to the error from PETSc configure, the wrong part of the code should be:
https://github.com/GEOSX/thirdPartyLibs/blob/089a2a5bbeda91a2b3bd4f30c389d8c21959b0a5/CMakeLists.txt#L798

I'm using Ubuntu 18.04, with cmake 3.10.2, gcc/g++/gfortran 7.4.0 and openmpi 2.1.1.

@andrea-franceschini
Copy link
Contributor Author

After #60, I'm able to compile the tpl, but linking GEOSX is still a problem. The error that I have is:
libpetsc.so: undefined reference to `SCOTCH_ParMETIS_V3_NodeND'

@TotoGaz
Copy link
Contributor

TotoGaz commented Sep 17, 2019 via email

@andrea-franceschini
Copy link
Contributor Author

Everything is set up according to the default options and MPI should be enabled.
In the installation folder I have:

libpetsc.so
libpetsc.so.3.10
libpetsc.so.3.10.2
libptesmumps.a
libptscotch.a
libptscotcherr.a
libptscotcherrexit.a
libptscotchparmetis.a
libscalapack.a
libscotch.a
libscotcherr.a
libscotcherrexit.a
libscotchmetis.a
petsc
pkgconfig

@rrsettgast
Copy link
Member

have you tried a newer cmake?

@andrea-franceschini
Copy link
Contributor Author

Not yet! I'm trying to use a local installation, but the module folder conflicts with the system one (/usr/share/cmake-3.10/Modules) ...

@rrsettgast
Copy link
Member

Can you confirm that it doesn't work on another system?

@TotoGaz
Copy link
Contributor

TotoGaz commented Sep 18, 2019 via email

@andrea-franceschini
Copy link
Contributor Author

Can you confirm that it doesn't work on another system?

I don't have another system ... Do you mean something different from Ubuntu 18.04?

@andrea-franceschini
Copy link
Contributor Author

Yes, it's available in libptscotchparmetis.a only.

@TotoGaz
Copy link
Contributor

TotoGaz commented Sep 18, 2019 via email

@andrea-franceschini
Copy link
Contributor Author

Today I compiled everything from scratch (both TPL and GEOSX) and I always have the same error:
libpetsc.so: undefined reference to `SCOTCH_ParMETIS_V3_NodeND'

@AntoineMazuyer
Copy link

AntoineMazuyer commented Sep 18, 2019

btw, I also have a similar problem :

/usr/bin/ld: gk_cur_jbufs: TLS definition in lib/libgeosx_core.so section .tdata mismatches non-TLS definition in /usr/lib/libmetis.so section .data
/usr/bin/ld: /usr/lib/libmetis.so: error adding symbols: bad value
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/geosx.dir/build.make:143: bin/geosx] Error 1
make[1]: *** [CMakeFiles/Makefile2:358: CMakeFiles/geosx.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

When compiling geosx :/

Maybe it is related to the recent changes in the tpls ?

@TotoGaz
Copy link
Contributor

TotoGaz commented Sep 18, 2019 via email

@andrea-franceschini
Copy link
Contributor Author

Having a closer look to the PETSc library problem, I notice that, in the cmake inital configuration of GEOSX, the following variable is set:
Petsc_LIBRARIES = .../code/geosx/thirdPartyLibs/install-default-release/petsc/lib/libpetsc.so
and the libptscotchparmetis.a is completely missing.
Can this be the problem?

@francoishamon
Copy link
Contributor

@AF1990 @TotoGaz I had linking problems earlier this week, but I managed to compile the TPLs and GEOSX on my machine without any problem after pulling the recent changes this morning. My system is Ubuntu 18.04, gcc 7.4.0, openmpi 2.1.1.

@andrea-franceschini
Copy link
Contributor Author

I really don't understand where the difference is 😢
I'm always facing the scotch error ...

@francoishamon
Copy link
Contributor

@AF1990 Strange... and we are using the same version of CMake (3.10.2)

I don't know if it helps for your specific problem, but the only thing that I had to change on my system to solve an issue with Scotch and compile the TPLs was:
sudo apt-get install flex bison
and then from there everything went smoothly.

@andrea-franceschini
Copy link
Contributor Author

I already have both of them ...

@AntoineMazuyer
Copy link

Do you have the linking command line (maybe VERBOSE=1 will help)? Did you recompile your petsc or superlu recently? Is it possible that it went wrong ? Do you have a libmetis in your TPL ?

I think the problem comes from metis which is already integrated in PETSc so there is two concurrent versions and the linker is lost somehow.

@andrea-franceschini
Copy link
Contributor Author

Digging into the problem, it turns out that the already present scotch library on my system seems to be the main issue. It is compiled without the SCOTCH_METIS_PREFIX that PETSc requires. When PETSc links to create libpetsc.so, it uses the system library (why???), leaving undefined some functions, like SCOTCH_ParMETIS_V3_NodeND, that are present without the SCOTCH_ prefix, i.e., ParMETIS_V3_NodeND.
Any idea on how to solve the problem (the possibility to remove scotch from the system is not one!)?

@andrea-franceschini
Copy link
Contributor Author

Josh, I added you because I know you are working with PETSc now. Maybe you are interested in this problem.

@TotoGaz TotoGaz removed their assignment Jul 3, 2024
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

Successfully merging a pull request may close this issue.

7 participants