Results 1 to 6 of 6

Thread: What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?

  1. #1
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    257

    Unhappy What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?

    Hi, I am building ElmerGUI Flatpak package, https://github.com/kevinsmia1939/fla...e/fi.csc.Elmer
    but I have some problem understanding something about building package in general.

    I got error while compiling ElmerGUI. I did build Open MPI before Elmer. But Elmer does not seems to find Open MPI.




    Code:
    [ 65%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/TimeIntegrate.F90.o
    [ 65%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/ListMatrix.F90.o
    [ 65%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/IterativeMethods.F90.o
    [ 65%] Linking CXX executable ElmerGUI
    [ 65%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/IterSolve.F90.o
    /usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lMPI::MPI_C
    [ 65%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/SParIterSolver.F90.o
    collect2: error: ld returned 1 exit status
    make[2]: *** [ElmerGUI/Application/CMakeFiles/ElmerGUI.dir/build.make:1352: ElmerGUI/Application/ElmerGUI] Error 1
    make[1]: *** [CMakeFiles/Makefile2:24531: ElmerGUI/Application/CMakeFiles/ElmerGUI.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    I can check where and what Open MPI ld is looking for using

    Code:
    ld -IMPI --verbose
    ld: mode elf_x86_64 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libMPI.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libMPI.a failed 
    attempt to open /usr/lib/x86_64-linux-gnu/libMPI.so failed 
    attempt to open /usr/lib/x86_64-linux-gnu/libMPI.a failed 
    attempt to open /usr/lib/libMPI.so failed 
    attempt to open /usr/lib/libMPI.a failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/libMPI.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/libMPI.a failed 
    ld: cannot find -lMPI 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libMPI.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/MPI.a failed 
    attempt to open /usr/lib/x86_64-linux-gnu/libMPI.so failed 
    attempt to open /usr/lib/x86_64-linux-gnu/MPI.a failed 
    attempt to open /usr/lib/libMPI.so failed 
    attempt to open /usr/lib/MPI.a failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/libMPI.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/MPI.a failed 
    Error: module test: Child process exited with code 1
    
    Is it normal for ld to not find Open MPI in /usr because in case of Flatpak, it is installed in /app

    So I use,
    Code:
    ld -L/app/lib -lMPI --verbose
    attempt to open /app/lib/libMPI.so succeeded 
    /app/lib/libMPI.so
    bla bla
    which it does find Open MPI.

    But with
    Code:
    ld -L/app/lib -lMPI::MPI_C --verbose
    ld: mode elf_x86_64 
    attempt to open /app/lib/libMPI::MPI_C.so failed 
    attempt to open /app/lib/libMPI::MPI_C.a failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libMPI::MPI_C.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libMPI::MPI_C.a failed 
    attempt to open /usr/lib/x86_64-linux-gnu/libMPI::MPI_C.so failed 
    attempt to open /usr/lib/x86_64-linux-gnu/libMPI::MPI_C.a failed 
    attempt to open /usr/lib/libMPI::MPI_C.so failed 
    attempt to open /usr/lib/libMPI::MPI_C.a failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/libMPI::MPI_C.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/libMPI::MPI_C.a failed 
    ld: cannot find -lMPI::MPI_C 
    attempt to open /app/lib/libMPI::MPI_C.so failed 
    attempt to open /app/lib/MPI::MPI_C.a failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/libMPI::MPI_C.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib64/MPI::MPI_C.a failed 
    attempt to open /usr/lib/x86_64-linux-gnu/libMPI::MPI_C.so failed 
    attempt to open /usr/lib/x86_64-linux-gnu/MPI::MPI_C.a failed 
    attempt to open /usr/lib/libMPI::MPI_C.so failed 
    attempt to open /usr/lib/MPI::MPI_C.a failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/libMPI::MPI_C.so failed 
    attempt to open /usr/x86_64-unknown-linux-gnu/lib/MPI::MPI_C.a failed 
    Error: module test: Child process exited with code 1
    
    Failed, so...


    I would like to know what the part "::MPI_C" mean. Thanks.

  2. #2

    Default Re: What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?

    https://github.com/ResearchComputing...mming/MPI-C.md

    IMHO you need MPI for C and C++ being installed - not only Fortran part.

  3. #3
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    257

    Default Re: What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?

    Quote Originally Posted by Svyatko View Post
    https://github.com/ResearchComputing...mming/MPI-C.md

    IMHO you need MPI for C and C++ being installed - not only Fortran part.
    Hi,
    Thanks for reply, I am not sure what am I missing. Elmer have OpenMP and MPI flag, but is it referring to mpich or OpenMPI?

  4. #4
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    257

    Default Re: What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?

    I pass this flags to Open MPI, still same error.

    Code:
           --prefix=/app
           --bindir=/app/bin
           --datadir=/app/share
           --includedir=/app/include
           --libdir=/app/lib
           --enable-mpi-fortran=all
           --enable-mpi-cxx
           --disable-static
           --enable-builtin-atomics
           --enable-mpi-thread-multiple
           --with-libmpi-name=MPI

  5. #5

    Default Re: What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?


  6. #6
    Join Date
    Oct 2018
    Location
    Atlantis
    Posts
    257

    Default Re: What does "::MPI_C" meant in ld: cannot find -lMPI::MPI_C?

    Quote Originally Posted by Svyatko View Post
    Thanks for the help, but I still can't figured it out. I will ask around.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •