[sdpb] 233/233: Generalize Makefile; improve make test; remove pseudolicense from docs .sty

Tobias Hansen thansen at moszumanska.debian.org
Thu Mar 9 04:06:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository sdpb.

commit 26c89ef85fe969806301141e2bac877a4dfecce3
Author: David Simmons-Duffin <dsd at ssh2.sns.ias.edu>
Date:   Wed Mar 8 22:49:19 2017 -0500

    Generalize Makefile; improve make test; remove pseudolicense from docs .sty
---
 Makefile              | 38 +++++++++++++++++++++++++-------------
 docs/dsdshorthand.sty |  3 ---
 2 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile
index d00cb9d..eeb23f5 100755
--- a/Makefile
+++ b/Makefile
@@ -13,11 +13,13 @@ else
 # If you're using Linux or Windows or a nonstandard OS X setup, modify
 # these variables to point to the appropriate places.
 
+BASEDIR := $(HOME)
+
 # directory containing the header files 'gmp.h' and 'gmpxx.h'
-GMPINCLUDEDIR   = $(HOME)/include
+GMPINCLUDEDIR   = $(BASEDIR)/include
 
 # directory containing boost header files, e.g. 'bind.hpp', etc.
-BOOSTINCLUDEDIR = $(HOME)/include/boost
+BOOSTINCLUDEDIR = $(BASEDIR)/include/boost
 
 # directory containing library files, e.g.
 #   libboost_filesystem.a,
@@ -26,35 +28,42 @@ BOOSTINCLUDEDIR = $(HOME)/include/boost
 # as well as analogous files for 'boost_system',
 # 'boost_serialization', 'boost_timer', 'boost_program_options',
 # 'gmp', and 'gmpxx',
-LIBDIR          = $(HOME)/lib
+LIBDIR          = $(BASEDIR)/lib
 
 endif
 
 ################ End of modifications ################
 
-SOURCES := $(wildcard src/*.cpp) $(wildcard src/mpack/*.cpp) $(wildcard src/tinyxml2/*.cpp)
-HEADERS := $(wildcard src/*.h) $(wildcard src/mpack/*.h) $(wildcard src/tinyxml2/*.h)
-OBJECTS := $(patsubst src/%.cpp,obj/%.o,$(SOURCES))
+SOURCES = $(wildcard src/*.cpp) $(wildcard src/mpack/*.cpp)
+HEADERS = $(wildcard src/*.h) $(wildcard src/mpack/*.h)
+OBJECTS = $(patsubst src/%.cpp,obj/%.o,$(SOURCES))
 RESULT  = sdpb
 
+ifeq ($(SHARED_TINYXML2), 1)
+LIBS = -ltinyxml2
+else
+SOURCES += $(wildcard src/tinyxml2/*.cpp)
+HEADERS += $(wildcard src/tinyxml2/*.h)
+endif
+
 ifdef INTEL
 
 CC = icpc
-CFLAGS = -g -O2 -ipo -xhost -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -openmp -D___MPACK_BUILD_WITH_GMP___
-LIBS = -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lrt
+CFLAGS += -g -O2 -ipo -xhost -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -openmp -D___MPACK_BUILD_WITH_GMP___
+LIBS += -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lrt
 
 else 
 ifdef CLANG
 
 CC = clang-omp
-CFLAGS = -g -O2 -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -fopenmp -D___MPACK_BUILD_WITH_GMP___
-LIBS =  -liomp5 -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lc++
+CFLAGS += -g -O2 -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -fopenmp -D___MPACK_BUILD_WITH_GMP___
+LIBS +=  -liomp5 -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lc++
 
 else
 
 CC = g++
-CFLAGS = -g -O2 -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -fopenmp -D___MPACK_BUILD_WITH_GMP___
-LIBS = -lgomp -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lrt
+CFLAGS += -g -O2 -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -fopenmp -D___MPACK_BUILD_WITH_GMP___
+LIBS += -lgomp -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lrt
 
 endif
 endif
@@ -63,7 +72,7 @@ endif
 .SUFFIXES: .cpp .o
 
 $(RESULT): $(OBJECTS)
-	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 obj/%.o: src/%.cpp
 	$(CC) $(CFLAGS) -c -o $@ $<
@@ -78,6 +87,9 @@ obj:
 
 test:
 	./sdpb -s test.xml --noFinalCheckpoint
+	test -f test.out
+	grep "primalObjective = 1.84026576313204924668804017173" test.out > /dev/null || \
+	(echo "Test failed: primalObjective differs from 1.84026576313204924668804017173." && exit 1)
 
 $(OBJECTS): $(HEADERS) | obj
 
diff --git a/docs/dsdshorthand.sty b/docs/dsdshorthand.sty
index 45416ce..64d443d 100644
--- a/docs/dsdshorthand.sty
+++ b/docs/dsdshorthand.sty
@@ -9,9 +9,6 @@
 %%  David Simmons-Duffin <davidsd at gmail.com>
 %%  Last modified May 17, 2006
 %%
-%%  Feel free to use this on the condition that you share any good
-%%  ideas of yours with me!
-%%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{dsdshorthand}[2006/05/17 David Simmons-Duffin's macros]
 \RequirePackage{amsmath, amssymb, amsthm}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sdpb.git



More information about the debian-science-commits mailing list