0

I am trying to install gwsem (v2.1.5) in R (v4.2.1) on an intel MacBook Pro. I know the package was removed from CRAN, but the GitHub lists detailed instructions for installing from source. However, I have tried both in R and in the command line to install it, but I receive the error each time. The instructions for install are

git clone https://github.com/jpritikin/gwsem 
cd gwsem 
./tools/rox
cd ..
R CMD INSTALL gwsem R_LIBS_USER
Rscript tools/test.R

I know it requires roxygen2 to run, so using install_github or devtools doesn't work. Each time I get to ./tools/rox and it fails with the following:

./tools/rox

R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(roxygen2)
> pkgload::load_all()
ℹ Loading gwsem
Re-compiling gwsem
─  installing *source* package ‘gwsem’ ...
   ** using staged installation
   ** libs
   clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/BH/include' -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include' -I/usr/local/include      -I. -Iinclude  -fPIC  -Wall -g -O2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c bgen.cpp -o bgen.o
   In file included from bgen.cpp:14:
   In file included from include/genfile/bgen/bgen.hpp:20:
   include/genfile/zlib.hpp:14:10: fatal error: 'zstd.h' file not found
   #include <zstd.h>
            ^~~~~~~~
   1 error generated.
   make: *** [bgen.o] Error 1
   ERROR: compilation failed for package ‘gwsem’
─  removing ‘/private/var/folders/9x/x3jyk269287916gzlmg35kyh0000gn/T/RtmpjDZzGD/devtools_install_582f289c75a6/gwsem’
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'R' failed
---

If I try to use the "remotes" package in R and install from GitHub using remotes::install_github("jpritikin/gwsem") I have the same error message about the zstd.h file. I have re-installed zstd to make sure there wasn't an error there and made sure all of the dependency packages are installed and ready for use.

Any help to get this package installed and running in R would helpful!

Evg
  • 25,259
  • 5
  • 41
  • 83

0 Answers0