homebrew not installing JAGS - r

I'm trying to install JAGS through homebrew so I can use it in R. I am getting the following warning every time I install:
Warning: jags dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
Then, when I try to install rjags in R, I get the following error:
configure: error: "cannot link to JAGS library in /usr/local/Cellar/jags/4.3.0_2/lib."
ERROR: configuration failed for package ‘rjags’
* removing ‘/usr/local/lib/R/4.0/site-library/rjags’
I also tried following the installation guide in the JAGS 4.3.0 readme. This yielded the same error once I moved to R.
Googling leads me to the following links, none of which seem closely related enough to help me:
https://github.com/Homebrew/brew/issues/4904
https://github.com/Homebrew/homebrew-core/issues/32112
Link different C++ standard libraries on Mac OS X
Here also is the entire result of my brew doctor
(base) aridf#Aris-MacBook-Pro ~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/Users/aridf/opt/anaconda3/bin/icu-config
/Users/aridf/opt/anaconda3/bin/krb5-config
/Users/aridf/opt/anaconda3/bin/freetype-config
/Users/aridf/opt/anaconda3/bin/xslt-config
/Users/aridf/opt/anaconda3/bin/libpng16-config
/Users/aridf/opt/anaconda3/bin/libpng-config
/Users/aridf/opt/anaconda3/bin/xml2-config
/Users/aridf/opt/anaconda3/bin/python3-config
/Users/aridf/opt/anaconda3/bin/curl-config
/Users/aridf/opt/anaconda3/bin/ncursesw6-config
/Users/aridf/opt/anaconda3/bin/pcre-config
/Users/aridf/opt/anaconda3/bin/python3.8-config
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libtcl8.6.dylib
/usr/local/lib/libtk8.6.dylib
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/fakemysql.h
/usr/local/include/fakepq.h
/usr/local/include/fakesql.h
/usr/local/include/itcl.h
/usr/local/include/itcl2TclOO.h
/usr/local/include/itclDecls.h
/usr/local/include/itclInt.h
/usr/local/include/itclIntDecls.h
/usr/local/include/itclMigrate2TclCore.h
/usr/local/include/itclTclIntStubsFcn.h
/usr/local/include/mysqlStubs.h
/usr/local/include/odbcStubs.h
/usr/local/include/pqStubs.h
/usr/local/include/tcl.h
/usr/local/include/tclDecls.h
/usr/local/include/tclOO.h
/usr/local/include/tclOODecls.h
/usr/local/include/tclPlatDecls.h
/usr/local/include/tclThread.h
/usr/local/include/tclTomMath.h
/usr/local/include/tclTomMathDecls.h
/usr/local/include/tdbc.h
/usr/local/include/tdbcDecls.h
/usr/local/include/tdbcInt.h
/usr/local/include/tk.h
/usr/local/include/tkDecls.h
/usr/local/include/tkPlatDecls.h
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a
Thanks!

The solution, per https://gist.github.com/casallas/8411082, was to change ~/.R/Makedir to the following:
CC=clang
CXX=clang++
Then reinstall the package in R

Related

Netcdf-Fortran failure when installing: netcdf-fortran-4.5/nf03_test

I am desperated and hope someone might be able to bring some light on this problem:
I am trying to install netcdf-fortran in Fedora 35 using Intel compilers. To do so, I first installed ONEAPI from intel in /opt/intel/oneapi. Then, I install
https://gmplib.org/download/gmp/gmp-6.2.0.tar.lz
https://www.mpfr.org/mpfr-current/mpfr-4.1.0.tar.gz
https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
git clone https://gnu.googlesource.com/gcc
git checkout releases/gcc-10
source /opt/intel/oneapi/setvars.sh intel64
export PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/bin:$PATH
export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2021.4.0/linu/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/opt/intel/oneapi/compiler/2021.4.0/lib/pkgconfig:$PKG_CONFIG_PATH
export C_INCLUDE_PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/include:$CPLUS_INCLUDE_PATH
Then exported the utilities directory where I am install all these packages and exported it accordingly.
Then, I kept installing:
szip-2.1.1.tar
libjpeg-turbo-2.1.2
gzip-1.11
bzip2-1.0.8
libuuid-1.0.3
brotli
gperf-3.1
gettext-0.21
hdf-4.2.15
hdf5-1.13.0
netcdf-c-4.8.1
and up everything compiles and works fine. Yet, when I tried to install
https://downloads.unidata.ucar.edu/netcdf-fortran/4.5.3/netcdf-fortran-4.5.3.tar.gz
Then it keeps failing and failing with the error:
make[3]: * [Makefile:728: test-suite.log] Error 1
make[2]: * [Makefile:836: check-TESTS] Error 2
make[2]: Leaving directory '/SOME/LOCAL/ADDRESS/netcdf-fortran-4.5.0/nf03_test'
make[1]: * [Makefile:917: check-am] Error 2
make[1]: Leaving directory '/SOME/LOCAL/ADDRESS/netcdf-fortran-4.5.0/nf03_test'
I don't know what the problem is but it is not a problem with the version as even if I install an older version, the error keeps being the same.
I tried to follow the instructions I was finding about how to install these libraries.
Can someone please give me an advice on how to do this?
My configure is as follows:
CC=icc FC=ifort F77=ifort CPP="icc -E" ./configure --prefix=$PRFX --with-sysroot=$PRFX --with-pic
I have defined:
PRFX=/SOME/LOCAL/ADDRESS/
Thank you in advance,
When you say "... and up everything compiles and works fine." did you mean that you compiled all those packages with ONEAPI? or did you just install those from the depository?
It is much predictable to install netcdf-f when all other dependencies are compiled with a same compiler. Or you should refer to cross-compilation for all required dependencies.
Did you compile hdf5 and netcdf-c (which are one of the basic dependencies for netcdf-fortran) with the ONEAPI? If not, I recommend you doing that first.
I realized that using different compiler than GCC when compiling netcdf-fortran generates an error regarding shared library. You should try compiling it with static library by adding "--disable-shared --enable-static" during the "configuration" stage (for detailed instructions, consult the "Building with static libraries" sections of this link). Make sure you explicitly link the 'include' and 'lib'
directories when you are using the netcdf-f library.

Missing boost files from an unknown path

I receive errors on missing boost files but to my knowledge I already have them installed by YAST (OpenSUSE). However, I still receive the error. I need help fixing this problem.
When installation from YAST package did not work, I installed boost from source code. It still did not work. I installed boost-1.70.0
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_date_time
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_filesystem
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_system
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lboost_regex
collect2: error: ld returned 1 exit status
make: *** [/home/hafiz/OpenFOAM/OpenFOAM-6/wmake/makefiles/general:142: /home/hafiz/OpenFOAM/hafiz-6/platforms/linux64GccDPInt64Opt/bin/laminarBuoyantSimpleSMOKE] Error 1
I would expect by installation of boost by source code, this error would get resolved but yet it's still there. boost compilation was successful as mentioned here:
...updated 184 targets...
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/hafiz/Softwares/boost/boost_1_70_0
The following directory should be added to linker library paths:
/home/hafiz/Softwares/boost/boost_1_70_0/stage/lib
I'm not sure if compiler include paths and linker library paths are automatically added though. Please help resolve this issue! Thanks
It seems like you're using OpenFOAM and OpenSMOKE++ so you've left out a lot of important information to actually answer this question (e.g. OpenFOAM uses wmake and not make explicitly!). Despite this, I'm going to answer assuming you (1) have OpenFOAM installed already, (2) are compiling OpenSMOKE++ applications/solvers, and (3) your only problem is that wmake can't find boost that you've installed.
You need to add the boost paths to your (solver)/Make/files EXE_LIBS section for wmake to find boost:
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions \
-L$(BOOST_LIB_DIR)
Where BOOST_LIB_DIR is an environmental variable set to /home/hafiz/Softwares/boost/boost_1_70_0/stage/lib
For more information, see the OpenFOAM User Guide Section 3.2: Compiling Applications and Libraries https://cfd.direct/openfoam/user-guide/v6-compiling-applications/#x10-710003.2
Also, stackoverflow isn't the best place for OpenFOAM -- cfd-online.com has a CFD/OpenFOAM specific forum better suited to questions like this.

golang: core net/http package import errors

I've cloned go source code using git clone https://go.googlesource.com/go into my ~/godev/ directory (outside of GOPATH as the docs advise).
My $GOPATH is ~/gocode
I installed go 1.8.1 using the official osx installer.
If I cd into ~/godev/go/src/net/http and run go test, I get these errors:
h2_bundle.go:46:2: cannot find package "golang_org/x/net/http2/hpack" in any of:
/usr/local/go/src/golang_org/x/net/http2/hpack (from $GOROOT)
~/gocode/src/golang_org/x/net/http2/hpack (from $GOPATH)
h2_bundle.go:47:2: cannot find package "golang_org/x/net/idna" in any of:
/usr/local/go/src/golang_org/x/net/idna (from $GOROOT)
~/gocode/src/golang_org/x/net/idna (from $GOPATH)
h2_bundle.go:48:2: cannot find package "golang_org/x/net/lex/httplex" in any of:
/usr/local/go/src/golang_org/x/net/lex/httplex (from $GOROOT)
~/gocode/src/golang_org/x/net/lex/httplex (from $GOPATH)
transport.go:32:2: cannot find package "golang_org/x/net/proxy" in any of:
/usr/local/go/src/golang_org/x/net/proxy (from $GOROOT)
~/gocode/src/golang_org/x/net/proxy (from $GOPATH)
transfer.go:14:2: use of internal package not allowed
After I follow the directions here by doing cd $GOPATH/src
followed by cp -R /usr/local/go/src/vendor/golang_org ., I still get these errors:
h2_bundle.go:47:2: code in directory ~/gocode/src/golang_org/x/net/idna expects import "golang.org/x/net/idna"
transport.go:32:2: cannot find package "golang_org/x/net/proxy" in any of:
/usr/local/go/src/golang_org/x/net/proxy (from $GOROOT)
~/gocode/src/golang_org/x/net/proxy (from $GOPATH)
transfer.go:14:2: use of internal package not allowed
It is true that there is no proxy package under ~/gocode/src/golang_org/x/net, but I still don't know how to fix that and the other 2 errors.
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="~/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/71/k_tftg2d1qd7gf5ww0n_wl_r0000gn/T/go-build541211050=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
If I run the all.bash script, it will run all unit tests, but that is time consuming. Is there a way to run just net/http tests without getting these errors?
The problem here is that you're running go test, where the go command is your 1.8.1 installation. For the tests to work properly you should run with the Go toolchain built from your development directory.
Make sure you've built the Go toolchain, cd ~/godev/src; ./make.bash (./all.bash will work too, but then you'll have to wait for tests to run instead of just building the toolchain).
Run the tests with the newly compiled toolchain, cd ~/godev/src/net/http; ~/godev/bin/go test.
I suggest adding an alias to your profile, such as alias godev=~/godev/bin/go, then you can run godev test.
Also make sure that you are not setting the GOROOT environment variable as it will cause the go command to use the specified path as the GOROOT regardless of which toolchain you're running with, which is not what you want.
Update
As requested in the comments, here's as brief an explaination as I can come up with:
The errors that mention "cannot find package" are looking for some packages that are vendored in ~/godev/src/vendor/golang_net/.... However, the vendoring support added in 1.5/1.6 only works when the package is inside the GOPATH or GOROOT. Your godev installation is not (and should not be) inside GOPATH and GOROOT is pointing to your 1.8.1 install.
transfer.go:14:2: use of internal package not allowed is because transfer.go imports net/http/internal. Since this is not a relative path it'll be found in $GOROOT/src/net/http/internal, instead of ~/godev/src/net/http/internal and internal packages cannot be imported if the importing package does not share a common root with the internal directory.
It boils down to GOROOT pointing to your 1.8.1 installation. You might wonder if you could just set GOROOT to point at your godev directory, but this is not going to work correctly either. I'm not as certain of the mechanics here, but I think the problems come down to mismatches between what the 1.8.1 compiler expects are what is in ~/godev/src/runtime.
When the toolchain is compiled the location of GOROOT is compiled in, so when ~/godev/bin/go is run, it uses ~/godev as it's GOROOT.

Issues using Clisp to compile files

So I'm using the new Bash on Ubuntu on Windows shell, and installed the clisp package to mess with Common Lisp. I get this error when I try clisp test.clisp:
/usr/lib/clisp-2.49/base/lisp.run: error while loading shared libraries: libavcall.so.0: cannot enable executable stack as shared object requires: Invalid argument
This is an entirely fresh install too. I looked in /usr/lib and found the libavcall.so.0 file, but I'm not sure what to do with it. How do I fix this issue?
This issue no longer exists with libffcall 2.0 or newer. It was fixed through this commit.
If you are still using libffcall 1.x: The FAQ (cited by user #cybevnm) explains most of it:
libavcall.so is flagged as requiring executable stack (property GNU_STACK has the value RWE), although it does not need an executable stack. This occurs because it was compiled from assembly-language source code.
You can remove this flag through a command such as sudo execstack -c /usr/lib/libavcall.so.0.

Moving directory after compilation of R

I compiled R in /tmp/R-3.0.0 and then moved it to /home/user/opt/R-3.0.0, then I got an error when executing R:
/home/kaiyin/opt/R-3.0.0/bin/R: line 236: /tmp/R-3.0.0/etc/ldpaths: No such file or directory
ERROR: R_HOME ('/tmp/R-3.0.0') not found
If I export R_HOME='/home/kaiyin/opt/R-3.0.0', it still gives almost the same error:
WARNING: ignoring environment value of R_HOME
/home/kaiyin/opt/R-3.0.0/bin/R: line 236: /tmp/R-3.0.0/etc/ldpaths: No such file or directory
ERROR: R_HOME ('/tmp/R-3.0.0') not found
Is there a way to solve this, or do I have to recompile it?
You are supposed to do
configure [...]
make
make install
rather than a manual move. This is a very standard process for source code on Unix system following the GNU conventions.
For more details, please see the manual R Installation and Administration that came with the sources.
There are also pre-built binaries for several distributions.

Resources