##
## Makefile configuration for normaliz
## (for the classic build system)
##
CXX = g++
## CXX = clang++
#CXX = linux32 g++ -m32 -march=i686  #compile it for linux32
CXXFLAGS += -std=c++11
CXXFLAGS += -Wall -pedantic
CXXFLAGS += -O3 -funroll-loops
#CXXFLAGS += -I /usr/local/boost_1_45_0
#CXXFLAGS += -g       ## debugging
#CXXFLAGS += -pg      ## profiling
#CXXFLAGS += -DNDEBUG ## disables asserts
#CXXFLAGS +=-mtune=corei7-avx

SCIPPATH = $(HOME)/SCIP/scipoptsuite-3.2.0

COCOA_ROOT=$(HOME)/nmz_opt_lib
FLINT_ROOT = $(COCOA_ROOT)
MPFR_ROOT = $(FLINT_DIR)

INSTALLDIR= /usr/local

## use OpenMP?
ifeq ($(OPENMP),no)
  CXXFLAGS += -Wno-unknown-pragmas
else
  CXXFLAGS += -fopenmp ## g++
  ## CXXFLAGS += -fopenmp=libgomp ## clang++
endif

## for distributing the executables link static (does not work for mac)
CXXFLAGS += -static
## for almost static compilation on Mac use
#CXXFLAGS += -static-libgcc
## make it compatible with older Mac versions
#CXXFLAGS += -mmacosx-version-min=10.5


GMPFLAGS = -lgmpxx -lgmp

## use SCIP?
ifeq ($(SCIP),yes)
  CXXFLAGS += -DNMZ_SCIP
  CXXFLAGS += -I $(SCIPPATH)/scip-3.2.0/src

  SCIPFLAGS = -L $(SCIPPATH)/lib  \
    -lscipopt-3.2.0.linux.x86_64.gnu.opt# \
    -lreadline \
    -lz
endif

##use COCOA?
ifeq ($(COCOA),no)
else
  CXXFLAGS += -DNMZ_COCOA -DCoCoA_THREADSAFE_HACK
  CXXFLAGS += -I $(COCOA_ROOT)/include
  COCOAFLAGS = $(COCOA_ROOT)/lib/libcocoa.a
endif

##use FLINT?
ifeq ($(FLINT),no)
else
CXXFLAGS += -DNMZ_FLINT
CXXFLAGS += -I $(FLINT_ROOT)/include/
FLINTFLAGS = -L $(FLINT_ROOT)/lib -lflint -L $(MPFR_ROOT)/lib -lmpfr
CXXFLAGS += -I $(MPFR_ROOT)/include
endif

#gperftools ?
ifeq ($(GPERFTOOLS),yes)
CXXFLAGS += -DNMZ_GPERF
PERFFLAGS = -lprofiler
#   -lunwind -llzma
endif


LINKFLAGS += $(SCIPFLAGS) $(COCOAFLAGS) $(FLINTFLAGS) $(GMPFLAGS) $(PERFFLAGS) $(PERFFLAGS)
#$(PERFFLAGS)
## -lprofiler -lunwind -llzma