Giter VIP home page Giter VIP logo

Comments (4)

lassefolkersen avatar lassefolkersen commented on August 22, 2024 1

I had a lot of problems with this as well. Here's the make file that worked for me eventually:

#COMPILER MODE C++11
CXX=g++ -std=c++11

HTSLIB_ROOT=/home/ubuntu/programs/htslib-1.9
HTSLIB_INC=$(HTSLIB_ROOT)/include
HTSLIB_LIB=-L$(HTSLIB_ROOT)/lib -lhts

BOOST_ROOT=/usr/lib/x86_64-linux-gnu
BOOST_INC=$(BOOST_ROOT)/include
BOOST_LIB_IO=-L$(BOOST_ROOT)/lib -lboost_iostreams
BOOST_LIB_PO=-L$(BOOST_ROOT)/lib -lboost_program_options

#Best performance is achieved with this. Use it if running on the same plateform you're compiling, it's definitely worth it!
CXXFLAG=-O3 -march=native

LDFLAG=-O3

#DYNAMIC LIBRARIES
DYN_LIBS=-lz -lbz2 -lm -lpthread -llzma

#SHAPEIT SOURCES & BINARY
BFILE=bin/shapeit4
HFILE=$(shell find src -name *.h)
CFILE=$(shell find src -name *.cpp)
OFILE=$(shell for file in `find src -name *.cpp`; do echo obj/$$(basename $$file .cpp).o; done)
VPATH=$(shell for file in `find src -name *.cpp`; do echo $$(dirname $$file); done)

#COMPILATION RULES
all: $(BFILE)

$(BFILE): $(OFILE)
$(CXX) $(LDFLAG) $^ $(HTSLIB_LIB) $(BOOST_LIB_IO) $(BOOST_LIB_PO) -o $@ $(DYN_LIBS)

obj/%.o: %.cpp $(HFILE)
$(CXX) $(CXXFLAG) -c $< -o $@ -Isrc -I$(HTSLIB_INC) -I$(BOOST_INC)

clean:
  rm -f obj/*.o $(BFILE)

Quite similar to @pcarbo - just with BOOST_ROOT defined. Thanks a lot for the solution! Also when doing it, I afterwards had to export

export LD_LIBRARY_PATH=/home/ubuntu/programs/htslib-1.9/

Because it had trouble linking it otherwise (I think, I'm no makefile expert)

from shapeit4.

scimerc avatar scimerc commented on August 22, 2024

BOOST_ROOT may be undefined.

from shapeit4.

pcarbo avatar pcarbo commented on August 22, 2024

Ah, right---please fix as needed.

from shapeit4.

macsx82 avatar macsx82 commented on August 22, 2024

Thanks guys!
This fixed compiling errors with htslib for me on release 4.1.3 .

from shapeit4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.