Thread: Simple makefile question, shared libraries

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    269

    Simple makefile question, shared libraries

    I link to a bunch of static and shared libraries. The static ones are easy:

    Code:
    -L $(HOME)/lib -L $(LIBDIRS) $(TRANSACT_LIBS) $(MPI_LIBS)
    Pretty straight forward. TRANSACT_LIBS corresponds to a bucnh of static libraries (-lnuma -lutil etc etc etc)

    However, for MPI_LIBS, these are .so files, and I have to put the full path. When I try to do -L dir something.so something2.so .... it says it can't find the .so files.

    How do I specify a directory to search for the .so files? I have the appropriate directory appended to my LD_LIBRARY_PATH variable...

  2. #2
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    There's a foreach function in make that you can use. I don't recall the syntax off hand; you'll have to look it up.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A simple question about writing a Makefile
    By meili100 in forum C++ Programming
    Replies: 3
    Last Post: 04-29-2008, 08:07 PM
  2. shared libraries
    By kris.c in forum Linux Programming
    Replies: 5
    Last Post: 12-25-2006, 08:08 PM
  3. Shared Libraries and such
    By divineleft in forum Linux Programming
    Replies: 3
    Last Post: 11-04-2006, 08:38 PM
  4. Problems with shared libraries
    By nilesh82 in forum C Programming
    Replies: 2
    Last Post: 10-02-2005, 06:29 AM
  5. shared libraries
    By Raven Arkadon in forum C++ Programming
    Replies: 5
    Last Post: 06-27-2005, 07:11 AM