PGI compiler TIPS
PGI¥³¥ó¥Ñ¥¤¥é¤òÍøÍѤ·¤¿¥ê¥ó¥¯Áàºî¤Î΢µ»
µ»½Ñ¾ðÊó¡¦TIPS¡¡> ¥ê¥ó¥¯Áàºî¤Î΢µ»
¡¡

PGI ¥³¥ó¥Ñ¥¤¥é¤òÍøÍѤ¹¤ëºÝ¤Î¥é¥¤¥Ö¥é¥ê¡¦¥ê¥ó¥¯Áàºî¤Î΢µ»¡¡¡Ê2005ǯ5·î6Æü¡Ë

PGI ¥³¥ó¥Ñ¥¤¥é¤Ë¸Â¤é¤º¡¢°ìÈÌŪ¤Ê¥³¥ó¥Ñ¥¤¥é¤Ç¤Ï¡¢¥¢¥»¥ó¥Ö¥ëµ¡Ç½¤È¥ê¥ó¥¯µ¡Ç½¤Ï¡¢GNU¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»ÈÍѤ·¤Þ¤¹¡ÊLinux ¤Î¾ì¹ç¡Ë¡£°ìÈ̤ˡ¢¥×¥í¥°¥é¥à¤Î¥³¥ó¥Ñ¥¤¥ë¤«¤é¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ÎÀ¸À®¤Þ¤Ç¤Ï¡¢°Ê²¼¤ÎÆâÉôŪ¤Ê¼ê³¤­¤¬¹Ô¤ï¤ì¤Æ¤¤¤Þ¤¹¡£PGI ¥³¥ó¥Ñ¥¤¥é¤Ï°Ê²¼¤Î¼ê³¤­¤ò¼«Æ°Åª¤Ë¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£°Ê²¼¤Î¼ê³¤­¤ÎÆâÍƤȳƥ³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤òÃΤ뤿¤á¤ÎÊýË¡¤Ï¡¢¤³¤Á¤é¤ÇÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡£

  1. ¥³¥ó¥Ñ¥¤¥ë¡õ¥³¡¼¥ÉÀ¸À® (pgi ¤Î¥³¥ó¥Ñ¥¤¥é¥³¥Þ¥ó¥É¡¦¥³¥Þ¥ó¥É¡Ë
  2. ¥¢¥»¥ó¥Ö¥é¤Ë¤è¤ë¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¡¡(GNU as ¥³¥Þ¥ó¥É¡Ë
  3. ¥ê¥ó¥«¤Ë¤è¤ë¥é¥¤¥Ö¥é¥êÅù¤Î¥ê¥ó¥¯¤ò¹Ô¤Ã¤Æ¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ÎÀ¸À®¡¡¡ÊGNU ld ¥³¥Þ¥ó¥É¡Ë


¾åµ­¤Î¼ê³¤­¤ÎÃæ¤Ç¡¢1¡¤2 ¤Ë´Ø¤·¤Æ¤Ï¥æ¡¼¥¶¤¬Ä¾ÀÜÁàºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤¬¡¢3 ¤Î¥ê¥ó¥±¡¼¥¸¤Î½èÍý¤Ë´Ø¤·¤Æ¤Ï¡¢¥æ¡¼¥¶Æȼ«¤Ç GNU ¤Î ld ¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤òÁàºî¤·¤Æ¡¢¥ê¥ó¥¯»þ¤ÎÌäÂêÅù¤ËÂбþ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
°Ê²¼¤ËÀâÌÀ¤¹¤ëÆâÍƤϡ¢¥ê¥ó¥¯¤Ë¤ª¤±¤ëÍÍ¡¹¤Ê΢µ»¤ÎÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¹¡£¡Ö¥ê¥ó¥¯»þ¤Ë¤ª¤±¤ëÌäÂê¡×¤Î¿¤¯¤Ï¡¢É¬ÍפȤ¹¤ë¥é¥¤¥Ö¥é¥ê¤¬¸«¤Ä¤«¤é¤Ê¤¤ÌäÂꡢƱ¤¸´Ø¿ô¡¦¥µ¥Ö¥×¥í¥°¥é¥à¤òÊ̤Υ饤¥Ö¥é¥ê¡¦¥Õ¥¡¥¤¥ë¤«¤é¥ê¥ó¥¯¤·¤¿¤¤Åù¤ÎÂн褬¿¤¤¤¿¤á¡¢¥ê¥ó¥±¡¼¥¸¤Ë´Ø¤¹¤ë´ðËÜŪ¤ÊÃ챤òÍפ·¤Þ¤¹¡£ ¤³¤³¤Ç¤Ï¡¢¥ê¥ó¥¯»þ¤Ë¤ª¤±¤ë¡Ö¥é¥¤¥Ö¥é¥ê¡×¤ÎÂнèË¡¤Ë´Ø¤·¤Æ¥Õ¥©¡¼¥«¥¹¤·¡¢¤½¤Î΢µ»¤òÀâÌÀ¤·¤Þ¤¹¡£

¡ü ¥é¥ó¥¿¥¤¥à¡¦¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤¹¤ë´ðÁÃÃμ±
¤Þ¤º»Ï¤á¤Ë¡¢¼Â¹Ô¥â¥¸¥å¡¼¥ë¤Ë¥ê¥ó¥¯¤µ¤ì¤ë¡¢¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤¹¤ë´ðÁÃŪ¤Ê»ö¹à¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£¥æ¡¼¥¶¡¦¥×¥í¥°¥é¥à(¥ª¥Ö¥¸¥§¥¯¥È¡Ë¤Ë¥ê¥ó¥¯¤µ¤ì¤ë¥é¥¤¥Ö¥é¥ê¤Ë¤Ï¡¢Â礭¤¯°Ê²¼¤ÎÆó¤Ä¤Î¥é¥¤¥Ö¥é¥ê·Á¼°¤¬¤¢¤ê¤Þ¤¹¡£

  • ¥¹¥¿¥Æ¥£¥Ã¥¯(ÀÅŪ¡Ë¥é¥¤¥Ö¥é¥ê
  • ¥·¥§¥¢¡¼¥É¡Ê¶¦Í­¡Ë¥é¥¤¥Ö¥é¥ê

Æó¤ÄÌܤζ¦Í­¥é¥¤¥Ö¥é¥ê¤ÎÈÏáƤˤϡ¢°ìÈ̤˥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤È¸À¤¦·Á¼°¤Î¤â¤Î¤â¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤ÎÆüì¤ÊÎã¤Ç¤¹¡£¥¹¥¿¥Æ¥£¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥ê¥ó¥¯»þ¤Ë¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ÎÃæ¤ËÁȤ߹þ¤Þ¤ì¤Þ¤¹¡£¥â¥¸¥å¡¼¥ë¥µ¥¤¥º¤ÏÂ礭¤¯¤Ê¤ê¤Þ¤¹¤¬¡¢Ê̤Υ·¥¹¥Æ¥à¾å¤ÇÆ°ºî¤µ¤»¤¿¤¤¾ì¹ç¤Ï¡¢Á´¤ÆɬÍפʥ饤¥Ö¥é¥ê¤¬ÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¤½¤Î¤Þ¤Þ¤Î·Á¤ÇÆ°ºî¤·¤Þ¤¹¡£°ìÈ̤ˡ¢¥Õ¥¡¥¤¥ë̾·Á¼°¤È¤·¤Æ¡¢lib***.a ¤È¸À¤¦ .a ¤Î̾¾Î¤¬¤Ä¤±¤é¤ì¤Æ¤ª¤ê¤Þ¤¹¡£¥¹¥¿¥Æ¥£¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢°ìÈ̤ˡ¢ar ¥³¥Þ¥ó¥É¤Ç¥ª¥Ö¥¸¥§¥¯¥È(*.o)¤ò¤Þ¤È¤á¡¢ ranlib ¥³¥Þ¥ó¥É¤Ç¥ê¥ó¥¯¤ò¹â®²½¤¹¤ëÀèƬ»Ò¤ò¤Ä¤±¡¢strip ¥³¥Þ¥ó¥É¤Ç¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤òºï½ü¤·¤Þ¤¹¡£
°ìÊý¡¢¥·¥§¥¢¡¼¥É¡Ê¶¦Í­¡Ë¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô»þ¤Ë¥·¥¹¥Æ¥à¾å¤ËÈ÷¤¨¤Æ¤¤¤ë¡¢¤½¤Î¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤·¤Æ»ÈÍѤ¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ê¡¢¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó¤¬°Û¤Ê¤Ã¤¿¤ê¡¢¥·¥¹¥Æ¥à¾å¤Ë¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢¼Â¹Ô¥â¥¸¥å¡¼¥ë¤¬Æ°ºî¤·¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£°ìÈ̤ˡ¢¥Õ¥¡¥¤¥ë̾·Á¼°¤È¤·¤Æ¡¢lib***.so ¤È¸À¤¦ .so ¤Î̾¾Î¤¬¤Ä¤±¤é¤ì¤Æ¤ª¤ê¤Þ¤¹¡£¥·¥§¥¢¡¼¥É¥é¥¤¥Ö¥é¥ê¤Î°ì¤Ä¤Ç¤¢¤ë¡¢¥À¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤È¤Ï¡¢¼Â¹Ô»þ¤Ë load/unload ¤¹¤ë¤³¤È¤¬²Äǽ¤Ê¡Ö°ÌÃÖÆÈΩ¤Ê¥é¥¤¥Ö¥é¥ê·Á¼°¡×¤Î¤â¤Î¤ò¸À¤¤¤Þ¤¹¡£¤³¤ì¤Ï¡¢¥ê¥ó¥¯»þ¤Î¥ª¥×¥·¥ç¥ó¤Ë -fPIC ¤ò»ØÄꤷ¤ÆºîÀ®¤µ¤ì¤Æ¤ª¤ê¤Þ¤¹¡£

°ìÈ̤μ¹ԥ⥸¥å¡¼¥ë¤Ï¡¢¤Û¤È¤ó¤É¤¬¡Ö¥·¥§¥¢¡¼¥É¡Ê¶¦Í­¡Ë¥é¥¤¥Ö¥é¥ê¡×¤ò¥ê¥ó¥¯¤¹¤ë¤È¤ÎÁ°Äó¤ÇÀ¸À®¤µ¤ì¡¢¼Â¹Ô»þ¤ËɬÍפȤµ¤ì¤ë¥·¥¹¥Æ¥à¶¦Í­¥é¥¤¥Ö¥é¥ê¤ÈPGI ¤Î¾ì¹ç¤Ï¡¢PGI ÍѤζ¦Í­¥é¥¤¥Ö¥é¥ê¤¬¥í¡¼¥É¤µ¤ì¤ë·Á¼°¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥ê¥ó¥¯Êý¼°¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¡¢¡Ö¥ê¥ó¥¯»þ¤Ë¤ª¤±¤ëÌäÂê¡×¤Ï¡¢¤Û¤È¤ó¤ÉȯÀ¸¤·¤Þ¤»¤ó¤¬¡¢ÌÀ¼¨Åª¤Ë¥¹¥¿¥Æ¥£¥Ã¥¯(ÀÅŪ)¥é¥¤¥Ö¥é¥ê¤ò¥ê¥ó¥¯¤¹¤ëºÝ¤Ë̤²ò·è¤Ê¥ª¥Ö¥¸¥§¥¯¥È¡¦¥ë¡¼¥Á¥ó¤¬Â¸ºß¤¹¤ë¾ì¹ç¤äºî°ÙŪ¤Ë¤¢¤ë¥é¥¤¥Ö¥é¥ê¤òÁȤ߹þ¤ß¤¿¤¤Åù¤ÎÁàºî¤ò¤·¤¿¾ì¹ç¡¢¥ê¥ó¥¯»þ¤ÎÌäÂ꤬ȯÀ¸¤·¤Þ¤¹¡£


¡ü ¥ê¥ó¥¯»þ¤Ë¤ª¤±¤ë¥é¥¤¥Ö¥é¥ê¤ÎÁȹþ¤ß½ç½ø
¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥ê¥ó¥«¤Ï¤Þ¤º¡¢¥·¥§¥¢¡¼¥É¡Ê¶¦Í­¡Ë¥é¥¤¥Ö¥é¥ê¤ò¸¡º÷¤·¡¢É¬ÍפȤʤë¥ë¡¼¥Á¥ó¤òÁȤ߹þ¤â¤¦¤È¤·¤Þ¤¹¡£¼¡¤Ë¡¢¥¹¥¿¥Æ¥£¥Ã¥¯(ÀÅŪ)¤Ê¥é¥¤¥Ö¥é¥ê¤ÎÃ椫¤éõ¤·½Ð¤·¡¢¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ËÁȤ߹þ¤ß¤Þ¤¹¡£½¾¤Ã¤Æ¡¢°ìÈ̤Υ³¥ó¥Ñ¥¤¥ë(¥ê¥ó¥¯)¥ª¥×¥·¥ç¥ó¤Ç¤Ï¡¢¤¢¤ëÇÛθ¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¡¢¾ï¤Ë¡¢¥·¥§¥¢¡¼¥É¡Ê¶¦Í­¡Ë¥é¥¤¥Ö¥é¥ê¤¬ÁȤ߹þ¤Þ¤ì¤ë¤È¸À¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤ÎÅÀ¤òÍý²ò¤·¤Æ¤ª¤¯¤¬¡¢¡Ö¥ê¥ó¥¯¤¹¤ë½ç½ø¡×¤È¶¦¤Ë½ÅÍפʥݥ¤¥ó¥È¤È¤Ê¤ê¤Þ¤¹¡£
¤Á¤Ê¤ß¤Ë¡¢¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ÎÃæ¤Ç¤É¤Î¤è¤¦¤Ê dynamic shared library ¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¤Ï¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É (ldd) ¤Ç³Î¤«¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°Ê²¼¤ÎÎã¤Ç¤Ï¡¢PGI ´ØÏ¢¤Î libpgc.so ¤À¤±¤Ç¤Ê¤¯¡¢¥·¥¹¥Æ¥à¤ËÈ÷¤¨¤é¤ì¤¿¥·¥§¥¢¡¼¥É¡Ê¶¦Í­¡Ë¥é¥¤¥Ö¥é¥ê¤â¥ê¥ó¥¯¤µ¤ì¤ë¤Ù¤­¼Â¹Ô¥â¥¸¥å¡¼¥ë¤Ç¤¢¤ë¤³¤È¤¬Ê¬¤«¤ê¤Þ¤¹¡£ÆÃ¤Ë libpgc.so ¥Õ¥¡¥¤¥ë¤Ï¡¢PGI ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Þ¥·¥ó¾å¤Ç¤·¤«Â¸ºß¤·¤Þ¤»¤ó¡£Î㤨¤Ð¡¢Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤³¤Î¤è¤¦¤Ê¼Â¹Ô¥â¥¸¥å¡¼¥ë¤òÆ°ºî¤µ¤»¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤Îlibpgc.so ¥Õ¥¡¥¤¥ë¤òͽ¤á¥³¥Ô¡¼¤·¤Æ¤ª¤¯¤³¤È¤¬É¬ÍפȤʤê¤Þ¤¹¡£


¡¡$ ldd a.out
¡¡¡¡¡¡libc.so.6 => /lib/i686/libc.so.6 (0x4002d000)
¡¡¡¡¡¡libpgc.so => /usr/pgi/linux86/5.2/lib/libpgc.so (0x4015d000)
¡¡¡¡¡¡libm.so.6 => /lib/i686/libm.so.6 (0x40172000)
¡¡¡¡¡¡/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

°ìÊý¡¢¥¹¥¿¥Æ¥£¥Ã¥¯¤Ê¥é¥¤¥Ö¥é¥ê¤ò¥ê¥ó¥¯¤·¤ÆºîÀ®¤µ¤ì¤¿¼Â¹Ô¥â¥¸¥å¡¼¥ë¤Ç¤Ï¡¢ldd ¥³¥Þ¥ó¥É¤Ç¤É¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤ë¤Ç¤·¤ç¤¦¤«¡©°Ê²¼¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£

¡¡$ ldd a.out
¡¡¡¡¡¡not a dynamic executable

¥ê¥ó¥«¤¬°ÅÌۤǹԤ¦¥·¥¹¥Æ¥à¾å¤Î¥é¥¤¥Ö¥é¥ê¸¡º÷½ç½ø¤Ï¾åµ­¤Ë½Ò¤Ù¤¿¤È¤ª¤ê¤Ç¤¹¤Î¤Ç¡¢¤³¤ì¤òºî°ÙŪ¤ËÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢½ê˾¤È¤¹¤ë¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Á¥ó¤òÀè¤ËÁȤ߹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°ìÈ̤ˡ¢¥ê¥ó¥«¡Ê¥³¥Þ¥ó¥É¡Ë¤Î¥ª¥×¥·¥ç¥ó¤Î»ØÄê¤Ç¡¢¥é¥¤¥Ö¥é¥ê¤Î¸¡º÷½ç°Ì¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤È¤Ï¸À¤Ã¤Æ¤â¡¢¤³¤ÎÁàºî¤Ï´Êñ¤Ç¡¢Ã±¤Ë¥ê¥ó¥¯¤¹¤ë¥é¥¤¥Ö¥é¥ê̾¤ò¥³¥Þ¥ó¥ÉÎó¤ÎÃæ¤ÇÀè¤Ë»ØÄꤹ¤ë¤À¤±¤ÎÁàºî¤È¤Ê¤ê¤Þ¤¹¡£¤³¤Î¤³¤È¤òÍý²ò¤¹¤ì¤Ð¡¢¸å¤Ï»î¹Ôºø¸í¤Ç¡¢¥ê¥ó¥¯¥¨¥é¡¼¤¬µ¯¤­¤Ê¤¤¤è¤¦¤Ë½ê˾¤È¤¹¤ë¥é¥¤¥Ö¥é¥ê¤òÁȤ߹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Ê£¿ô¤Î¥é¥¤¥Ö¥é¥ê´Ö¤Ç¸Æ¤Ó½Ð¤·/»²¾È¤Î½ç½ø¤Î°Í¸´Ø·¸¤¬¤¢¤ë¾ì¹ç¡¢¥é¥¤¥Ö¥é¥ê̾¤ò¥³¥Þ¥ó¥ÉÎó¤Ç»ØÄꤹ¤ë½ç½ø¤Ï¡¢É¬¤º°Ê²¼¤Î¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡Ê½ç½ø¤Ï¥»¥ó¥·¥Æ¥£¥Ö¤Ç¤¹¡Ë¡£

¡¡Î㤨¤Ð¡¢¡¡¥æ¡¼¥¶¤Î¥¹¥¿¥Æ¥£¥Ã¥¯¥é¥¤¥Ö¥é¥ê libA.a ¤ÎÃæ¤Î´Ø¿ô¤¬¡¢libB.a ¤ÎÃæ¤Î´Ø¿ô¤òɬÍפȤ¹¤ë¾ì¹ç¤ÎÎã¤òµ­¤·¤Þ¤¹¡£

¡¡¡¡¡¡libA.a ---> libB.a ¡Ê¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¤Ï¡¢ libA.so ---> libB.so)

¡¡¥ê¥ó¥«¤Î¥³¥Þ¥ó¥ÉÎó¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê½çÈ֤ǥê¥ó¥¯¸¡º÷½ç½ø¤ò»ØÄꤷ¤Þ¤¹¡£¥é¥¤¥Ö¥é¥ê(*.a) Æâ¤Î»²¾È¤Î²ò·è¤Ï¡¢¥³¥Þ¥ó¥É¹Ô¤Ëµ­¤µ¤ì¤¿¤â¤Î¤ò½çÈ֤ˡ¢1²ó¸Â¤ê¤Î¸¡º÷¤ò¹Ô¤¤¤Þ¤¹¡£ÆäËÂç»ö¤Ê¤³¤È¤Ï¡¢¥³¥Þ¥ó¥É¹Ô¾å¤ÇÀè¹Ô¤¹¤ë¥¢¡¼¥«¥¤¥Ö¡¦¥é¥¤¥Ö¥é¥ê¤ò¡¢¸å³¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë¡Ê¥é¥¤¥Ö¥é¥ê¤ò´Þ¤à¡ËÆâ¤Î¿·¤·¤¤»²¾È¤Î²ò·è¤Ë»ÈÍѤ¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³¤Î¥ê¥ó¥±¡¼¥¸¤Ë¤ª¤±¤ë°ÅÌۤηè¤Þ¤ê¤´¤È¤¬¡¢¥³¥Þ¥ó¥É¹Ô¤Î¥é¥¤¥Ö¥é¥ê̾»ØÄê¤Î½ç½ø¤Ë´Ø·¸¤·¤Þ¤¹¡£°Ê²¼¤ÎÎã¤Ç¤Ï¡¢ºÇ½é¤Ë test.o ¤Î̤²ò·è¤Î»²¾È¤ò¥³¥Þ¥ó¥É¹Ô¤Î¼¡°Ê¹ß¤Ëµ­¤µ¤ì¤¿ *.a ¤ò½çÈ֤˸¡º÷¤·¤Æ²ò·è¤¹¤ì¤ÐÌäÂê¤Ê¤¯¡¢test.o ¤ò¼Â¹Ô¥â¥¸¥å¡¼¥ë¤Ë¤Ç¤­¤Þ¤¹¤¬¡¢¤³¤ì¤ÇÁ´¤ÆOK¤È¤Ï¸À¤¨¤Þ¤»¤ó¡£¼¡¤Î¥³¥Þ¥ó¥É¹Ô¤Ë½Ð¤Æ¤¯¤ë libA.a ÆâÉô¤Î̤²ò·è»²¾È¤¬¤¢¤ë¤«¤É¤¦¤«¡¢¥ê¥ó¥«¤Ï¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£¥ê¥ó¥«¤Ï¡¢¥³¥Þ¥ó¥É¹Ô¤ÎlibA.a ¤Î±¦Â¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥é¥¤¥Ö¥é¥ê¤Î¤ß¤·¤«¡¢Ì¤²ò·è»²¾È¥·¥ó¥Ü¥ë¤ò¸¡º÷¤·¤Þ¤»¤ó¡£¤â¤·¡¢¤½¤ÎÁ°¤Ë¥¢¡¼¥«¥¤¥Ö̾µ­½Ò¤µ¤ì¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢Î㤨¤Ð¡¢¤³¤Î¾ì¹çlibB.a ¤¬¥³¥Þ¥ó¥É¹Ô¤ÎÁ°¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤Æ¤â¡¢¡Ö¸¡º÷¡×¼«ÂΤò¹Ô¤¤¤Þ¤»¤ó¡£¾ï¤Ë¡¢¥³¥Þ¥ó¥É¹Ô¤ò1²ó¸Â¤ê¡¢¾ï¤Ë±¦¤Ë¤¢¤ë¤â¤Î¤ò¸¡º÷¤¹¤ë¤Î¤ß¤Ç¤¹¡£

¡¡¡¡¡¡pgCC test.o -Bstatic -L{directory} -lA -lB ¡Ê -lB -lA ¤Î½çÈÖ¤Ç¤Ï libB.a ¤Î´Ø¿ô¤¬Ì¤²ò·è¤Ë¤Ê¤ê¤Þ¤¹¡Ë

¡¡¤¢¤ë¤¤¤Ï¡¢ÌÀ¼¨Åª¤Ë¥é¥¤¥Ö¥é¥ê̾¤ò»ØÄꤷ¤Þ¤¹¡£

¡¡¡¡¡¡pgCC test.o -Bstatic libA.a libB.a
¡¡
¡¡¶¦Í­¥é¥¤¥Ö¥é¥ê¡ÊlibA.so¡¢libB.so¡Ë¤Î¾ì¹ç¤Ï¡¢
¡¡¡¡¡¡pgCC test.o -L{directory} -lA -lB ¤¢¤ë¤¤¤Ï¡¢pgCC test.o libA.so libB.so

¡ü ÀÅŪ¤Ë¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤Î¥³¥ó¥Ñ¥¤¥ë¡¦¥ª¥×¥·¥ç¥ó
PGI ¥³¥ó¥Ñ¥¤¥é¤Ç¤Ï¡¢¥ê¥ó¥«¤ËÀÅŪ¥ê¥ó¥±¡¼¥¸¤ò¹Ô¤¦¤³¤È¤ò»Ø¼¨¤¹¤ë¤¿¤á¤Ë¡¢ -Bstatic ¤È¸À¤¦¥ª¥×¥·¥ç¥ó¤¬¤¢¤ê¤Þ¤¹¡£´ðËÜŪ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ë¤è¤Ã¤Æ¡¢¥ê¥ó¥«¤ÏÀÅŪ¥é¥¤¥Ö¥é¥ê¤òÀè¤Ë¸¡º÷¤·¤è¤¦¤È¤·¤Þ¤¹¡£Ã¢¤·¡¢-Bstatic ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¼Â¹Ô¥â¥¸¥å¡¼¥ë¤òºîÀ®¤¹¤ëºÝ¤Ë¡¢¥ê¥ó¥«¤Î¥ì¥Ù¥ë¤Ç¡¢¡Ö̤²ò·è¤Ê»²¾È¥ë¡¼¥Á¥ó¡×¤¬Â¸ºß¤·¤Æ¡¢¼Â¹Ô¥â¥¸¥å¡¼¥ë¤¬ºîÀ®¤Ç¤­¤Ê¤¤¥¨¥é¡¼¤¬À¸¤¸¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¡¢PGI ¥³¥ó¥Ñ¥¤¥é¡Êld¡¡¥ê¥ó¥«¡Ë¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥é¥¤¥Ö¥é¥ê¤Î¸¡º÷½ç½ø¤¬Å¬Åö¤Ç¤Ê¤¤¾ì¹ç¤ËÀ¸¤¸¤Þ¤¹¡£¤³¤ÎÂкö¤Ë¤Ä¤¤¤Æ¤Ï¡¢°Ê²¼¤ËÎã¤ò¼¨¤·¤Þ¤·¤¿¡£

(1) -Bstatic ¤ò»ØÄꤹ¤ë¤È¡¢Ì¤²ò·è¤Ê¥é¥¤¥Ö¥é¥ê¥ë¡¼¥Á¥ó¤¬Â¸ºß¤·¡¢¥â¥¸¥å¡¼¥ë¤¬À¸À®¤Ç¤­¤Ê¤¤ÌäÂê

pgCC (C++) ¤ò»ÈÍѤ·¤Æ¡¢¥Ç¥Õ¥©¥ë¥È¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò¥ê¥ó¥¯¤·¤Æ¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ÏÌäÂê¤Ê¤¯ºîÀ®¤Ç¤­¤ë¤¬¡¢ÀÅŪ¥ê¥ó¥¯ -Bstatic ¤ò»ØÄꤹ¤ë¤È¡¢¥ê¥ó¥¯»þ¤Ë¡¡Ž¢Ì¤²ò·è¤Ê»²¾È¥ë¡¼¥Á¥ó¡×¡¡¤¬Â¸ºß¤¹¤ë¤È¸À¤¦·Á¤Ç¥¨¥é¡¼¤Ë¤Ê¤ë¡£

$ pgCC test.C ¡¡¡ÊưŪ¥ê¥ó¥¯¤ÏÌäÂê¤Ê¤¯¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ÏÀ¸À®¤µ¤ì¤ë¡Ë

$ pgCC -Bstatic test.C ¡ÊÀÅŪ¥ê¥ó¥¯¤Ç̤²ò·è¤Ê»²¾È¤¬¤¢¤ê¥¨¥é¡¼¡Ë
¡¡/usr/pgi/linux86-64/6.0/lib/libstd.a(locale_impl.o)(.text+0x25): In function ¡¡
¡¡`std::_STLP_mutex_base::_M_acquire_lock( (void))':: undefined reference to `pthread_mutex_lock'
¡¡/usr/pgi/linux86-64/6.0/lib/libstd.a(locale_impl.o)(.text+0x35): In function ¡¡
¡¡`std::_STLP_mutex_base::_M_release_lock( (void))':: undefined reference to `pthread_mutex_unlock'


¡¡¡Ú²ò·èÊýË¡¡Û

ÌäÂê¤Î¾õ¶·¤ÎÇÄ°®¡§
ưŪ¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢Àµ¾ï¤Ê¥é¥¤¥Ö¥é¥ê¤Î¥ê¥ó¥¯¤¬¤Ê¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¥é¥¤¥Ö¥é¥ê´Ö¤Î»²¾È°Í¸À­¤Ï²ò·è¤µ¤ì¤Æ¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¡£°ìÊý¡¢ÀÅŪ¥é¥¤¥Ö¥é¥ê¤ò»ÈÍѤ·¤Æ¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ö¤Î»²¾È¤Î°Í¸À­¤¬Â¸ºß¤·¤Æ¤¤¤ë¡£libstd.a ¥é¥¤¥Ö¥é¥ê¤¬¡¢pthread ´Ø·¸¤ÎÀÅŪ¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê¤ò»²¾È¤¹¤ë¤¬¡¢¤³¤ì¤é¤Î¥é¥¤¥Ö¥é¥ê¤Î¥ê¥ó¥¯¤Î½ç½ø¤ÎÉÔÀ°¹ç¤«¡¢¤¢¤ë¤¤¤Ï¡¢pthread ¤Î¥é¥¤¥Ö¥é¥ê¤¬¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¸À¤¦Í½ÁÛ¤¬¤Ä¤¯¡£Æ°Åª¥é¥¤¥Ö¥é¥ê¤ÈÀÅŪ¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¡¢¸Ä¡¹¤Î¥é¥¤¥Ö¥é¥ê¤Î¤½¤Î»²¾È¹½À®¤¬°Û¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£¾¯¤Ê¤¯¤È¤â¡¢ÀÅŪ¥ê¥ó¥¯Ë¡¤Ç¤Ï¡¢libstd.a ¤¬ÌÀ¼¨Åª¤Ë¥ê¥ó¥¯¤µ¤ì¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤·Á¼°¤È¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤À(ưŪ¥ê¥ó¥¯¤È¤Ï°Û¤Ê¤ë¡Ë¡£¤½¤ÎÃæ¤Ç¡¢pthread ¥é¥¤¥Ö¥é¥ê¤¬»²¾È¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¥ê¥ó¥¯»þ¤Ë¤³¤Î pthread ¥é¥¤¥Ö¥é¥ê¤¬²¿¤é¤«¤Î·Á¤Ç»²¾È¤Ç¤­¤Ê¤¤¤È¤¤¤¦¾õ¶·¤Î¤è¤¦¤Ç¤¢¤ë¡£

¡Ú¥ê¥ó¥¯»þ (ld) ¤Î¥ª¥×¥·¥ç¥ó¤ÎÀßÄê¤òÄ´¤Ù¤ë¡Û
$ pgCC -Bstatic test.C -#¡¡¡¡¡Ê¥³¥ó¥Ñ¥¤¥ë¼ê³¤­¤Î¾ÜºÙ¤òÄ´¤Ù¤ë¡Ë
¡¡/usr/bin/ld /usr/lib64/crt1.o /usr/lib64/crti.o /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/crtbegin.o
-m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /tmp/pgCCcaaaareeat.o
-L/usr/pgi/linux86-64/6.0/lib -L/usr/lib64 -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3
-rpath /usr/pgi/linux86-64/6.0/lib -Bstatic -lstd -lC -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/crtend.o /usr/lib64/crtn.o

¾åµ­¤Î ld ¥³¥Þ¥ó¥É¤Î¥é¥¤¥Ö¥é¥ê»ØÄê¤ÎÃæ¤Ç¡¢-lstd (libstd.a) ¤Ï¸ºß¤¹¤ë¤¬¡¢ -lpthread (libpthread.a) ¤Î»ØÄê¤Ï¤Ê¤¤¤¿¤á¡¢Ì¤²ò·è¤Ê»²¾È¤È¤·¤Æ¥¨¥é¡¼¤È¤Ê¤Ã¤Æ¤¤¤ë¡£

¡Úlibstd.a ¤È libpthread.a ¤Î¸ºß¾ì½ê¤òÄ´¤Ù¤ë¡Û
¾åµ­¤Î¥³¥Þ¥ó¥ÉÎó¤ÎÃæ¤Ç¡¢¥é¥¤¥Ö¥é¥ê»²¾È¥Ñ¥¹¡¡-L/usr/pgi/linux86-64/6.0/lib -L/usr/lib64 ¤ÎÃæ¤Ë¸ºß¤¹¤ë¤«¤òÄ´¤Ù¤ë¡£ÆÃ¤Ë libpthread.a ¤Î¸ºß¤òÄ´¤Ù¤ë¤È¡¢³Î¤«¤Ë /usr/lib64 ÇÛ²¼¤Ë¸ºß¤¹¤ë¡£½¾¤Ã¤Æ¡¢¥³¥ó¥Ñ¥¤¥ë(¥ê¥ó¥¯¡Ë¥ª¥×¥·¥ç¥ó¤Ë¡¢ÌÀ¼¨Åª¤Ë -lpthread ¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¥ê¥ó¥¯¤¬²Äǽ¤Ç¤¢¤ë¤ÈͽÁÛ¤¬¤Ä¤¯¡£

¡Ú¥³¥ó¥Ñ¥¤¥ë(¥ê¥ó¥¯¡Ë¥ª¥×¥·¥ç¥ó¤Ë¡¢É¬Íפʥ饤¥Ö¥é¥ê̾¤òÉÕ¤±²Ã¤¨¤ë¡Û
¥³¥ó¥Ñ¥¤¥ë¡¦¥ª¥×¥·¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢¤³¤ÎÌäÂê¤ò²óÈò¤¹¤ë¤¿¤á¤ÎÊýË¡¤ò°Ê²¼¤Ë¼¨¤¹¡£¥é¥¤¥Ö¥é¥ê¤Î»ØÄê¤Ï¡¢É¬¤º¡¢¥æ¡¼¥¶¥×¥í¥°¥é¥à test.C¡Êtest.o) ¤Î¸å¤Ë»ØÄꤷ¤¿Êý¤¬°ÂÁ´¤Ç¤¢¤ë¡£(»²¾È¤Î¾å°Ì¤Î½çÈÖ¤«¤é»ØÄꤹ¤ë¡Ë

  pgCC -Bstatic test.C  -lstd -lpthread  (std ¤È pthread ¤Î½çÈÖ¤ò´Ö°ã¤ï¤Ê¤¤¤è¤¦¤Ë¡ª¡Ë

¤¢¤ë¤¤¤Ï¡¢

¡¡pgCC -Bstatic test.C  -Wl,'-lstd','-lpthread'

¤¢¤ë¤¤¤Ï¡¢

¡¡pgcc -Bstatic test.C /usr/pgi/linux86-64/6.0/lib/libstd.a /usr/lib64/libpthread.a


(2) FORTRN77 3F´Ø¿ô ¤Ë´Ø¤·¤Æ PGI Ä󶡴ؿô¤Ç¤Ï¤Ê¤¯¡¢¥Í¥¤¥Æ¥£¥Ö¤Ê G77 3F ´Ø¿ô¤Î¥é¥¤¥Ö¥é¥ê¤ò¥ê¥ó¥¯¤¹¤ë

3F ¥ë¡¼¥Á¥ó¤È¤·¤ÆÃΤé¤ì¤Æ¤¤¤ë Fortan run-time ¥é¥¤¥Ö¥é¥ê¤Ç¤¢¤ë¡¢Linux ¥·¥¹¥Æ¥à¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼è¤ê»ý¤Ä´Ø¿ô¡¢¥µ¥Ö¥×¥í¥°¥é¥à¤Ï¡¢Â¿¤¯¤Î¥·¥¹¥Æ¥à¾å¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï¡¢ FORTRAN77 3F ¥ë¡¼¥Á¥ó¤È¾Î¤µ¤ì¡¢C¥×¥í¥°¥é¥à¤¬ C ¥é¥¤¥Ö¥é¥ê¤Ç Linux ¥·¥¹¥Æ¥à¤Î¥·¥§¥ëŽ¢Åù¤Îµ¡Ç½¤òÀ©¸æ¤Ç¤­¤ë¤è¤¦¤Ë¡¢¤³¤ì¤é¤ÈƱÍͤʵ¡Ç½¤òÄ󶡤·¤Þ¤¹¡£PGI ¥³¥ó¥Ñ¥¤¥é¤Ï¡¢¤³¤ì¤é3F ´Ø¿ô¤¬¥×¥í¥°¥é¥à¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¼«Æ°Åª¤Ë¥ê¥ó¥¯(¥í¡¼¥É¡Ë¤·ÍøÍѤǤ­¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï¡¢PGI ¤¬Ä󶡤¹¤ë3F¸ß´¹¤Î¥é¥¤¥Ö¥é¥ê¤¬¡¢¥ê¥ó¥¯¤µ¤ì¤Þ¤¹¤¬¡¢´Ø¿ô¤Î½ÐÎϤ¹¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤¬°Û¤Ê¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢GNU ¤Î 3F ´Ø¿ô·Á¼°¤Î½ÐÎϤòÍøÍѤ·¤¿¤¤¾ì¹ç¡¢¥Í¥¤¥Æ¥£¥Ö¤Ê3F ´Ø¿ô¤ò¥ê¥ó¥¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾õ¶·¤¬À¸¤¸¤Þ¤¹¡£
¤³¤³¤Ç¤ÎÎã¤Ï¡¢PGI ¤Î¥Ç¥Õ¥©¥ë¥È¤Î 3F ´Ø¿ô¤ò»ÈÍѤ»¤º¤Ë¡¢Linux ¥·¥¹¥Æ¥à¤¬Ä󶡤·¤Æ¤¤¤ë g77 ¤Î 3F ´Ø¿ô¤ò¥ê¥ó¥¯¤·¤¿¤¤¤È¸À¤¦Í×µá¤ËÂФ¹¤ëÂнèÎã¤ò¼¨¤·¤¿¤â¤Î¤Ç¤¹¡£¶ñÂÎŪ¤Ë¤Ï¡¢idate ´Ø¿ô¤Î½ÐÎÏ¥Õ¥©¡¼¥Þ¥Ã¥È¤¬ g77 ¤È¤Ï°Û¤Ê¤ë¾ì¹ç¡¢PGI ¤Î¥é¥¤¥Ö¥é¥ê¤Ç¤Ï¤Ê¤¯¡¢GNU g77 ¤Î¥é¥¤¥Ö¥é¥ê¤òľÀÜ¥ê¥ó¥¯¤·¤¿¤¤¾ì¹ç¤Î¥ê¥ó¥¯¤ÎÊýË¡¤ò½Ò¤Ù¤¿¤â¤Î¤Ç¤¹¡£

¥×¥í¥°¥é¥àÎ㡧 3F ´Ø¿ô idate ¤Î»ÈÍÑÎã test.f

      INTEGER*4 ia(3)
      call idate( ia )
      write(*, "(' The date is: ',3i5)" ) ia
      stop
      end

¼Â¹ÔÎ㡧 idate ¤Ï¡¡Ç¯·îÆü¤ò½ÐÎϤ¹¤ë´Ø¿ô¤Ç¤¹

$ pgf95 -g77libs -o a.out test.f
$ ./a.out
 The date is:     4   19    5  ¡Ê²¼µ­¤Î g77 ¤Î¾ì¹ç¤È½ÐÎÏ·Á¼°¤¬°Û¤Ê¤ë¡Ë

$ g77 -o a.out test.f
$ ./a.out
 The date is:    19    4 2005

  • PGI ¥³¥ó¥Ñ¥¤¥é¤Ç¤Ï ÁȤ߹þ¤ß´Ø¿ô¤Ï´ðËÜŪ¤Ë¡¢PGI ¤¬Ä󶡤¹¤ë´Ø¿ô·²¡¢G77¸ß´¹¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤¬Á°Äó¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð¡¢G77 ¤Î¸ß´¹Áȹþ¤ß´Ø¿ô¤Ï /usr/pgi/linux86/6.0/lib/libpgftnrtl.a ¤È¸À¤¦¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤Æ¤ª¤ê¤Þ¤¹¡£
  • °ìÊý¡¢Linux ¤¬Ä󶡤¹¤ë g77 ¤Î Áȹþ¤ß´Ø¿ô¤Ë´Ø¤·¤Æ¤Ï¡¢°ìÈ̤ˤϡ¢/usr/lib/libg2c.a or libg2c.so ¤Ë´Þ¤Þ¤ì¤Æ¤ª¤ê¤Þ¤¹¡£¾ì½ê¤Ï Linux OS ¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¤¬¡¢g77¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¢¤ì¤Ð¡¢libg2c¡¡¤È¸À¤¦¥é¥¤¥Ö¥é¥ê¤Ï¤¤¤º¤ì¤«¤Î¾ì½ê¤Ë¸ºß¤·¤Þ¤¹¡£


º£²ó¤ÎÌäÂê¤Ë´Ø¤·¤ÆÂн褹¤ëÊýË¡¤Ï¡¢¥ê¥ó¥¯»þ¤Ë¤ª¤¤¤Æ¥Ç¥Õ¥©¥ë¥È¤Î PGI¡¡Ä󶡤Πg77 intrinsic ¤Ç¤Ï¤Ê¤¯¡¢GNU¡¡¤Î libg2c.so ¤Î g77 intrinsic ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë PGI µÚ¤Ó¥·¥¹¥Æ¥à¡¦¥é¥¤¥Ö¥é¥ê¤Î¥ê¥ó¥±¡¼¥¸¤Î½çÈÖ¤òÌÀ¼¨Åª¤ËÊѹ¹¤¹¤ë¤³¤È¤Ç¤¹¡£pgf95(pgf77) ¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Ç¤Ï¡¢¤³¤ì¤ò°Ê²¼¤ÎÊýË¡¤Ç¹Ô¤¤¤Þ¤¹¡£

 pgf95  -Wl,'/usr/lib/libg2c.so' test.f   (32bit Linux)
 pgf95  -Wl,'/usr/lib64/libg2c.so' test.f (64bit Linux)

¤¢¤ë¤¤¤Ï°ÂÁ´¤Î¤¿¤á¤Ë -g77libs ¤òÆþ¤ì¤Æ¤ª¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£

 pgf95  -g77libs  -Wl,'/usr/lib/libg2c.so' test.f   (32bit Linux)
 pgf95  -g77libs  -Wl,'/usr/lib64/libg2c.so' test.f (64bit Linux)

 $ ./a.out
  The date is:    19    4 2005

¤³¤³¤Ç¡¢ -Wl,'/usr/lib/libg2c.so' ¤Î»ØÄêÊýË¡¤Ï¡¢PGI ¤Ë¸Â¤é¤º¥³¥ó¥Ñ¥¤¥é¾å¤Ç¤Î¾¤Î¥â¥¸¥å¡¼¥ë¡Ê¥ê¥ó¥«¡¼Åù¡Ë¤Ø¤Î¥ª¥×¥·¥ç¥ó¤ò°ú¤­ÅϤ¹¤¿¤á¤Î¶¦ÄÌ¥Õ¥©¡¼¥à¤Ç¤¹¡£-Wl,"°ú¤­ÅϤ¹¥ª¥×¥·¥ç¥ó"¡¡¤È¸À¤¦¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¹¤¬¡¢-Wl ¤Î¥¨¥ë (l) ¤Ï "l"="linker" ¤È¸À¤¦°ÕÌ£¤Ç¡¢¥ê¥ó¥«¡¼¤ËÂФ· /usr/lib/libg2c.so ¤È¸À¤¦¥é¥¤¥Ö¥é¥ê¤ò°ìÈֺǽé¤Î¸¡º÷¥é¥¤¥Ö¥é¥ê(¥ª¥Ö¥¸¥§¥¯¥È¡Ë¤Ë¤»¤è¤È¸À¤¦»Ø¼¨¤Î°ÕÌ£¤È¤Ê¤ê¤Þ¤¹¡£

¤¹¤Ê¤ï¤Á¡¢PGI¤¬¼Â¹Ô¥â¥¸¥å¡¼¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¥ê¥ó¥«¡¼ld ¤Ë°ú¤­ÅϤ¹¥ê¥ó¥±¡¼¥¸¤Î¥ª¥×¥·¥ç¥ó¤Ë¡¢¾åµ­¤Î '/usr/lib/libg2c.so' ¤ò²Ã¤¨¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï¡¢É¬¤º PGI ¤ÎÄ󶡤¹¤ë g77 intrinsic ¥é¥¤¥Ö¥é¥ê¤Ç¤¢¤ë libpgftnrtl.a ¤¬Àè¤Ë¥ê¥ó¥¯¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£½¾¤Ã¤Æ¡¢PGI¤¬Ä󶡤¹¤ë°ìÈÌŪ¤Ê¥³¥ó¥Ñ¥¤¥é¤Î¥ª¥×¥·¥ç¥ó¤Ç¤Ï¡¢PGI ¤Î´Ø¿ô¤òÀè¤Ë»ÈÍѤ¹¤ë¤¿¤á¡¢ g77 ¤Î·ë²Ì¤Î¤è¤¦¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¡£

PGI¥³¥ó¥Ñ¥¤¥é¤Î¥³¥Þ¥ó¥É¡¡¡Êpgf77)¡¡¤¬¤½¤Î¥³¥ó¥Ñ¥¤¥ë¥Õ¥§¡¼¥º¡Ê¥ê¥ó¥¯¥Õ¥§¡¼¥º¡Ë¤Ç¤É¤Î¤è¤¦¤Ê¥ª¥×¥·¥ç¥ó½ç°Ì¤Ç¥ê¥ó¥¯¤·¤Æ¤¤¤ë¤«¤ò³Îǧ¤·¤Æ¤ß¤Þ¤¹¡£-# ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£°Ê²¼¤Ï¡¢SuSE 9.1(32bit) ¤Î OS ²¼¤Ç PGI5.2 ¤Î¾ì¹ç¤Ë¤ª¤¤¤Æ½ÐÎϤµ¤ì¤ë¤â¤Î¤Ç¤¹¡£¤³¤³¤Ç¤Ï°ÂÁ´¤Î°ÕÌ£¤Ç¡¢-g77libs ¤ò»ØÄꤷ¤ÆGNU ¤Î¥é¥¤¥Ö¥é¥ê¤â¥ê¥ó¥±¡¼¥¸¥é¥¤¥Ö¥é¥ê¸õÊä¤Ë»ØÄꤷ¤Æ¤¤¤Þ¤¹¡£

$ pgf77 -g77libs -# test.f

(¥ê¥ó¥«¡¼ ld ¤Ç¥ê¥ó¥±¡¼¥¸¤¹¤ë¥Õ¥§¡¼¥º¤È¤½¤Î¥ª¥×¥·¥ç¥ó¡Ë
/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i586-suse-linux/3.3.3/crtbegin.o
/usr/pgi/linux86/5.2/lib/pgfmain.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
/tmp/pgf77baaaaBwtab.o -L/usr/pgi/linux86/5.2/lib -L/usr/lib
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.3 -L/usr/lib/gcc-lib/i586-suse-linux/3.3.3 -rpath
/usr/pgi/linux86/5.2/lib -lpgftnrtl -lg2c -lc -lnspgc -lpgc -lm -lgcc
-lc -lgcc /usr/lib/gcc-lib/i586-suse-linux/3.3.3/crtend.o /usr/lib/crtn.o

¥ê¥ó¥« ld ¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢ºÇ¸å¤ÎÊý¤Ë -lpgftnrtl -lg2c ¤È¸À¤¦½çÈÖ¤Çʤó¤Ç¤¤¤ë¤³¤È¤¬Ê¬¤«¤ê¤Þ¤¹¡£ld ¤Î¥ª¥×¥·¥ç¥ó¤Ç¤Ï¡¢»ØÄꤵ¤ì¤¿¥é¥¤¥Ö¥é¥ê¤Î½çÈÖ¤Ç̤²ò·è¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤òõ¤·¤ÆºÇ½é¤Ë¸«¤Ä¤«¤ì¤Ð¤½¤ì¤òºÎÍѤ·¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ï¡¢PGI ¤Î g77 Intrinsic ¡Êlibpgftnrtl) ¤¬¡¡-lg2c ¤è¤êºÇ½é¤ËÍè¤Æ¤¤¤Þ¤¹¡£½¾¤Ã¤Æ¡¢ PGI ¤Î¥é¥¤¥Ö¥é¥ê¤ÎÊý¤¬Í¥À褵¤ì¤Þ¤¹¡£

¤½¤ì¤Ç¤Ï¡¢°Ê²¼¤Î²ò·èºö¤Î¾ì¹ç¤Ï¤É¤¦¤Ç¤·¤ç¤¦¡£

$ pgf77 -g77libs -Wl,'/usr/lib/libg2c.so' -# test.f
$ a.out
The date is: 19 4 2005
FORTRAN STOP

¡Ê¥ê¥ó¥«¤ÎÉôʬ¤Î¤ß¼¨¤·¤Þ¤¹¡Ë
/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i586-suse-linux/3.3.3/crtbegin.o
/usr/pgi/linux86/5.2/lib/pgfmain.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
/tmp/pgf77baaaatxtap.o -L/usr/pgi/linux86/5.2/lib -L/usr/lib
-L/usr/lib/gcc-lib/i586-suse-linux/3.3.3 -L/usr/lib/gcc-lib/i586-suse-linux/3.3.3 -rpath
/usr/pgi/linux86/5.2/lib /usr/lib/libg2c.so -lpgftnrtl -lg2c -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i586-suse-linux/3.3.3/crtend.o /usr/lib/crtn.o

¥ª¥×¥·¥ç¥ó¤ÎºÇ¸å¤ÎÊý¤Ë¡¢/usr/lib/libg2c.so -lpgftnrtl ¤È¸À¤¦½çÈ֤ǥê¥ó¥¯¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¸¡º÷½ç°Ì¤ÎºÇ½é¤Î /libg2c.so ¤Î g77Intrinsic ¤¬¥ê¥ó¥¯¤µ¤ì¤Æ¡¢°Õ¿Þ¤¹¤ë½ÐÎϤ¬ÆÀ¤é¤ì¤Þ¤¹¡£

(3) ¹âÅ٤ʥƥ¯¥Ë¥Ã¥¯ ¡§ ¥ê¥ó¥« (ld) ¤òľÀÜÁà¤ëÊýË¡

Á´¤Æ¤Î¥é¥¤¥Ö¥é¥ê¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¤Ë¥ê¥ó¥¯¤·¤Ê¤¤¤Ç¡¢PGI ¥³¥ó¥Ñ¥¤¥é¤Î¶¦Í­¥é¥ó¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê¤Ç¤¢¤ë¡¢libpgc.so Åù¡Êlibpgc.a) ¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¤Ë¥ê¥ó¥¯¤·¡¢GNU glibc ·Ï¤Î¥é¥¤¥Ö¥é¥ê¤ò¥À¥¤¥Ê¥ß¥Ã¥¯·Á¼°¤Î¤Þ¤Þ¤Ç¼Â¹Ô¥â¥¸¥å¡¼¥ë¤òºî¤ë¤È¸À¤Ã¤¿¡¢Æüì¤Ê¥ê¥ó¥±¡¼¥¸¤ÎÎã¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£¤³¤ÎÁàºî¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢GNU ld (¥ê¥ó¥«¡Ë¥³¥Þ¥ó¥É¤òľÀÜ¡¢Áàºî¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤³¤Î¤è¤¦¤Ê¥ê¥ó¥¯¤òɬÍפȤ¹¤ë°ìÎã¤È¤·¤Æ¤Ï¡¢¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ò¥Ð¥¤¥Ê¥ê¤Ç¾¼Ô¤ËÄ󶡤¹¤ëºÝ¤Ë¡¢¼«¥³¡¼¥É¤Î¥½¡¼¥¹¤ò¸ø³«¤»¤º¤Ë¡¢ GNU ¥é¥¤¥»¥ó¥¹¤Ë¨¤·¤¿·Á¤Ç GNU ¤Î¥é¥ó¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê¤Î¤ß¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò»ÈÍѤ¹¤ë¥Ð¥¤¥Ê¥ê·Á¼°¤ÇÄ󶡤¹¤ë¤è¤¦¤Ê¾ì¹ç¤¬ÁÛÄê¤Ç¤­¤Þ¤¹¡£

­¡ Á´¤Æ¤Î¥é¥¤¥Ö¥é¥ê¤¬Æ°Åª¥ê¥ó¥¯¤Î¾ì¹ç¤Î¥ê¥ó¥¯¾õ¶·¤òÄ´¤Ù¤ë

¡¡$ pgf77 -# test.f

¡Ê¥ê¥ó¥«¤ÎÉôʬ¤Î¤ß¼¨¤·¤Þ¤¹¡Ë
/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o /export/pgi524/linux86/5.2/lib/pgfmain.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /tmp/pgf77baaaayxeai.o -L/export/pgi524/linux86/5.2/lib -L/usr/lib -L/usr/lib/gcc -lib/i386-redhat-linux/2.96 -rpath /export/pgi524/linux86/5.2/lib -lpgftnrtl -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/ i386-redhat-linux/2.96/crtend.o /usr/lib/crtn.o

¡¡$ ldd a.out¡¡¡Ê»ÈÍѤµ¤ì¤Æ¤¤¤ë¥À¥¤¥Ê¥ß¥Ã¥¯¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÄ´¤Ù¤ë¡Ë
libc.so.6 => /lib/i686/libc.so.6 (0x40033000)¡¡¡¡¡ÊGNU ¥é¥¤¥Ö¥é¥ê¡Ë
libpgc.so => /export/pgi524/linux86/5.2/lib/libpgc.so (0x4016e000) ¡¡¤³¤ì¤òÀÅŪ¥é¥¤¥Ö¥é¥ê¡¦¥ê¥ó¥¯¤Ë¤¹¤ë
libm.so.6 => /lib/i686/libm.so.6 (0x40183000)¡¡¡ÊGNU ¥é¥¤¥Ö¥é¥ê¡Ë
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)¡¡¡ÊGNU ¥é¥¤¥Ö¥é¥ê¡Ë

¾åµ­¤Î¤¦¤Á¡¢PGI ÍѤΥÀ¥¤¥Ê¥ß¥Ã¥¯¥é¥¤¥Ö¥é¥ê libpgc.so ¤Î¤ß¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¤Ë¥ê¥ó¥¯¤¹¤ëÊýË¡¤ò¹Í¤¨¤Þ¤¹¡£

¡¡$ ls -lt a.out¡¡(¥Ð¥¤¥Ê¥ê¤Î¥µ¥¤¥º¡Ë
¡¡-rwxr-xr-x 1 kato softek 64439 Dec 15 21:16 a.out*

­¢ Á´¤Æ¤Î¥é¥¤¥Ö¥é¥ê¤òÀÅŪ¤Ë¥ê¥ó¥¯¤·¤¿¾ì¹ç¤Î¾õ¶·¤âÄ´¤Ù¤Æ¤ß¤ë

¡¡$ pgf77 -# -Bstatic test.f

¡Ê¥ê¥ó¥«¤ÎÉôʬ¤Î¤ß¼¨¤·¤Þ¤¹¡Ë
/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o /export/pgi524/linux86/5.2/lib/pgfmain.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /tmp/pgf77baaaaoyeao.o -L/export/pgi524/linux86/5.2/lib -L/usr/lib -L/usr/lib/gcc -lib/i386-redhat-linux/2.96 -rpath /export/pgi524/linux86/5.2/lib -Bstatic -lpgftnrtl -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib /gcc-lib/i386-redhat-linux/2.96/crtend.o /usr/lib/crtn.o

¡¡$ ldd a.out
¡¡¡¡not a dynamic executable

¡¡$ ls -lt a.out¡¡(¥Ð¥¤¥Ê¥ê¤Î¥µ¥¤¥º¡Ë
¡¡¡¡-rwxr-xr-x 1 kato softek 1837840 Dec 15 21:20 a.out*

­£ PGI ¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¡¡libpgc ¤Î¤ß¤òÀÅŪ¤Ë¥ê¥ó¥¯¤·¡¢gnu ¥é¥¤¥Ö¥é¥ê¤òưŪ¤Ë¥ê¥ó¥¯¤¹¤ëÊýË¡

¤Þ¤º¡¢ºÇ½é¤Ë pgi ¤Î¥³¥ó¥Ñ¥¤¥é¡¦¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤Ë -# ¤ò¤Ä¤±¤Æ¡¢³Æ¥³¥ó¥Ñ¥¤¥ë¥Õ¥§¡¼¥º¤Î¼ê³¤­¤Î¾ÜºÙ¥ª¥×¥·¥ç¥ó¤òÄ´¤Ù¤Þ¤¹¡£Æäˡ¢PGI ¤Ë¤è¤Ã¤Æ½ÐÎϤµ¤ì¤¿ ld ¥ê¥ó¥«¤Î¥ª¥×¥·¥ç¥ó¤ò´Þ¤à¥³¥Þ¥ó¥ÉÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£¤³¤Î¥³¥Þ¥ó¥ÉÎó¤ò½¤Àµ¤·¤Æ¡¢Ä¾ÀÜ¥ê¥ó¥¯¤Î¼Â¹Ô¤ò¸å¤Ç¹Ô¤¤¤Þ¤¹¡£¼¡¤Ë¡¢¥³¥ó¥Ñ¥¤¥ë¥³¥Þ¥ó¥É¤Ç¡¢¥ê¥ó¥¯¤ò¹Ô¤ï¤º¡¢¥×¥í¥°¥é¥à¤Î¥ª¥Ö¥¸¥§¥¯¥È(¾åµ­¤ÎÎã¤Ç¤Ï¡¢test.o)¤òºîÀ®¤·¤Þ¤¹¡£ºîÀ®¤µ¤ì¤¿ test.o ¤ò»ÈÍѤ·¡¢ÀÅŪ¡¢Æ°Åª¥é¥¤¥Ö¥é¥ê¤òŬµ¹¥ª¥×¥·¥ç¥ó¤È¤·¤Æ»ØÄꤷ¡¢ld ¥³¥Þ¥ó¥É¤Ç¼Â¹Ô¥â¥¸¥å¡¼¥ë¤òºîÀ®¤·¤Þ¤¹¡£¤³¤Î¶ñÂÎŪ¤ÊÎã¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£

¡¡$ pgf77 -c test.f¡¡¡Êtest.o ¤Î¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤òºîÀ®¡Ë

¼¡¤Ë¡¢ ld ¥³¥Þ¥ó¥É¤òľÀÜÁàºî¤·¤Þ¤¹¡£¥ê¥ó¥«¤Î¥ª¥×¥·¥ç¥ó¤ÎÃæ¤Ç¡¢¥é¥¤¥Ö¥é¥ê¤Î»ØÄê¤òưŪ¤Ê¤â¤Î¤È¡¢ÀÅŪ¥ê¥ó¥¯¤¬É¬Íפʥ饤¥Ö¥é¥ê¤È¤ò¶èÊ̤·¤Æ»ØÄꤷ¤Þ¤¹¡£

¡¡$ /usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o /export/pgi524/linux86/5.2/lib/pgfmain.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 test2.o -L/export/pgi524/linux86/5.2/lib -L/usr/lib -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 -rpath /export/pgi524/linux86/5.2/lib -lc -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o -Bstatic -lpgftnrtl -lnspgc -lpgc -lc /usr/lib/crtn.o

¾åµ­¤ÎÎã¤Ç¸À¤¨¤Ð¡¢Æ°Åª¤Ê¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¹½À®¤¹¤ë gnu ¤Î¥é¥¤¥Ö¥é¥ê·Ï¤ò -lc -lm -lgcc -lc -lgcc ¤È¤·¤Æ»ØÄꤷ¡¢PGI ¤Î¥é¥ó¥¿¥¤¥à¥é¥¤¥Ö¥é¥ê¤ò -Bstatic -lpgftnrtl -lnspgc -lpgc ¤È¤·¤ÆÀÅŪ¥ê¥ó¥¯¥ª¥×¥·¥ç¥ó -Bstatic ¤Î¸å¤Ë»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢´üÂÔ¤¹¤ë·ë²Ì¤¬ÆÀ¤é¤ì¤Þ¤¹¡£

¡¡$ ldd a.out¡¡¡ÊPGI ¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê libpgc.so ¤Ï¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¡Ë
¡¡¡¡libc.so.6 => /lib/i686/libc.so.6 (0x40033000)
¡¡¡¡libm.so.6 => /lib/i686/libm.so.6 (0x4016e000)
¡¡¡¡/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

¡¡$ ls -lt a.out¡¡¡Ê¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¡Ë
¡¡¡¡-rwxr-xr-x 1 kato softek 74630 Dec 15 21:21 a.out*
¡¡$ strip a.out¡¡(¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤Îºï½ü¡Ë
¡¡$ ls -l a.out¡¡
¡¡¡¡-rwxr-xr-x 1 kato softek 48960 Dec 15 21:21 a.out

­¤ pgf77¡Êpgf95/pgcc) ¤Î¥³¥Þ¥ó¥É¥ª¥×¥·¥ç¥ó¤Ç¡¢­£¤ò¼Â¸½¤¹¤ëÊýË¡

PGI ¥³¥ó¥Ñ¥¤¥é¤Ç¤Ï¡¢¥ê¥ó¥«¤ËÂФ·¤ÆÅϤ¹°ú¿ô¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¡¢-Bdynamic ¤È -Bstatic ¤¬¤¢¤ê¤Þ¤¹¡£¤½¤ì¤¾¤ì¡¢¤½¤ì°Ê¹ß»ØÄꤵ¤ì¤ë¥é¥¤¥Ö¥é¥ê¤òưŪ¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¥ê¥ó¥¯¡¢¤¢¤ë¤¤¤ÏÀÅŪ¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¥ê¥ó¥¯¤¹¤ë¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤â¤Î¤Ç¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¡¢¾åµ­¤Î¤³¤È¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥ÉÎó¤òºîÀ®¤¹¤ë¤³¤È¤Ç¼Â¸½¤·¤Þ¤¹¡£¥ê¥ó¥¯¤¹¤Ù¤­¥é¥¤¥Ö¥é¥ê¤Î¼ïÎà¤Ï¡¢ -# ¥ª¥×¥·¥ç¥ó¤Ç³Î¤«¤á¤Æ¤«¤é¡¢°Ê²¼¤Î¤è¤¦¤Ê·ÁÂ֤ǻÈÍѤ¹¤ë¤³¤È¤¬É¬ÍפǤ¹¡£

¡¡$ pgf90 test.f -Bdynamic -lc -lm -lgcc -lc -lgcc -Bstatic -lpgftnrtl -lnspgc -lpgc

¡¡$ldd a.out
¡¡¡¡libc.so.6 => /lib/i686/libc.so.6 (0x40033000)
¡¡¡¡libm.so.6 => /lib/i686/libm.so.6 (0x4016e000)
¡¡¡¡/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

­¥¡¡¾å¤Îµ¡Ç½¤ò¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó¤Ç¼Â¸½¤¹¤ëÊýË¡¡ÊPGI 6.2°Ê¹ß¡Ë

PGI ¤¬Ä󶡤¹¤ëÀìÍѥ饤¥Ö¥é¥ê¤ÏÀÅŪ¥ê¥ó¥¯¤Ç¹Ô¤¤¡¢Linux ¤Î¥·¥¹¥Æ¥à°Í¸¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥À¥¤¥Ê¥ß¥Ã¥¯¤Ë¥ê¥ó¥¯¤µ¤»¤ë¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¡Ê-Bstatic_pgi¡Ë¤¬ PGI 6.2 ¤«¤éÄ󶡤µ¤ì¤Þ¤·¤¿¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ÇÀ¸À®¤µ¤ì¤¿¼Â¹Ô¥â¥¸¥å¡¼¥ë¤Ï¡¢Â¾¤Î Linux¥·¥¹¥Æ¥à¡ÊOS ¤Î glibc¥Ð¡¼¥¸¥ç¥óÅù¤¬Æ±¤¸¤â¤Î¡Ë¤Ë¤ª¤¤¤Æ¤â¡¢PGI¤¬Ä󶡤¹¤ëÀìÍÑ¥·¥§¥¢¡¼¥É¥é¥¤¥Ö¥é¥ê¤ò¥³¥Ô¡¼¤¹¤ë¤³¤È¤Ê¤¯¼Â¹Ô¤Ç¤­¤ëÍøÅÀ¤¬¤¢¤ê¤Þ¤¹¡£

¡¡$ pgf95 -fastsse -Bstatic_pgi test.f