GuipengLi / ChIA-PET2

a versatile and flexible pipeline for analysing different variants of ChIA-PET data
GNU General Public License v3.0
34 stars 19 forks source link

Solution to ld missing -lz during make #26

Open solo7773 opened 3 years ago

solo7773 commented 3 years ago

I am using conda environment and compliers are installed in custom path.

The error 'ld missing -lz' appeared when running the make command. This is minor but could take some time to fix for those (eg myself) who are not experienced in compiling source c/cpp code.

The solution here dose not suit all cases, but it would give you a hint to solve the error quickly.

Open and edit the Makefile

# custome g++ complier CC=/path/to/g++ # custome include library and lib CFLAGS=-Wall -O2 -Wno-char-subscripts -fopenmp -I/path/to/your/zlib/include -L/path/to/your/zlib/lib

Hint: To locate your custom zlib include and lib directories, you can run command like

find /path/to/possible/dir '*' | grep zlib

The above settings do not fix the error of compiling bedpe2Matrix because it uses different compile options. To fix this

  1. Open Makefile and find the line $(CC) -Wall -O2 -std=c++0x -o ${BIN}/$@ ${SOURCES}/bedpe2Matrix.cpp ${LDFLAGS}

  2. Add -I /path/to/your/zlib/include -L /path/to/your/zlib/lib before -Wall parameter