You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2019/06/26 19:37:33 UTC

[incubator-datasketches-cpp] branch old_gcc_rhel_fixes updated: compatibility changes for gcc 4.x on old RHEL

This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch old_gcc_rhel_fixes
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git


The following commit(s) were added to refs/heads/old_gcc_rhel_fixes by this push:
     new a367aec  compatibility changes for gcc 4.x on old RHEL
a367aec is described below

commit a367aec04285b9a0b1104a7260f77a3a2aa4e555
Author: jmalkin <jm...@users.noreply.github.com>
AuthorDate: Wed Jun 26 12:37:23 2019 -0700

    compatibility changes for gcc 4.x on old RHEL
---
 Makefile                                |  1 -
 config.mk                               | 12 ++++++++----
 cpc/cpc.mk                              |  2 +-
 fi/fi.mk                                |  2 +-
 fi/test/reverse_purge_hash_map_test.cpp |  2 +-
 hll/hll.mk                              |  2 +-
 kll/kll.mk                              |  2 +-
 theta/theta.mk                          |  2 +-
 8 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 40cf395..fb3b9d3 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,6 @@ TARGET := $(TARGETDIR)/$(LIBRARY)
 INC := -I /usr/local/include
 LIB := -L /usr/local/lib -lcppunit -L lib -l$(LIB_BASE_NAME)
 
-#MODULES := hll cpc kll fi theta
 MODULES := cpc kll fi theta hll
 
 .PHONY: all
diff --git a/config.mk b/config.mk
index 194b681..ac1fb1b 100644
--- a/config.mk
+++ b/config.mk
@@ -10,10 +10,12 @@ else
   LIB_SUFFIX := so
 endif
 
-COMMON_FLAGS := -O0 -fpic -Wall -pedantic -g3
+COMMON_FLAGS := -O3 -fpic -Wall -pedantic -g0
 
 ifeq ($(UNAME_S),Linux)
-    #CFLAGS += -std=gnu++11 -O2 # -fPIC
+    CFLAGS += -std=gnu++11 -fPIC
+    CPPFLAGS += -std=gnu++11 -fPIC
+    LINKFLAGS := -shared
 
     # PostgreSQL Special
     #PG_VER := 9.3
@@ -21,7 +23,7 @@ ifeq ($(UNAME_S),Linux)
     #LIB += -L /usr/pgsql-$(PG_VER)/lib
 else
   CFLAGS += -x c $(COMMON_FLAGS)
-  CPPFLAGS += -std=c++17 $(COMMON_FLAGS)
+  CPPFLAGS += -std=c++11 $(COMMON_FLAGS)
 
   ifeq (clang,$(findstring clang,$(CC)))
     LINKFLAGS := -dynamiclib
@@ -31,12 +33,14 @@ else
   endif
 endif
 
+TSTLNKFLAGS := -Wl,-rpath=/usr/local/lib
+
 ifeq ($(COVERAGE),1)
   #ifeq (clang,$(findstring clang,$(CC)))
     CFLAGS += --coverage
     CPPFLAGS += --coverage
     LINKFLAGS += --coverage
-    TSTLNKFLAGS := --coverage
+    TSTLNKFLAGS += --coverage
   #else
   #  CFLAGS += --coverage -ftest-covearge -fprofile-arcs
   #  CPPFLAGS += --coverage -ftest-covearge -fprofile-arcs
diff --git a/cpc/cpc.mk b/cpc/cpc.mk
index 3dc2b03..e822b99 100644
--- a/cpc/cpc.mk
+++ b/cpc/cpc.mk
@@ -43,7 +43,7 @@ cpc_exec: $(COM_TSTOBJS) $(CPC_OBJECTS) $(CPC_TSTOBJS)
 	@$(CC) $^ -o $(CPC_TARGET) $(TSTLNKFLAGS) $(LIB)
 
 cpc_test: $(LIBRARY) cpc_exec
-	@cd cpc; DYLD_LIBRARY_PATH=../$(TARGETDIR) ./$(CPC_TEST_BIN)
+	@cd cpc; LD_LIBRARY_PATH=../$(TARGETDIR) ./$(CPC_TEST_BIN)
 
 cpc_clean:
 	@echo "Cleaning cpc...";
diff --git a/fi/fi.mk b/fi/fi.mk
index ff87101..7a990e6 100644
--- a/fi/fi.mk
+++ b/fi/fi.mk
@@ -23,7 +23,7 @@ fi_exec: $(COM_TSTOBJS) $(FI_TSTOBJS)
 	@$(CC) $^ -o $(FI_TARGET) $(TSTLNKFLAGS) $(LIB)
 
 fi_test: fi_exec
-	@cd fi; DYLD_LIBRARY_PATH=../$(TARGETDIR) ./$(FI_TEST_BIN)
+	@cd fi; LD_LIBRARY_PATH=../$(TARGETDIR) ./$(FI_TEST_BIN)
 
 .PHONY: fi_clean
 fi_clean:
diff --git a/fi/test/reverse_purge_hash_map_test.cpp b/fi/test/reverse_purge_hash_map_test.cpp
index b3dbd8c..a1437e5 100644
--- a/fi/test/reverse_purge_hash_map_test.cpp
+++ b/fi/test/reverse_purge_hash_map_test.cpp
@@ -42,7 +42,7 @@ class reverse_purge_hash_map_test: public CppUnit::TestFixture {
     reverse_purge_hash_map<int> map(3, 3);
     map.adjust_or_insert(1, 1);
     CPPUNIT_ASSERT_EQUAL(1U, map.get_num_active());
-    CPPUNIT_ASSERT_EQUAL(1ULL, map.get(1));
+    CPPUNIT_ASSERT_EQUAL(1, (int) map.get(1));
   }
 
   void iterator() {
diff --git a/hll/hll.mk b/hll/hll.mk
index bb7aa30..a6f3ce5 100644
--- a/hll/hll.mk
+++ b/hll/hll.mk
@@ -23,7 +23,7 @@ hll_exec: $(COM_TSTOBJS) $(HLL_TSTOBJS)
 	@$(CC) $^ -o $(HLL_TARGET) $(TSTLNKFLAGS) $(LIB)
 
 hll_test: hll_exec
-	@cd hll; DYLD_LIBRARY_PATH=../$(TARGETDIR) ./$(HLL_TEST_BIN)
+	@cd hll; LD_LIBRARY_PATH=../$(TARGETDIR) ./$(HLL_TEST_BIN)
 
 .PHONY: hll_clean
 hll_clean:
diff --git a/kll/kll.mk b/kll/kll.mk
index 8e8e035..b574589 100644
--- a/kll/kll.mk
+++ b/kll/kll.mk
@@ -23,7 +23,7 @@ kll_exec: $(COM_TSTOBJS) $(KLL_TSTOBJS)
 	@$(CC) $^ -o $(KLL_TARGET) $(TSTLNKFLAGS) $(LIB)
 
 kll_test: kll_exec
-	@cd kll; DYLD_LIBRARY_PATH=../$(TARGETDIR) ./$(KLL_TEST_BIN)
+	@cd kll; LD_LIBRARY_PATH=../$(TARGETDIR) ./$(KLL_TEST_BIN)
 
 .PHONY: kll_clean
 kll_clean:
diff --git a/theta/theta.mk b/theta/theta.mk
index bae0600..317c389 100644
--- a/theta/theta.mk
+++ b/theta/theta.mk
@@ -23,7 +23,7 @@ theta_exec: $(COM_TSTOBJS) $(THETA_TSTOBJS)
 	@$(CC) $^ -o $(THETA_TARGET) $(TSTLNKFLAGS) $(LIB)
 
 theta_test: theta_exec
-	@cd theta; DYLD_LIBRARY_PATH=../$(TARGETDIR) ./$(THETA_TEST_BIN)
+	@cd theta; LD_LIBRARY_PATH=../$(TARGETDIR) ./$(THETA_TEST_BIN)
 
 .PHONY: theta_clean
 theta_clean:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org