Skip to content

Commit

Permalink
Merge pull request #17 from XPIR-team/feature/better-osx-behavior
Browse files Browse the repository at this point in the history
Feature/better osx behavior
  • Loading branch information
carlosaguilarmelchor committed Apr 16, 2016
2 parents 251c51d + 156b37f commit 3d834f9
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 38 deletions.
8 changes: 5 additions & 3 deletions CMakeCompilers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
3 changes: 0 additions & 3 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(../..)

Expand Down
4 changes: 0 additions & 4 deletions apps/client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(../..)

Expand Down
14 changes: 0 additions & 14 deletions apps/server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(..)
Expand All @@ -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 ".")
Expand Down
5 changes: 0 additions & 5 deletions apps/simplepir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(..)
Expand All @@ -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})


Expand Down
4 changes: 0 additions & 4 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion helper_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 3d834f9

Please sign in to comment.