Installation bugs in Rgraphviz
0
0
Entering edit mode
Ruoshi • 0
@a7314d5d
Last seen 2 days ago
United States

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.

  1. 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:
    cp: 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
    
    and examined the temporary installation directory to find that there is indeed no libunix but instead libwin. This explains why it couldn't find the header files which are also in libwin. Our temporary solution is to create a symlink libunix -> libwin/x64 after the installation begins.
  2. 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."
Rgraphviz • 68 views
ADD COMMENT
0
Entering edit mode

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

Libraries have been installed in:
   /tmp/Rtmp*/R.INSTALL*/Rgraphviz/src/libunix/lib/graphviz

If these lines are shown:

cp: will not overwrite just-created '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libgvplugin_core.a' with '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libunix/lib/graphviz/libgvplugin_core.a'
cp: will not overwrite just-created '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libgvplugin_core.la' with '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libunix/lib/graphviz/libgvplugin_core.la'
cp: will not overwrite just-created '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libgvplugin_dot_layout.a' with '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libunix/lib/graphviz/libgvplugin_dot_layout.a'
cp: will not overwrite just-created '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libgvplugin_dot_layout.la' with '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libunix/lib/graphviz/libgvplugin_dot_layout.la'
cp: will not overwrite just-created '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libgvplugin_neato_layout.a' with '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libunix/lib/graphviz/libgvplugin_neato_layout.a'
cp: will not overwrite just-created '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libgvplugin_neato_layout.la' with '/tmp/Rtmp3NvhjF/R.INSTALL14086e31ea0d/Rgraphviz/src/libunix/lib/graphviz/libgvplugin_neato_layout.la'

immediately pause the installation (Ctrl-Z), go to the src directory, and copy the library files manually:

cp libunix/lib/graphviz/* .

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:

/usr/bin/ld.gold: error: libgvplugin_dot_layout.a: member at 1326 is not an ELF object
/usr/bin/ld.gold: error: libgvplugin_neato_layout.a: member at 11248 is not an ELF object
/usr/bin/ld.gold: error: libgvplugin_core.a: member at 1212 is not an ELF object
collect2: error: ld returned 1 exit status
make: *** [Rgraphviz.so] Error 1
ERROR: compilation failed for package ‘Rgraphviz’
ADD REPLY

Login before adding your answer.

Traffic: 372 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6