Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
2
answers
3511
views
libcairo undefined symbol: FT_Get_Var_Design_Coordinates error when calling R from compiled MATLAB application on Centos7
I'm posting this question to document the solution to a problem which had me stuck for several weeks for which no answer was found on StackExchange or discussion boards. (Answer forthcoming) I'm trying to run a compiled matlab program (MATLAB 2017a) compiled using the application compiler toolbox (M...
I'm posting this question to document the solution to a problem which had me stuck for several weeks for which no answer was found on StackExchange or discussion boards. (Answer forthcoming)
I'm trying to run a compiled matlab program (MATLAB 2017a) compiled using the application compiler toolbox (Matlab compiler 6.4) on a Centos7 operating system. The tricky part is that my Matlab program uses the "system" command to call R and knit an rmarkdown document.
To get standalone matlab programs to run on linux operating systems it is necessary to set LD_LIBRARY_PATH like thus:
export LD_LIBRARY_PATH={$LD_LIBRARY_PATH}:/usr/local/MATLAB/MATLAB_Runtimev92/v92/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtimev92/v92/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtimev92/v92/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtimev92/v92/sys/opengl/lib/glnxa64
The problem was, this broke R in the following way:
In grDevices::png(f) :
unable to load shared object '/usr/lib64/R/library/grDevices/libs//cairo.so':
/lib64/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates
Testing the R code independently I found it ran fine when run with sudo privileges. This didn't work because the MATLAB program wouldn't work when run with sudo privileges.
Turns out, sudo privileges clear LD_LIBRARY_PATH: https://unix.stackexchange.com/questions/171262/ld-library-path-always-blank-after-sudo
One workaround I found was to change my system call in MATLAB to call with sudo but its a sloppy fix since it requires the user to type their sudo password halfway through the program run. So I'm looking for a better fix.
Zachary Klamer
(41 rep)
Jan 8, 2021, 08:59 PM
• Last activity: May 29, 2025, 11:06 PM
0
votes
1
answers
2029
views
working directory in gnuplot
How do I specify the **working directory** for **gnuplot** in interactive mode? If I want to call a script with `"call 'label_loop.gnu'"` and do not want to put the script file in the gnuplot installation folder, do I need to specify the full path each time? I think the following would be the case w...
How do I specify the **working directory** for **gnuplot** in interactive mode?
If I want to call a script with
"call 'label_loop.gnu'"
and do not want to put the script file in the gnuplot installation folder, do I need to specify the full path each time? I think the following would be the case with normal usage. "I put the data or script I want to load in any directory"-> "I plot it in interactive mode"-> "I want to adjust the position of the label (preferably) with the mouse action"- > "I copy and paste the previous commands and I create a batch file"-> "GnuPlot converts the output to PDF"
user15181
(9 rep)
Feb 17, 2020, 01:27 AM
• Last activity: May 26, 2025, 09:00 PM
0
votes
1
answers
3874
views
Troubles with the installation of R on Ubuntu 18.04
I have this version of Ubuntu ``` Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic ``` on my computer in a dual boot with Windows. I have tried to install R following this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04...
I have this version of Ubuntu
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
on my computer in a dual boot with Windows.
I have tried to install R following this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04 and I got the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.6.2-1bionic) but it is not going to be installed
Depends: r-recommended (= 3.6.2-1bionic) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
To fix the error I followed this answer https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies-after-adding-a-ppa but none of the proposed solution works.
In partcular, even if my apt-get -f install
returns upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
, if I try again apt install r-base
it's still not working
Eleonora
(3 rep)
Dec 21, 2019, 01:31 PM
• Last activity: May 21, 2025, 04:04 PM
0
votes
1
answers
5529
views
Error in installing R package headers/libs are not available
I am installing the R package (`R-3.0.1`) in Red Hat Linux 6.0. Initially when I tried to install it gave the error “F77 compiler not found”. I installed the compiler and tried it again, now the error I am getting is configure: error: --with-readline=yes (default) and headers/libs are not available...
I am installing the R package (
R-3.0.1
) in Red Hat Linux 6.0.
Initially when I tried to install it gave the error “F77 compiler not found”. I installed the compiler and tried it again, now the error I am getting is
configure: error: --with-readline=yes (default) and headers/libs are not available
I tried ./configure --with-x=no
but it doesn't work, again I am getting the same error.
sridhar
(21 rep)
Jun 6, 2013, 09:26 AM
• Last activity: Apr 20, 2025, 01:02 PM
1
votes
2
answers
2227
views
Find `.gz` extension file and unpack with `tar`
I want to find a gunzipped tarball file within my directory and unpack it. I have tried: ``` system("find . -name '*.gz' | tar -xvf -") ``` this produces the following error: ``` tar: Missing type keyword in mtree specification x ./Library/rmarkdown_2.17.1.tar.gz tar: Error exit delayed from previou...
I want to find a gunzipped tarball file within my directory and unpack it. I have tried:
system("find . -name '*.gz' | tar -xvf -")
this produces the following error:
tar: Missing type keyword in mtree specification
x ./Library/rmarkdown_2.17.1.tar.gz
tar: Error exit delayed from previous errors.
system
is a func in R to call linux commands.
dollar bill
(111 rep)
Oct 21, 2022, 10:45 PM
• Last activity: Mar 24, 2025, 10:34 AM
1
votes
1
answers
1934
views
How can I submit multiple R job at once?
I have a R-script which runs multiple files say file=1 to 50. I usually submit repeated jobs say 5 times with 10 files each time by changing the number in R-script. So, how can I submit the 5-job at once without submitting the job 5 times? In addition, I want to update the **default.out** and **erro...
I have a R-script which runs multiple files say file=1 to 50.
I usually submit repeated jobs say 5 times with 10 files each time by changing the number in R-script.
So, how can I submit the 5-job at once without submitting the job 5 times? In addition, I want to update the **default.out** and **errorfile** for each job.
sample bash code:
#!/bin/bash
#PBS -l nodes=1:ppn=20,walltime=05:00:00
#PBS -m e
#PBS -o default.out
#PBS -e errorfile
module load R/4.0
Rscript ~/r_script1.R
b_takhel
(21 rep)
May 22, 2021, 07:54 PM
• Last activity: Feb 13, 2025, 02:08 PM
5
votes
1
answers
14103
views
The repository 'https://cloud.r-project.org/bin/linux/ubuntu bionic Release' does not have a Release file
My computer has Linux Mint 19.1 Tessa with R version 3.6.3. I am trying to do `sudo apt-get update` and I am having this error: ``` Err:21 https://cloud.r-project.org/bin/linux/ubuntu bionic Release 404 Not Found [IP: 2600:9000:2045:e400:6:c2d3:f940:93a1 443] E: The repository 'https://cloud.r-proje...
My computer has Linux Mint 19.1 Tessa with R version 3.6.3. I am trying to do
sudo apt-get update
and I am having this error:
Err:21 https://cloud.r-project.org/bin/linux/ubuntu bionic Release
404 Not Found [IP: 2600:9000:2045:e400:6:c2d3:f940:93a1 443]
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
Also, I would like to install appropriate drivers but I am also getting this error:
E:The repository 'https://cloud.r-project.org/bin/linux/ubuntu bionic Release' does not have a Release file.
`
Could someone help me? I remember that I had a problem upgrading R, but I am not sure what happened with Release. R now is working normally I think.
user435322
(53 rep)
Oct 1, 2020, 05:14 AM
• Last activity: Feb 13, 2025, 01:11 PM
7
votes
3
answers
6545
views
How to set R to use all of the width of my terminal?
I am running interactive `R` in terminal, however it doesn't use all of the width of the terminal. It only use 72 characters out of 226. It is very uncomfortable to read any data with a lot of columns displayed in interactive `R`. I am using `urxvt` on `debian 9,8`.
I am running interactive
R
in terminal, however it doesn't use all of the width of the terminal. It only use 72 characters out of 226. It is very uncomfortable to read any data with a lot of columns displayed in interactive R
.
I am using urxvt
on debian 9,8
.
JiaHao Xu
(248 rep)
Mar 6, 2019, 09:31 AM
• Last activity: Nov 19, 2024, 11:34 PM
0
votes
1
answers
11126
views
Loop over a data frame comparing elements of the first and second row
I want to loop over a dataframe, I want to compare one of the elements of the actual row and the next row. for example, I have a data frame that looks like this: V1 V2 V3 V4 1 chr1 10 1000 2000 2 chr1 10 2000 3000 3 chr1 10 4000 5000 . . . I would like to compare the element of the 1st row and 4th c...
I want to loop over a dataframe, I want to compare one of the elements of the actual row and the next row.
for example, I have a data frame that looks like this:
V1 V2 V3 V4
1 chr1 10 1000 2000
2 chr1 10 2000 3000
3 chr1 10 4000 5000
.
.
.
I would like to compare the element of the 1st row and 4th column with the element of the 2nd row and third column, and if they are the same do something, then the element of the 2nd row and 4th column with the element of the 3th row and 3th column, do something and so on.
So I am trying something like this:
for (i in 1:nrow(my_dataframe)){
if (my_dataframe[i, 4] == my_dataframe[i+1 , 3]) {
print("OK")
}
}
So this would give me for example 1 OK with my example data frame
However it looks that R doesn't like the i + 1, because is giving me the next error:
Error in if (tabla4subset[i, 4] > tabla4subset[i + 1, 3]) { :
missing value where TRUE/FALSE needed
Some one know how to do this?
Eric González
(275 rep)
Jun 18, 2017, 10:38 PM
• Last activity: Oct 26, 2024, 06:01 PM
3
votes
0
answers
766
views
Arch linux: Cannot install R package "ragg"
After 10+ years using debian-based linux, I am now using Arch. I use R for data science analysis and development. I am facing difficulties to install the R package ragg (r-ragg), which is a dependency for other libraries I use. When I try to install "ragg" from within R using the `install.packages("...
After 10+ years using debian-based linux, I am now using Arch.
I use R for data science analysis and development. I am facing difficulties to install the R package ragg (r-ragg), which is a dependency for other libraries I use. When I try to install "ragg" from within R using the
install.packages("ragg")
command, I get the following error:
make: * [/usr/lib64/R/etc/Makeconf:204: agg/src/agg_font_freetype.o] Error 1
which leads to a compilation failure for "ragg".
I got the same error message in Arch and in an arch-based OS
Any suggestion to resolve this? (I have search a lot how to solve this, without concrete success.)
I also tried to install it via terminal using yay -S r-ragg
and I received this as feedback:
make: *** [/usr/lib64/R/etc/Makeconf:204: agg/src/agg_font_freetype.o] Error 1
ERROR: compilation failed for package ‘ragg’
removing ‘/home/machiavelli/.cache/yay/r-ragg/src/build/ragg’
==> ERROR: A failure occurred in build().
Aborting...
-> error making: r-ragg-exit status 4
-> Failed to install the following packages. Manual intervention is required:
r-ragg - exit status 4
The relevant part of the Makeconf
file is:
$ awk 'NR>200 && NR $@
.cpp.d:
@echo "making $@ from $ install.packages("ragg")
* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -ljpeg
** libs
using C++ compiler: ‘g++ (GCC) 14.2.1 20240805’
[endless compilation verbose here]
agg/src/agg_font_freetype.cpp: In instantiation of ‘bool agg::decompose_ft_outline(const FT_Outline&, bool, const trans_affine&, PathStorage&) [with PathStorage = path_storage_integer; FT_Outline = FT_Outline_]’:
agg/src/agg_font_freetype.cpp:1071:48: required from here
1071 | if(decompose_ft_outline(m_cur_face->glyph->outline,
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1072 | m_flip_y,
| ~~~~~~~~~
1073 | m_affine,
| ~~~~~~~~~
1074 | m_path32))
| ~~~~~~~~~
agg/src/agg_font_freetype.cpp:182:35: error: invalid conversion from ‘unsigned char*’ to ‘char*’ [-fpermissive]
182 | tags = outline.tags + first;
| ~~~~~~~~~~~~~~^~~~~~~
| |
| unsigned char*
agg/src/agg_font_freetype.cpp: In instantiation of ‘bool agg::decompose_ft_outline(const FT_Outline&, bool, const trans_affine&, PathStorage&) [with PathStorage = path_storage_integer; FT_Outline = FT_Outline_]’:
agg/src/agg_font_freetype.cpp:1092:48: required from here
1092 | if(decompose_ft_outline(m_cur_face->glyph->outline,
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 | m_flip_y,
| ~~~~~~~~~
1094 | m_affine,
| ~~~~~~~~~
1095 | m_path16))
| ~~~~~~~~~
agg/src/agg_font_freetype.cpp:182:35: error: invalid conversion from ‘unsigned char*’ to ‘char*’ [-fpermissive]
182 | tags = outline.tags + first;
| ~~~~~~~~~~~~~~^~~~~~~
| |
| unsigned char*
make: *** [/usr/lib64/R/etc/Makeconf:204: agg/src/agg_font_freetype.o] Error 1
ERROR: compilation failed for package ‘ragg’
-----
**ISSUE RESOLVED**
install.packages("ragg")
downloads and installs (or fails to install, in my case) ragg
version 1.3.2 from CRAN. This was not working on my workstation running arch-based Endeavour OS.
I found the source code for ragg
version 1.3.2.9000 at https://r-lib.r-universe.dev/ragg\ and it worked like a charm. No compilation needed, instant success. I loaded the library and ran a test code and it produced the expected output.
Case closed. Many thanks for your support through this!
3mpad4
(31 rep)
Aug 23, 2024, 02:04 PM
• Last activity: Aug 23, 2024, 09:49 PM
1
votes
3
answers
137
views
Fetch data from a large file based on time and date recursively
Fetch data based on date(column 1) and time (column 2). Each date has time in column 2. Based on each date in column1 two files are to be generated which will have all the fields based on time 6:00 to 21:50:08 (day) and 22:00:00 to 5:50:00 (night). Trying to get two files for each date as date_day a...
Fetch data based on date(column 1) and time (column 2). Each date has time in column 2. Based on each date in column1 two files are to be generated which will have all the fields based on time 6:00 to 21:50:08 (day) and 22:00:00 to 5:50:00 (night). Trying to get two files for each date as date_day and date_night based on the times specified.
Input file:
Date Time R1 R2 R3
03/10/2023 19:00:08 19.06 39.870 5.12
03/10/2023 19:10:08 18.87 39.970 4.98
03/10/2023 19:20:08 18.68 39.940 4.80
03/10/2023 19:30:08 18.84 40.110 5.01
03/10/2023 19:40:08 18.89 38.960 4.64
03/10/2023 19:50:08 18.60 39.100 4.43
03/10/2023 23:30:08 18.03 34.200 2.03
03/10/2023 23:40:08 17.94 33.930 1.84
03/10/2023 23:50:08 17.87 33.840 1.74
03/11/2023 00:00:08 17.75 33.790 1.61
03/11/2023 00:10:08 17.96 34.060 1.91
03/11/2023 00:20:08 18.13 33.690 1.91
03/11/2023 00:30:08 17.91 33.620 1.68
Output files:
03/10/2023_day
Date Time R1 R2 R3
03/10/2023 19:00:08 19.06 39.870 5.12
03/10/2023 19:10:08 18.87 39.970 4.98
03/10/2023 19:20:08 18.68 39.940 4.80
03/10/2023 19:30:08 18.84 40.110 5.01
03/10/2023 19:40:08 18.89 38.960 4.64
03/10/2023_night
Date Time R1 R2 R3
03/10/2023 19:50:08 18.60 39.100 4.43
03/10/2023 23:30:08 18.03 34.200 2.03
03/10/2023 23:40:08 17.94 33.930 1.84
03/10/2023 23:50:08 17.87 33.840 1.74
03/11/2023_night
:
Date Time R1 R2 R3
03/11/2023 00:00:08 17.75 33.790 1.61
03/11/2023 00:10:08 17.96 34.060 1.91
03/11/2023 00:20:08 18.13 33.690 1.91
03/11/2023 00:30:08 17.91 33.620 1.68
I tried the following to fetch day and night files. This I will have to do for each date again and again. I removed the ':' from the time column in my code to get a number without :. Can anyone please help to put it in a loop and the separate day and night files for each date?
awk '$1 ~ /03\/10\/2023/ && $2 >= 060000 && $2 03_10_23_day.csv
awk '$1 ~ /03\/10\/2023/ && $2 > 215000' data |sed 's/\t/,/g' > 03_10_23_night.csv
Gavin
(91 rep)
Feb 12, 2024, 12:59 AM
• Last activity: Feb 12, 2024, 05:26 PM
2
votes
1
answers
432
views
SSH session termination on script error when sourcing multiple sub-scripts
I'm facing an issue with SSH on a server. Running individual scripts (source s01.sh, etc.) works fine, with errors displayed in the console. However, when using a master script to source these scripts, the SSH connection unexpectedly terminates upon encountering an error. The master script `master.s...
I'm facing an issue with SSH on a server. Running individual scripts (source s01.sh, etc.) works fine, with errors displayed in the console. However, when using a master script to source these scripts, the SSH connection unexpectedly terminates upon encountering an error. The master script
master.sh
is as follows:
#!/bin/bash
set -e
source s01.sh
source s02.sh
Rscript s03.R
source s04.sh
I source the master script in interactive SSH session using
source master.sh
With set -e, I expect the script to stop at errors, but instead, it's causing the entire SSH session to drop. This only happens with the combined script, not with individual sourcing. Why does this occur, and how can I keep the SSH session from closing on script errors?
I am aware this might involve SSH server configurations, but I'm unsure which settings to investigate.
jay.sf
(237 rep)
Nov 26, 2023, 09:38 AM
• Last activity: Nov 26, 2023, 01:38 PM
0
votes
1
answers
404
views
How to have R 4.1 on Debian 11? Debian 11 won't update
1. Debian 11 only updates to R 4.0.4. 2. I have packages that require at least R 4.1.0 to be installed. 4. I already tried adding the official R repository to the source list as [the official website tells to do][1], but I get the following limitation. > sudo apt update > > 20 packages can be upgrad...
1. Debian 11 only updates to R 4.0.4.
2. I have packages that require at least R 4.1.0 to be installed.
4. I already tried adding the official R repository to the source list as the official website tells to do , but I get the following limitation.
> sudo apt update
>
> 20 packages can be upgraded. Run 'apt list --upgradable' to see them.
>
> apt list --upgradable
>
> r-base-core/bullseye-cran40 4.3.2-1~bullseyecran.0 amd64 [upgradable from: 4.0.4-1]
>
> r-base-dev/bullseye-cran40 4.3.2-1~bullseyecran.0 all [upgradable from: 4.0.4-1]
>
> r-base/bullseye-cran40 4.3.2-1~bullseyecran.0 all [upgradable from: 4.0.4-1]
>
> r-cran-boot/bullseye-cran40 1.3-28.1-1~bullseyecran.0 all [upgradable from: 1.3-27-1]
>
> r-cran-class/bullseye-cran40 7.3-22-2~bullseyecran.0 amd64 [upgradable from: 7.3-18-1]
>
> r-cran-cluster/bullseye-cran40 2.1.4-1~bullseyecran.0 amd64 [upgradable from: 2.1.1-1]
>
> r-cran-codetools/bullseye-cran40 0.2-19-1~bullseyecran.0 all [upgradable from: 0.2-18-1]
>
> r-cran-foreign/bullseye-cran40 0.8.85-1~bullseyecran.0 amd64 [upgradable from: 0.8.81-1]
>
> r-cran-kernsmooth/bullseye-cran40 2.23-22-1~bullseyecran.0 amd64 [upgradable from: 2.23-18-1]
>
> r-cran-lattice/bullseye-cran40 0.22-5-1~bullseyecran.0 amd64 [upgradable from: 0.20-41-1+b1]
>
> r-cran-littler/bullseye-cran40 0.3.18-2~bullseyecran.0 amd64 [upgradable from: 0.3.12-1]
>
> r-cran-mass/bullseye-cran40 7.3-60-2~bullseyecran.0 amd64 [upgradable from: 7.3-53.1-1]
>
> r-cran-matrix/bullseye-cran40 1.6-1.1-1~bullseyecran.0 amd64 [upgradable from: 1.3-2-1]
>
> r-cran-mgcv/bullseye-cran40 1.9-0-1~bullseyecran.0 amd64 [upgradable from: 1.8-34-1]
>
> r-cran-nlme/bullseye-cran40 3.1.163-1~bullseyecran.0 amd64 [upgradable from: 3.1.152-1]
>
> r-cran-nnet/bullseye-cran40 7.3-19-2~bullseyecran.0 amd64 [upgradable from: 7.3-15-1]
>
> r-cran-rpart/bullseye-cran40 4.1.21-1~bullseyecran.0 amd64 [upgradable from: 4.1-15-2+b1]
>
> r-cran-spatial/bullseye-cran40 7.3-17-1~bullseyecran.0 amd64 [upgradable from: 7.3-13-1]
>
> r-cran-survival/bullseye-cran40 3.5-7-1~bullseyecran.0 amd64 [upgradable from: 3.2-7-1]
>
> r-recommended/bullseye-cran40 4.3.2-1~bullseyecran.0 all [upgradable from: 4.0.4-1]
>
> sudo apt upgrade
>
> The following packages have been kept back:
>
> r-base r-base-core r-base-dev r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-littler
>
> r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-recommended
>
BsAxUbx5KoQDEpCAqSffwGy554PSah
(203 rep)
Nov 17, 2023, 06:19 PM
• Last activity: Nov 19, 2023, 11:04 PM
10
votes
2
answers
29154
views
"--with-x=yes (default) and X11 headers/libs are not available"
I am trying to install R in our cluster (the cluster is Red Hat Enterprise Linux 6), where I don't have root access. I tried: $wget http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz $ tar xvf R-3.1.1.tar.gz $ cd R-3.1.1 $ ./configure --prefix=/home/Kryo/R-3.1.1 But I am getting an error: configure...
I am trying to install R in our cluster (the cluster is Red Hat Enterprise Linux 6), where I don't have root access. I tried:
$wget http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz
$ tar xvf R-3.1.1.tar.gz
$ cd R-3.1.1
$ ./configure --prefix=/home/Kryo/R-3.1.1
But I am getting an error:
configure: error: --with-x=yes (default) and X11 headers/libs are not available
Kryo
(211 rep)
Jul 13, 2015, 04:11 PM
• Last activity: Nov 7, 2023, 11:24 PM
0
votes
1
answers
189
views
R Packages won't install via ansible (ALMA Linux 8)
# Problem I would like to use ansible to provision a virtual box. This box will need to do multiple things, but it needs to have R installed as well as some specific packages that aren't included in base R. I use the vagrant file provided below to create a new virtual machine and then install ansibl...
# Problem
I would like to use ansible to provision a virtual box. This box will need to do multiple things, but it needs to have R installed as well as some specific packages that aren't included in base R.
I use the vagrant file provided below to create a new virtual machine and then install ansible, epel-release and git using yum. On this virtual machine I then use the "Alma Linux 8" and "Docker" playbooks provided below before the one I believe to be problematic.
I then run this playbook to install R
---
- name: "Setup R on the local machine"
hosts: localhost
connection: local
tasks:
# Update all installed packages
- name: Update all packages to their latest version
become: yes
ansible.builtin.package:
name: "*"
state: latest
# Install EPEL to get extra packages
- name: Install EPEL
become: yes
ansible.builtin.package:
name: epel-release
state: latest
# Enable the Code Ready Builder (CRB) repository
- name: Install utilities to enable package repositories
become: yes
ansible.builtin.package:
name: yum-utils
state: latest
- name: Enable the PowerTools repository
become: yes
shell: dnf config-manager --set-enabled powertools
# Install R
- name: Install R
become: yes
ansible.builtin.package:
name: R
state: latest
After running this playbook I can then run the command
Rscript --slave --no-save --no-restore-history -e "print('Test')"
"Test"
showing that R is working at least in some capacity. But then when I try and use this to install a package I get this error
Rscript --slave --no-save --no-restore-history -e "install.packages('tidyverse')"
> Installing package into ‘/usr/lib64/R/library’
> (as ‘lib’ is unspecified)
> Warning in install.packages("tidyverse") :
> 'lib = "/usr/lib64/R/library"' is not writable
> Error in install.packages("tidyverse") : unable to install packages
> Execution halted
# Attempted Fix #
I have attempted to fix this by appending these lines on to the end of the R playbook above
- name: Make directory writable
become: yes
file:
path: /usr/lib64/R/library
mode: '0777'
- name: Make directory writable
become: yes
file:
path: /usr/share/doc/R/html
mode: '0777'
to manually make the problematic directories readable, but this has not worked.
# Reference Files #
## Vagrant File ##
Vagrant.configure("2") do |config|
config.vm.box = "almalinux/8"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 2
end
end
## Ansible Playbooks ##
### Alma Linux 8 ###
---
- name: "Setup AlmaLinux 8 on the local machine"
hosts: localhost
connection: local
tasks:
# Install the base operating systemctl
- name: Update all packages to their latest versions
become: yes
ansible.builtin.package:
name: '*'
state: latest
- name: Install virtual machine support
become: yes
ansible.builtin.package:
name: open-vm-tools
state: latest
# Install EPEL to get extra packages
- name: Install EPEL
become: yes
ansible.builtin.package:
name: epel-release
state: latest
### Docker ###
---
- name: "Setup Docker on the local machine"
hosts: localhost
connection: local
tasks:
# Install Docker
- name: Uninstall any older versions of Docker
become: yes
ansible.builtin.package:
name:
- docker
- docker-client
- docker-client-latest
- docker-common
- docker-latest
- docker-latest-logrotate
- docker-logrotate
- docker-engine
state: absent
- name: Install yum-utils to install a new package repository
become: yes
ansible.builtin.package:
name: yum-utils
state: latest
- name: Install the Docker Repository
become: yes
shell: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- name: Install Docker
become: yes
ansible.builtin.package:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: latest
- name: Enable the docker service
become: yes
shell: systemctl enable docker
- name: Enable the containerd service
become: yes
shell: systemctl enable containerd
- name: Start the docker service
become: yes
shell: systemctl start docker
- name: Start the containerd service
become: yes
shell: systemctl start containerd
- name: Ensure docker group exists
become: yes
ansible.builtin.group:
name: docker
state: present
- name: Add the vagrant user to the docker group
become: yes
ansible.builtin.user:
name: vagrant
groups: docker
append: yes
Hugh Warden
(103 rep)
Oct 23, 2023, 01:45 AM
• Last activity: Oct 23, 2023, 03:38 AM
0
votes
1
answers
1454
views
error: libcurl >= 7.28.0 library and headers are required with support for https
I'm sorry for having written such a long question, but given how many times similar questions have been asked, I felt like I had to give a lot more context. ---- In my system, I get. . . ``` checking for curl-config... /usr/bin/curl-config checking libcurl version ... 8.2.1 checking curl/curl.h usab...
I'm sorry for having written such a long question, but given how many times similar questions have been asked, I felt like I had to give a lot more context.
----
In my system, I get. . .
checking for curl-config... /usr/bin/curl-config
checking libcurl version ... 8.2.1
checking curl/curl.h usability... yes
checking curl/curl.h presence... yes
checking for curl/curl.h... yes
checking if libcurl is version 7 and >= 7.28.0...
configure: error: libcurl >= 7.28.0 library and headers are required with support for https
when trying to install R (**version 4.0.3**, this is non-negotiable) with ./configure --prefix=/opt/R/ --exec-prefix=/opt/R/ --with-libpth-prefix=/opt/ --without-recommended-packages --with-pcre1 --enable-R-shlib
.
In config.log
, I see the following.
configure:46024: checking for curl-config
configure:46042: found /usr/bin/curl-config
configure:46054: result: /usr/bin/curl-config
configure:46080: checking curl/curl.h usability
configure:46080: gcc -c -g -O2 -fpic -I/usr/local/include conftest.c >&5
configure:46080: $? = 0
configure:46080: result: yes
configure:46080: checking curl/curl.h presence
configure:46080: gcc -E -I/usr/local/include conftest.c
configure:46080: $? = 0
configure:46080: result: yes
configure:46080: checking for curl/curl.h
configure:46080: result: yes
configure:46094: checking if libcurl is version 7 and >= 7.28.0
configure:46123: gcc -o conftest -g -O2 -fpic -I/usr/local/include -L/usr/local/lib64 conftest.c -lcurl -lpcre -llzma -lbz2 -lz -lrt -ldl -lm >&5
configure:46123: $? = 0
configure:46123: ./conftest
configure:46123: $? = 1
configure: program exited with status 1
configure: failed program was:
And then, after the contents of confdefs.h
have been exposed, I see:
#include
| #include
| int main()
| {
| #ifdef LIBCURL_VERSION_MAJOR
| #if LIBCURL_VERSION_MAJOR > 7
| exit(1);
| #elif LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 28
| exit(0);
| #else
| exit(1);
| #endif
| #else
| exit(1);
| #endif
| }
|
configure:46133: result:
configure:46191: error: libcurl >= 7.28.0 library and headers are required with support for https
There are multiple questions concerning the same error across multiple websites, but none of the solutions I tried worked for me.
Since apparently I have multiple versions of available. . .
bash-4.2# yum list curl --showduplicates | head -n 5
Loaded plugins: ovl, priorities
Installed Packages
curl.x86_64 8.2.1-1.amzn2.0.3 installed
Available Packages
curl.x86_64 7.55.1-8.amzn2.0.1 amzn2-core
bash-4.2# yum list libcurl --showduplicates | head -n 5
Loaded plugins: ovl, priorities
Installed Packages
libcurl.x86_64 8.2.1-1.amzn2.0.3 installed
Available Packages
libcurl.x86_64 7.55.1-8.amzn2.0.1 amzn2-core
. . . (I have many more of each), my last tries have revolved around trying to downgrade and/or remove curl
and libcurl
, but no luck:
bash-4.2# yum downgrade libcurl
Loaded plugins: ovl, priorities
amzn2-core | 3.6 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package libcurl.x86_64 0:8.2.1-1.amzn2.0.2 will be a downgrade
---> Package libcurl.x86_64 0:8.2.1-1.amzn2.0.3 will be erased
--> Finished Dependency Resolution
Error: Package: curl-8.2.1-1.amzn2.0.3.x86_64 (installed)
Requires: libcurl(x86-64) = 8.2.1-1.amzn2.0.3
(The output continues).
I'm working in a docker container, so the above is easily reproducible. I leave the Docker file at the end of this question.
I presume the following is useful system information.
bash-4.2# cat /etc/*-release*
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/ "
SUPPORT_END="2025-06-30"
Amazon Linux release 2 (Karoo)
cpe:2.3:o:amazon:amazon_linux:2
Can anyone help me fix this?
----
Here's Dockerfile
:
FROM amazonlinux:2
RUN yum update -y && \
yum install -y make zip gzip tar which wget java \
readline-devel \
xorg-x11-server-devel libX11-devel libXt-devel \
libcurl-devel libcurl4-openssl-dev \
openssl-devel libxml2-devel \
gcc-c++ gcc-gfortran \
zlib-devel bzip2 bzip2-libs bzip2-devel xz-devel && \
yum clean all
RUN mkdir -p /opt/R /opt/bin
RUN mv /usr/bin/which /opt/bin/
WORKDIR /opt
RUN wget https://cran.r-project.org/src/base/R-4/R-4.0.3.tar.gz && \
tar -xf R-4.0.3.tar.gz && \
mv R-4.0.3/* /opt/R && \
rm -rf R-4.0.3.tar.gz R-4.0.3
WORKDIR /opt/R
# RUN ./configure --prefix=/opt/R/ --exec-prefix=/opt/R/ --with-libpth-prefix=/opt/ \
# --without-recommended-packages --with-pcre1 --enable-R-shlib
CMD ["bash"]
Sweet Shell O'Mine
(315 rep)
Oct 3, 2023, 09:35 AM
• Last activity: Oct 3, 2023, 11:17 AM
2
votes
0
answers
499
views
Unable to install "tidyverse" in R or Rstudio without running into errors and/or non-zero exit status
I've been having troubles with installing the tidyverse package in Rstudio and more recently when reinstalling R. I'll post my most recent error message when reinstalling R below after system info. My system info to start: Lenovo Thinkpad T14s Gen 2a OS:Dual boot with Linux Mint Cinnamon 20.3 (una)(...
I've been having troubles with installing the tidyverse package in Rstudio and more recently when reinstalling R. I'll post my most recent error message when reinstalling R below after system info.
My system info to start:
Lenovo Thinkpad T14s Gen 2a
OS:Dual boot with Linux Mint Cinnamon 20.3 (una)(kernel 5.13.0-51-generic), and Windows 10 on separate partition.
userXXXX:~$ sudo apt install --no-install-recommends r-cran-tidyverse
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
r-cran-tidyverse : Depends: r-cran-broom but it is not going to be installed
Depends: r-cran-dbplyr but it is not going to be installed
Depends: r-cran-dplyr but it is not going to be installed
Depends: r-cran-dtplyr but it is not going to be installed
Depends: r-cran-forcats but it is not going to be installed
Depends: r-cran-googledrive but it is not going to be installed
Depends: r-cran-googlesheets4 but it is not going to be installed
Depends: r-cran-ggplot2 but it is not going to be installed
Depends: r-cran-haven but it is not going to be installed
Depends: r-cran-hms but it is not going to be installed
Depends: r-cran-httr but it is not going to be installed
Depends: r-cran-modelr but it is not going to be installed
Depends: r-cran-readr but it is not going to be installed
Depends: r-cran-readxl but it is not going to be installed
Depends: r-cran-reprex but it is not going to be installed
Depends: r-cran-rvest but it is not going to be installed
Depends: r-cran-stringr but it is not going to be installed
Depends: r-cran-tibble but it is not going to be installed
Depends: r-cran-tidyr but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
It seems like I need to remove these broken packages before reinstalling the new ones. If there is anyone that can help with going about this it would be greatly appreciated! Thank you!
notsotidyverse
(21 rep)
Jun 23, 2022, 09:56 PM
• Last activity: Sep 18, 2023, 04:22 AM
7
votes
5
answers
17611
views
Local installation of pcre2 not detected while installing R 4.0.4 from source
I am trying to do a build and local install of R 4.0.4 on Red Hat Linux 6.8. There were several unmet dependencies which I resolved by doing local installations (following the procedure in [this][1]). However, I couldn't resolve the issue of `pcre2` with that procedure. This is the configure command...
I am trying to do a build and local install of R 4.0.4 on Red Hat Linux 6.8. There were several unmet dependencies which I resolved by doing local installations (following the procedure in this ). However, I couldn't resolve the issue of
pcre2
with that procedure. This is the configure command I run:
./configure --with-pcre2 --prefix=$HOME/bin/R-4.0.4 --enable-R-shlib LDFLAGS="-L/$HOME/local/zlib-1.2.11/lib -L/$HOME/local/bzip2-1.0.8/lib -L/$HOME/local/xz-5.2.5/lib -L/$HOME/local/pcre2-10.00/lib" CPPFLAGS="-I/$HOME/local/zlib-1.2.11/include"
This is the error I get:
checking whether PCRE support suffices... no
configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support
I also tried configure with a local installation of pcre-8.44
and --with-pcre1
flag but I get the same error.
What should I do so that the configure script detects the pcre2
local installation?
Dronacharya
(171 rep)
Feb 22, 2021, 06:54 AM
• Last activity: Jul 5, 2023, 09:43 AM
-1
votes
1
answers
199
views
nix-shell default.nix: How to install rPackages.data_table with the zlib dependency?
I have a multi-user installation of nix on ubuntu 22.04. I'm trying to develop an R package that depends on `data.table`, but am unable to install `data.table` with `zlib` headers so that I can use the `fwrite` function with gzip compression. Here is the `default.nix` I'm using with `direnv`: ```nix...
I have a multi-user installation of nix on ubuntu 22.04. I'm trying to develop an R package that depends on
data.table
, but am unable to install data.table
with zlib
headers so that I can use the fwrite
function with gzip compression.
Here is the default.nix
I'm using with direnv
:
with import {};
let
rlibs = with rPackages; [
R
Rcpp
data_table
roxygen2
pkgbuild
];
_libs = with pkgs; [
zlib
ccls
];
in mkShell {
nativeBuildInputs = [
rlibs
_libs
];
}
Everything installs fine and runs, but when I call
fwrite(iris, "iris.txt.gz', compress="gzip")
I get
Compression in fwrite uses zlib library. Its header files were not found at the time data.table was compiled. To enable fwrite compression, please reinstall data.table and study the output for further guidance.
At first I didn't have zlib
in default.nix
so I added it and tried reinstalling. This required cleaning out the full set of packages. I can do nix-store --delete
, but it also makes me garbage collect all the specified packages. Reinstaling did not solve the problem though. I don't see any output to inspect either.
How do I specify zlib
as a dependency? Also is there a way to re-install a package with nix? I can't find any documentation online about it - any results are about reinstalling nix as a whole, not a single package.
UPDATE:
I've also tried
nix-shell -p pkg-config zlib R rPackages.data_table
.
During the data.table
install, there are messages that pkg-config was not found. However, in that shell, running pkg-config --libs zlib
gives
-L/nix/store/37a5krk4a1a8vhl93q2bm9nbv8hymyii-zlib-1.2.13/lib -lz
Trying the nix manuals override doesn't work either:
{
packageOverrides = super: let self = super.pkgs; in
{
rEnv = super.rWrapper.override {
packages = with self.rPackages; [
data_table
];
};
};
}
basesorbytes
(1 rep)
Jun 6, 2023, 03:50 PM
• Last activity: Jun 8, 2023, 03:13 PM
0
votes
1
answers
158
views
Saving the output from individual shell scripts
I have a bash script that loops over iterations. How do i save the output from the individual scripts in the bash file according to the iteration? #Working directory cd /lustre/nobackup/WUR/ABGC/agyir001/ # Set the number of replicates num_replicates=100 # Loop over the replicates for i in $(seq 1 $...
I have a bash script that loops over iterations. How do i save the output from the individual scripts in the bash file according to the iteration?
#Working directory
cd /lustre/nobackup/WUR/ABGC/agyir001/
# Set the number of replicates
num_replicates=100
# Loop over the replicates
for i in $(seq 1 $num_replicates); do
# replicate number with leading zeros
rep_num=$(printf "%03d" $i)
output_file="accuracy_results_${rep_num}.txt"
#Run scenario 1,2 and 3 of male contributions
Rscript Scenario_1_male_contributions.R
Rscript Scenario_2_male_contributions.R
Rscript Scenario_3_male_contributions.R
#creating correlated qtl effects for 1000 selected qtls
Rscript Correlated_qtl_effects.R
#Selecting 1000 qtls, creating TBVS and phenotypes
Rscript Breeding_values_and_Phenotypes.R 7500
# prepare phenotypes and genotypes/markers
Rscript /lustre/nobackup/WUR/ABGC/agyir001/scripts/Markers_phenotypes_for_EBV.R
Mabel
(1 rep)
May 15, 2023, 12:29 AM
• Last activity: May 15, 2023, 08:50 AM
Showing page 1 of 20 total questions