Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load gtools_macosx_v3.plugin, error 9999 #87

Closed
austinsmoss opened this issue Jul 27, 2022 · 17 comments
Closed

Could not load gtools_macosx_v3.plugin, error 9999 #87

austinsmoss opened this issue Jul 27, 2022 · 17 comments
Assignees
Labels

Comments

@austinsmoss
Copy link

I am having the same issue described in issue #73 (same issue title) even though that report mentions that the issue should be fixed in the updated gtools version. The fix described in that thread by @florianpeters does work, but I wanted to bring it to your attention that the issue is still (again?) outstanding.

I am running Stata 17.0 on a 2021 Macbook Pro with M1 Pro chip.

@mcaceresb
Copy link
Owner

@austinsmoss I am kind of aware since someone commented they still had the problem but unfortunately I'm not 100% what to do about it. I should at least make a note of it somewhere, though, so I'll leave this issue open this time. Thankfully compiling on OSX is not too bad; I believe this comment compiles and clarifies the instructions I gave throughout the thread. I repeat here for convenience:

  1. Build gtools. From the command line (terminal)
git clone https://github.com/mcaceresb/stata-gtools
cd stata-gtools
git submodule update --init --recursive
make clean SPI=3.0 SPIVER=v3
make all   SPI=3.0 SPIVER=v3
  1. Uninstall gtools, if a previous version was present. From Stata,
ssc uninstall gtools
net uninstall gtools
  1. Install from local folder. From Stata,
net install gtools, from(/path_to_folder_where_gtools_was_compiled/stata-gtools/build) replace

Anyway, the issue is that there was some change either in OSX or with the Apple processors that broke the plugin and since I don't have a mac, I can't debug the issue. I thought compiling with github would help but apparently it's still broken on some systems. I suppose even if I did have a Mac, I don't really know whether my fix would break comparability with older models or OSX versions. There's a similar issue on some Windows servers, if I recall, that is still open (#60) and I don't have Windows hardware, let alone a Windows server.

@mcaceresb mcaceresb self-assigned this Jul 27, 2022
@mcaceresb mcaceresb added the bug label Jul 27, 2022
@mcaceresb
Copy link
Owner

@austinsmoss Can you share your OS version?

@austinsmoss
Copy link
Author

Monterey v 12.5

@mcaceresb
Copy link
Owner

@austinsmoss If you try to use the original plugin (the one that failed), after you have done so, do you see under " System Preferences > Security & Privacy > General" a note that macOS has blocked the plugin and to allow it to run anyway?

@austinsmoss
Copy link
Author

I do not see this option. Would it be useful to Zoom so I can share my screen? If so, shoot me an email at austin.moss@colorado.edu

@mcaceresb
Copy link
Owner

@austinsmoss I am asking because a user of a different plugin recently had this issue after upgrading to the latest macOS, where the system gave the message that the execution of the plugin had been blocked. The solution is for me to sign it (costs $ apparently), for the user to unblock it (in Security and Privacy, hence my question), or for the user to compile (which is what this thread suggests, but I figured unblocking it might be easier).

I do not own a mac, and it's been several years since I used one, so I am not sure if I'd be that helpful even with screen share. I am basing my question off a google search, actually Un_n. Just to be sure, though, you checked after trying to use the plugin file that caused gtools to fail, yes?

@austinsmoss
Copy link
Author

Understood. Yes, I uninstalled the working version that I compiled and reinstalled the SSC version. I am not given that error message.

@chisquared
Copy link

To confirm, the instructions in the comment above worked perfectly for me on a M1 Macbook Pro, running macOS 12.5.1.

I couldn't run ssc uninstall gtools, which gave the error criterion matches more than one package. But just reinstalling with net install gtools, from($folder/stata-gtools/build) replace worked regardless of the existing package, and got the plugin working.

I didn't see any warnings in System Preferences > Security about the plugin being blocked, so I suspect it is just that the Mac is looking for the plugin to be compiled as ARM, and doesn't know to run the Intel plugin with Rosetta emulation.

@annorazhao
Copy link

@austinsmoss I am kind of aware since someone commented they still had the problem but unfortunately I'm not 100% what to do about it. I should at least make a note of it somewhere, though, so I'll leave this issue open this time. Thankfully compiling on OSX is not too bad; I believe this comment compiles and clarifies the instructions I gave throughout the thread. I repeat here for convenience:

  1. Build gtools. From the command line (terminal)
git clone https://github.com/mcaceresb/stata-gtools
cd stata-gtools
git submodule update --init --recursive
make clean SPI=3.0 SPIVER=v3
make all   SPI=3.0 SPIVER=v3
  1. Uninstall gtools, if a previous version was present. From Stata,
ssc uninstall gtools
net uninstall gtools
  1. Install from local folder. From Stata,
net install gtools, from(/path_to_folder_where_gtools_was_compiled/stata-gtools/build) replace

Anyway, the issue is that there was some change either in OSX or with the Apple processors that broke the plugin and since I don't have a mac, I can't debug the issue. I thought compiling with github would help but apparently it's still broken on some systems. I suppose even if I did have a Mac, I don't really know whether my fix would break comparability with older models or OSX versions. There's a similar issue on some Windows servers, if I recall, that is still open (#60) and I don't have Windows hardware, let alone a Windows server.

I followed the instruction, but on the step 3 to install the package locally, it said "option from() incorrectly specified". Can I get more information about how to figure out the correct path to the folder? Thanks!

@mcaceresb
Copy link
Owner

@annorazhao Where did you clone the repository?

@annorazhao
Copy link

I think is this one from the first thread you posted: https://github.com/mcaceresb/stata-gtools

@mcaceresb
Copy link
Owner

@annorazhao I meant in your computer. You need to replace the path in from() with the path in your computer where stata-gtools was cloned into. So, where is it in your computer?

@annorazhao
Copy link

That is the place I got confused, in my laptop, the packages are installed under /Users/.../Library/Application Support/Stata/ado/plus, the ssc installed gtools are stored under the subfolder "g", how should I replace the path? Sorry that I'm a novice and know very few about this. Thanks for the help!

@mcaceresb
Copy link
Owner

That is the place I got confused, in my laptop, the packages are installed under /Users/.../Library/Application Support/Stata/ado/plus, the ssc installed gtools are stored under the subfolder "g", how should I replace the path? Sorry that I'm a novice and know very few about this. Thanks for the help!

It seems the SSC version fails on newer OSX systems and you have to compile the plugins yourself. In order to do this, you need to follow the steps here. If you have a gtools installation under /Users/.../Library/Application Support/Stata/ado/plus then you have not done step 2.

  • If you did step 1, then you should be able to type pwd into the the terminal. Copy the output (a directory path will be printed).
  • If you did step 2, then gtools should not be installed in your system. At this point, there shouldn't be any gtools files in /Users/.../Library/Application Support/Stata/ado/plus/g. Please check this is the case.
  • For step 3, you need to copy the path you found in the first bullet and replace path_to_folder_where_gtools_was_compiled with that path. The final command will be something like net install gtools, from(/Users/.../stata-gtools/build) replace

@annorazhao
Copy link

Oh, this time it works! Thanks so much!

@mcaceresb
Copy link
Owner

@austinsmoss I recently found this article on cross-compiling and it worked for another project. Can you re-install gtools from the develop branch (gtools, upgrade branch(develop)) and try it out?

@austinsmoss
Copy link
Author

@mcaceresb I re-installed from the develop branch and it is working. Great solution!

mcaceresb added a commit that referenced this issue Dec 7, 2022
Features

- `noinit` option for `gcollapse, merge`, `gegen`, `gstats` (selected),
  `gregress` (and co.) to prevent targets from being emptied out
  with `replace`. Prints warning!

- Adds various algorithms for projection (cg, squarem, it, map) to

  `gstats hdfe`, `gregress`, `givregress`, `gglm`.

- Some ancillary options (`tolerance()`, `traceiter`, `standardize`)

- Parallel execution of select functions can be enabled at compile
  time via `GTOOLSOMP`

- Typed (direct/non-hashed) radix sort to API internals

- Add `gstats hdfe` (alias `gstats residualize`) for residualizing
  variables (i.e. HDFE transform).

Enhancements

- `gtop` prints the number of levels in Other and Missing rows by
  default. (With missing it only does it if there's more than
  one type of missing value.)

- `greshape` tries to detect repeated stubs and suggests this possibility
  to the user when a stub matches multiple variables.

- Faster excludeself mean and sum w/o specified range in `gstats transform`.

Bug fixes

- Fixed incorrect results with excludeself without specified range in
  `gstats transform` (if there were missing values the input buffer was
  not being copied, but replaced).

- `gstats transform [if] [in], replace nogreedy` not allowed (since
  nogreedy reads groups on the fly it can't initialize the entire
  variable).

- Closes #87: For OSX, make now compiles x86_64 and arm64 separately
  then combines via `lipo`.

- `geomean` (`gcollapse`, `gegen`, `gstats`) no longer exhibits
  inconsistent behavior with zeros and negative values. A negative value
  results in a missing value evne if there are zeros present (internally,
  if a zero is encountered the loop just checks for negative values and
  returns 0 if it finds none).

- `gstats winsor`, exits with error if replace and if/in are passed
  (the way it's set up it'd be a bit of a hassle to allow init/noinit).

- `gstats transform`, `gstats hdfe`, `gregress` (and co.) all now
  initialize their targets to be empty (missing values) with
  if in and replace.

- `gstats transform` now exits with error if excludeself is passed
  without range, and now prints a warning if it's passed with
  stats other than range.

- `gtop` no longer incorrectly replaces the display value if the
  numerical variable has a value label and no missing values. If there
  was a single value this would result in an error: `gtop` would think
  there was always at least one missing value to replace.

- `gcollapse` no longer fails when trying to label the collapsed output
  if the source labels are blank (this can happen for example with data
  transformed to `.dta` from other formats or programs).

- `gcollapse` no longer gives incorrect missing variables list when
  part of that list is called with varlist notation (e.g. `x* y`
  and `x*` exist but `y` does not).

- `gunique` no longer ignores if/in with `gen` and `replace`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants