Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

On Big Red or Quarry at IU, how do I link to a library?

Note: Following a system-wide upgrade in December 2012, Quarry now runs Red Hat Enterprise Linux version 6 (RHEL 6) and uses the Modules package (instead of SoftEnv) for manipulating user environments. For more, see Information about the 2012 upgrade to Quarry at IU. If you encounter any problems or have questions, email the High Performance Systems group.

Note: Big Red is scheduled to be retired from service in June 2013. Indiana University is replacing it with Big Red II, the fastest university-owned supercomputer in the nation, capable of performing one quadrillion floating-point operations per second (1 petaflop). Based on Cray XE/XK technology, Big Red II has 676 XK nodes (each containing one AMD "Interlagos" processor and one NVIDIA "Kepler" GPU) and 344 XE nodes (each containing two AMD "Abu Dhabi" processors). For more, see Big Red II at Indiana University.

On Unix systems (including Big Red and Quarry at Indiana University), if the library file resides in one of the standard directories (i.e., /usr/lib/lib or /usr/local/lib), you can link to the library by using the  -l  flag (lowercase L). For example, linking with the -lx flag actually means the library file is libx.a or libx.so in one of the standard directories.

If the library is not in a standard directory, use the  -L  flag (uppercase L) to explicitly specify the library file search path. For example, if the LAPACK library resides in the /libapps/lapack directory, use the following to link with it:

-L/libapps/lapack -llapack

The linker ld usually searches in the directories specified by the  -L  flag first, and then in the standard directories. The first match will satisfy the search. If files with both .a and .so extensions are found in a directory, the .so file is used.

For more, see the ld man page. Also, see When compiling a C program in Unix, why do I get "ld: Unresolved:"?

Note: In some special cases, you cannot link to a library using  -l  flags; for example, on Solaris systems, the Sun Performance Library uses -xlic_lib .

This is document akqm in domain all.
Last modified on November 01, 2012.

I need help with a computing problem

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.



Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

I have a comment for the Knowledge Base

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.