I'm trying to compile minimap2(in this repo https://github.com/lh3/minimap2.git) from source under a conda environment, The c compilers are also installed by conda. And it failed to link with zlib:
<conda_path>/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
This error can be reproduced by simply running "<conda_path>/bin/x86_64-conda_cos6-linux-gnu-cc -lz"
but if running "ld -lz --verbose" it works
$ which ld
/usr/bin/ld
$ ld -lz --verbose
(sth not useful)
===
attempt to open //usr/x86_64-redhat-linux/lib64/libz.so failed
attempt to open //usr/x86_64-redhat-linux/lib64/libz.a failed
attempt to open //usr/lib64/libz.so succeeded
-lz (//usr/lib64/libz.so)
libc.so.6 needed by //usr/lib64/libz.so
found libc.so.6 at /usr/lib64//libc.so.6
ld-linux-x86-64.so.2 needed by /usr/lib64//libc.so.6
found ld-linux-x86-64.so.2 at /usr/lib64//ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address
I've add /usr/lib64/ to LIBRARY_PATH and LD_LIBRARY_PATH and nothing changed, so how to solve this? any help would be appreciated