fatal error: 'dirent.h' file not found when trying to install gopls/Go tools via Visual Studio Code - go

I am trying to install the Go tools in Visual Studio Code and am getting the following error when installing gopls:
Tools environment: GOPATH=/Users/jal/go
Installing 1 tool at /Users/jal/go/bin in module mode.
gopls
Installing golang.org/x/tools/gopls#latest FAILED
{
"killed": false,
"code": 2,
"signal": null,
"cmd": "/opt/brew/bin/go install -v golang.org/x/tools/gopls#latest",
"stdout": "",
"stderr": "golang.org/x/tools/internal/fastwalk\n# golang.org/x/tools/internal/fastwalk\n../../go/pkg/mod/golang.org/x/tools#v0.2.1-0.20221101170700-b5bc717366b2/internal/fastwalk/fastwalk_darwin.go:11:10: fatal error: 'dirent.h' file not found\n#include <dirent.h>\n ^~~~~~~~~~\n1 error generated.\n"
}
1 tools failed to install.
gopls: failed to install gopls(golang.org/x/tools/gopls#latest): Error: Command failed: /opt/brew/bin/go install -v golang.org/x/tools/gopls#latest
golang.org/x/tools/internal/fastwalk
# golang.org/x/tools/internal/fastwalk
../../go/pkg/mod/golang.org/x/tools#v0.2.1-0.20221101170700-b5bc717366b2/internal/fastwalk/fastwalk_darwin.go:11:10: fatal error: 'dirent.h' file not found
#include <dirent.h>
^~~~~~~~~~
1 error generated.
I know I have dirent.h because I see results in my local Xcode SDKs when running find / -iregex ".*/dirent.h$" 2>/dev/null.
I am following the steps here: https://learn.microsoft.com/en-us/azure/developer/go/configure-visual-studio-code
My setup is:
Fresh install of go from Homebrew
Fresh install of VSCode macOS from go.dev/doc/install
Instal the Go plugin
In the Command Palette, search for and select "Go: Install/Update tools" and select all tools in the dropdown
All tools are installed successfully except for gopls. I have installed go via Homebrew and have also installed gopls via Homebrew but am not sure how to configure VSCode to point to this alternative gopls path.

The issue seemed to be due to a misconfigured or corrupted Xcode and command line tools.
I uninstalled and re-installed the latest version of Xcode, as well as the Command Line Tools package (this one is especially important) from here https://developer.apple.com/download/all/.
I had to do this despite xcode-select --install telling me everything was installed correctly and up to date.
Future issue discussion available here: https://github.com/golang/go/issues/56663

Related

Cannot install gotk3, getting GdkMonitor error

I tried to use gotk3 for creating desktop application. I follow the instruction in gotk3 wiki and this installing-on-linux wiki to install it. But then I get this error while executing go get -v:
gcc errors for preamble:
In file included from ../../gotk3/gotk3/gdk/gdk_since_3_22.go:23:0:
./gdk_since_3_22.go.h:22:8: error: unknown type name 'GdkMonitor'
static GdkMonitor *
^
I've tried to delete the gotk3 directory, and then trying to go get -v again, but still, it didn't work.
I also checked the GTK version that installed in my Ubuntu 16.04 using apt-cache policy libgtk2.0-0 libgtk-3-0 | grep Installed. And it shows this:
Installed: 2.24.30-1ubuntu1.16.04.2
Installed: 3.18.9-1ubuntu3.3
What did I do wrong? Thanks
GdkMonitor was introduced in GTK+ 3.22. Your version is 3.18.
go get -tags gtk_3_18 github.com/gotk3/gotk3/gtk at the very beginning of building (see here NOTE section) should fix things

Cannot install package "predictionet" on Windows

I am trying to install predictionet but having troubles. Clearly there are no windows binaries available so I have been trying to install by building from source.
I have Rtools installed from here.
So far I have tried to use this command:
> install.packages("C:/Users/Blah/predictionet_1.10.0.tar.gz", repos = NULL, type="source")
But I am receiving this error message:
Installing package into ‘C:/Users/Blah/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package 'predictionet' ...
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-31~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="predictionet.dll" OBJECTS="foo_mrmr.o mrnet_adapted.o mrnet_adapted2.o mrnet_ensemble_standalone.o"' had status 309
ERROR: compilation failed for package 'predictionet'
* removing 'C:/Users/Blah/Documents/R/win-library/3.1/predictionet'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\Blah\Documents\R\win-library\3.1" "C:/Users/Blah/Desktop/predictionet_1.10.0.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/Blah/Desktop/predictionet_1.10.0.tar.gz’ had non-zero exit status
I am new to R so have no idea how to go about troubleshooting this, any help would be much obliged!
Note: I am using Rstudio
You may try :
source("http://bioconductor.org/biocLite.R")
biocLite("predictionet")

Octave 3.8.0 - package installation error in Mac OS X

I am trying to install some packages in Octave however, I am getting errors. Any help will be much appreciated. I tried this from Octave home directory. (I have also tried: pkg install general-1.3.4.tar.gz)
octave:1> pkg install -forge general
In file included from /usr/local/octave/3.8.0/lib/gcc47/gcc/x86_64-apple-darwin13/4.7.3/include/stdint.h:3:0,
from /usr/local/octave/3.8.0/include/octave-3.8.0/octave/oct-conf-post.h:167,
from /usr/local/octave/3.8.0/include/octave-3.8.0/octave/config.h:3351,
from /usr/local/octave/3.8.0/include/octave-3.8.0/octave/../octave/oct.h:31,
from SHA1.cc:19:
/usr/local/octave/3.8.0/lib/gcc47/gcc/x86_64-apple-darwin13/4.7.3/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory
compilation terminated.
make: *** [SHA1.oct] Error 1
/usr/local/octave/3.8.0/bin/mkoctfile-3.8.0 SHA1.cc
pkg: error running `make' for the general package.
error: called from 'configure_make' in file /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/configure_make.m near line 82, column 9
error: called from:
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/install.m at line 199, column 5
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/pkg.m at line 394, column 9
Running the following command on a new terminal window solved it for me on the command line and gui based versions:
xcode-select --install
I have found a workaround from other sites on the web:
I was having the same issue when trying to install the Octave Signal Package without success. The following finally appears to be working.
code-select --install from the Terminal window to install the command line tools
Install MacPorts for Mac. This is a standard installer that you can download from Macports.
sudo port install gcc48 --> This is a Fortran compiler, which is necessary for installing octave-general
sudo port install octave-general [NOTE: THIS TOOK A VERY LONG TIME, and I had to disable Spotlight indexing...Hours on a Macbook Pro]
sudo port install octave-control
sudo port install octave-signal
I am having similar problems with octave 3.8.0 and Yosemite
pkg install /Users/Andrew/Downloads/odepkg-0.8.4.tar.gz
configure: error: in /var/tmp/oct-ZcfViL/odepkg/src':
configure: error: C compiler cannot create executables
Seeconfig.log' for more details
checking for gcc... /usr/local/octave/3.8.0/bin/gcc-mp-4.7
checking whether the C compiler works... no
pkg: error running the configure script for odepkg.
error: called from 'configure_make' in file /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/configure_make.m near line 72, column 9
error: called from:
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/install.m at line 199, column 5
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/pkg.m at line 394, column 9
I have the xcode command line tools installed.

Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.6.sdk

I'm trying to install rpy2 for Python3 with the following command:
easy_install-3.2 rpy2
This gives a few warnings and an error:
warning: no previously-included files matching '*patch*' found anywhere in distribution
warning: no previously-included files matching '*diff*' found anywhere in distribution
warning: no previously-included files matching '.hg' found anywhere in distribution
no previously-included directories found matching 'dist'
gcc-4.2 not found, using clang instead
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.6.sdk
Please check your Xcode installation
build/python3_rpy/rpy/rinterface/_rinterface.c:51:10: fatal error: 'signal.h' file not found
#include <signal.h>
^
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
The file /Developer/SDKs/MacOSX10.6.sdk seems to be missing even though I have xcode 4.5.1 installed.
There is no file called MacOSX10.6.sdk in the "Downloads for Apple Developers" on the Apple home page. What do I do?
Ps. It all works well if I do not specify python3.
What is happening is that python was built with a pre-4.3 version of Xcode where the tools and SDKs were installed in /Developer. This is no longer the case with Xcode 4.3 where the tools and SDKs are part of the Xcode.app bundle. It also looks like python was compiled using gcc rather than clang.
I would recommend dumping the installation of python3 you have and installing it via macports, which will use the latest Xcode to build its ports and will therefore be able to compile additional python modules.
Once you have installed macports, simply do:
$ sudo port install python33
There is also a good chance those python modules can be installed by simply doing:
$ sudo port install whizzopymod
EDIT: Scratch that last part as macports doesn't have rpy2 for python3. You'll have to continue using easy_install I guess.

Agave dependency error

I am trying to install Agave under Fedora, but I got this error:
configure: error: gnome-doc-utils >= 0.3.2 not found
I tried to compile and install the gnome-doc-utils from this page, but i still got this error,and when i try the
yum list installed gnome-doc-utils*
command, I can't find the package. Do I have to register the package after installing? I don't think I have a error for the make install, because I don't see any the text error in the process, or I could be wrong.
In general, package managers (tools like yum) don't know that something has been installed on your machine unless it was installed as a package. If an agave package for Fedora exists, I would suggest using that instead of compiling from source.

Resources