<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem with lgamma function in f90 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255179#M714844</link>
    <description>No, that is a normal warning simply indicating that this code may not run on all HP boxes.&lt;BR /&gt;&lt;BR /&gt;I just wrote a quickie C program and linked with -lm; the underlying lgamma function appears fine. It would be good to know if this is a problem with the write function (or perhaps the implicit format) or with the compiler itself. I would first assign the result of lgamma to your double precision variable, r. Write r using your existing format; if that fails use an explicit format and see if the results are any better. This will help separate out the "real" problem. You might want to stop the f90 compile at the assembly step and have a look at the .s  source code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It's always a good idea to look for cumulative compiler/linker/library patches but since you didn't bother to mention your version of compiler or HP-UX, I'm not going to bother looking.&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Apr 2004 10:12:24 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-04-21T10:12:24Z</dc:date>
    <item>
      <title>problem with lgamma function in f90</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255177#M714842</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have problems calling lgamma function from fortran 90. In the following example the returned value should be 0 (because lgamma(1) = 0), but it's not:&lt;BR /&gt;&lt;BR /&gt;rcc:fit# cat test.f&lt;BR /&gt;        double precision        x, r&lt;BR /&gt;        x = 1.0&lt;BR /&gt;        write (*,*) lgamma(x)&lt;BR /&gt;        end&lt;BR /&gt;rcc:fit# f90 -lm test.f&lt;BR /&gt;test.f&lt;BR /&gt;   main program&lt;BR /&gt;&lt;BR /&gt;6 Lines Compiled&lt;BR /&gt;/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (test.o) was detected. The linked output may not run on a PA 1.x system.&lt;BR /&gt;rcc3:fit# ./a.out&lt;BR /&gt; 1082562470&lt;BR /&gt;rcc:fit#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Does anyone has any ideas why?&lt;BR /&gt;best regards&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 21 Apr 2004 09:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255177#M714842</guid>
      <dc:creator>Krzysztof Kielak</dc:creator>
      <dc:date>2004-04-21T09:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem with lgamma function in f90</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255178#M714843</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;My guess is that the linker is telling you that the builted binary is 64 bits and won't work on a 32 system.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Wed, 21 Apr 2004 10:02:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255178#M714843</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-21T10:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with lgamma function in f90</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255179#M714844</link>
      <description>No, that is a normal warning simply indicating that this code may not run on all HP boxes.&lt;BR /&gt;&lt;BR /&gt;I just wrote a quickie C program and linked with -lm; the underlying lgamma function appears fine. It would be good to know if this is a problem with the write function (or perhaps the implicit format) or with the compiler itself. I would first assign the result of lgamma to your double precision variable, r. Write r using your existing format; if that fails use an explicit format and see if the results are any better. This will help separate out the "real" problem. You might want to stop the f90 compile at the assembly step and have a look at the .s  source code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It's always a good idea to look for cumulative compiler/linker/library patches but since you didn't bother to mention your version of compiler or HP-UX, I'm not going to bother looking.&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Apr 2004 10:12:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255179#M714844</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-21T10:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: problem with lgamma function in f90</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255180#M714845</link>
      <description>I've googled it :&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,399,00.html" target="_blank"&gt;http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,399,00.html&lt;/A&gt;</description>
      <pubDate>Wed, 21 Apr 2004 10:14:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255180#M714845</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-21T10:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: problem with lgamma function in f90</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255181#M714846</link>
      <description>You need to specify the return type and the parameter passing convention before you call a function with a "C" language binding.  The alias directive can be used to tell f90 that the parameter is passed by value instead of the fortran convention of pass by reference.&lt;BR /&gt;&lt;BR /&gt;!$HP$ ALIAS lgamma(%VAL)&lt;BR /&gt; double precision lgamma&lt;BR /&gt; double precision x, r&lt;BR /&gt; x = 1.0&lt;BR /&gt; write (*,*) lgamma(x)&lt;BR /&gt; x = 3.0&lt;BR /&gt; write (*,*) lgamma(x)&lt;BR /&gt; x = 3.06&lt;BR /&gt; write (*,*) lgamma(x)&lt;BR /&gt; end</description>
      <pubDate>Wed, 21 Apr 2004 13:43:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-lgamma-function-in-f90/m-p/3255181#M714846</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2004-04-21T13:43:43Z</dc:date>
    </item>
  </channel>
</rss>

