shared libraries

This is a discussion on shared libraries within the Linux Programming forums, part of the Platform Specific Boards category; Just downloaded and installed OPEN-MPI. I am having some problem in linking the shared library file libmpi.so.0 Code: # whereis ...

  1. #1
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342

    shared libraries

    Just downloaded and installed OPEN-MPI.
    I am having some problem in linking the shared library file libmpi.so.0


    Code:
    # whereis libmpi
    libmpi: /usr/local/lib/libmpi.la  /usr/local/lib/libmpi.so
    #  mpicc sample2.c -L//usr/local/lib -lmpi
    #   mpirun -np 2 a.out
     a.out : error while loading shared libraries : libmpi.so.0 :cannot open shared object file: No such file or directory
    What is wrong here?
    In the middle of difficulty, lies opportunity

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Possibly libmpi.la is corrupted?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    try this:
    Code:
    cd /usr/local/lib/
    ln -s libmpi.so{,.0}

  4. #4
    .
    Join Date
    Nov 2003
    Posts
    307
    Be sure /usr/local/lib is in the /etc/ld.so.conf file. Perspecitve is on the right track. It looks as if your install procedure left loose ends....

    It did complete with no errors?

  5. #5
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    @CornedBee : I have downloaded the latest stable release.I dont think thats the case.
    @Perspective : yeah, i tried that. it says the file already exists.
    @ jim : yeah, it didnt give any errors. But that file doesnot contain /usr/local/lib. I added it manually. But, still i got the same when i tried running my program.
    PS: Sorry for the delay

    EDIT: what's even more confusing is that, the same verison is working well in SUSE 10.0. But, I get this error in CENTOS.
    Last edited by kris.c; 12-25-2006 at 06:21 AM.
    In the middle of difficulty, lies opportunity

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Post the contents of the .la. It's a text file (shell script actually).
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-06-2009, 12:27 PM
  2. GCC: Compiling with both static and shared libraries
    By eatwithaspork in forum C Programming
    Replies: 4
    Last Post: 06-23-2008, 02:48 PM
  3. shared libraries, datasegment and multiple processes
    By ashim_k1 in forum Linux Programming
    Replies: 1
    Last Post: 02-28-2008, 02:23 PM
  4. Replies: 3
    Last Post: 11-07-2006, 06:41 AM
  5. Problems with shared libraries
    By nilesh82 in forum C Programming
    Replies: 2
    Last Post: 10-02-2005, 07:29 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21