Skip to content

Commit

Permalink
update the examples to cpp17
Browse files Browse the repository at this point in the history
  • Loading branch information
Apostolos Chalkis committed Jun 26, 2024
1 parent 960969c commit da7348d
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/EnvelopeProblemSOS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(EnvelopeProblem)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_CXX_FLAGS_DEBUG_CUSTOM "-O0 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DIPM_USE_DOUBLE -DIPM_DOUBLE=double")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG_CUSTOM}")
Expand Down Expand Up @@ -83,4 +83,4 @@ else ()
target_link_directories(EnvelopeProblem PRIVATE ${OPENMP_LIBRARIES})
endif ()
target_link_libraries(EnvelopeProblem Python2::Python Python2::NumPy)
endif ()
endif ()
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ else ()
add_compile_definitions("EIGEN_NO_DEBUG")
endif ()

add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17")
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
1 change: 1 addition & 0 deletions examples/crhmc_prepare/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ endif ()


#add_definitions(${CMAKE_CXX_FLAGS} "-g") # enable debuger
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++17 standard
set(ADDITIONAL_FLAGS "-march=native -DSIMD_LEN=0 -DTIME_KEEPING")
add_definitions(${CMAKE_CXX_FLAGS} "-O3 " ${ADDITIONAL_FLAGS}) # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
Expand Down
2 changes: 1 addition & 1 deletion examples/crhmc_sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++17 standard
set(ADDITIONAL_FLAGS "-march=native -DSIMD_LEN=0 -DTIME_KEEPING")
add_definitions(${CMAKE_CXX_FLAGS} "-O3 -DTIME_KEEPING" ${ADDITIONAL_FLAGS}) # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
Expand Down
2 changes: 1 addition & 1 deletion examples/ellipsoid-sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
1 change: 1 addition & 0 deletions examples/hpolytope-volume/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ include_directories (BEFORE ../../include/nlp_oracles)
include_directories (BEFORE ../../include/misc)
include_directories (BEFORE ../../include/optimization)

add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17")
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-ldl")
Expand Down
2 changes: 1 addition & 1 deletion examples/logconcave/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
2 changes: 1 addition & 1 deletion examples/mmcs_method/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++17 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
2 changes: 1 addition & 1 deletion examples/multithread_sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ else ()
endif ()


#add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++17 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
1 change: 1 addition & 0 deletions examples/optimization_spectrahedra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17")

add_executable (read_write_sdpa_file read_write_sdpa_file.cpp)

Expand Down
1 change: 1 addition & 0 deletions examples/order-polytope-basics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17")

option(DISABLE_NLP_ORACLES "Disable non-linear oracles (used in collocation)" ON)
option(BUILTIN_EIGEN "Use eigen from ../../external" OFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++17 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
2 changes: 1 addition & 1 deletion examples/volume_spectrahedron/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++17 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down
1 change: 1 addition & 0 deletions examples/vpolytope-volume/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ else ()
add_compile_definitions("EIGEN_NO_DEBUG")
endif ()

add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17")
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
Expand Down

0 comments on commit da7348d

Please sign in to comment.