Rstudio unable to install package devtools: gcc error - gcc

I want to install package devtools. But after successful downloading of all dependencies, it gives error while installing of the form:
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c rawmatch.c -o rawmatch.o
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
gcc: error: unrecognized command line option ‘-Wdate-time’
/usr/lib/R/etc/Makeconf:159: recipe for target 'rawmatch.o' failed
make: *** [rawmatch.o] Error 1
ERROR: compilation failed for package ‘mime’
* removing ‘/usr/local/lib/R/site-library/mime’
I have checked gcc. I am able to run a sample c program file from terminal.

It seems you'll need to use a more recent gcc version, 4.9 at least.
Both unrecognized options, -fstack-protector-strong and -Wdate-time, were introduced in gcc 4.9 (release notes).

Related

facing an error during installing mumps on cygwin?

trying to install mumps on my windows laptop, followed instructions to setup cygwin first and install mumps through it....now facing this error updon running ./BuildMumpsWithNativeClientServer.script in cygwin terminal
config.status: creating include/mumpsc/config.h
Now run "make" followed by "make install"
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o mumps.o mumps.c
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o parse.o parse.c
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o sys1.o sys1.c
g++ -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o arith.o arith.cpp
sys1.c:804:1: error: conflicting types for ‘itoa’
itoa (val, str, rad)
^~~~
In file included from sys1.c:51:0:
/usr/include/stdlib.h:224:8: note: previous declaration of ‘itoa’ was here
char * itoa (int, char *, int);
^~~~
make: *** [<builtin>: sys1.o] Error 1
make: *** Waiting for unfinished jobs....
arith.cpp: In function ‘void mps_exp10(char*, char*)’:
arith.cpp:855:15: error: ‘exp10’ was not declared in this scope
double aa=exp10(strtod(a,NULL));
^~~~~
arith.cpp:855:15: note: suggested alternative: ‘expx’
double aa=exp10(strtod(a,NULL));
^~~~~
expx
make: *** [<builtin>: arith.o] Error 1
I'm going to give a non-answer that (I hope) will help you achieve your ultimate goal of installing a MUMPS build on your Windows laptop. Because you're running "BuildMumpsWithNativeClientServer.script", I'm guessing you're trying to install Kevin O'Kane's version of MUMPS. You might want to switch to a production-ready MUMPS build like Intersystems Cache, GT.M, or YottaDB.
If you use Intersystems Cache, it will install natively on Windows. If you use GT.M or it's fork, YottaDB, they install cleanly on most Linux distros, but not as native Windows apps. The painless option is to install Windows Subsystem for Linux (WSL) and a linux distro on your laptop. I recommend Ubuntu 18.04 as a Linux distro, since it's the most recent long-term support linux distro that's available in the Windows store.
Once you have linux installed via WSL on your Windows box, installing GT.M only takes a single command: sudo apt install fis-gtm
I know this isn't exactly answering the question you asked, but I'm hoping it gets you the result you really want. Good luck!

Install xgboost on Mac - ld: library not found

I am trying to install OpenMP enabled xgboost on my mac. I installed gcc with no problem:
brew install gcc --without-multilib
then cloned git repository:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk
but I get an error when I do
make -j4
Here is the error I get. I'd appreciate if you can help fixing this problem:
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -o xgboost build/cli_main.o build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -shared -o lib/libxgboost.so build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
clangclang: : warningwarning: : argument unused during compilation: '-pthread'argument unused during compilation: '-pthread'
ld: library not found for -lgomp
ld: library not found for -lgomp
clang: error: clanglinker command failed with exit code 1 (use -v to see invocation):
error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libxgboost.so] Error 1
make: *** Waiting for unfinished jobs....
make: *** [xgboost] Error 1
I have the same issue and solved it by:
brew install clang-omp
export CC=clang-omp
export CXX=clang-omp++
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4
cd python-package
sudo python setup.py install
If you used pip to install xgboost before, then delete the previous installed xgboost from your project. Then use
pip install xgboost
to install it again.
A new versions of OSX has a Clang as a default c\c++ compiler. Therefore your c++ command refers to clang++.
You should define a CC\CXX environmental variables for your make command like this CC=gcc CXX=g++ make -j
Also you can build an OpenMP for clang OpenMPrt and customise your shell environment (I didn't try this by own)
(I have no mac at this moment to check this solution; just linux)

Platypus installation error message

I am trying to install Platypus and have gotten the following error message:
building 'htslibWrapper' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c htslibWrapper.c -o build/temp.linux-x86_64-2.7/htslibWrapper.o -msse2 -msse3 -funroll-loops -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC
htslibWrapper.c:243:25: fatal error: htslib/bgzf.h: No such file or directory
#include "htslib/bgzf.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I am new to Bioinformatics and cannot seem to find a working solution online.
Sometimes the bioinformatics applications don't describe thier dependencies all that well. See this link for a possible solution
Install htslib from http://www.htslib.org/download/ and copy c headers to Platypus root folder:
cp -r htslib-x.x.x/htslib platypus_folder/
Build again

ld cannot find -l<library>

I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error:
/usr/bin/ld: cannot find -lcoinhsl
Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/
does anyone have a solution for this?
below is the complete return of running setup.py build:
root#ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build
running build
running build_ext
building 'pyipopt' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/pyipopt.c -o build/temp.linux-x86_64-2.7/src/pyipopt.o
src/pyipopt.c: In function ‘set_intermediate_callback’:
src/pyipopt.c:452:15: warning: variable ‘myowndata’ set but not used [-Wunused-but-set-variable]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relrobuild/temp.linux-x86_64-2.7/src/callback.o build/temp.linux-x86_64-2.7/src/pyipopt.o -L/home/mostafa/MyBuilds/CoinIpopt/build/lib/ -lipopt -lblas -lcoinhsl -lcoinmetis -llapack -ldl -lm -o build/lib.linux-x86_64-2.7/pyipopt.so -Wl,--rpath -Wl,/home/mostafa/MyBuilds/CoinIpopt/build/lib/
/usr/bin/ld: cannot find -lcoinhsl
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
-Ldir
Add directory dir to the list of directories to be searched for -l.
You may install your coinhsl library in one of your standard libraries directories and run 'ldconfig` before doing your ppyipopt install
I had a similar problem with another library and the reason why it didn't found it, was that I didn't run the make install (after running ./configure and make) for that library. The make install may require root privileges (in this case use: sudo make install). After running the make install you should have the so files in the correct folder, i.e. here /usr/local/lib and not in the folder mentioned by you.
you can add the Path to coinhsl lib to LD_LIBRARY_PATH variable. May be that will help.
export LD_LIBRARY_PATH=/xx/yy/zz:$LD_LIBRARY_PATH
where /xx/yy/zz represent the path to coinhsl lib.

Having difficulty to install git using Homebrew

I am watching this video to install git using Homebrew. I already got Homebrew installed. The problem i have is installing git using Homebrew. I typed brew install git and have certain error message.
Error msg:
./generate-cmdlist.sh > common-cmds.h+ && mv common-cmds.h+ common-cmds.h
/usr/bin/xcrun clang -o hex.o -c -MF ./.depend/hex.o.d -MMD -MP -Os -w -pipe -march=native -Qunused-arguments -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM hex.c
/usr/bin/xcrun clang -o ident.o -c -MF ./.depend/ident.o.d -MMD -MP -Os -w -pipe -march=native -Qunused-arguments -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM ident.c
/usr/bin/xcrun clang -o kwset.o -c -MF ./.depend/kwset.o.d -MMD -MP -Os -w -pipe -march=native -Qunused-arguments -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM kwset.c
In file included from ident.c:8:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
^
In file included from hex.c:1:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
^
In file included from kwset.c:37:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
^
1 error generated.
make: *** [hex.o] Error 1
1 error generated.
make: *** Waiting for unfinished jobs....
make: *** [ident.o] Error 1
1 error generated.
make: *** [kwset.o] Error 1
==> Build Environment
CPU: quad-core 64-bit sandybridge
MacOS: 10.7.4-x86_64
Xcode: 4.3.2
CC: /usr/bin/xcrun clang => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CXX: /usr/bin/xcrun clang++ => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
LD: /usr/bin/xcrun clang => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j4
Error: Failed executing: make prefix=/usr/local/Cellar/git/1.7.10.3 CC=/usr/bin/xcrun\ clang CFLAGS=-Os\ -w\ -pipe\ -march=native\ -Qunused-arguments LDFLAGS= install (git.rb:49)
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/8643
https://github.com/mxcl/homebrew/issues/9023
https://github.com/mxcl/homebrew/issues/9618
https://github.com/mxcl/homebrew/issues/10544
https://github.com/mxcl/homebrew/issues/11481
https://github.com/mxcl/homebrew/issues/12325
https://github.com/mxcl/homebrew/issues/12344
https://github.com/mxcl/homebrew/issues/12400
https://github.com/mxcl/homebrew/issues/12478
Otherwise, please report the bug:
https://github.com/mxcl/homebrew/wiki/reporting-bugs
How do i solve this error? Need some help
You must install the command-line tools through Xcode to get the needed headers.
I suggest you to download it. Also, if you use github, I suggest you to just read this page. One year ago I started in this way.

Resources