<commit_before>##
#  CMake script for the step-4 tutorial program:
##

# Set the name of the project and target:
PROJECT(demo)
SET(TARGET "demo")

FILE(GLOB SRC_FILES source/*cc)

# Declare all source files the target consists of:
SET(TARGET_SRC
    ${SRC_FILES}
    # You can specify additional files here!
  )

# Usually, you will not need to modify anything beyond this point...

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)

FIND_PACKAGE(deal.II 8.0 QUIET
  HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
  )
 FIND_PATH(FFTW3_INCLUDE_DIRS NAMES fftw3.h HINTS ENV FFTW_DIR PATH_SUFFIXES include)
  FIND_LIBRARY(FFTW3_LIBRARIES NAMES fftw3 libfftw3 HINTS ENV FFTW_DIR PATH_SUFFIXES lib)
  IF(NOT FFTW3_INCLUDE_DIRS OR NOT FFTW3_LIBRARIES)
    MESSAGE(FATAL_ERROR "Could not find fftw3.")
  ENDIF()
  FIND_PATH(FFTW3_MPI_INCLUDE_DIRS NAMES fftw3-mpi.h HINTS ENV FFTW_DIR PATH_SUFFIXES include)
  FIND_LIBRARY(FFTW3_MPI_LIBRARIES NAMES fftw3_mpi libfftw3_mpi HINTS ENV FFTW_DIR PATH_SUFFIXES lib)
  IF(NOT FFTW3_MPI_INCLUDE_DIRS OR NOT FFTW3_MPI_LIBRARIES)
    MESSAGE(FATAL_ERROR "Could not find fftw3-mpi.")
  ENDIF()
  INCLUDE_DIRECTORIES(include/)
  INCLUDE_DIRECTORIES(${FFTW3_INCLUDE_DIRS})
  INCLUDE_DIRECTORIES(${FFTW3_MPI_INCLUDE_DIRS})

IF(NOT ${deal.II_FOUND})
  MESSAGE(FATAL_ERROR "\n"
    "*** Could not locate deal.II. ***\n\n"
    "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n"
    "or set an environment variable \"DEAL_II_DIR\" that contains this path."
    )
ENDIF()


DEAL_II_INITIALIZE_CACHED_VARIABLES() 
PROJECT(${TARGET})
DEAL_II_INVOKE_AUTOPILOT()

TARGET_LINK_LIBRARIES(demo /Applications/deal.II.brew.app/Contents/Resources/brew/opt/fftw/lib/libfftw3.a)
TARGET_LINK_LIBRARIES(demo /Applications/deal.II.brew.app/Contents/Resources/brew/opt/fftw/lib/libfftw3_mpi.a)<commit_msg>bigolo<commit_after>##
# CMake script for large project, with one executable
# and a library of objects, optionally
# depending on deal2lkit.
#
# The structure of the directory is assumed to be:
# ./source: containing implementations and one file with "int main()"
# ./include: containing all class declarations
# ./tests: containing pairs of files: test.cc/test.output to test
#
# If you set the environemnt variable D2K_DIR,
# everything will work out of the box
##

# Set the name of the project and target
# If your application follows the structure above, you don't need to
# specify anything else.
SET(TARGET nufft)
SET(_main source/main.cc)

# Set the _main variable to empty if you don't want an executable
# but only a library
#SET(_main "")

############################################################
# Normally you shouldn't need to change anything below.
############################################################
# Declare all source files the target consists of:
file(GLOB _files source/*cc)

# Don't compile the main file into the library
IF(NOT "${_main}" STREQUAL "")
    LIST(REMOVE_ITEM _files
      ${CMAKE_CURRENT_SOURCE_DIR}/${_main}
    )
ENDIF()

INCLUDE_DIRECTORIES(include)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)

FIND_PACKAGE(deal.II 8.3 REQUIRED
  HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)

DEAL_II_INITIALIZE_CACHED_VARIABLES()
PROJECT(${TARGET})

#SET(D2K_DIR "$ENV{D2K_DIR}" CACHE PATH "Path to deal2lkit")

# We one library and one target for each type of deal.II library
# we found. If you compiled deal.II with both Release and Debug
# mode, this will generate both Release and Debug programs for you
# The debug library and program are postfixed with ".g"
SET(_d2_build_types "Release;Debug")
SET(Release_postfix "")
SET(Debug_postfix ".g")

FOREACH(_build_type ${_d2_build_types})
    # Postfix to use everywhere
    SET(_p "${${_build_type}_postfix}")
    # Only build this type, if deal.II was compiled with it.
    IF(DEAL_II_BUILD_TYPE MATCHES "${_build_type}")
	MESSAGE("-- Found ${_build_type} version of deal.II.")

	SET(_lib "${TARGET}-lib${_p}")
	MESSAGE("-- Configuring library ${_lib}")

	STRING(TOUPPER "${_build_type}" _BUILD_TYPE)

	# Add all files, except the main file, to the library
	ADD_LIBRARY(${_lib} SHARED ${_files})

	# Look for deal2lkit. If not found, ignore it.
	#SET(_d2k deal2lkit${${_build_type}_postfix})
	#MESSAGE("-- Looking for ${_d2k} in ${D2K_DIR}")
	#FIND_LIBRARY(D2K${_p} ${_d2k} HINTS ${D2K_DIR} PATH_SUFFIXES lib)
	#IF(NOT "${D2K${_p}}" STREQUAL "D2K${_p}-NOTFOUND")
	#    TARGET_LINK_LIBRARIES(${_lib} ${D2K${_p}})
	#    MESSAGE("-- Library ${_d2k} found: ${D2K${_p}}")
	#ELSE()
	#    MESSAGE(WARNING "-- Library deal2lkit not found: ${D2K${_p}}")
	#ENDIF()

  FIND_PATH(FFTW3_INCLUDE_DIRS NAMES fftw3.h HINTS ENV FFTW_DIR PATH_SUFFIXES include)
  FIND_LIBRARY(FFTW3_LIBRARIES NAMES fftw3 libfftw3 HINTS ENV FFTW_DIR PATH_SUFFIXES lib)
  IF(NOT FFTW3_INCLUDE_DIRS OR NOT FFTW3_LIBRARIES)
    MESSAGE(FATAL_ERROR "Could not find fftw3.")
  ENDIF()
  FIND_PATH(FFTW3_MPI_INCLUDE_DIRS NAMES fftw3-mpi.h HINTS ENV FFTW_DIR PATH_SUFFIXES include)
  FIND_LIBRARY(FFTW3_MPI_LIBRARIES NAMES fftw3_mpi libfftw3_mpi HINTS ENV FFTW_DIR PATH_SUFFIXES lib)
  IF(NOT FFTW3_MPI_INCLUDE_DIRS OR NOT FFTW3_MPI_LIBRARIES)
    MESSAGE(FATAL_ERROR "Could not find fftw3-mpi.")
  ENDIF()
  INCLUDE_DIRECTORIES(include/)
  INCLUDE_DIRECTORIES(${FFTW3_INCLUDE_DIRS})
  INCLUDE_DIRECTORIES(${FFTW3_MPI_INCLUDE_DIRS})
  TARGET_LINK_LIBRARIES(${_lib} ${FFTW3_MPI_LIBRARIES})
  TARGET_LINK_LIBRARIES(${_lib} ${FFTW3_LIBRARIES})

	# Compile an executable only if required by the user
	IF(NOT "${_main}" STREQUAL "")
	    SET(_exe "${TARGET}${${_build_type}_postfix}")
	    MESSAGE("-- Configuring executable ${_exe}")
	    ADD_EXECUTABLE(${_exe} ${_main})
	    TARGET_LINK_LIBRARIES(${_exe} ${_lib})
	    DEAL_II_SETUP_TARGET(${_exe} ${_BUILD_TYPE})
	ENDIF()

	SET(TEST_LIBRARIES_${_BUILD_TYPE} ${_lib})
	DEAL_II_SETUP_TARGET(${_lib} ${_BUILD_TYPE})
  ENDIF()
ENDFOREACH()

#INCLUDE_DIRECTORIES(${D2K_DIR}/include)

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests AND NUFFT_ENABLE_TESTING)
  ADD_SUBDIRECTORY(tests)
  ENABLE_TESTING()
endif()


# Doxygen
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
    find_package(Doxygen)
    if(DOXYGEN_FOUND)
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
    add_custom_target(doc
    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    COMMENT "Generating API documentation with Doxygen" VERBATIM
    )
    endif(DOXYGEN_FOUND)
endif()

IF(NOT ${deal.II_FOUND})
  MESSAGE(FATAL_ERROR "\n"
    "*** Could not locate deal.II. ***\n\n"
    "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n"
    "or set an environment variable \"DEAL_II_DIR\" that contains this path."
    )
ENDIF()


#DEAL_II_INITIALIZE_CACHED_VARIABLES()
#PROJECT(${TARGET})
#DEAL_II_INVOKE_AUTOPILOT()
{'fraction_non_alphanumeric': 0.13066860465116278, 'fraction_numerical': 0.010755813953488373, 'mean_word_length': 5.261146496815287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5472032', 'n_tokens_mistral': 2835, 'n_tokens_neox': 2625, 'n_words': 609}