140 lines
4.3 KiB
Makefile
140 lines
4.3 KiB
Makefile
# ----- You should not need to modify the following, unless the -----
|
|
# ----- configuration is not standard. In that case, please tell us -----
|
|
# ----- about it. -----
|
|
|
|
# This is needed to find python.h
|
|
PYTHON_INC = -I/usr/include/python$(UNIX_PYTHON_VER) -I/usr/lib/python$(UNIX_PYTHON_VER)
|
|
# This is needed to find gflags/gflags.h
|
|
GFLAGS_INC = -I$(UNIX_GFLAGS_DIR)/include
|
|
# This is needed to find protocol buffers.
|
|
PROTOBUF_INC = -I$(UNIX_PROTOBUF_DIR)/include
|
|
|
|
# Define UNIX_CLP_DIR if unset and if UNIX_CBC_DIR is set.
|
|
ifdef UNIX_CBC_DIR
|
|
ifndef UNIX_CLP_DIR
|
|
UNIX_CLP_DIR = $(UNIX_CBC_DIR)
|
|
endif
|
|
endif
|
|
# This is needed to find Coin LP include files.
|
|
ifdef UNIX_CLP_DIR
|
|
CLP_INC = -I$(UNIX_CLP_DIR)/include -DUSE_CLP
|
|
CLP_SWIG = $(CLP_INC)
|
|
endif
|
|
# This is needed to find Coin Branch and Cut include files.
|
|
ifdef UNIX_CBC_DIR
|
|
CBC_INC = -I$(UNIX_CBC_DIR)/include -DUSE_CBC
|
|
CBC_SWIG = $(CBC_INC)
|
|
endif
|
|
# This is needed to find GLPK include files.
|
|
ifdef UNIX_GLPK_DIR
|
|
GLPK_INC = -I$(UNIX_GLPK_DIR)/include -DUSE_GLPK
|
|
GLPK_SWIG = $(GLPK_INC)
|
|
endif
|
|
# This is needed to find scip include files.
|
|
ifdef UNIX_SCIP_DIR
|
|
SCIP_INC = -I$(UNIX_SCIP_DIR)/src -DUSE_SCIP
|
|
SCIP_SWIG = $(SCIP_INC)
|
|
endif
|
|
|
|
SWIG_INC = $(GLPK_SWIG) $(CLP_SWIG) $(CBC_SWIG) $(SCIP_SWIG)
|
|
|
|
# Compilation flags
|
|
DEBUG = -O3 -DNDEBUG
|
|
JNIDEBUG = -O1 -DNDEBUG
|
|
SYSCFLAGS = -fPIC
|
|
CCC = g++
|
|
|
|
# ----- OS Dependent -----
|
|
OS = $(shell uname -s)
|
|
|
|
ifeq ($(OS),Linux)
|
|
LD = gcc -shared
|
|
# This is needed to find libgflags.a
|
|
GFLAGS_LNK = -Wl,-rpath $(UNIX_GFLAGS_DIR)/lib -L$(UNIX_GFLAGS_DIR)/lib -lgflags
|
|
# This is needed to find libz.a
|
|
ZLIB_LNK = -lz
|
|
# This is needed to find libprotobuf.a
|
|
PROTOBUF_LNK = -Wl,-rpath $(UNIX_PROTOBUF_DIR)/lib -L$(UNIX_PROTOBUF_DIR)/lib -lprotobuf -lpthread
|
|
ifdef UNIX_GLPK_DIR
|
|
GLPK_LNK = -Wl,-rpath $(UNIX_GLPK_DIR)/lib -L$(UNIX_GLPK_DIR)/lib -lglpk
|
|
endif
|
|
ifdef UNIX_CLP_DIR
|
|
CLP_LNK = -Wl,-rpath $(UNIX_CLP_DIR)/lib/coin -L$(UNIX_CLP_DIR)/lib/coin -lClp -lCoinUtils
|
|
endif
|
|
ifdef UNIX_CBC_DIR
|
|
CBC_LNK = -Wl,-rpath $(UNIX_CBC_DIR)/lib/coin -L$(UNIX_CBC_DIR)/lib/coin -lCbcSolver -lCbc -lCgl -lOsi -lOsiCbc -lOsiClp -lOsiVol -lVol
|
|
endif
|
|
ifdef UNIX_SCIP_DIR
|
|
SCIP_LNK = -Wl,-rpath $(UNIX_SCIP_DIR)/lib -L$(UNIX_SCIP_DIR)/lib -lscip.$(SCIP_ARCH) -lnlpi.$(SCIP_ARCH) -llpispx.$(SCIP_ARCH) -lsoplex.$(SCIP_ARCH) -lreadline
|
|
endif
|
|
# Detect 32 bit or 64 bit OS and define ARCH and SCIP_ARCH flags correctly.
|
|
LBITS : = $(shell getconf LONG_BIT)
|
|
ifeq ($(LBITS),64)
|
|
ARCH = -DARCH_K8
|
|
SCIP_ARCH = linux.x86_64.gnu.opt
|
|
else
|
|
ARCH =
|
|
SCIP_ARCH = linux.x86.gnu.opt
|
|
endif
|
|
SYS_LNK = -lrt
|
|
JAVA_INC = -I$(LINUX_JDK_ROOT)/include -I$(LINUX_JDK_ROOT)/include/linux
|
|
JAVAC_BIN = $(LINUX_JDK_ROOT)/bin/javac
|
|
JAVA_BIN = $(LINUX_JDK_ROOT)/bin/java
|
|
JAR_BIN = $(LINUX_JDK_ROOT)/bin/jar
|
|
JNILIBEXT = so
|
|
FIX_SWIG = sed -i -e 's/Tlong/T_long/g' gen/com/google/ortools/constraintsolver/Solver.java
|
|
endif
|
|
ifeq ($(OS),Darwin) # Assume Mac Os X
|
|
LD = ld -arch x86_64 -bundle -flat_namespace -undefined suppress
|
|
GFLAGS_LNK = -L$(UNIX_GFLAGS_DIR)/lib -lgflags
|
|
ZLIB_LNK = -lz
|
|
PROTOBUF_LNK = -L$(UNIX_PROTOBUF_DIR)/lib -lprotobuf
|
|
ARCH = -DARCH_K8
|
|
SYS_LNK =
|
|
JAVA_INC = -I$(MAC_JDK_HEADERS)
|
|
JAVAC_BIN = javac
|
|
JAVA_BIN = java
|
|
JAR_BIN = jar
|
|
JNILIBEXT = jnilib
|
|
FIX_SWIG =
|
|
|
|
ifdef UNIX_GLPK_DIR
|
|
GLPK_LNK = -L$(UNIX_GLPK_DIR)/lib -lglpk
|
|
endif
|
|
ifdef UNIX_CLP_DIR
|
|
CLP_LNK = -L$(UNIX_CLP_DIR)/lib/coin -lClp -lCoinUtils
|
|
endif
|
|
ifdef UNIX_CBC_DIR
|
|
CBC_LNK = -L$(UNIX_CBC_DIR)/lib/coin -lCbcSolver -lCbc -lCgl -lOsi -lOsiCbc -lOsiClp
|
|
endif
|
|
ifdef UNIX_SCIP_DIR
|
|
SCIP_ARCH = darwin.x86.gnu.opt
|
|
SCIP_LNK = -L$(UNIX_SCIP_DIR)/lib -lscip.$(SCIP_ARCH) -lnlpi.$(SCIP_ARCH) -llpispx.$(SCIP_ARCH) -lsoplex.$(SCIP_ARCH) -lreadline
|
|
endif
|
|
endif
|
|
|
|
CFLAGS = $(SYSCFLAGS) $(DEBUG) -I. -Igen $(GFLAGS_INC) $(ARCH) \
|
|
-Wno-deprecated $(PROTOBUF_INC) $(CBC_INC) $(CLP_INC) $(GLPK_INC) \
|
|
$(SCIP_INC)
|
|
JNIFLAGS = $(SYSCFLAGS) $(JNIDEBUG) -I. -Igen $(GFLAGS_INC) $(ARCH) \
|
|
-Wno-deprecated $(PROTOBUF_INC) $(CBC_INC) $(CLP_INC) $(GLPK_INC) $(SCIP_INC)
|
|
LDFLAGS = $(GFLAGS_LNK) $(ZLIB_LNK) $(PROTOBUF_LNK) $(SYS_LNK)
|
|
LDLPDEPS = $(GLPK_LNK) $(CBC_LNK) $(CLP_LNK) $(SCIP_LNK)
|
|
|
|
# Unix specific definitions
|
|
PROTOBUF_DIR = $(UNIX_PROTOBUF_DIR)
|
|
SWIG_BINARY = $(UNIX_SWIG_BINARY)
|
|
LIBPREFIX = lib
|
|
LIBSUFFIX = a
|
|
LINKCMD = ar rv
|
|
LINKPREFIX =
|
|
O = o
|
|
E =
|
|
SHAREDLIBEXT = so
|
|
LDOUT = -o # need the space.
|
|
OBJOUT = -o # need the space.
|
|
EXEOUT = -o # need the space.
|
|
DEL = rm -f
|
|
S = /
|
|
CPSEP = :
|