I am trying to build my own Rcpp package, it works pretty well in my local computer, now I am installing it into another computer, the following error pops up:
ERROR: dependency ‘RcppArmadillo’ is not available for package "my_package_name"
Below is some information about the environment (by sessionInfo()):
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS
Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3]
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7]
LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.3
In the DESCRIPTION file, I already have
Linking to: Rcpp, RcppArmadillo
One action I tried but still did not work is installing the development versions of BLAS and LAPACK as suggested in https://support.bioconductor.org/p/117905/
Is there anyone knows which causes this error? Thank you in advance!
Related
There seems to be literally 0 info online about this. I want to install threadscope for haskell Parallelization. the pre built binaries on https://github.com/haskell/ThreadScope/releases are for x86 (intel). I tried to build the source code too, and it doesnt work.
When i try the pre built binary:
ME#ME-MBP documents % ./threadscope.macOS-latest.ghc-9.2.2
dyld[3954]: Library not loaded: '/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib'
Referenced from: '/Users/ME/Documents/threadscope.macOS-latest.ghc-9.2.2'
Reason: tried: '/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libgtk-quartz-2.0.0.dylib' (no such file), '/usr/lib/libgtk-quartz-2.0.0.dylib' (no such file)
zsh: abort ./threadscope.macOS-latest.ghc-9.2.2
When i build the source code myself (the final lines as i'm installing are):
[ 6 of 38] Compiling Events.TestEvents
[ 7 of 38] Compiling GUI.App
[ 8 of 38] Compiling GUI.ConcurrencyControl
[ 9 of 38] Compiling GUI.DataFiles
[10 of 38] Compiling GUI.GtkExtras
[11 of 38] Compiling GUI.EventsView
[12 of 38] Compiling GUI.MainWindow
<command line>: dlopen(/Users/ME/.stack/snapshots/x86_64-osx/894064171ba5044f814f0d855cf6a9996fb275c6016d0ad96e7110885834c41e/8.8.4/lib/x86_64-osx-ghc-8.8.4/libHScairo-0.13.8.1-CJN2bpyQimUKJQPgfKRXra-ghc8.8.4.dylib, 0x0005): symbol not found in flat namespace (_cairo_append_path)
-- While building package threadscope-0.2.14.1 (scroll up to its section to see the error) using:
/Users/ME/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.0.1.0 build exe:threadscope --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Solved it - Use cabal to install with the source code:
this will build and install the binary:
cabal --project-file=cabal.project.osx v2-install
Don't use stack for this!!
If the previous method doesn't work, try
cabal update
cabal install gtk
cabal install threadscope
works for mac/linux/windows.
I think this question is a duplicate: RcppEigen install failure on Ubuntu 20.04: warning: ignoring attributes on template argument ‘__m128’
However I don't think the solution proposed will work for me as I do not have root access to the machine. I am using R in a conda environment on Ubuntu 18 Bionic Beaver. Attempting to install RcppEigen gives a bunch of warnings (snippet of which are shown), then the make command abruptly fails:
../inst/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type {aka __vector(2) double}' [-Wignored-attributes]
../inst/include/Eigen/src/Core/CoreEvaluators.h:960:8: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type {aka __vector(2) double}' [-Wignored-attributes]
make: *** [/home/4469722/miniconda3/envs/r_env/lib/R/etc/Makeconf:175: fastLm.o] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/4473331/R/x86_64-conda_cos6-linux-gnu-library/3.6/RcppEigen’
Any help is appreciated. Here is my session info:
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
Matrix products: default
BLAS/LAPACK: /home/4469722/miniconda3/envs/r_env/lib/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
Here's a simple test function that calls Rcpp::stop()
#include <Rcpp.h>
NumericVector dostop()
{
Rcpp::stop("foo");
NumericVector x(1);
return x;
}
With clang on OS X, this performs as expected:
> library(Rcpp)
> sourceCpp('stop.cpp')
> dostop()
Error in dostop() : foo
>
However, with g++ on Linux, this function crashes R:
> library(Rcpp)
> sourceCpp('stop.cpp')
> dostop()
*** glibc detected *** /share/apps/R/3.3.3/lib64/R/bin/exec/R: free(): invalid pointer: 0x0000000001c29ff8 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3407c75f4e]
/lib64/libc.so.6[0x3407c78cad]
/tmp/RtmpiUT8Xb/sourceCpp-x86_64-pc-linux-gnu-1.0.1/sourcecpp_7dc862cd8f07/sourceCpp_2.so(_Z31exception_to_condition_templateIN4Rcpp9exceptionEEP7SEXPRECRKT_b+0x1da)[0x7f6fab831287]
/tmp/RtmpiUT8Xb/sourceCpp-x86_64-pc-linux-gnu-1.0.1/sourcecpp_7dc862cd8f07/sourceCpp_2.so(_Z29rcpp_exception_to_r_conditionRKN4Rcpp9exceptionE+0x29)[0x7f6fab83073d]
/tmp/RtmpiUT8Xb/sourceCpp-x86_64-pc-linux-gnu-1.0.1/sourcecpp_7dc862cd8f07/sourceCpp_2.so(sourceCpp_1_dostop+0x27d)[0x7f6fab82dd02]
/share/apps/R/3.3.3/lib64/R/lib/libR.so(+0xdc4fe)[0x7f6fb4ea04fe]
(and many more lines of similar)
Here is the relevant sessionInfo:
> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Workstation release 6.6 (Santiago)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Rcpp_1.0.1
Question 1: Should am I using Rcpp::stop() correctly? That is, should I expect to be able to call it and get an error message at the console like in the OS X case?
Question 2: If so, is there any workaround for the decidedly suboptimal behavior that I'm seeing on Linux/g++?
Brief answers:
Question 1
You are using Rcpp::stop() correctly. But your system is a few years, and several R releases behind, and we made several dozen (!!) Rcpp releases since it was current. That combination of stone-old R and compiler with current Rcpp is rare.
Question 2
Upgrade to current versions, or stick with the ancient ones we made when those R and g++ versions rules. Maybe try an Rcpp version 0.12.* or 0.13.*.
Example
On current OS and compiler versions:
> Rcpp::cppFunction('double doStop(NumericVector x) { stop("foo"); return x[1]; }')
> doStop(c(1.2, 3.4))
Error in doStop(c(1.2, 3.4)) : foo
>
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.10
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.3.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0 Rcpp_1.0.1
>
I ran into this issue recently under centos 7.3 and R 3.6. You are probably using a version of gcc >= 5.1 together with the associated libstdc++ while your glibc version is <= 2.17.
In this context, C++11 code better be compiled using the -D_GLIBCXX_USE_CXX11_ABI=0 flag to work correctly.
You can add
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
in your ~/.R/Makevars file and reinstall Rcpp. I didn't noticed any issue after the change.
I'm trying to install Haskelly extension for vs studio code by following the steps here.
rajkumar#linux-2278:~> stack install intero QuickCheck stack-run
stack-run-0.1.1.4: configure
stack-run-0.1.1.4: build
-- While building package stack-run-0.1.1.4 using:
/home/rajkumar/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: /home/rajkumar/.stack/global-project/.stack-work/logs/stack-run-0.1.1.4.log
Configuring stack-run-0.1.1.4...
Preprocessing executable 'stack-run' for stack-run-0.1.1.4..
Building executable 'stack-run' for stack-run-0.1.1.4..
/tmp/stack30563/stack-run-0.1.1.4/unix/System/Console/Questioner.hs:4:14: warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
|
4 | {-# LANGUAGE OverlappingInstances #-}
| ^^^^^^^^^^^^^^^^^^^^
[1 of 5] Compiling System.Console.Questioner.Autocomplete ( unix/System/Console/Questioner/Autocomplete.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner/Autocomplete.o )
[2 of 5] Compiling System.Console.Questioner.Util ( unix/System/Console/Questioner/Util.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner/Util.o )
[3 of 5] Compiling System.Console.Questioner.ProgressIndicators ( unix/System/Console/Questioner/ProgressIndicators.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner/ProgressIndicators.o )
[4 of 5] Compiling System.Console.Questioner ( unix/System/Console/Questioner.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/System/Console/Questioner.o )
[5 of 5] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/stack-run/stack-run-tmp/Main.o )
/tmp/stack30563/stack-run-0.1.1.4/src/Main.hs:18:1: error:
Could not find module ‘Distribution.PackageDescription.Parse’
Perhaps you meant
Distribution.PackageDescription.Parsec (needs flag -package-key Cabal-2.4.0.1)
Distribution.PackageDescription.Parsec (from Cabal-2.4.1.0)
Distribution.PackageDescription.Check (needs flag -package-key Cabal-2.4.0.1)
Use -v to see a list of the files searched for.
|
18 | import Distribution.PackageDescription.Parse
Below is the contents of /home/rajkumar/.stack/global-project/stack.yaml -
packages: []
resolver: lts-13.21
allow-newer: true
extra-deps:
- conduit-1.2.13.1
- conduit-extra-1.1.17
- resourcet-1.1.11
- streaming-commons-0.1.19
cabal version -
$ cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library
stack version -
$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
Below are the OpenSuse OS details -
rajkumar#linux-2278:~> lsb_release -a
LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: openSUSE
Description: openSUSE Leap 15.0
Release: 15.0
Codename: n/a
This also happens in Fedora 30 OS -
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 30 (Thirty)
Release: 30
Codename: Thirty
I don't know how to resolve this issue. Any idea would be helpful.
You are running Cabal version 2.4 and package Distribution.PackageDescription.Parse was removed in Cabal 2.2. See Cabal issue tracker.
Consider using Distribution.PackageDescription.Parsec instead. They are using that in obelisk project.
As per the doco for Haskelly, if you run into issues, refer to
https://github.com/yamadapc/stack-run/issues/17#issuecomment-427545735
Essentially, modify your stack.yml, then run individually:
stack build
stack build intero
stack install QuickCheck
stack --stack-yaml ~/.stack/global-project/stack-cabal-1.24.yaml install stack-run
I've followed all the steps in the official guide. Except I built it using:
$ bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=- msse4.1 --copt=-msse4.2 --config=opt -k //tensorflow/tools/pip_package:build_pip_package
And during ./config I've set the right paths and disabled Google Cloud Platform, Hadoop, XLA, VERBS, OpenCL, CUDA, MPI support.
Hardware:
Macbook Pro 13 inch (mid 2014)
CPU: Intel Core i5 (4278U)
RAM: 8GB
Software:
High Sierra (10.13.2)
Clang Version: clang-900.0.39.2
Bazel Version: 0.9.0
Conda Version: 4.4.3
Python: 3.6.3
All the packages are upto date. This worked perfectly fine 2 months ago on this machine. For some strange reasons it doesn't build anymore now. I'm just posting a part of the error list here:
WARNING: Config values are not defined in any .rc file: opt
ERROR: Skipping 'msse4.1': no such target '//:msse4.1': target 'msse4.1' not declared in package '' defined by /Users/rakshithgb/Documents/Tensorflow/tensorflow/BUILD
WARNING: Target pattern parsing failed.
ERROR: /private/var/tmp/_bazel_rakshithgb/fde7bc60972656b0c2db4fd0b79e24fb/external/com_googlesource_code_re2/BUILD:96:1: First argument of 'load' must be a label and start with either '//', ':', or '#'. Use --incompatible_load_argument_is_label=false to temporarily disable this check.
ERROR: /private/var/tmp/_bazel_rakshithgb/fde7bc60972656b0c2db4fd0b79e24fb/external/com_googlesource_code_re2/BUILD:98:1: name 're2_test' is not defined (did you mean 'ios_test'?)
ERROR: /private/var/tmp/_bazel_rakshithgb/fde7bc60972656b0c2db4fd0b79e24fb/external/com_googlesource_code_re2/BUILD:100:1: name 're2_test' is not defined (did you mean 'ios_test'?)
And it ends like this:
ERROR: /Users/rakshithgb/Documents/Tensorflow/tensorflow/tensorflow/core/kernels/BUILD:550:1: Target '#local_config_sycl//sycl:using_sycl' contains an error and its package is in error and referenced by '//tensorflow/core/kernels:debug_ops'
WARNING: errors encountered while analyzing target '//tensorflow/tools/pip_package:build_pip_package': it will not be built
INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (203 packages loaded).
INFO: Found 0 targets...
ERROR: command succeeded, but there were errors parsing the target pattern
INFO: Elapsed time: 12.763s, Critical Path: 0.02s
FAILED: Build did NOT complete successfully
Has anyone else had this issue? How do I fix it? I've uploaded the entire error log on GitHub Tensorflow issue page. #15622
Ok it looks like the new bazel version isn't compatible with the current Tensorflow release. It looks like the fix will be issued in the next release. According to this thread on GitHub - #15492
The temporary fix that worked for me was to build it using --incompatible_load_argument_is_label=false in the bazel command. So my build command now looks like this:
$ bazel build --config=opt --incompatible_load_argument_is_label=false //tensorflow/tools/pip_package:build_pip_package