PETSc is unable to simultaneously build SuperLU and SuperLU_DIST with Fortran disabled

Issue #83 new
Aron Ahmadia
created an issue

Error message in make:

     CLINKER /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libpetsc.3.05.2.dylib
duplicate symbol _mc64bd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64rd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64sd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64wd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64dd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64ed_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64fd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64ud_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
duplicate symbol _mc64qd_ in:
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_dist_3.3.a(mc64ad.o)
    /Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libsuperlu_4.3.a(mc64ad.o)
ld: 9 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/aron/sandbox/petsc/arch-darwin-c-debug/lib/libpetsc.3.05.2.dylib] Error 1
make[2]: Leaving directory `/Users/aron/sandbox/petsc'
make[1]: *** [gnumake] Error 2
make[1]: Leaving directory `/Users/aron/sandbox/petsc'
**************************ERROR*************************************
  Error during compile, check arch-darwin-c-debug/conf/make.log
  Send it and arch-darwin-c-debug/conf/configure.log to petsc-maint@mcs.anl.gov
********************************************************************
make: *** [all] Error 1

Configure and make logs are attached.

Comments (7)

  1. BarryFSmith

    I answered this via email response and for some reason bitbucket didn't put my response here. So here it is again:

    Ok, this is complicated.

    1) PETSc determines Fortran mangling. If no fortran compiler then uses 'unchanged' compilers.py line 15 2) PETSc determines BLAS/LAPACK mangling but first testing with Fortran mangling Notes: on Apple the blas/lapack libraries have both unchanged and _ versions of the symbols 3) PETSc passes the blas/lapack mangling to SuperLU and SuperLU_DIST makefiles 4a) SuperLU_DIST mangles the symbols mc64id and mc64ad based on the mangling passed in (in Cnames.h) 4b) SuperLU does not mangle the symbols mc64id and mc64ad based on the mangling passed in, it always uses an _ at the end 5) both SuperLU and SuperLU_DIST contain the file mc64ad.c which compiles identically unless the mangling is not _ 6) when linking PETSc needs to squeeze the two non-identical mc64ad.o into the shared library or executable bad news when

    The good news is that in SuperLU_DIST 4.0 Sherry changed the symbol names in mc64ad.c hopefully preventing the conflict. She still keeps the mangling for the symbols but which is silly since they are all in C and only used in C; this is a relic from the when she originally used the fortran code.

    So I am going to say the bug will not be fixed, rather it will go away when we upgrade PETSc to use 4.0

    Note: you can change compilers.py line 15 to underscore to resolve the problem for you particular build.

    Barry

  2. BarryFSmith
    Ok, this is complicated.
    

    1) PETSc determines Fortran mangling. If no fortran compiler then uses 'unchanged' compilers.py line 15 2) PETSc determines BLAS/LAPACK mangling but first testing with Fortran mangling Notes: on Apple the blas/lapack libraries have both unchanged and _ versions of the symbols 3) PETSc passes the blas/lapack mangling to SuperLU and SuperLU_DIST makefiles 4a) SuperLU_DIST mangles the symbols mc64id and mc64ad based on the mangling passed in (in Cnames.h) 4b) SuperLU does not mangle the symbols mc64id and mc64ad based on the mangling passed in, it always uses an _ at the end 5) both SuperLU and SuperLU_DIST contain the file mc64ad.c which compiles identically unless the mangling is not _ 6) when linking PETSc needs to squeeze the two non-identical mc64ad.o into the shared library or executable bad news when

    The good news is that in SuperLU_DIST 4.0 Sherry changed the symbol names in mc64ad.c hopefully preventing the conflict. She still keeps the mangling for the symbols but which is silly since they are all in C and only used in C; this is a relic from the when she originally used the fortran code.

    So I am going to say the bug will not be fixed, rather it will go away when we upgrade PETSc to use 4.0

    Note: you can change compilers.py line 15 to underscore to resolve the problem for you particular build.

    Barry

  3. Denis Davydov

    i actually came across this issue with SuperLU_DIST 4.0 (although externally built):

    duplicate symbol _mc64dd_ in:
        /usr/local/opt/superlu_dist/lib/libsuperlu_dist.a(mc64ad_dist.o)
        /usr/local/opt/superlu/lib/libsuperlu.a(mc64ad.o)
    duplicate symbol _mc64ed_ in:
        /usr/local/opt/superlu_dist/lib/libsuperlu_dist.a(mc64ad_dist.o)
        /usr/local/opt/superlu/lib/libsuperlu.a(mc64ad.o)
    duplicate symbol _mc64fd_ in:
        /usr/local/opt/superlu_dist/lib/libsuperlu_dist.a(mc64ad_dist.o)
        /usr/local/opt/superlu/lib/libsuperlu.a(mc64ad.o)
    
  4. Log in to comment