<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I have tried to get the German (Vogt)
      2005 cernlib to work on Mac in the past. The effort always
      founders on the shoals of trying to get a consistent version of
      the other Unix-y support stuff from outside the Mac universe:
      imake, gfortran, related header files...<br>
      <br>
      That having been said, if gridmake works, then...well..., it
      works! :-)<br>
      <br>
      On 12/16/2012 01:08 PM, Richard Jones wrote:<br>
    </div>
    <blockquote cite="mid:50CE0E19.1060001@uconn.edu" type="cite">Matt,
      <br>
      <br>
      This is a common problem seen in trying to port cernlib to 64bit.
      The problem is deep in the heart of cernlib, where there exists
      code from ages ago that was designed to circumvent inefficiencies
      in subroutine calling way back in the days of the VAX and the
      CDC.  In those days, it was expensive to call a subroutine because
      you had to construct a stack frame, push all of the registers
      contents into the stack frame, then load up the argument list,
      then do the call.  The return was just the same in reverse.  So if
      the subroutine did something simple, the overhead was signficant.
      These things called jumpad, jumpst, jumpx0, jumpx1, ... are all
      low-overhead ways of calling subroutines that take shortcuts with
      the push/restore of context.  Unfortunately, these things made
      certain assumptions about the length of a pointer, which changes
      in x86_64.  This LOCF error happens when you get it wrong.
      <br>
      <br>
      It takes quite some work to get it right.   Rather than fix it
      myself, I went on a hunt and found one guy (a German grad student,
      as I recall) that did it for x86_64 hardware and I downloaded his
      mod of 2005.  This is what I use.  I build everything from
      sources, so with a little luck it may also work for you.
      <br>
      <br>
      The quick way to go would be to download the "gridmake" utility
      and just be bold and try to make a hdgeant data file.  For
      example,
      <br>
      <br>
      ./gridmake -f gridmake.xml hdgeant_1.hddm
      <br>
      <br>
      It tries to recognize all software packages (eg. xerces, cernlib,
      root, jana, amptools,...) that you need and download and build
      them if they are not already present on your system in a
      recognizable form.  It builds everything under a "packages"
      directory that it makes in the CWD of wherever you are when you
      run gridmake.  For this, all you need is the gridmake perl script
      and the gridmake.xml file.  Both are available from here:
      <br>
      <br>
      <a class="moz-txt-link-freetext" href="http://zeus.phys.uconn.edu/halld/gridwork/">http://zeus.phys.uconn.edu/halld/gridwork/</a>
      <br>
      <br>
      You also need a grid certificate and have the environment variable
      X509_USER_PROXY point to a proxy made from your grid cert.  Your
      certificate DN needs to be on file in our Gluex grid database for
      the build to work.
      <br>
      <br>
      -Richard J.
      <br>
      <br>
      <br>
      <br>
      <br>
      On 12/16/2012 9:00 AM, Matthew Shepherd wrote:
      <br>
      <blockquote type="cite">Hi all,
        <br>
        <br>
        I upgraded my MacBook recently to latest version of OS X.  I was
        able to get the full GlueX source to compile with a little
        work.  Basic details:
        <br>
        <br>
        Install command line tools from "Preferences" in Xcode
        <br>
        <br>
        Install fink
        <br>
        use fink to install cernlib and geant3
        <br>
        <br>
        set /cern/pro to point to /sw  (can probably change env also,
        but this is standard path)
        <br>
        <br>
        inside of /sw/lib set these symlinks:
        <br>
        <br>
        libgcc_s.dylib -> gcc4.7/lib/libgcc_s.1.dylib
        <br>
        libgfortran.a -> gcc4.7/lib/libgfortran.a
        <br>
        libquadmath.a -> gcc4.7/lib/libquadmath.a
        <br>
        <br>
        I then updated everything and did a fresh build.
        <br>
        <br>
        Now when I run hdgeant I get the following message:
        <br>
        <br>
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        <br>
        LOCB/LOCF: address 0x7fff5074435c exceeds the 32 bit address
        space
        <br>
        or is not in the data segments
        <br>
        This may result in program crash or incorrect results
        <br>
        Therefore we will stop here
        <br>
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        <br>
        <br>
        While I don't understand it, it seems to be an artifact of
        trying to run a 64-bit version of hdgeant.  Is there a way to
        fix this?  Do we know if the problem is in our code or in
        cernlib?
        <br>
        <br>
        I'm just using cernlib provided by fink.  There is some
        discussion of patching an recompiling cernlib here:
        <br>
        <br>
<a class="moz-txt-link-freetext" href="http://www-jlc.kek.jp/~fujiik/macosx/10.7.X/HEPonX/memo/CERNLIBonX.html">http://www-jlc.kek.jp/~fujiik/macosx/10.7.X/HEPonX/memo/CERNLIBonX.html</a>
        <br>
        <br>
        However, the author seems to imply that the fink distributions
        have the patches applied.  I have not tried to patch and compile
        my own copy of cernlib.
        <br>
        <br>
        It is probably not worth a major development effort to fix
        this.  I just thought if someone knew of a trival fix, I could
        do it.  After all, I've been running hdgeant elsewhere and
        copying files to my laptop for years now.
        <br>
        <br>
        Matt
        <br>
        <br>
        <br>
        _______________________________________________
        <br>
        Halld-offline mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:Halld-offline@jlab.org">Halld-offline@jlab.org</a>
        <br>
        <a class="moz-txt-link-freetext" href="https://mailman.jlab.org/mailman/listinfo/halld-offline">https://mailman.jlab.org/mailman/listinfo/halld-offline</a>
        <br>
      </blockquote>
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Halld-offline mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Halld-offline@jlab.org">Halld-offline@jlab.org</a>
<a class="moz-txt-link-freetext" href="https://mailman.jlab.org/mailman/listinfo/halld-offline">https://mailman.jlab.org/mailman/listinfo/halld-offline</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Mark M. Ito
Jefferson Lab
<a class="moz-txt-link-abbreviated" href="mailto:marki@jlab.org">marki@jlab.org</a>
(757)269-5295
</pre>
  </body>
</html>