<commit_before>#
# This file is part of Quantum++.
#
# MIT License
#
# Copyright (c) 2013 - 2019 <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
PROJECT(qpp VERSION 1.2 LANGUAGES CXX)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

#### Quantum++ headers
INCLUDE_DIRECTORIES(include)

#### Source file(s) to be compiled, modify as needed
SET(SOURCE_FILES
        examples/minimal.cpp)

#### Eigen3
MESSAGE(STATUS "Detecting Eigen3")
SET(EIGEN3_INCLUDE_DIR "" CACHE PATH "Path to Eigen3")
#### Location manually specified
IF (NOT ${EIGEN3_INCLUDE_DIR} STREQUAL "")
    IF (IS_DIRECTORY ${EIGEN3_INCLUDE_DIR})
        MESSAGE(STATUS "Detecting Eigen3 - done (in ${EIGEN3_INCLUDE_DIR})")
        INCLUDE_DIRECTORIES(SYSTEM "${EIGEN3_INCLUDE_DIR}")
    ELSE ()
        MESSAGE(FATAL_ERROR "Invalid path to Eigen3 installation")
    ENDIF ()
ELSE () #### Try to find it automatically
    FIND_PACKAGE(Eigen3 3.0 QUIET NO_MODULE)
    IF (NOT TARGET Eigen3::Eigen) # did not find Eigen3 automatically
        MESSAGE(FATAL_ERROR
                "Eigen3 not detected! Please point EIGEN3_INCLUDE_DIR\
            to your Eigen3 location when building with cmake,\
            for example\

            cmake -DEIGEN3_INCLUDE_DIR=$HOME/eigen ..")
    ENDIF ()
    MESSAGE(STATUS "Detecting Eigen3 - done")
ENDIF ()

#### Cygwin has issues with std=c++11, use std=gnu++11 instead
IF (CYGWIN)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
ENDIF ()

SET(ADDITIONAL_FLAGS "-pedantic -Wall -Wextra -Weffc++")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem")

#### CMake support only for GNU gcc and Clang/AppleClang
#### AppleClang does not support OpenMP; only Clang >= 3.7 supports OpenMP
IF (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"
        AND NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
    MESSAGE(FATAL_ERROR
            "This CMakeLists.txt works only with GNU gcc/Clang/AppleClang")
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 ()

#### MATLAB support
SET(WITH_MATLAB "" CACHE PATH "Path to MATLAB (to enable MATLAB support)")
# WITH_MATLAB option was activated (set)
IF (NOT ${WITH_MATLAB} STREQUAL "")
    IF (IS_DIRECTORY ${WITH_MATLAB})
        MESSAGE(STATUS "MATLAB support enabled")
        # MATLAB include files
        SET(MATLAB_INCLUDE "${WITH_MATLAB}/extern/include")
        IF (IS_DIRECTORY ${MATLAB_INCLUDE})
            INCLUDE_DIRECTORIES(SYSTEM ${MATLAB_INCLUDE})
        ELSE ()
            MESSAGE(FATAL_ERROR "Possibly corrupted MATLAB include headers")
        ENDIF ()
        # MATLAB linker files
        SET(MATLAB_LINK "${WITH_MATLAB}/bin/maci64")
        IF (IS_DIRECTORY ${MATLAB_LINK})
            SET(CMAKE_EXE_LINKER_FLAGS
                    "${CMAKE_EXE_LINKER_FLAGS} -L${MATLAB_LINK}")
        ELSE ()
            MESSAGE(FATAL_ERROR "Possibly corrupted MATLAB linker files")
        ENDIF ()
        #### everything is OK, inject definition (as #define) in the source
        ADD_DEFINITIONS(-DWITH_MATLAB_)
    ELSE ()
        MESSAGE(FATAL_ERROR "Invalid path to MATLAB installation")
    ENDIF ()
ENDIF ()

#### OpenMP support
OPTION(WITH_OPENMP "OpenMP support" ON)
IF (${WITH_OPENMP})
    #### Enable only for GNU gcc or clang >= 3.8
    IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR
    (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND
    (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.8" OR
            CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "3.8")))
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
        #### inject definition (as #define) in the source files
        ADD_DEFINITIONS(-DWITH_OPENMP_)
    ELSE ()
        MESSAGE(WARNING "Detected compiler: ${CMAKE_CXX_COMPILER_ID} \
        ${CMAKE_CXX_COMPILER_VERSION}. Support for OpenMP is enabled only for \
        the GNU gcc compiler or the clang version version 3.8 or higher.")
    ENDIF ()
ENDIF ()

#### Enable all warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_FLAGS}")
<commit_msg>Update CMakeLists.txt<commit_after>#
# This file is part of Quantum++.
#
# MIT License
#
# Copyright (c) 2013 - 2019 <NAME> (vgheorgh<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
PROJECT(qpp VERSION 1.2 LANGUAGES CXX)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

#### Quantum++ headers
INCLUDE_DIRECTORIES(include)

#### Source file(s) to be compiled, modify as needed
SET(SOURCE_FILES
        examples/minimal.cpp)

#### Eigen3
MESSAGE(STATUS "Detecting Eigen3")
SET(EIGEN3_INCLUDE_DIR "" CACHE PATH "Path to Eigen3")
#### Location manually specified
IF (NOT ${EIGEN3_INCLUDE_DIR} STREQUAL "")
    IF (IS_DIRECTORY ${EIGEN3_INCLUDE_DIR})
        MESSAGE(STATUS "Detecting Eigen3 - done (in ${EIGEN3_INCLUDE_DIR})")
        INCLUDE_DIRECTORIES(SYSTEM "${EIGEN3_INCLUDE_DIR}")
    ELSE ()
        MESSAGE(FATAL_ERROR "Invalid path to Eigen3 installation")
    ENDIF ()
ELSE () #### Try to find it automatically
    FIND_PACKAGE(Eigen3 3.0 QUIET NO_MODULE)
    IF (NOT TARGET Eigen3::Eigen) # did not find Eigen3 automatically
        MESSAGE(FATAL_ERROR
                "Eigen3 not detected! Please point EIGEN3_INCLUDE_DIR\
            to your Eigen3 location when building with cmake,\
            for example\

            cmake -DEIGEN3_INCLUDE_DIR=$HOME/eigen ..")
    ENDIF ()
    MESSAGE(STATUS "Detecting Eigen3 - done")
ENDIF ()

#### Cygwin has issues with std=c++11, use std=gnu++11 instead
IF (CYGWIN)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
ENDIF ()

SET(ADDITIONAL_FLAGS "-pedantic -Wall -Wextra -Weffc++")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem")

#### CMake support only for GNU gcc and Clang/AppleClang
#### AppleClang does not support OpenMP; only Clang >= 3.7 supports OpenMP
IF (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"
        AND NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
    MESSAGE(FATAL_ERROR
            "This CMakeLists.txt works only with GNU gcc/Clang/AppleClang")
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 ()

#### MATLAB support
SET(WITH_MATLAB "" CACHE PATH "Path to MATLAB (to enable MATLAB support)")
# WITH_MATLAB option was activated (set)
IF (NOT ${WITH_MATLAB} STREQUAL "")
    IF (IS_DIRECTORY ${WITH_MATLAB})
        MESSAGE(STATUS "MATLAB support enabled")
        # MATLAB include files
        SET(MATLAB_INCLUDE "${WITH_MATLAB}/extern/include")
        IF (IS_DIRECTORY ${MATLAB_INCLUDE})
            INCLUDE_DIRECTORIES(SYSTEM ${MATLAB_INCLUDE})
        ELSE ()
            MESSAGE(FATAL_ERROR "Possibly corrupted MATLAB include headers")
        ENDIF ()
        # MATLAB linker files
        SET(MATLAB_LINK "${WITH_MATLAB}/bin/maci64")
        IF (IS_DIRECTORY ${MATLAB_LINK})
            SET(CMAKE_EXE_LINKER_FLAGS
                    "${CMAKE_EXE_LINKER_FLAGS} -L${MATLAB_LINK}")
        ELSE ()
            MESSAGE(FATAL_ERROR "Possibly corrupted MATLAB linker files")
        ENDIF ()
        #### everything is OK, inject definition (as #define) in the source
        ADD_DEFINITIONS(-DWITH_MATLAB_)
    ELSE ()
        MESSAGE(FATAL_ERROR "Invalid path to MATLAB installation")
    ENDIF ()
ENDIF ()

#### OpenMP support
OPTION(WITH_OPENMP "OpenMP support" ON)
IF (${WITH_OPENMP})
    #### Enable only for GNU gcc or clang >= 3.8
    IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR
    (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND
    (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.8" OR
            CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "3.8")))
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
        #### inject definition (as #define) in the source files
        ADD_DEFINITIONS(-DWITH_OPENMP_)
    ELSE ()
        MESSAGE(WARNING "Detected compiler: ${CMAKE_CXX_COMPILER_ID} \
        ${CMAKE_CXX_COMPILER_VERSION}. Support for OpenMP is enabled only for \
        the GNU gcc compiler or the clang compiler version version 3.8 or \
        higher.")
    ENDIF ()
ENDIF ()

#### Enable all warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_FLAGS}")

{'fraction_non_alphanumeric': 0.09706942775261163, 'fraction_numerical': 0.009614495701211057, 'mean_word_length': 3.808, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4460675', 'n_tokens_mistral': 3724, 'n_tokens_neox': 3314, 'n_words': 1080}