1 / 7

Outline

Outline. Announcements HWI due today, 5PM HWII available later today Updated syllabus Sign-up for CTC account Building UNIX Shared Objects Building Windows DLL’s. Syllabus. Intro, Philosophy Types of libraries & where to find them Using libraries I: compiling and linking

keiji
Download Presentation

Outline

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Outline Announcements HWI due today, 5PM HWII available later today Updated syllabus Sign-up for CTC account Building UNIX Shared Objects Building Windows DLL’s

  2. Syllabus Intro, Philosophy Types of libraries & where to find them Using libraries I: compiling and linking Survey of numerical methods and available libraries Using libraries II: inter-language operability DLL’s Getting what you pay for--legal and moral issues Graphics & GUIs lecture (OpenGL) Graphics & GUIs Intro to MPI and parallelism Cornell Theory Center and Velocity MPI Lab

  3. Cornell Theory Center Accounts Week 4 will be devoted to parallel programming with MPI Monday: lecture on MPI and parallel programming Wednesday: lecture on CTC systems Friday: lab on MPI Lab will require logging into CTC Go to http://www.tc.cornell.edu/Services/allocations/explore.asp Fill in information: Advisor: Andrew Pershing Project Title: CIS 404

  4. Creating Shared-object libraries Compile with -fPIC and -c flags PIC stands for “Position Independent Code” Link explicitly with linker (ld) and some options: ld -shared -soname lib<name>.so.1 -o lib<name>.so.1.0 -lc <name>.o -shared says to make the library shared -soname gives the library a soname -o gives the library a name

  5. Compile your program (-c) Link it to your so-library (-L<path> -l<name>) Add <path> to your LD_LIBRARY_PATH: CSH: setenv LD_LIBRARY_PATH $(LD_LIBRARY_PATH):<path> BASH: export LD_LIBRARY_PATH= $(LD_LIBRARY_PATH):<path> For more info, check out www-106.ibm.com/developerworks/library/l-shobj/ Using Shared-object Libraries

  6. Windows allows you to “hide” routines in DLLs from users. To “export” a routine, you must place __declspec(dllexport) in front of its prototype: void PrintArray(…) becomes __declspec(dllexport) void PrintArray(…) Link with the /dll flag Creates 3 files: .dll, .lib, .exp Creating DLL’s on Windows

  7. Build your program, link to the .lib file To run, you need to place the .dll in your PATH or set your PATH to point to the DL set PATH=%PATH%;<DLLPATH> For more info on DLL’s, check out www.tc.cornell.edu/services/edu/topics/libraries/more.asp Using DLL’s on Windows

More Related