This might work for you:
Start with your sample set of files:
$ find . -type f -name '*-gcc-*'
./intel-mkl/2018.1.163-gcc-7.1.0
./superlu-dist/5.2.2-gcc-7.2.0-openmpi@3.0.0
./exuberant-ctags/5.8-gcc-7.1.0
Here's a script to trim -gcc-* off the end of any filename:
$ cat ex.sh
#!/bin/bash
for i in $(find . -type f -name '*-gcc-*'); do
mv "$i" "$(echo "$i" | sed -e 's/-gcc-.*$//')"
done
Run the script:
$ bash ex.sh
Note that the files no longer contain the -gcc-* suffix:
$ find . -type f
./intel-mkl/2018.1.163
./superlu-dist/5.2.2
./exuberant-ctags/5.8