The Mac version of R always reports an error when installing WGCNA
Entering edit mode
562125035 • 0
Last seen 16 months ago
> install.packages("WGCNA")

Package which is only available in source form, and may need compilation of C/C++/Fortran:


Do you want to attempt to install these from sources? (Yes/no/cancel) Yes

installing the source package ‘WGCNA’


Content type 'application/x-gzip' length 1168289 bytes (1.1 MB)


downloaded 1.1 MB

* installing *source* package ‘WGCNA’ ...

** 成功将‘WGCNA’程序包解包并MD5和检查

** using staged installation

** libs

clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DWITH_THREADS -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c corFunctions-utils.c -o corFunctions-utils.o

clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]

corFunctions-utils.c:16:10: fatal error: 'stdio.h' file not found

#include <stdio.h>


1 error generated.

make: *** [corFunctions-utils.o] Error 1

ERROR: compilation failed for package ‘WGCNA’

* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/WGCNA’

Warning in install.packages :

  installation of package ‘WGCNA’ had non-zero exit status

The downloaded source packages are in

software error WGCNA mac • 267 views
Entering edit mode

WGCNA is not a bioconductor package so you're not very likely to get informative answers here. Try posting this to R-SIG-Mac (R special interest group - Mac), see

Entering edit mode
Last seen 5 hours ago
United States

If you want to install source packages on MacOS, you have to also have the compilers available, which is not something that happens by default. For R-4.0.0 (which you should be using, but without output from running sessionInfo, it's a mystery to us) you can just use the XCode tools.

That said, it does appear that there is a MacOS binary for WGCNA at CRAN. And additionally, WGCNA isn't actually a Bioconductor package (although people do seem to post about it here), so you should actually be asking about it on


Login before adding your answer.

Traffic: 275 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6