I am reporting two bugs during the installation of Rgraphviz on a CentOS cluster with GCC 7.1. I did not investigate into the cause for these two bugs, but I hope this report will shed some light on a long-standing problem encountered by Rgraphviz users.
- The first bug is the
<gvc.h> not found
error reported by other users but the solution does not require a separate installation of graphviz. I noticed these error messages:
and examined the temporary installation directory to find that there is indeed nocp: cannot stat '/tmp/RtmpzOzXHN/R.INSTALL13d1c949152/Rgraphviz/src/libunix/lib/*': No such file or directory cp: cannot stat '/tmp/RtmpzOzXHN/R.INSTALL13d1c949152/Rgraphviz/src/libunix/lib/graphviz/*': No such file or directory
libunix
but insteadlibwin
. This explains why it couldn't find the header files which are also inlibwin
. Our temporary solution is to create a symlinklibunix -> libwin/x64
after the installation begins. The second bug is an unrecognized compiler flag:
gcc: error: unrecognized command line option '-wd269'
Our temporary solution is to remove this flag from all files by monitoring the installation with a script. I provide a copy of the script in case anyone else would like to use it. Run the script after the installation begins. (It is something I put together quickly and so it may not be foolproof. Customization may be needed.)
#!/bin/bash
# bug fix for Rgraphviz installation
# Ruoshi Sun, University of Virginia Research Computing
# 2021-07-14
TMP=/tmp
DIR=$(ls -ltd $TMP/Rtmp*|grep -m1 $USER|awk '{print $NF}')
LIBWIN="libwin/x64"
cd $DIR/R.INSTALL*/Rgraphviz/src
INSTALLDIR=$(realpath $(pwd)/..)
echo $INSTALLDIR
[ ! -e libunix ] && {
echo "libunix not found. Creating symlink to $LIBWIN."
[ ! -e $LIBWIN ] && {
echo "$LIBWIN not found. Exiting."
exit 1
}
ln -s $LIBWIN libunix
}
INTERVAL=2
echo "Removing '-wd269' every $INTERVAL seconds.
Press Ctrl-C to exit."
while [ -e $INSTALLDIR ]; do
date
FILES=$(grep -Rl -- "-wd269")
for i in $FILES; do
echo "Found: $i"
sed -i 's/-wd269//g' $i
done
echo
sleep $INTERVAL
done
echo
echo "Exiting since $INSTALLDIR no longer exists."
When I was trying to redo this, I might have found a third bug.
Towards the end as the installation enters the 3rd instance of
If these lines are shown:
immediately pause the installation (Ctrl-Z), go to the
src
directory, and copy the library files manually:Then resume the installation and it should finish shortly.
If I do not do this I end up with the following error at the very last linking step: