[petsc-users] Exhausted all shared linker guesses. Could not determine how to create a shared library!

Barry Smith bsmith at petsc.dev
Mon Mar 8 20:28:04 CST 2021


  Fande,

     I see you are using CONDA, this can cause issues since it sticks all kinds of things into the environment. PETSc tries to remove some of them but perhaps not enough. If you run printenv you will see all the mess it is dumping in. 

    Can you trying the same build without CONDA environment? 

  Barry


> On Mar 8, 2021, at 7:31 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Mon, Mar 8, 2021 at 8:23 PM Fande Kong <fdkong.jd at gmail.com <mailto:fdkong.jd at gmail.com>> wrote:
> Thanks Matthew,
> 
> Hmm, we still have the same issue after shutting off all unknown flags.
> 
> Oh, I was misinterpreting the error message:
> 
>   ld: can't link with a main executable file '/var/folders/tv/ljnkj46x3nq45cp9tbkc000c0000gn/T/petsc-6v1w4q4u/config.setCompilers/libconftest.dylib'
> 
> So clang did not _actually_ make a shared library, it made an executable. Did clang-11 change the options it uses to build a shared library?
> 
> Satish, do we test with clang-11?
> 
>   Thanks,
> 
>       Matt
> 
> Thanks,
> 
> Fande
> 
> On Mon, Mar 8, 2021 at 6:07 PM Matthew Knepley <knepley at gmail.com <mailto:knepley at gmail.com>> wrote:
> On Mon, Mar 8, 2021 at 7:55 PM Fande Kong <fdkong.jd at gmail.com <mailto:fdkong.jd at gmail.com>> wrote:
> Hi All,
> 
> mpicc rejected "-fPIC". Anyone has a clue how to work around this issue?
> 
> The failure is at the last step
> 
> Executing: mpicc  -o /var/folders/tv/ljnkj46x3nq45cp9tbkc000c0000gn/T/petsc-6v1w4q4u/config.setCompilers/conftest    -fPIC /var/folders/tv/ljnkj46x3nq45cp9tbkc000c0000gn/T/petsc-6v1w4q4u/config.setCompilers/conftest.o  -L/var/folders/tv/ljnkj46x3nq45cp9tbkc000c0000gn/T/petsc-6v1w4q4u/config.setCompilers -lconftest
> Possible ERROR while running linker: exit code 1
> stderr:
> ld: can't link with a main executable file '/var/folders/tv/ljnkj46x3nq45cp9tbkc000c0000gn/T/petsc-6v1w4q4u/config.setCompilers/libconftest.dylib' for architecture x86_64
> clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> but you have some flags stuck in which may or may not affect this. I would try shutting them off:
> 
> LDFLAGS_LD=-pie -headerpad_max_install_names -dead_strip_dylibs -rpath /Users/kongf/miniconda3/envs/moose/lib -L/Users/kongf/miniconda3/envs/moose/lib
> 
> I cannot tell exactly why clang is failing because it does not report a specific error.
> 
>   Thanks,
> 
>      Matt
> 
> The log was attached.
> 
> Thanks so much,
> 
> Fande
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210308/b8162af2/attachment.html>


More information about the petsc-users mailing list