Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Installing gtools package on a remote computer (with no admin access)

    Hello,
    I am working on a Remote Stata Server (OS: Windows Server 2016 Standard) with Stata/SE 15.1.

    I need to install on it two things: 1) the gtools package (ssc install gtools); 2) the function Lorenz (ssc install lorenz).

    I have no admin access nor internet connection on the remote Stata server. Therefore, I can't run "ssc install".
    I followed the advice listed in this post:
    1. download on my Local computer (OS: macOS Big Sur) the packages I need, using my local version of Stata.
    2. looked up my "PLUS" folder where all the functions downloaded from the web are saved.
    3. copied "PLUS" into my "cd" in the Stata server.
    4. told Stata on the server to modify the "PLUS" folder and to use the one that I copied (the one from my local which contains "lorenz" and the "gtools" functions.
    At this point I thought I was all set and ready to start using my "gtools" functions as well as "lorenz":
    • when I try to use the "lorenz" function, everything works fine. Mission accomplished
    • when I try to use a function from the "gtools" package, it does not work.
    For instance, if I try to use "gquantiles", Stata returns the following message:
    Code:
    . gquantiles pp = federal_action_obligation, pctile
    class GtoolsResults undefined
    (282 lines skipped)
    (error occurred while loading _gtools_internal.ado)
    r(3000);
    I get the same message using other functions of "gtools", say "hashsort", "gcollapse"....

    The only clues that I have, probably pointless, are:
    • I downloaded gtools on a Mac while the Stata server is on Windows (if so, then why "lorenz" works?!)
    • Unlike "lorenz", "gtools" is a package and not a function (if so, I would be surprised because I thought a package is simply a set of functions).
    Any suggestion would be much appreciated.

    Cordially,
    Edoardo

  • #2
    Depending on your Stata version, you might need to restart Stata because of the Mata content of gtools.Other details about plug-ins could be tricky, but others would know more about tat.

    The lorenz package by contrast is just one .ado file defining a command (not a function, but that's terminology) and a help file. That should work straight away, as you found.

    Comment


    • #3
      The gtools package includes a plugin, and plugin code is hardware dependent. (Look at the list of included files described in
      Code:
      net describe gtools, from(http://fmwww.bc.edu/RePEc/bocode/g)
      Some packages download only the plugin necessary for the system, and then rename whatever is downloaded appropriately.

      At this moment I am having trouble accessing SSC, so I cannot investigate further. I don't know what was downloaded to your system, but suspect it may have been macOS-specific.

      Comment


      • #4
        Nick, William, thanks a lot! This is really helpful.

        I am now running a very long code and I cannot try to implement what you are suggesting. As the code finishes I will and then I will let you know. I suspect the "plugin" is the source of the issue I am having.

        Cordially,
        Edoardo

        Comment


        • #5
          What gtools provide is speed only, otherwise there are other Stata/Mata implementations doing the same, albeit more slowly.

          If you do not manage to make one of the two work:

          1. Ask the administrator of the server to install those for you.

          2. Compile on a Windows machine, and then repeat the steps

          you can just settle for the slower version that is doing the same as gtools.

          Comment


          • #6
            On a different level, it seems that https://github.com/mcaceresb/stata-gtools is the more up-to-date version.

            Comment


            • #7
              Dear all,
              thanks for your additional comments. In particular:
              • Nick's message #2: I restarted Stata but the result was unsuccessful.
              • William's message #3: you are right, there is a plugin contained in PLUS. However, Stata automatically downloads all of the possible plugins for all the systems compatible with gtools, even the Windows one if you use a Mac. In fact, I downloaded gtools from another computer (with Windows) and the PLUS folder I got looked identical to the one of mine. I then tried to upload this new (Windows originating) PLUS folder as a new PLUS directory for Stata on my remote server. Nothing changed. Still got the same error.
              • Joro's message #5: thanks Joro for your feedback. Concerning your points:
                1. Actually my admin redirected me to Statalist.org to fix the problem because they do not want to install any extra package onto the server.
                2. Already done (see my answer to William's message #3), and it did not work.
                3. I am aware that gtools is only for boosting speed and this is exactly what I would love to have. Simply more speed. I am working with a 130GB database with 71 million rows. Even splitting the database into segments is still kind of slow.
              I am afraid that "gtools" is not compatible with the OS I have: Windows server 2016 standard. I will shoot an email to the gtools developer to ask.

              Anyway, I appreciate a lot your help and all good advice!
              Many thanks,

              Edoardo

              Comment


              • #8
                I have a thought about plugins. Please replicate the following on your server (not your Mac) and report the results.
                Code:
                . display c(os)
                MacOSX

                Comment

                Working...
                X