How to stop CMake from appending shared libraries on a Cray?

3.18.2

The end of my link line has

-lz -ldl -lrt
/global/project/projectdirs/txsupp/vp11usrs/cori/contrib-gcc8.3/muparser-2.2.6.1-ser/lib64/libmuparser.a
/global/project/projectdirs/txsupp/vp11usrs/cori/contrib-gcc8.3/Python-2.7.16-sersh/lib/python2.7/config/libpython2.7.a
-lutil
/opt/cray/pe/libsci/19.06.1/GNU/8.1/x86_64/lib/libsci_gnu_82_mpi_mp.so
/opt/cray/pe/libsci/19.06.1/GNU/8.1/x86_64/lib/libsci_gnu_82_mp.so
/opt/gcc/8.3.0/snos/lib64/libgomp.so

which results in

/usr/bin/ld: attempted static link of dynamic object
`/opt/cray/pe/libsci/19.06.1/GNU/8.1/x86_64/lib/libsci_gnu_82_mpi_mp.so’
collect2: error: ld returned 1 exit status

It all links just fine if those appended shared libraries are taken off
the link line.

How can I tell CMake not to append these?

Thanks

Could you provide the relevant target_link_libraries for this? Potentially the find_package calls involved with that as well. It could be that you need to tell something to find static libraries instead.

@chuckatkins if you know what might be going on here.

This can be closed. By some combination of removing libraries, getting rid of implicit libs, etc., the problem went away. Thx!