Browse Source

Merge pull request #17 from XPIR-team/feature/better-osx-behavior

Feature/better osx behavior
Carlos Aguilar Melchor 6 years ago
parent
commit
3d834f91a8

+ 5 - 3
CMakeCompilers.txt

@@ -21,14 +21,16 @@ set(CMAKE_EXE_LINKER_FLAGS "-fopenmp")
 if(CMAKE_BUILD_TYPE MATCHES Debug)
   add_definitions(-DCHECK_STRICTMOD)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
+  message(STATUS "Building DEBUG version")
 else()
-	set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
-	foreach(FLAG -march=native -mtune=native -funroll-loops)
+  set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
+  message(STATUS "Building RELEASE version")
+  foreach(FLAG -march=native -mtune=native -funroll-loops)
 		string(REGEX REPLACE -= _ FLAG_ID ${FLAG})
 		string(TOUPPER ${FLAG_ID} FLAG_ID)
 		CHECK_CXX_COMPILER_FLAG(${FLAG} COMPILER_SUPPORTS${FLAG_ID})
 	    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAG}")
-	endforeach()
+  endforeach()
   # For OSX use clang
   if(APPLE)
 	    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfpmath=sse -Wa,-q")

+ 2 - 2
CMakeLists.txt

@@ -10,13 +10,13 @@ endif()
 
 set(CMAKE_C_COMPILER "gcc")
 set(CMAKE_CXX_COMPILER "g++")
-set(CMAKE_CXX_FLAGS "-std=c++11 -fopenmp -ggdb")
+set(CMAKE_CXX_FLAGS "-std=c++11 -fopenmp -ggdb -Wno-deprecated-declarations")
 set(CMAKE_EXE_LINKER_FLAGS "-fopenmp")
 set(BOOST_ROOT "./local")
 
 SET( Boost_USE_STATIC_LIBS FALSE )
 find_package(Boost 1.55.0  REQUIRED
-  COMPONENTS atomic chrono date_time exception program_options regex system thread)
+  COMPONENTS atomic chrono date_time exception program_options regex system thread program_options)
 include_directories(${Boost_INCLUDE_DIR})
 link_directories(${Boost_LIBRARY_DIR})
 	

+ 0 - 3
apps/CMakeLists.txt

@@ -7,10 +7,7 @@ add_subdirectory("simplepir")
 
 set(CMAKE_CXX_FLAGS "-std=c++11")
 set (CMAKE_EXE_LINKER_FLAGS "-fopenmp")
-if (APPLE)
-        set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options")
 
-endif()
 include_directories(..)
 include_directories(../..)
 

+ 0 - 4
apps/client/CMakeLists.txt

@@ -1,10 +1,6 @@
 cmake_minimum_required(VERSION 2.6.0)
 
 set (CMAKE_EXE_LINKER_FLAGS "-fopenmp") 
-if (APPLE)
-	set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options")
-
-endif()
 include_directories(..)
 include_directories(../..)
 

+ 0 - 14
apps/server/CMakeLists.txt

@@ -1,9 +1,5 @@
 cmake_minimum_required(VERSION 2.6.0)
 
-if (APPLE)
-	set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options")
-
-endif()
 
 include_directories(.)
 include_directories(..)
@@ -13,16 +9,6 @@ add_executable(pir_server DBDirectoryProcessor.cpp DBGenerator.cpp PIRServer.cpp
 
 target_link_libraries(pir_server pir ${Boost_LIBRARIES} ${GMP_LIBRARIES} pthread )
 
-# set (git_cmd "git")
-# set (git_arg "--version")
-# message(STATUS "git cmd: ${git_cmd}")
-# execute_process(COMMAND ${git_cmd} ${git_arg}
-#   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-#   RESULT_VARIABLE git_result
-#   OUTPUT_VARIABLE git_ver)
-#
-# message(STATUS "git ver[${git_result}]: ${git_ver}")
-
 file(COPY "../tools/check-correctness.sh" DESTINATION ".")
 file(COPY "../tools/makedb.sh" DESTINATION ".")
 file(COPY "../tools/mkdb-correctness.sh" DESTINATION ".")

+ 0 - 5
apps/simplepir/CMakeLists.txt

@@ -1,9 +1,5 @@
 cmake_minimum_required(VERSION 2.6.0)
 
-if (APPLE)
-	set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options")
-
-endif()
 
 include_directories(.)
 include_directories(..)
@@ -14,7 +10,6 @@ file(COPY "../tools/makedb.sh" DESTINATION ".")
 
 
 add_executable(simple_pir simplePIR.cpp ../../libpir.hpp ../server/DBGenerator.cpp ../server/DBDirectoryProcessor.cpp)
-#target_link_libraries(simple_pir pir_server_pir pir_query_gen pir_reply pir pir_client_events pir_client_optim pthread ${MPFR_LIBRARIES} ${Boost_LIBRARIES} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES})
 target_link_libraries(simple_pir pir pthread ${MPFR_LIBRARIES} ${Boost_LIBRARIES} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES})
 
 

+ 0 - 4
crypto/CMakeLists.txt

@@ -4,10 +4,6 @@ add_subdirectory("prng")
 
 set(CMAKE_CXX_FLAGS "-std=c++11 -fopenmp")
 set (CMAKE_EXE_LINKER_FLAGS "-fopenmp")
-if (APPLE)
-	set(CMAKE_EXE_LINKER_FLAGS "-fopenmp -L$ENV{HOME}/Code/xpir/freshxpir/xpir-ng/local/lib/ -lboost_program_options")
-
-endif()
 include_directories(..)
 
 add_library(pir_crypto STATIC

+ 1 - 1
helper_script.sh

@@ -25,7 +25,7 @@ CONFIGURE="./configure CFLAGS=-I$PWD/local/include LDFLAGS=-L$PWD/local/lib --pr
 
   cd dependencies/mpfr-3.1.2 && $CONFIGURE && make && make install
   cd ../..
-  cd dependencies/gmp-6.0.0 && $CONFIGURE && make && make check && make install
+  cd dependencies/gmp-6.0.0 && $CONFIGURE --enable-cxx && make && make check && make install
   cd ../..
   LOCAL_PATH="$PWD/local/ "
   # Boostrap the build module

+ 0 - 2
pir/CMakeLists.txt

@@ -32,8 +32,6 @@ add_library(pir SHARED ${PIRLIB_ASMS} ${PIRLIB_SRCS})
 target_link_libraries(pir  ${MPFR_LIBRARY} ${Boost_LIBRARIES} ${GMP_LIBRARIES} ${GOBJECT_LIBRARIES})
 install(TARGETS pir LIBRARY DESTINATION lib)
 
-#if(!APPLE)
 add_library(pir_static STATIC ${PIRLIB_ASMS} ${PIRLIB_SRCS})
 target_link_libraries(pir_static ${MPFR_LIBRARY} ${Boost_LIBRARIES} ${GMP_LIBRARY} ${GOBJECT_LIBRARIES} gmp libgmp )
 install(TARGETS pir_static ARCHIVE DESTINATION lib)
-#endif()