Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Gheorghiu <[email protected]>
  • Loading branch information
vsoftco committed Jan 23, 2025
1 parent 77c8205 commit 0f38324
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 27 deletions.
6 changes: 3 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
- `qpp::QEngineT<>::get_non_measured()` ->
`qpp::QEngineT<>::get_non_measured_d()`
- `qpp::QEngineT<>::was_measured()` -> `qpp::QEngineT<>::was_measured_d()`
- Bugfix in qpp::internal::canonical_form(), the re-ordering is now stable, so
qpp::QCircuit measurement probabilities are not displayed in reversed order
w.r.t. target
- Bugfix in `qpp::internal::canonical_form()`, the re-ordering is now stable,
so `qpp::QCircuit` measurement probabilities are not displayed in reversed
order w.r.t. target
- Simplified MATLAB detection via CMake `find_package()` function. Users should
only use `-DQPP_MATLAB=ON` when building with MATLAB support, all other
MATLAB-related CMake flags have been removed.
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ install(FILES "${CMAKE_SOURCE_DIR}/cmake/qpp_MATLAB.cmake"

# Uninstall
# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
# UNIX/Linux: sudo cmake --build build --target uninstall Windows: cmake
# --build build --target uninstall
#
# UNIX/Linux: sudo cmake --build build --target uninstall

# Windows: cmake --build build --target uninstall
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/qpp_uninstall.cmake.in"
Expand Down
33 changes: 18 additions & 15 deletions cmake/qpp_dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Quantum++ additional dependencies Do not modify unless you know what you're
# doing
# Quantum++ additional dependencies
# Do not modify unless you know what you're doing

# Custom index type. If none selected, a default one is selected by
# include/types.hpp (usually std::size_t).
Expand Down Expand Up @@ -112,7 +112,7 @@ if(${QPP_OPENMP})
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
if(OpenMP_CXX_VERSION_MAJOR GREATER_EQUAL 3)
# inject definition (as #define) in the source files
# Inject definition (as #define) in the source files
add_compile_definitions(QPP_OPENMP)
# OpenMP linking dependencies to be injected in the main CMakeLists.txt
set(QPP_OPENMP_LINK_DEPS OpenMP::OpenMP_CXX)
Expand All @@ -123,18 +123,20 @@ requires OpenMP 3.0 or later")
endif()
endif()

# Disable support for thread_local storage duration specifier when using
# AppleClang as libc++ doesn't yet support it if (${CMAKE_CXX_COMPILER_ID}
# STREQUAL "AppleClang") #### inject definition (as #define) in the source files
# add_definitions(-DNO_THREAD_LOCAL_) message(WARNING "Detected compiler:
# ${CMAKE_CXX_COMPILER_ID} \ ${CMAKE_CXX_COMPILER_VERSION}. thread_local not
# supported.") endif ()
# # Disable support for thread_local storage duration specifier when using
# # AppleClang as libc++ doesn't yet support it
# if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
# # Inject definition (as #define) in the source files
# add_definitions(-DNO_THREAD_LOCAL_)
# message(WARNING "Detected compiler: ${CMAKE_CXX_COMPILER_ID} \
# ${CMAKE_CXX_COMPILER_VERSION}. thread_local not # supported.")
# endif ()

# Windows issues with Microsoft Visual Studio
if(MSVC)
# Disable spurious Eigen warnings with MSVC (warning STL4007)
add_compile_definitions(_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
add_compile_options(-bigobj)
add_compile_options(/bigobj)
endif()

# MinGW or Cygwin have issues with object files that are too large
Expand All @@ -154,11 +156,12 @@ endif()

# GCC additional debug settings
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
# if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ## use the "no-weak" debugging
# flag only when debugging under OS X, ## as gdb cannot step in template
# functions when debugging code ## produced by g++ ## see
# https://stackoverflow.com/questions/23330641/gnu-gdb-can-not-step-into-template-functions-os-x-mavericks
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-weak") endif ()
# if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# # Use the "no-weak" debugging flag only when debugging under OS X, as gdb
# # cannot step in template functions when debugging code produced by g++, see
# # https://stackoverflow.com/questions/23330641/gnu-gdb-can-not-step-into-template-functions-os-x-mavericks
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-weak")
# endif ()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -D_GLIBCXX_DEBUG")
endif()

Expand Down
4 changes: 2 additions & 2 deletions cmake/qpp_eigen3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if(NOT TARGET Eigen3::Eigen)
GIT_TAG 3.4.0 # 3.4.0
GIT_SHALLOW TRUE
# no CMakeLists.txt in cmake, so this turns off configure. Recommend also
# add `FIND_PACKAGE_ARGS CONFIG` so that FetchContent checks to see if Eigen
# is installed on the system, via the o/s, or a package manager
# to add `FIND_PACKAGE_ARGS CONFIG` so that FetchContent checks to see if
# Eigen is installed on the system, via the OS, or a package manager
SOURCE_SUBDIR cmake)
FetchContent_MakeAvailable(Eigen3)
endif()
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#
# cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/installed/qpp
#
# then uncomment the following line and replace the installation path with yours
# uncomment the following line and replace the installation path with yours

# set(CMAKE_PREFIX_PATH "/path/to/installed/qpp")

Expand Down
1 change: 0 additions & 1 deletion include/qpp/classes/ijson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class IJSON {
*/
virtual std::string
to_JSON(bool enclosed_in_curly_brackets = true) const = 0;

}; /* class IJSON */

} /* namespace qpp */
Expand Down
2 changes: 1 addition & 1 deletion pyqpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
wrapper for Quantum++. **pyqpp** requires the same dependencies as Quantum++,
and can be installed using `pip`

```
```shell
pip install git+https://github.com/softwareQinc/qpp
```

Expand Down
4 changes: 2 additions & 2 deletions unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ FetchContent_Declare(
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)
# For Windows: Prevent overriding the parent project's compiler/linker settings,
# and add bigobj option
# and add /bigobj option
if(MSVC)
add_compile_options(-bigobj)
add_compile_options(/bigobj)
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
Expand Down

0 comments on commit 0f38324

Please sign in to comment.