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


The end of my link line has

-lz -ldl -lrt

which results in

/usr/bin/ld: attempted static link of dynamic object
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?


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!