Programming Languages on Power

Power Programming Languages

IBM Power, including the AIX, IBM i, and Linux operating systems, support a wide range of programming languages, catering to both traditional enterprise applications and modern development needs.


#Power


#Servers
#Programminglanguages
 View Only
Expand all | Collapse all

The device linker only supports static linking

  • 1.  The device linker only supports static linking

    Posted 10/16/18 10:55 PM

    Originally posted by: Itaru Kitayama


    Hi,

    At link time of my OpenMP offload enabled application I get:

    [...]

    [ 97%] Linking CXX executable nest
    /gpfs/software/opt/xlc/16.1.0/xlC/16.1.0/bin/.orig/xlc++: warning: 1501-308 The device linker only supports static linking.  Any device code placed into a shared library by the qmkshrobj option will be inaccessible.
    /gpfs/software/opt/xlc/16.1.0/xlC/16.1.0/bin/.orig/minilink: warning: 1501-308 The device linker only supports static linking.  Any device code placed into a shared library by the qmkshrobj option will be inaccessible.
    [ 98%] Built target nest_lib

    [...]

     

    How do I correctly treat this warning message? I'm on Minskey, using the XL 16.1.0, community edition compiler. 


    #C/C++andFortran
    #Ask-Question-Here--General-Compiler-Q-and-A


  • 2.  Re: The device linker only supports static linking

    Posted 10/17/18 09:08 AM

    Originally posted by: Rafik_Zurob


    Hello

    The warning message above is usually issued when you have both the -qmkshrobj and the -qoffload options in the same link command.  The -qmkshrobj option creates shared libraries (*.so).  The -qoffload option enables offloading OpenMP target regions to the GPU.

    • If the code you're putting in the shared library does not contain OpenMP target regions or declare target functions, you can safely ignore the warning message.
    • If the code you're putting in the shared library contains OpenMP target regions or declare target regions, the resulting device code will not be callable from outside the shared library.  This is because the device linker (nvlink) only knows how to link to static libraries (*.a) and so it ignores shared libraries (*.so).  This is currently a limitation in the device linker, and we can't do anything about it.  Additionally, in my experience, device code within the library that's called from target regions within the same library also does not work.  Theoretically, it is possible to make this part work, but we don't currently support it.

    So if you have target regions / declare target regions and you need to put them in a library, please use a static library instead by removing -qmkshrobj and placing the object files into an archive via the "ar" command.


    #Ask-Question-Here--General-Compiler-Q-and-A
    #C/C++andFortran