- status: open --> closed
I tried to build CPSeis in Ubuntu 20.04, but got gibberish from the script
cpseis_bashrc.sh
It contains these lines for Ubuntu and Red Hat linux:
export UBUNTU=$(uname -a | awk '{print $2}')
if [ "$UBUNTU" == "ubuntu" ] ; then
export GLIBCVERSION=$( $(which ldd) --version | grep "ldd (Ubu" | sed "s/. //;s/'//g")
export GCCVERSION=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
else
export GLIBCVERSION=$( cat $(which ldd) | grep "ldd (GNU libc)" | sed "s/. //;s/'//g")
export GCCVERSION=$(echo $(basename /usr/lib/gcc/x86_64-redhat-linux/*))
fi
Maybe this worked for Ubuntu 16.04 but something changed to confuse the
script.
The following will work with Centos, Fedora, Suse, Debian and a few other
linux distributions, and is simpler:
export GLIBCVERSION=$(ldd --version | head -1 | awk '{print $NF}')
export GCCVERSION=$(gcc -dumpversion)
dumpversion returns the same version as you would find under the
/usr/lib/gcc/x86_64-redhat-linux directory.
I put the modified cpseis_bashrc.sh into etc and scripts subdirectories, and
then install_cpseis would work under Ubuntu 20.04, well at least as far as
the Fortran code, but stumbles at the c++ code due to the narrowing conversion
error.
GCCVERSION is used in makefile.generic, but will also come in handy to patch
scripts or makefiles for such issues.