MacOS RStudio accessing wrong clang after upgrade to Catalina - clang

After an upgrade to MacOS Catalina, I find that I can no longer install packages from source in the RStudio IDE (v1.2.5001, current stable release).
Example:
> install.packages("processx", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/processx_3.4.1.tar.gz'
Content type 'application/x-gzip' length 123430 bytes (120 KB)
==================================================
downloaded 120 KB
* installing *source* package ‘processx’ ...
** package ‘processx’ successfully unpacked and MD5 sums checked
** libs
/usr/local/clang4/bin/clang -Wall -g -O2 -Wall tools/px.c -o tools/px
make: *** [tools/px] Killed: 9
ERROR: compilation failed for package ‘processx’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/processx’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/processx’
Warning in install.packages :
installation of package ‘processx’ had non-zero exit status
In the process I get a popup with this message:
“clang-4.0” cannot be opened because the developer cannot be verified.
It seems that RStudio is pointed at clang from XCode 11.1, rather than the clang 8 I got from CRAN https://cran.r-project.org/bin/macosx/tools/.
Straight from R (e.g. sudo -i R in my terminal) a source install works fine, so it seems to be a matter of getting RStudio to look in the right place for the clang binary.
Any ideas?

I changed my ~/.R/Makevars file to point to a newer version of clang (R recommends 8+), e.g. CC=/usr/local/opt/llvm/bin/clang. I commented out the clang4 lines and created a new set pointing to the updated clang. Worked like a charm, now able to install R packages as usual.
Note: I had previously used brew to update llvm, which installed clang9.
Hope that helps!

Related

ODBC link check failed error while compiling Erlang OTP on FreeBSD 10.1

I am trying to compile Erlang OTP-R16B03-1 on FreeBSD 10.1 OS. When i run the ./configure command the output is
odbc : ODBC library - header check failed
I have tried installing unixODBC, iODBC. Also /usr/ports/databases/unixODBC exists. The sql.h file is located in /usr/local/include.
I am still getting the link failed error. Any help will be useful
The log for ./configure |grep odbc command is as shown below
config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting
=== configuring in odbc/. (/root/otp_src_R16B03-1/lib/odbc/.)
checking for odbc in standard locations... -L/usr/local/lib
checking for SQLAllocHandle in -lodbc... no
configure: WARNING: "ODBC library - header check failed"
configure: WARNING: Check for large file support flags failed; getconf failed
odbc : ODBC library - header check failed
I had the same problem on erlang 21 but when I downloaded the newest version from github (erlang 22), and tried ./configure the error ODBC library - header check failed appeared again but after trying make install again, everything finished successfully.
What finally worked for me was
apt-get install unixodbc-dev
Then
otp_build configure --with-odbc=/usr/lib/x86_64-linux-gnu/

How to build DCMTK 3.6.1 libs for iOS?

I followed Russes' instructions found at http://forum.dcmtk.org/viewtopic.php?f=3&t=3047&start=15
With a fresh copy of his "afab" git branch, I built Xcode project for x86 arch with the command line:
cmake -DIOS_PLATFORM=SIMULATOR64 -G Xcode ../dcmtk.public
or for arm arch with:
cmake -DIOS_PLATFORM=OS -G Xcode ../dcmtk.public
However, my Xcode project can't be successfully built because of, at least, the following errors:
List of Xcode errors on ofchrenc.cc file (for eg. "No class named Implementation in OFCharacterEncoding")
The compilation with Unix makefiles gives the same errors in my case:
Scanning dependencies of target ofstd
0% Building CXX object ofstd/libsrc/CMakeFiles/ofstd.dir/ofchrenc.cc.o
dcmtk.public/ofstd/libsrc/ofchrenc.cc:518:28: error: no class named 'Implementation' in 'OFCharacterEncoding'
class OFCharacterEncoding::Implementation {};
dcmtk.public/ofstd/libsrc/ofchrenc.cc:556:31: error: out-of-line definition of 'getLocaleEncoding' does not match any declaration in
'OFCharacterEncoding'
OFString OFCharacterEncoding::getLocaleEncoding()
/usr/local/include/dcmtk/ofstd/ofchrenc.h:97:21: note: member declaration does not match because it is const qualified
const OFString &getLocaleEncoding() const;
[...]
dcmtk.public/ofstd/libsrc/ofchrenc.cc:644:34: error: out-of-line definition of 'setConversionFlags' does not match any declaration in
'OFCharacterEncoding'
OFCondition OFCharacterEncoding::setConversionFlags(const unsigned flags)
19 errors generated.
make 2: ofstd/libsrc/CMakeFiles/ofstd.dir/ofchrenc.cc.o Error 1
make 1: ofstd/libsrc/CMakeFiles/ofstd.dir/all Error 2
make: [all] Error 2
I don't understand what is wrong in my configuration:
MacOs Sierra 10.12.2
Xcode 8.2
CMake 3.7.1 (I have the same issue previously with 3.5.2 version)
GNU Make 3.81 (for Unix makefiles compilation)
Apple LLVM version 8.0.0.8000042
Darwin version of host: 16.3.0
Building for minimum iOS version: 10.2 (SDK version: 10.2)
I'm not sure about the first error message but
/usr/local/include/dcmtk/ofstd/ofchrenc.h:97:21: note: member
declaration does not match because it is const qualified const
OFString &getLocaleEncoding() const;
seems to indicate that you are mixing an old version of "ofchrenc.h" (stored in "/usr/local/...") with a more recent version of "ofchrenc.cc" (stored in your working directory).

Error compiling Mosquitto 1.4

I have tried to compile Mosquitto on both Arch and CentOS 7, but everytime I get the same error. I want to test the Websocket feature.
This is the procedure I am using for CentOS:
yum group install "Development Tools"
yum install cmake openssl-devel cmake
yum install uuid-devel libxslt docbook5-style-xsl.noarch docbook-style-xsl.noarch
git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets/
mkdir build;cd build
cmake ..
make
make install
git clone https://git.eclipse.org/r/mosquitto/org.eclipse.mosquitto
cd org.eclipse.mosquitto/
git checkout origin/1.4
vi config.mk
Change "WITH_WEBSOCKETS:=yes"
make
And this is where it dies on Arch and CentOS:
make[1]: Entering directory '/home/install/org.eclipse.mosquitto/src'
cc -Wall -ggdb -O2 -I. -I.. -I../lib -DVERSION="\"1.4\"" -DTIMESTAMP="\"2015-05-04 17:17:55+0200\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_WEBSOCKETS -DWITH_EC -c mosquitto.c -o mosquitto.o
In file included from /usr/include/unistd.h:25:0,
from mosquitto.c:22:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
mosquitto.c: In function ‘main’:
mosquitto.c:275:101: error: expected expression before ‘,’ token
_mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s (build date %s) starting", VERSION, TIMESTAMP);
mosquitto.c:290:54: error: expected expression before ‘)’ token
snprintf(buf, 1024, "mosquitto version %s", VERSION);
mosquitto.c:368:88: error: expected expression before ‘)’ token
_mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s terminating", VERSION);
Makefile:15: recipe for target 'mosquitto.o' failed
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory '/home/install/org.eclipse.mosquitto/src'
Makefile:21: recipe for target 'mosquitto' failed
make: *** [mosquitto] Error 2
If someone can please point out what I am doing wrong or missing ?
As #hardillb says, the VERSION defines are the problem. If I add the line
#define VERSION
to mosquitto.c, then I can reproduce the error that you see, but also get a warning about redefining VERSION.
If I remove the definition of VERSION from config.mk, then I get an error about VERSION not being defined.
These both make sense.
What seems to be happening for you is that the compiler is ignoring the command line definition -DVERSION="\"1.4.1\"" and replacing it with -DVERSION=, or isn't parsing the string properly. This doesn't make sense.
Other people have managed to compile on Arch, and the CentOS7 repository has a binary version - but without websockets.
After some investigation, it appears as though there is a bug in recent libwebsockets code. This changeset introduces some changes that mean that libwebsockets is claiming the macro VERSION all for itself, which isn't very polite for a library. If you use a released version of libwebsockets you should not have any problem compiling.
Just out of interest have you tried building from the TGZ src bundle for Mosquitto 1.4.1 available here:
http://mosquitto.org/download/
The errors look to be something to do with expanding the passed in VERSION and TIMESTAMP values. It builds fine [with the exception of the docs] on Fedora 20 which shouldn't be that far from RHEL 7.0 (and from there to Centos 7).

Building OpenCV with CUDA support Error on transpose.cu

Recently I am trying to build OpenCV with CUDA support, and I met problem while building the module cudaarithm.
OpenCV source: git cloned from : http://github.com/Itseez/opencv.git
OpenCV branch: master branch
OpenCV commit:
`commit 5466e321b8c8f97536002a357e5b7ff49a5d2bf9, on Tue Feb 10 12:17:11 2015 +0000`
CUDA version: CUDA 6.5
Hardware: MacBook Pro (13-inch, Mid 2010)
GPU: NVIDIA GeForce 320M 256 MB
OS Version: OS X Yosemite
Steps I used:
1. cd in OpenCVSource, then mkdir myrelease, and cd myrelease
2. cmake -DPLANTUML_JAR=/usr/local/Cellar/plantuml/8002 -D BUILD_DOCS=1 -DPYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib -DPYTHON2_INCLUDE_DIR=/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DPYTHON3_LIBRARY=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4m.dylib -DPYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/include/python3.4m -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -Wno-dev -DNVCC_FLAGS_EXTRA="-Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++" -DOPENCV_EXTRA_CXX_FLAGS=" -stdlib=libstdc++" -DOPENCV_EXTRA_EXE_LINKER_FLAGS="-stdlib=libstdc++" ..
3. make VERBOSE=1
Expect Result: Building success without error
Actual Result: when building OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu, error happend like below:
/Users/Hawk/Documents/study/DIP/OpenCV/OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu(61): *error: identifier "getInputMat" is undefined*
/Users/Hawk/Documents/study/DIP/OpenCV/OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu(67): *error: identifier "getOutputMat" is undefined*
/Users/Hawk/Documents/study/DIP/OpenCV/OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu(92): *error: identifier "syncOutput" is undefined*
Then what action I take:
check the code and I found these undefined symboles are defined in OpenCVSource/modules/core/include/opencv2/core/private.cuda.hpp
check the code and I confrim that the "transpose.cu" file include "opencv2/core/private.cuda.hpp"
check the building log, and I the confirm the private.cuda.hpp is in the search path of header file
cp "opencv2/core/private.cuda.hpp" as another file "opencv2/core/hawk.hpp", and then edit "transpose.cu" to include this new file, and I found
the "undifined symbole error" disapeared.
Although this is a workable workaround, I would like know whether the original OpenCV source cannot be compiled.
All, I think I found the problem cause.
Before I met such problem, I've already build and install OpenCV using older code from the git repo. So that there already have header files in my /usr/local/include/opencv2, especially there is /usr/local/include/opencv2/core/private.cuda.hpp.
However, it is an older one that doesn't define the symbols reporting undefined in above question. At the same time I found during the building nvcc have -I/usr/local/include in the command line, so that it use wrong private.cuda.hpp. As you know it should use the one in OpenCVSource, not the older installed one.
I think the solution is to gracefully remove the original installed OpenCV from my computer, then build again. I am trying and I will report later.

compile vlc for android

I am trying to compile vlc for android in RHEL 6.4 (Santiago). I am following the instructions given in this page https://wiki.videolan.org/AndroidCompile. I am getting some errors.
First is when I build this, I get error in git.
error: unknown switch `B'. refer http://txt.do/6tjh for log
I changed the git checkout -B android ${TESTED_HASH} to git checkout -b android ${TESTED_HASH}. Then this error does not come
Then when I run sh compile.sh, I get following errors (refer http://tny.cz/bb552912 I have removed some part of log which had code to download packages like automake, protobuf, ragel etc)
rmdir: failed to remove /root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype/config': No such file or directory
make[1]: [install] Error 1 (ignored)
rmdir: failed to remove `/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype': No such file or directory
make[1]: [install] Error 1 (ignored)
Then if I again run sh compile.sh, weird things happen. I don't get this error again, but it builds some library and then stops.
First it build libdvdcss and then stops (refer http://tny.cz/5f3ab58f)
It ends like
Libraries have been installed in:
/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution
add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
use the `-Wl,-rpath -Wl,LIBDIR' linker flag
have your system administrator add LIBDIR to `/etc/ld.so.conf'
make[2]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
make[1]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
touch .dvdcss
Then each time I run "sh compile.sh" it build one more library and then stops.
it has build following libraries
libopenjpeg (http://tny.cz/86236e8b)
libgpg-error http://tny.cz/26c5626b)
ffmpeg (http://tny.cz/1f05aa0f)
gmp
libgcrypt
iconv
nettle
libjpeg
Finally I get an following error and I am not able to do any after that (http://tny.cz/ed7798ea)
autopoint: * The AM_GNU_GETTEXT_VERSION declaration in your configure.ac file requires the infrastructure from gettext-0.18 but this version is older. Please upgrade to gettext-0.18 or newer.
autopoint: * Stop.
autoreconf: autopoint failed with exit status: 1
configure.in:20: error: possibly undefined macro: AM_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /root/Documents/android/android/vlc/extras/tools/build/bin/autoconf failed with exit status: 1
make: *[.ogg] Error 1
I am not able to find gettext package with version > .18 for RHEL 6.4. Maximum available is .17 which is installed
Is not this weird. Should not doing "sh compile.sh" build all libraries and I should not have to do this again and again.
Also Is RHEL 6.4 (Santiago) compatible for building vlc android
Any help for these errors

Resources