fix mac libraries rpath in examples
This commit is contained in:
@@ -5,6 +5,10 @@ ifeq "$(SYSTEM)" "win"
|
||||
else
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
tools/fix_libraries_on_linux.sh
|
||||
else
|
||||
$(COPY) tools/install_libortools_mac.sh temp/$(INSTALL_DIR)
|
||||
chmod 775 temp/$(INSTALL_DIR)/install_libortools_mac.sh
|
||||
cd temp/$(INSTALL_DIR) && ./install_libortools_mac.sh && rm install_libortools_mac.sh
|
||||
endif
|
||||
cd temp && tar -c -v -z --no-same-owner -f ..$S$(INSTALL_DIR).tar.gz $(INSTALL_DIR)
|
||||
endif
|
||||
@@ -104,11 +108,6 @@ else
|
||||
cd temp$S$(INSTALL_DIR)$Sinclude && tar -C ..$S..$S..$Sdependencies$Sinstall$Sinclude -c -v gflags | tar xvm
|
||||
cd temp$S$(INSTALL_DIR)$Sinclude && tar -C ..$S..$S..$Sdependencies$Sinstall$Sinclude -c -v google | tar xvm
|
||||
cd temp$S$(INSTALL_DIR)$Sinclude && tar -C ..$S..$S..$Sdependencies$Sinstall$Sinclude -c -v sparsehash | tar xvm
|
||||
|
||||
ifeq ($(PLATFORM),MACOSX)
|
||||
$(COPY) tools/install_libortools_mac.sh temp/$(INSTALL_DIR)
|
||||
chmod 775 temp/$(INSTALL_DIR)/install_libortools_mac.sh
|
||||
endif
|
||||
endif
|
||||
|
||||
dotnet_archive:
|
||||
@@ -200,9 +199,6 @@ ifeq "$(SYSTEM)" "win"
|
||||
tools$Sunzip.exe $(INSTALL_DIR).zip -d temp
|
||||
else
|
||||
tar -x -v -f $(INSTALL_DIR).tar.gz -C temp
|
||||
endif
|
||||
ifeq ($(PLATFORM),MACOSX)
|
||||
cd temp$S$(INSTALL_DIR) && ./install_libortools_mac.sh
|
||||
endif
|
||||
cd temp$S$(INSTALL_DIR) && $(MAKE) test
|
||||
-$(DELREC) $(INSTALL_DIR)
|
||||
|
||||
@@ -38,16 +38,16 @@ LIB_DIR = $(OR_ROOT)lib
|
||||
|
||||
# Unix specific part.
|
||||
ifeq ("$(SYSTEM)","unix")
|
||||
# Defines OR_TOOLS_TOP if it is not already defined.
|
||||
OR_TOOLS_TOP ?= $(shell pwd)
|
||||
OS = $(shell uname -s)
|
||||
LIB_PREFIX = -Wl,-rpath $(OR_TOOLS_TOP)/lib -L$(OR_TOOLS_TOP)/lib
|
||||
OR_TOOLS_LIBS = $(LIB_PREFIX) -lortools
|
||||
CVRPTW_LIBS = $(LIB_PREFIX) -lcvrptw_lib $(LIB_PREFIX) -lortools
|
||||
DIMACS_LIBS = $(LIB_PREFIX) -ldimacs $(LIB_PREFIX) -lortools
|
||||
ifeq ($(OS),Linux)
|
||||
CCC = g++ -fPIC -std=c++0x
|
||||
LD_FLAGS = -lz -lrt -lpthread
|
||||
# Defines OR_TOOLS_TOP if it is not already defined.
|
||||
OR_TOOLS_TOP ?= $(shell pwd)
|
||||
LIB_PREFIX = -Wl,-rpath $(OR_TOOLS_TOP)/lib -L$(OR_TOOLS_TOP)/lib
|
||||
OR_TOOLS_LIBS = $(LIB_PREFIX) -lortools
|
||||
CVRPTW_LIBS = $(LIB_PREFIX) -lcvrptw_lib $(LIB_PREFIX) -lortools
|
||||
DIMACS_LIBS = $(LIB_PREFIX) -ldimacs $(LIB_PREFIX) -lortools
|
||||
LBITS = $(shell getconf LONG_BIT)
|
||||
ifeq ($(LBITS),64)
|
||||
PORT = Linux64
|
||||
@@ -63,9 +63,6 @@ ifeq ("$(SYSTEM)","unix")
|
||||
ifeq ($(OS),Darwin) # Assume Mac Os X
|
||||
CCC = clang++ -fPIC -std=c++11
|
||||
LD_FLAGS = -lz
|
||||
OR_TOOLS_LIBS = -L$(OR_ROOT)lib -lortools
|
||||
CVRPTW_LIBS = -L$(OR_ROOT)lib -lcvrptw_lib -lortools
|
||||
DIMACS_LIBS = -L$(OR_ROOT)lib -ldimacs -lortools
|
||||
ARCH = -DARCH_K8
|
||||
PORT = MacOsX64
|
||||
CSC = mcs
|
||||
@@ -165,8 +162,10 @@ clean:
|
||||
$(DEL) $(CPP_BIN_DIR)$S*
|
||||
$(DEL) $(OBJ_DIR)$S*$O
|
||||
|
||||
test_cc: $(CPP_BIN_DIR)/golomb$E
|
||||
test_cc: $(CPP_BIN_DIR)/golomb$E $(CPP_BIN_DIR)/cvrptw$E
|
||||
$(CPP_BIN_DIR)$Sgolomb$E
|
||||
$(CPP_BIN_DIR)/cvrptw$E
|
||||
|
||||
|
||||
test_java: EX:=Tsp
|
||||
test_java:
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
# This script must be run when you uncompress the archive or if you move it to
|
||||
# a new position.
|
||||
|
||||
export N=`pwd`/lib
|
||||
export B=`pwd`/bin/csharp
|
||||
export O=`otool -L lib/libortools.dylib | grep -v ':' | grep libortools | cut -d '(' -f 1`
|
||||
echo install library in path $N
|
||||
install_name_tool -id $B/libGoogle.OrTools.so $B/libGoogle.OrTools.so
|
||||
install_name_tool -change $O $N/libortools.dylib $B/libGoogle.OrTools.so
|
||||
install_name_tool -id $N/libcvrptw_lib.dylib $N/libcvrptw_lib.dylib
|
||||
install_name_tool -id $N/libdimacs.dylib $N/libdimacs.dylib
|
||||
install_name_tool -id $N/libjniortools.jnilib $N/libjniortools.jnilib
|
||||
install_name_tool -change $O $N/libortools.dylib $N/libjniortools.jnilib
|
||||
install_name_tool -id $N/libortools.dylib $N/libortools.dylib
|
||||
echo "$O"
|
||||
install_name_tool -change $O @loader_path/../../lib/libortools.dylib $B/libGoogle.OrTools.so
|
||||
install_name_tool -id @rpath/libortools.dylib $N/libortools.dylib
|
||||
install_name_tool -change $O @loader_path/libortools.dylib $N/libjniortools.dylib
|
||||
install_name_tool -id @rpath/libdimacs.dylib $N/libdimacs.dylib
|
||||
install_name_tool -id @rpath/libcvrptw_lib.dylib $N/libcvrptw_lib.dylib
|
||||
install_name_tool -change $O @loader_path/libortools.dylib $N/libjniortools.jnilib
|
||||
export P=`otool -L lib/libortools.dylib | grep -v ':' | grep libortools | cut -d '(' -f 1`
|
||||
echo the new path of the or-tools library is $P
|
||||
|
||||
Reference in New Issue
Block a user