diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100644 index 0000000000000..3a54418caeb7e --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,288 @@ +cmake_minimum_required(VERSION 2.8) +## library versions ## + +set(EXTERNAL_TOP_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}) + +set(llvm_VER 3.0) +set(readline_VER 6.2) +set(pcre_VER 8.21) +set(grisu_VER 1.1) +set(dsfmt_VER 2.1) +set(openblas_VER v0.1alpha2.5) +set(lapack_VER 3.4.0) +set(arpack_VER 3.0.2) +set(fftw_VER 3.3) +set(suitesparse_VER 3.7.0) +set(clp_VER 1.14.5) +set(unwind_VER 1.0.1) +set(lightttpd_VER 1.4.29) + +## Download Paths (to be replaced by git sumbodules) ## +set(validExtensions tar gz bz2 tgz) +set(llvm_URL http://llvm.org/releases/${llvm_VER}/llvm-${llvm_VER}.tar.gz) +set(readline_URL ftp://ftp.gnu.org/gnu/readline/readline-${readline_VER}.tar.gz) +set(pcre_URL ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${pcre_VER}.tar.bz2) +set(grisu_URL http://double-conversion.googlecode.com/files/double-conversion-${grisu_VER}.tar.gz) +set(dsfmt_URL http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmt_VER}.tar.gz) +set(openblas_URL https://github.com/xianyi/OpenBLAS/tarball/${openblas_VER}) +set(lapack_URL http://www.netlib.org/lapack/lapack-${lapack_VER}.tgz) +set(arpack_URL http://forge.scilab.org/index.php/p/arpack-ng/downloads/353/get/) +set(fftw_URL http://www.fftw.org/fftw-${fftw_VER}.tar.gz) +set(suitesparse_URL http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-${suitesparse_VER}.tar.gz) +set(clp_URL http://www.coin-or.org/download/source/Clp/Clp-${clp_URL}.tgz) +set(unwind_URL http://savannah.spinellicreations.com/libunwind/libunwind-${unwind_VER}.tar.gz) +set(lighthttp_URL download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${lighttd_VER}.tar.gz) + +## Needs tar command for unzipping - Possibly use cmake tar once strip-components is available ## +find_program(TarPath "tar" DOC "tar command") +if(${TarPath} MATCHES "TarPath-NOTFOUND") + message(FATAL_ERROR "tar command was not found") +endif() + +option(CHECK_CERTIFICATES "Enables certificate checks" OFF) +if(NOT DEFINED BACKUP_DOWNLOADER) + find_program(WgetPath "wget" DOC "wget command") + if(${WgetPath} MATCHES "WgetPath-NOTFOUND") + message(STATUS "wget command was not found") + find_program(CUrlPath "curl" DOC "wget command") + if(${CUrlPath} MATCHES "CUrlPath-NOTFOUND") + message(STATUS "curl command was not found") + else(${CUrlPath} MATCHES "CUrlPath-NOTFOUND") + set(BACKUP_DOWNLOADER "${CUrlPath} -kLo") + endif() + else() + set(BACKUP_DOWNLOADER ${WgetPath} "--no-check-certificate" "-O") + endif() +endif(NOT DEFINED BACKUP_DOWNLOADER) +if(NOT DEFINED BACKUP_DOWNLOADER) + message(WARNING "No alternate downloader found. Some file downloads may not be supported") + message(WARNING "You can use -DBACKUP_DOWNLOADER:PATH= to specify an alternative downloader!") +endif(NOT DEFINED BACKUP_DOWNLOADER) + +## Download Packages ## + +set(PACKAGES llvm pcre dsfmt openblas lapack arpack fftw suitesparse) + +## Linux Specific Packages ## + +IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(PACKAGES ${PACKAGES} unwind) +endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + +## Other Packages ## + +option(USE_SYSTEM_READLINE "Use the system-provided readline library" OFF) +IF(NOT USE_SYSTEM_READLINE) + set(PACKAGES ${PACKAGES} readline) +ENDIF(NOT USE_SYSTEM_READLINE) + +foreach(package ${PACKAGES}) + message(STATUS "Checking package " ${package}) + ## Get Version and URL to download ## + set(versionvar "${package}_VER") + set(version ${${versionvar}}) + set(URLvar "${package}_URL") + set(URL ${${URLvar}}) + ## Get proper extension ## + GET_FILENAME_COMPONENT(ext ${URL} EXT) + ## The extension may contain leftover junk from the version informmation. Clean that up! ## + + string(REPLACE "." ";" ext ${ext} "") #Create list of extensions + set(ext2 "${ext}") #copy list + list(REMOVE_ITEM ext2 ${validExtensions}) + list(REMOVE_ITEM ext ${ext2} "") #remove all but valid extensions + ## Account for missing file extension and assume tar.gz + list(LENGTH ext count) + IF(${count} EQUAL 0) + set(ext "tar;gz") + endif() + + string(REPLACE ";" "." ext "${ext}") #turn list back into string + + IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/${package}-${version}.${ext}) + ## Download the File ## + message(STATUS "Downloading package " ${package}) + file(DOWNLOAD ${URL} ${CMAKE_SOURCE_DIR}/${package}-${version}.${ext} STATUS downloadStatus SHOW_PROGRESS) + list(GET downloadStatus 1 downloadError) + list(GET downloadStatus 0 downloadStatus) + IF(downloadStatus EQUAL 1 AND downloadError MATCHES "unsupported protocol") + message(STATUS "Using alternate downloader from (${BACKUP_DOWNLOADER})") + execute_process(COMMAND ${BACKUP_DOWNLOADER} ${CMAKE_SOURCE_DIR}/${package}-${version}.${ext} ${URL} RESULT_VARIABLE downloadStatus) + endif() + IF(NOT downloadStatus EQUAL 0) + file(REMOVE ${CMAKE_SOURCE_DIR}/${package}-${version}.${ext}) + message(STATUS "File:" ${URL}) + message(STATUS "Error was: ${downloadError} (${downloadStatus})") + message(FATAL_ERROR "Failed to download package " ${package}) + else() + message(STATUS "Download of package " ${package} " succesful") + endif() + endif() + + IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/${package}-${version}) + message(STATUS "Decompressing package") + file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/${package}-${version}) + execute_process(COMMAND ${TarPath} -C ${package}-${version} --strip-components 1 -xf "${package}-${version}.${ext}" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE result) + IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/${package}-${version} OR result) + file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/${package}-${version}) + message(FATAL_ERROR "Decompression of package " ${package} " failed") + else() + message(STATUS "Decompression of package " ${package} " succesful") + endif() + ENDIF() + +endforeach(package) + +## Duplicate FFTW ## +IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/fftw-double-${fftw_VER}) +message(STATUS "creating fftw-double") +file(COPY fftw-${fftw_VER} DESTINATION ${CMAKE_BINARY_DIR}) +file(RENAME ${CMAKE_BINARY_DIR}/fftw-${fftw_VER} ${CMAKE_SOURCE_DIR}/fftw-double-${fftw_VER}) +message(STATUS "creation of fftw-double completed (hopefully)") +ENDIF() +## General Setup ## + +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/"root") +endif(NOT DEFINED CMAKE_INSTALL_PREFIX) + +if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE ) + message(FATAL_ERROR "In-source builds are not allowed. +Please create a directory and run cmake from there, passing the path +to this source directory as the last argument. +This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. +Please delete them.") +endif() + +## LLVM Setup + +set(LLVM_ENABLE_THREADS OFF) +set(LLVM_TARGETS_TO_BUILD X86) +add_subdirectory(llvm-${llvm_VER}) + +## PCRE Setup + +set(PCRE_SUPPORT_UNICODE_PROPERTIES ON) +set(PCRE_SUPPORT_UTF8 ON) +set(PCRE_SUPPORT_JIT ON) +add_subdirectory(pcre-${pcre_VER}) + + +# The Following configure check has been taken from LaPACK +# Check the usage of the user provided BLAS libraries +# If none were found, build the OpenBlas libraries + +if(BLAS_LIBRARIES) + include(CheckFortranFunctionExists) + set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES}) + unset( BLAS_FOUND ) + CHECK_FORTRAN_FUNCTION_EXISTS2("dgemm" BLAS_FOUND) + unset( CMAKE_REQUIRED_LIBRARIES ) + if(BLAS_FOUND) + message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.") + else(BLAS_FOUND) + message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS_LIBRARIES}.") + message(ERROR "--> Will use OpenBlas (by default)") + message(ERROR "--> Or Correct your BLAS_LIBRARIES entry ") + message(ERROR "--> Or Consider checking USE_OPTIMIZED_BLAS") + endif(BLAS_FOUND) + +# User did not provide a BLAS Library but specified to search for one +elseif( USE_OPTIMIZED_BLAS ) + find_package( BLAS ) +endif (BLAS_LIBRARIES) + +set(OpenBlasLIB ${CMAKE_SOURCE_DIR}/openblas-${openblas_VER}/libopenblas.${CMAKE_STATIC_LIBRARY_SUFFIX}) +# Neither user specified or optimized BLAS libraries can be used +if(NOT BLAS_FOUND) + message(STATUS "Using OpenBlas") + set( BLAS_LIBRARIES ${OpenBlasLIB}) + set( BUILD_OPENBLAS ON) + set( BLAS_TARGET openblas) +else() + set( CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}" + CACHE STRING "Linker flags for executables" FORCE) + set( CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}" + CACHE STRING "Linker flags for modules" FORCE) + set( CMAKE_SHARED_LINKER_FLAGS + "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}" + CACHE STRING "Linker flags for shared libs" FORCE) +endif( NOT BLAS_FOUND ) + +set(BUILD_SHARED_LIBS ON) +set(BLAS_FOUND 1) #Prevent LaPack from using it's own blas version +add_subdirectory(lapack-${lapack_VER}) +set( LAPACK_TARGET lapack-static ) + +add_subdirectory(amos) +##Set ASM Env var -- should not be necessary technically +include(CMakeDetermineASMCompiler) +set(CMAKE_ASM_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY}) + +add_subdirectory(fdlibm) +set(LapackLIB lapack) + +add_subdirectory(cmake) + +set(FFTW_CONFIG --enable-shared --disable-fortran --disable-mpi --disable-openmp --disable-threads --enable-sse2 --enable-fma) +IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") +set(FFTW_CONFIG ${FFTW_CONFIG} --with-our-malloc) +ENDIF() + +macro(autoconfTarget name options) +message(STATUS ${name}) +set(${name}_SRC_DIR ${CMAKE_SOURCE_DIR}/${name}-${${name}_VER}) +set(${name}_BINARY_DIR ${CMAKE_BINARY_DIR}/${name}-${${name}_VER}) +set(${name}_CONFIGURE ${${name}_SRC_DIR}/configure) +message(STATUS ${name}_SRC_DIR) +message(STATUS ${${name}_SRC_DIR}) +message(STATUS ${${name}_BINARY_DIR}) +file(MAKE_DIRECTORY ${${name}_BINARY_DIR}) +add_custom_command(OUTPUT ${${name}_BINARY_DIR}/Makefile COMMAND ${${name}_CONFIGURE} --prefix=${CMAKE_INSTALL_PREFIX} ${options} WORKING_DIRECTORY ${${name}_BINARY_DIR}) +add_custom_command(OUTPUT ${${name}_BINARY_DIR}/BuildDone COMMAND $(MAKE) -C ${${name}_BINARY_DIR} +COMMAND touch ${${name}_CONFIGURE} +COMMAND $(MAKE) -C ${${name}_BINARY_DIR} install +COMMAND touch ${${name}_BINARY_DIR}/BuildDone +DEPENDS ${${name}_BINARY_DIR}/Makefile +WORKING_DIRECTORY ${${name}_BINARY_DIR}) +endmacro() + +#set(fftw-double_VER ${fftw_VER}) +#set(fftwDoubleFeatures --enable-sse --enable-float ${FFTW_CONFIG}) +#autoconfTarget(fftw-double "${fftwDoubleFeatures}") +# +#autoconfTarget(fftw "${FFTW_CONFIG}") + +IF(OFF) +autoconfTarget(clp) +ENDIF() + + +IF(BUILD_OPENBLAS) +set(OPENBLAS_SRC_DIR ${CMAKE_SOURCE_DIR}/openblas-${openblas_VER}) +set(OPENBLAS_BINARY_DIR ${CMAKE_BINARY_DIR}/openblas-${openblas_VER}) +set(OPENBLAS_CONFIGURE ${OPENBLAS_SRC_DIR}/configure) +file(MAKE_DIRECTORY ${OPENBLAS_BINARY_DIR}) +add_custom_target(openblas COMMAND perl -i -ple "'s/^\\s*(EXTRALIB\\s*\\+=\\s*-lSystemStubs)\\s*$$/# $$1/g'" ${CMAKE_CURRENT_SOURCE_DIR}/openblas-${openblas_VER}/Makefile.system +COMMAND $(MAKE) DYNAMIC_ARCH=1 USE_THREAD=0 NO_LAPACK=1 CC=$(CC) FC=$(FC) FFLAGS="$(FFLAGS)" TARGET=$(TARGET_OPENBLAS_ARCH) +COMMAND $(MAKE) install PREFIX=${CMAKE_INSTALL_PREFIX} DYNAMIC_ARCH=1 USE_THREAD=0 NO_LAPACK=1 CC=$(CC) FC=$(FC) FFLAGS="$(FFLAGS)" TARGET=$(TARGET_OPENBLAS_ARCH) +WORKING_DIRECTORY ${OPENBLAS_SRC_DIR}) +ENDIF() + +IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +set(UNWIND_SRC_DIR ${CMAKE_SOURCE_DIR}/unwind-${unwind_VER}) +set(UNWIND_BINARY_DIR ${CMAKE_BINARY_DIR}/unwind-${unwind_VER}) +set(UNWIND_CONFIGURE ${UNWIND_SRC_DIR}/configure) +add_custom_target(unwind ALL cd ${UNWIND_DIR} COMMAND ${UNWIND_CONFIGURE} CFLAGS="-U_FORTIFY_SOURCE -fPIC" --prefix=${CMAKE_INSTALL_PREFIX} +COMMAND $(MAKE) -C ${UNWIND_BINARY_DIR} +COMMAND touch ${UNWIND_CONFIGURE} +COMMAND $(MAKE) -C ${UNWIND_BINARY_DIR} install +WORKING_DIRECTORY ${UNWIND_BINARY_DIR}) +ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + +#add_custom_target(dependencies ALL DEPENDS ${fftw_BINARY_DIR}/BuildDone ${fftw-double_BINARY_DIR}/BuildDone) + +add_dependencies(lapack openblas) +add_dependencies(arpack openblas lapack) diff --git a/external/amos/CMakeLists.txt b/external/amos/CMakeLists.txt new file mode 100644 index 0000000000000..d91af9cc8ee50 --- /dev/null +++ b/external/amos/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required(VERSION 2.8) +project(amos) + +enable_language(Fortran) + +# default to release build +if (NOT CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE RELEASE CACHE STRING + "Choose the type of build, options are: None Debug Release." + FORCE) +endif (NOT CMAKE_BUILD_TYPE) + +get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) +if (Fortran_COMPILER_NAME STREQUAL "gfortran") + # gfortran + set (CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC") + set (CMAKE_Fortran_FLAGS_DEBUG "-O0") +else() + message(WARNING "Using unknown Fortran compiler") + set (CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC") + set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g") +endif() + +# Don't use AUX_SOURCE_FILES for the reasons listed in the manual +set(SOURCES d1mach.f + dgamln.f + i1mach.f + xerror.f + zabs.f + zacai.f + zacon.f + zairy.f + zasyi.f + zbesh.f + zbesi.f + zbesj.f + zbesk.f + zbesy.f + zbinu.f + zbiry.f + zbknu.f + zbuni.f + zbunk.f + zdiv.f + zexp.f + zkscl.f + zlog.f + zmlri.f + zmlt.f + zrati.f + zs1s2.f + zseri.f + zshch.f + zsqrt.f + zuchk.f + zunhj.f + zuni1.f + zuni2.f + zunik.f + zunk1.f + zunk2.f + zuoik.f + zwrsk.f) + +add_library(amos SHARED ${SOURCES}) \ No newline at end of file diff --git a/external/cmake/CMakeLists.txt b/external/cmake/CMakeLists.txt new file mode 100644 index 0000000000000..c3433d62a8855 --- /dev/null +++ b/external/cmake/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +add_subdirectory(arpack) +add_subdirectory(fftw-3.3) \ No newline at end of file diff --git a/external/cmake/Tests.cmake b/external/cmake/Tests.cmake new file mode 100644 index 0000000000000..98a7a6ef65721 --- /dev/null +++ b/external/cmake/Tests.cmake @@ -0,0 +1,35 @@ +## MACRO adapted from http://www.opensource.apple.com/source/curl/curl-57.2/curl/CMakeLists.txt licensed under the MIT license +macro(COMPILE_TEST TEST_NAME) + if(NOT DEFINED(${TESE_NAME})) + set(MACRO_CHECK_FUNCTION_DEFINITIONS + "-D${TEST_NAME} ${TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LIBRARIES) + set(TEST_NAME_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif(CMAKE_REQUIRED_LIBRARIES) + + message(STATUS "Performing Test ${TEST_NAME}") + try_compile(${TEST_NAME} + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/cmake/tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${TEST_NAME_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT) + if(${TEST_NAME}) + set(${TEST_NAME} 1 CACHE INTERNAL "Test ${FUNCTION}" PARENT_SCOPE) + message(STATUS "Performing Test ${TEST_NAME} - Success") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Performing Curl Test ${TEST_NAME} passed with the following output:\n" + "${OUTPUT}\n") + else(${TEST_NAME}) + message(STATUS "Performing Test ${TEST_NAME} - Failed" PARENT_SCOPE) + set(${TEST_NAME} "" CACHE INTERNAL "Test ${FUNCTION}") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing Curl Test ${TEST_NAME} failed with the following output:\n" + "${OUTPUT}\n") + endif() + else() + message(STATUS "Skipped test ${TEST_NAME}") + message(STATUS "${${TEST_NAME}}") + endif() +endmacro() diff --git a/external/cmake/arpack/CMakeLists.txt b/external/cmake/arpack/CMakeLists.txt new file mode 100644 index 0000000000000..6c3bac108ffdd --- /dev/null +++ b/external/cmake/arpack/CMakeLists.txt @@ -0,0 +1,110 @@ +cmake_minimum_required(VERSION 2.8) +project(arpack) + +enable_language(Fortran) + +function(prefixlist list_name prefix) + set(${list_name}_TMP) + foreach(l ${${list_name}}) + list(APPEND ${list_name}_TMP ${prefix}${l} ) + endforeach() + set(${list_name} "${${list_name}_TMP}" PARENT_SCOPE) +endfunction(prefixlist) + +set(arpacksrc_DIR ${EXTERNAL_TOP_SRCDIR}/arpack-${arpack_VER}/SRC/) +set(arpackutil_DIR ${EXTERNAL_TOP_SRCDIR}/arpack-${arpack_VER}/UTIL/) + +set(arpacksrc_STAT_SRCS + sgetv0.f + slaqrb.f + sstqrb.f + ssortc.f + ssortr.f + sstatn.f + sstats.f + snaitr.f + snapps.f + snaup2.f + snaupd.f + snconv.f + sneigh.f + sngets.f + ssaitr.f + ssapps.f + ssaup2.f + ssaupd.f + ssconv.f + sseigt.f + ssgets.f + sneupd.f + sseupd.f + ssesrt.f + dgetv0.f + dlaqrb.f + dstqrb.f + dsortc.f + dsortr.f + dstatn.f + dstats.f + dnaitr.f + dnapps.f + dnaup2.f + dnaupd.f + dnconv.f + dneigh.f + dngets.f + dsaitr.f + dsapps.f + dsaup2.f + dsaupd.f + dsconv.f + dseigt.f + dsgets.f + dneupd.f + dseupd.f + dsesrt.f + cnaitr.f + cnapps.f + cnaup2.f + cnaupd.f + cneigh.f + cneupd.f + cngets.f + cgetv0.f + csortc.f + cstatn.f + znaitr.f + znapps.f + znaup2.f + znaupd.f + zneigh.f + zneupd.f + zngets.f + zgetv0.f + zsortc.f + zstatn.f) + +prefixlist(arpacksrc_STAT_SRCS "${arpacksrc_DIR}") + +set(arpackutil_STAT_SRCS + icnteq.f + icopy.f + iset.f + iswap.f + ivout.f + svout.f + smout.f + dvout.f + dmout.f + cvout.f + cmout.f + zvout.f + zmout.f) + +prefixlist(arpackutil_STAT_SRCS "${arpackutil_DIR}") + + +########### next target ############### +add_library(arpack SHARED ${arpacksrc_STAT_SRCS} ${arpackutil_STAT_SRCS}) +target_link_libraries(arpack ${LAPACK_TARGET} ${BLAS_LIBRARIES}) +set_target_properties(arpack PROPERTIES VERSION 2.0.0 SOVERSION 2) diff --git a/external/cmake/fftw-3.3/CMakeLists.txt b/external/cmake/fftw-3.3/CMakeLists.txt new file mode 100644 index 0000000000000..f24f337a908e4 --- /dev/null +++ b/external/cmake/fftw-3.3/CMakeLists.txt @@ -0,0 +1,525 @@ +cmake_minimum_required(VERSION 2.8) +enable_language(C) + +set(TOP_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../../fftw-3.3") +set(TOP_CMAKE_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}) + +function(prefixlist list_name prefix) + set(${list_name}_TMP) + foreach(l ${${list_name}}) + list(APPEND ${list_name}_TMP ${prefix}${l} ) + endforeach() + set(${list_name} "${${list_name}_TMP}" PARENT_SCOPE) +endfunction(prefixlist) + +## BUILD MACROS ## +macro(addObjects library) + list(APPEND FFTW${PREC_PREFIX}_${library}_objects ${ARGV}) + list(REMOVE_ITEM FFTW${PREC_PREFIX}_${library}_objects ${library}) + set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}) + string(REPLACE "${TOP_CMAKE_SRCDIR}" "" SRCDIR "${SRCDIR}") + prefixlist(FFTW${PREC_PREFIX}_${library}_objects "${TOP_SRCDIR}/${SRCDIR}/") + set_property(DIRECTORY ${TOP_CMAKE_SRCDIR} PROPERTY FFTW${PREC_PREFIX}_${library}_objects "${FFTW${PREC_PREFIX}_${library}_objects}") +endmacro() + +macro(findObjects outputVar) + foreach(f ${ARGV}) + if(NOT ${f} STREQUAL ${outputVar}) + get_property(FFTW${PREC_PREFIX}_${f}_objects DIRECTORY ${TOP_CMAKE_SRCDIR} PROPERTY FFTW${PREC_PREFIX}_${f}_objects) + list(APPEND ${outputVar} ${FFTW${PREC_PREFIX}_${f}_objects}) + endif() + endforeach() +endmacro() + +#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(CODE "/** THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT **/") + +include(CheckTypeSize) + +function(CheckSizeof type CODE_VAR) +string(REPLACE " " "_" name ${type}) +string(REPLACE "*" "P" name ${name}) +string(TOUPPER "SIZEOF_${name}" name) +CHECK_TYPE_SIZE(${type} ${name}) +set(${name} ${${name}} PARENT_SCOPE) +set(${CODE_VAR} "${${CODE_VAR}}\n${${name}_CODE}" PARENT_SCOPE) +endfunction() + +function(AddConfigHDefine name value CODE_VAR) +set(${CODE_VAR} "${${CODE_VAR}}\n#define ${name} ${value}" PARENT_SCOPE) +endfunction() + +function(AddConfigHVar name CODE_VAR) +if(${name}) + set(${CODE_VAR} "${${CODE_VAR}}\n#define ${name} ${${name}}" PARENT_SCOPE) +else() + set(${CODE_VAR} "${${CODE_VAR}}\n#undef ${name}" PARENT_SCOPE) +endif() +endfunction() + +function(AddConfigHVarB name CODE_VAR) +if(${name}) +set(${CODE_VAR} "${${CODE_VAR}}\n#define ${name} 1" PARENT_SCOPE) +else() +set(${CODE_VAR} "${${CODE_VAR}}\n#undef ${name}" PARENT_SCOPE) +endif() +endfunction() + + +set(TYPES +"int" +"unsigned int" +"long" +"unsigned long" +"long long" +"unsigned long long" +"size_t" +"ptrdiff_t" +"float" +"double" +"void *") +foreach(t ${TYPES}) +CheckSizeof(${t} CODE) +endforeach() + +get_target_property(VER fftw3${PREC_SUFFIX} VERSION) + +if(MSVC) +set(CMAKE_C_FLAGS "/GL") +set(LINK_FLAGS "/LTCG /OPT:REF /OPT:ICF") +set(CMAKE_SHARED_LINKER_FLAGS ${LINK_FLAGS}) +set(CMAKE_EXE_LINKER_FLAGS ${LINK_FLAGS}) +message(STATUS MSVC) +else() +set(CMAKE_C_FLAGS "-std=gnu99 -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -ffast-math") +endif() + +addConfigHDefine("PACKAGE" "\"fftw\"" CODE) +addConfigHDefine("PACKAGE_VERSION" "\"${VER}\"" CODE) +addConfigHDefine("VERSION" "\"${VER}\"" CODE) +addConfigHDefine("FFTW_CC" "\"${CMAKE_C_FLAGS}\"" CODE) + +set(HeadersToCheck malloc.h sys/types.h stdlib.h strings.h string.h stdint.h +stddef.h sys/time.h unistd.h sys/stat.h sys/sysctl.h sys/time.h sys/types.h alloca.h c_asm.h +dlfcn.h inttypes.h intrinsics.h libintl.h limits.h mach/mach_time.h memory.h) + +foreach(f ${HeadersToCheck}) +string(TOUPPER ${f} name) +string(REPLACE "/" "_" name ${name}) +string(REPLACE "." "_" name ${name}) +check_include_file(${f} HAVE_${name}) +addConfigHVarB(HAVE_${name} CODE) +endforeach() + +########### DETECT FMA ############### +set(DEFAULT_FMA "powerpc" "ia64" "hppa" "mips64") +string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} PROC) +list(FIND DEFAULT_FMA ${PROC} ENABLE_FMA_DEFUALT) +if(ENABLE_FMA_DEFUALT EQUAL -1) +option(HAVE_FMA "Enable optimizations for machines with fused multiply-add" OFF) +else() +option(HAVE_FMA "Enable optimizations for machines with fused multiply-add" ON) +endif() +addConfigHVarB(HAVE_FMA CODE) + +########## DEBUG ###################### +option(FFTW_DEBUG "Define to enable extra FFTW debugging code." OFF) +option(FFTW_DEBUG_MALLOC "Define to enable debugging malloc." OFF) +option(FFTW_DEBUG_ALIGNMENT "Define to enable alignment debugging hacks." OFF) + +if(FFTW_DEBUG) +set(FFTW_DEBUG_MALLOC ON) +endif() + +addConfigHVarB(FFTW_DEBUG CODE) +addConfigHVarB(FFTW_DEBUG_MALLOC CODE) +addConfigHVarB(FFTW_DEBUG_ALIGNMENT CODE) + +option(FFTW_RANDOM_ESTIMATOR "Define to enable pseudorandom estimate planning for debugging." OFF) +if(FFTW_RANDOM_ESTIMATOR) +set(CHECK_PL_OPTS "--estimate") +endif() +addConfigHVarB(FFTW_RANDOM_ESTIMATOR CODE) + +option(FFTW_ENABLE_ALLOCA "Define to enable the use of alloca()." ON) +addConfigHVarB(FFTW_ENABLE_ALLOCA CODE) + +## Precision Detection +option(FFTW_SINGLE "compile fftw in single precision" OFF) + +if(FFTW_SINGLE) + set(PRECISION "s") + set(BENCHFFT_SINGLE ON) +endif() + +option(FFTW_LDOUBLE "compile fftw in long-double precision" OFF) +if(FFTW_LDOUBLE) + if(FFTW_SINGLE) + message(FATAL_ERROR "Single and long double precisions conflict") + endif() + set(PRECISION "l") + set(BENCHFFT_LDOUBLE ON) +endif() + +option(FFTW_QUAD "compile fftw in quad precision" OFF) +if(FFTW_QUAD) + if(FFTW_SINGLE OR FFTW_LDOUBLE) + message(FATAL_ERROR "Conflicting Precision Options") + endif() + set(PRECISION "q") + set(BENCHFFT_QUAD ON) +endif() + +set(PREC_PREFIX ${PRECISION}) +if(NOT DEFINED PRECISION) + set(PRECISION "d") +endif() + +AddConfigHVarB(FFTW_SINGLE CODE) +AddConfigHVarB(FFTW_LDOUBLE CODE) +AddConfigHVarB(FFTW_QUAD CODE) + +AddConfigHVar(PRECISION CODE) +AddConfigHVar(PREC_PREFIX CODE) +AddConfigHVarB(BENCHFFT_SINGLE CODE) +AddConfigHVarB(BENCHFFT_LDOUBLE CODE) +AddConfigHVarB(BENCHFFT_QUAD CODE) + +## +option(ENABLE_SSE "enable SSE optimizations" OFF) +if(ENABLE_SSE AND FFTW_SINGLE) + message(FATAL_ERROR "SSE requires single precision") +endif() + +option(HAVE_SSE2 "enable SSE/SSE2 optimizations" ${ENABLE_SSE}) +if(HAVE_SSE2 AND (FFTW_LDOUBLE OR FFTW_QUAD)) + message(FATAL_ERROR "SSE2 requires single or double precision") +endif() + +option(HAVE_AVX "enable AVX optimizations" OFF) +if(HAVE_AVE AND (FFTW_LDOUBLE OR FFTW_QUAD)) + message(FATAL_ERROR "AVX requires single or double precision") +endif() + +option(HAVE_ALTIVEC "enable Altivec optimizations" OFF) +if(HAVE_AVE AND NOT FFTW_SINGLE) + message(FATAL_ERROR "Altivec requires single precision") +endif() + +option(HAVE_MIPS_PS "enable MIPS pair-single optimizations" OFF) +if(HAVE_MIPS_PS AND NOT FFTW_SINGLE) + message(FATAL_ERROR "MIPS paired-single requires single precision") +endif() + +option(WITH_OUR_MALLOC "use our aligned malloc (helpful for Win32)" OFF) +addConfigHVarB(WITH_OUR_MALLOC CODE) + +if(HAVE_SSE2) +include(CheckCXXSourceRuns) +if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX ) + set(SSE_FLAGS) + +if(NOT FFTW_SINGLE) + set(CMAKE_REQUIRED_FLAGS "-msse2") + check_cxx_source_runs(" + #include + + int main() + { + __m128d a, b; + double vals[2] = {0}; + a = _mm_loadu_pd(vals); + b = _mm_add_pd(a,a); + _mm_storeu_pd(vals,b); + return 0; + }" + HAS_SSE2_EXTENSIONS) +else() + set(CMAKE_REQUIRED_FLAGS "-msse") + check_cxx_source_runs(" + #include + int main() + { + __m128 a, b; + float vals[4] = {0}; + a = _mm_loadu_ps(vals); + b = a; + b = _mm_add_ps(a,b); + _mm_storeu_ps(vals,b); + return 0; + }" + HAS_SSE_EXTENSIONS) +endif() + set(CMAKE_REQUIRED_FLAGS) + + if(HAS_SSE2_EXTENSIONS) + message(STATUS "Using SSE2 extensions") + set(SSE_FLAGS "-msse2 -mfpmath=sse") + add_definitions("-DHAVE_SSE2") + elseif(HAS_SSE_EXTENSIONS) + message(STATUS "Using SSE extensions") + set(SSE_FLAGS "-msse -mfpmath=sse") + else() + message(FATAL_ERROR "SSE2 selected, but not supported by processor") + endif() + + add_definitions(${SSE_FLAGS}) +message(STATUS ${CMAKE_C_FLAGS}) + set(SSE2_CFLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}") +message(SATUS "${SSE2_CFLAGS}") +elseif(MSVC) + check_cxx_source_runs(" + #include + + int main() + { + __m128d a, b; + double vals[2] = {0}; + a = _mm_loadu_pd(vals); + b = _mm_add_pd(a,a); + _mm_storeu_pd(vals,b); + return 0; + }" + HAS_SSE2_EXTENSIONS) + if( HAS_SSE2_EXTENSIONS ) + message(STATUS "Using SSE2 extensions") + add_definitions( "/arch:SSE2 /fp:fast -D__SSE__ -D__SSE2__" ) + else() + message(FATAL_ERROR "SSE2 selected, but not supported by processor") + endif() +endif() +endif(HAVE_SSE2) + +addConfigHVarB(HAVE_SSE2 CODE) +addConfigHVarB(HAVE_AVX CODE) +addConfigHVarB(HAVE_ALTIVEC CODE) +addConfigHVarB(HAVE_MIPS_PS CODE) + +######## THREADS ###### +option(HAVE_OPENMP "use OpenMP directives for parallelism" OFF) +option(HAVE_THREADS "compile FFTW SMP threads library" OFF) +option(WITH_COMBINED_THREADS "combine threads into main libfftw3" OFF) + +if(WITH_COMBINED_THREAD AND (HAVE_OPENMP OR NOT HAVE_THREADS)) + message(FATAL_ERROR "WITH_COMBINED_THREAD requires HAVE_THREADS and not HAVE_OPENMP") +endif() + +addConfigHVarB(HAVE_OPENMP CODE) +addConfigHVarB(HAVE_THREADS CODE) + +if(HAVE_THREADS) + set(CAMKE_THREAD_PREFER_PTHREADS 1) + include(FindThreads) + if(CMAKE_THREAD_LIBS_INIT) + set(THREADLIBS ${CMAKE_THREAD_LIBS_INIT}) + if(CMAKE_USE_PTHREADS_INIT) + set(USE_POSIX_THREADS 1) + endif() + else() + message(FATAL_ERROR "could not find thread library") + endif(CMAKE_THREAD_LIBS_INIT) +elseif(HAVE_OPENMP) + include(FindOpenMP) + if(OPENMP_FOUND) + set(OPENMP_CFLAGS ${OpenMP_C_FLAGS}) + else() + message(FATAL_ERROR "don't know how to enable OpenMP") + endif(OPENMP_FOUND) +endif(HAVE_THREADS) + +addConfigHVarB(USE_POSIX_THREADS CODE) + +macro(conditionalSet var codition) +if(${condition}) +set(${var} 1) +endif() +addConfigHVarB("${var}" CODE) +endmacro() + +conditionalSet(OPENMP HAVE_OPENMP) +conditionalSet(THREADS HAVE_THREADS) +conditionalSet(SMP "HAVE_OPENMP OR HAVE_THREADS") +conditionalSet(COMBINED_THREADS HAVE_COMBINED_THREADS) + +################# + +set(FunctionsToCheck alloca abort BSDgettimeofday gettimeofday gethrtime read_real_time time_base_to_time drand48 sqrt memset posix_memalign memalign _mm_malloc _mm_free clock_gettime mach_absolute_time sysctl abort sinl cosl snprintf) +foreach(f ${FunctionsToCheck}) +string(TOUPPER ${f} name) +CHECK_FUNCTION_EXISTS(${f} HAVE_${name}) +addConfigHVarB(HAVE_${name} CODE) +endforeach() + +include(../Tests.cmake) +message(STATUS "Running test") +COMPILE_TEST(TIME_WITH_SYS_TIME) +addConfigHVarB(TIME_WITH_SYS_TIME CODE) + +## MSVC inline fix ## +if(MSVC) +set(CODE "${CODE}\n#ifndef __cplusplus\n#define inline __inline\n#endif") +endif(MSVC) + +set(FFTW_DLL 1) +addConfigHVarB(FFTW_DLL CODE) + +IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/config.h) +file(READ ${CMAKE_CURRENT_BINARY_DIR}/config.h OLDCODE) +ENDIF() +if(NOT CODE STREQUAL OLDCODE) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.h "${CODE}") +endif() + +add_definitions("-DHAVE_CONFIG_H") + +add_subdirectory(kernel) +add_subdirectory(simd-support) +add_subdirectory(dft) +add_subdirectory(rdft) +add_subdirectory(reodft) +add_subdirectory(api) +add_subdirectory(threads) +add_subdirectory(libbench2) +add_subdirectory(mpi) + +message(STATUS ${FFTW_kernel_objects}) +message(STATUS ${TEST}) + +message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(GENFFT)") + +########### next target ############### + + +set(SIMD_LIBS simd_support simd_sse2_nonportable) + +if(HAVE_SSE2) +set(SSE2_LIBS dft_sse2_codelets rdft_sse2_codelets) +endif(HAVE_SSE2) + +if(HAVE_AVX) +set(AVX_LIBS dft_avx_codelets rdft_avx_codelets) +endif(HAVE_AVX) + +if(HAVE_ALTIVEC) +set(ALTIVEC_LIBS dft_altivec_codelets rdft_altivec_codelets) +endif(HAVE_ALTIVEC) + + +if(HAVE_THREADS) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PTHREAD_CFLAGS}") +if(NOT COMBINED_THREADS) +set(FFTWTHREADLIBS fftw3${PREC_SUFFIX}_threads) +endif() +elseif(HAVE_OPENMP) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENMP_CFLAGS}") +set(FFTWTHREADLIBS fftw3${PREC_SUFFIX}_omp) +endif() + +findObjects(FFTW${PREC_PREFIX}_SOURCES reodft kernel dft_scalar_codelets dft_scalar dft rdft_scalar_r2cf rdft_scalar_r2cb rdft_scalar_r2r rdft_scalar rdft api ${SSE2_LIBS} ${AVX_LIBS} ${ALTIVEC_LIBS} ${SIMD_LIBS} ${FFTWTHREADLIBS}) +include_directories("${TOP_SRCDIR}/api" "${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/dft/scalar" "${TOP_SRCDIR}/dft/simd" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/rdft/scalar" "${TOP_SRCDIR}/rdft/simd" "${TOP_SRCDIR}/reodft" "${TOP_SRCDIR}/simd-support") +add_library(fftw3${PREC_SUFFIX} SHARED ${FFTW${PREC_PREFIX}_SOURCES}) + +set_target_properties(fftw3${PREC_SUFFIX} PROPERTIES VERSION 3.3.0) +install(TARGETS fftw3${PREC_SUFFIX} DESTINATION lib) + +#add_subdirectory(tools) +#add_subdirectory(tests) + +########### install files ############### + +configure_file(${TOP_SRCDIR}/fftw.pc.in ${CMAKE_CURRENT_BINARY_DIR}/fftw3${PREC_SUFFIX}.pc) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fftw3${PREC_SUFFIX}.pc DESTINATION lib/pkgconfig) + +## Type Sizes ## +include(CheckTypeSize) + +#original Makefile.am contents follow: + +#OPTIONS_AUTOMAKE=gnu +#lib_LTLIBRARIES = libfftw3@PREC_SUFFIX@.la +# +## pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@ +## nodist_pkginclude_HEADERS = config.h +# +## recompile genfft if maintainer mode is true +#if MAINTAINER_MODE +#GENFFT = genfft +#else +#GENFFT = +#endif +# +#ACLOCAL_AMFLAGS=-I m4 +# +#SUBDIRS=support $(GENFFT) kernel simd-support dft rdft reodft api \ +#threads libbench2 . tests mpi doc tools m4 +#EXTRA_DIST=COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in +# +#SIMD_LIBS = \ +# simd-support/libsimd_support.la \ +# simd-support/libsimd_sse2_nonportable.la +# +#if HAVE_SSE2 +#SSE2_LIBS = dft/simd/sse2/libdft_sse2_codelets.la \ +#rdft/simd/sse2/librdft_sse2_codelets.la +#endif +# +#if HAVE_AVX +#AVX_LIBS = dft/simd/avx/libdft_avx_codelets.la \ +#rdft/simd/avx/librdft_avx_codelets.la +#endif +# +#if HAVE_ALTIVEC +#ALTIVEC_LIBS = dft/simd/altivec/libdft_altivec_codelets.la \ +#rdft/simd/altivec/librdft_altivec_codelets.la +#endif +# +#if THREADS +#if COMBINED_THREADS +#COMBINED_THREADLIBS=threads/libfftw3@PREC_SUFFIX@_threads.la +#endif +#endif +# +#libfftw3@PREC_SUFFIX@_la_SOURCES = +# +#libfftw3@PREC_SUFFIX@_la_LIBADD = \ +# kernel/libkernel.la \ +# dft/libdft.la \ +# dft/scalar/libdft_scalar.la \ +# dft/scalar/codelets/libdft_scalar_codelets.la \ +# rdft/librdft.la \ +# rdft/scalar/librdft_scalar.la \ +# rdft/scalar/r2cf/librdft_scalar_r2cf.la \ +# rdft/scalar/r2cb/librdft_scalar_r2cb.la \ +# rdft/scalar/r2r/librdft_scalar_r2r.la \ +# reodft/libreodft.la \ +# api/libapi.la \ +# $(SIMD_LIBS) $(SSE2_LIBS) $(AVX_LIBS) $(ALTIVEC_LIBS) \ +# $(COMBINED_THREADLIBS) +# +#if QUAD +## cannot use -no-undefined since dependent on libquadmath +#libfftw3@PREC_SUFFIX@_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ +#else +#libfftw3@PREC_SUFFIX@_la_LDFLAGS = -no-undefined -version-info \ +#@SHARED_VERSION_INFO@ +#endif +# +#fftw3@PREC_SUFFIX@.pc: fftw.pc +# cp -f fftw.pc fftw3@PREC_SUFFIX@.pc +#pkgconfigdir = $(libdir)/pkgconfig +#pkgconfig_DATA = fftw3@PREC_SUFFIX@.pc +# +#WISDOM_DIR = /etc/fftw +#WISDOM = wisdom@PREC_SUFFIX@ +# +#WISDOM_TIME=12 # default to 12-hour limit, i.e. overnight +#WISDOM_FLAGS=--verbose --canonical --time-limit=$(WISDOM_TIME) +# +#wisdom: +# tools/fftw@PREC_SUFFIX@-wisdom -o $@ $(WISDOM_FLAGS) +# +#install-wisdom: wisdom +# $(mkinstalldirs) $(WISDOM_DIR) +# $(INSTALL_DATA) wisdom $(WISDOM_DIR)/$(WISDOM) diff --git a/external/cmake/fftw-3.3/api/CMakeLists.txt b/external/cmake/fftw-3.3/api/CMakeLists.txt new file mode 100644 index 0000000000000..18e0d2838ea3a --- /dev/null +++ b/external/cmake/fftw-3.3/api/CMakeLists.txt @@ -0,0 +1,101 @@ +########### next target ############### + +set(api_STAT_SRCS + apiplan.c + configure.c + execute-dft-c2r.c + execute-dft-r2c.c + execute-dft.c + execute-r2r.c + execute-split-dft-c2r.c + execute-split-dft-r2c.c + execute-split-dft.c + execute.c + export-wisdom-to-file.c + export-wisdom-to-string.c + export-wisdom.c + f77api.c + flops.c + forget-wisdom.c + import-system-wisdom.c + import-wisdom-from-file.c + import-wisdom-from-string.c + import-wisdom.c + malloc.c + map-r2r-kind.c + mapflags.c + mkprinter-file.c + mktensor-iodims.c + mktensor-rowmajor.c + plan-dft-1d.c + plan-dft-2d.c + plan-dft-3d.c + plan-dft-c2r-1d.c + plan-dft-c2r-2d.c + plan-dft-c2r-3d.c + plan-dft-c2r.c + plan-dft-r2c-1d.c + plan-dft-r2c-2d.c + plan-dft-r2c-3d.c + plan-dft-r2c.c + plan-dft.c + plan-guru-dft-c2r.c + plan-guru-dft-r2c.c + plan-guru-dft.c + plan-guru-r2r.c + plan-guru-split-dft-c2r.c + plan-guru-split-dft-r2c.c + plan-guru-split-dft.c + plan-many-dft-c2r.c + plan-many-dft-r2c.c + plan-many-dft.c + plan-many-r2r.c + plan-r2r-1d.c + plan-r2r-2d.c + plan-r2r-3d.c + plan-r2r.c + print-plan.c + rdft2-pad.c + the-planner.c + version.c + api.h + f77funcs.h + fftw3.h + x77.h + guru.h + guru64.h + mktensor-iodims.h + plan-guru-dft-c2r.h + plan-guru-dft-r2c.h + plan-guru-dft.h + plan-guru-r2r.h + plan-guru-split-dft-c2r.h + plan-guru-split-dft-r2c.h + plan-guru-split-dft.h + plan-guru64-dft-c2r.c + plan-guru64-dft-r2c.c + plan-guru64-dft.c + plan-guru64-r2r.c + plan-guru64-split-dft-c2r.c + plan-guru64-split-dft-r2c.c + plan-guru64-split-dft.c + mktensor-iodims64.c) + +addObjects(api ${api_STAT_SRCS}) + + +########### install files ############### + +install(FILES ${TOP_SRCDIR}/api/fftw3.h ${TOP_SRCDIR}/api/fftw3.f DESTINATION include) +configure_file(${TOP_SRCDIR}/api/fftw3.f03.in ${CMAKE_CURRENT_BINARY_DIR}/fftw3.f03) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fftw3.f03 DESTINATION lib/pkgconfig) + +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/reodft") + +IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/fftw.f03) +## Manually Configre to prepend ## + file(READ ${TOP_SRCDIR}/api/fftw3.f03.in contents) + set(contents "! Generated automatically. DO NOT EDIT!\n\n integer, parameter :: C_FFTW_R2R_KIND = @C_FFTW_R2R_KIND@\n${contents}") + string(CONFIGURE "${contents}" contents) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/fftw.f03 "${contents}") +ENDIF() diff --git a/external/cmake/fftw-3.3/dft/CMakeLists.txt b/external/cmake/fftw-3.3/dft/CMakeLists.txt new file mode 100644 index 0000000000000..a36f2f2831f74 --- /dev/null +++ b/external/cmake/fftw-3.3/dft/CMakeLists.txt @@ -0,0 +1,62 @@ +add_subdirectory(scalar) +add_subdirectory(simd) + + +########### next target ############### + +set(dft_STAT_SRCS + bluestein.c + buffered.c + conf.c + ct.c + dftw-direct.c + dftw-directsq.c + dftw-generic.c + dftw-genericbuf.c + direct.c + generic.c + indirect.c + indirect-transpose.c + kdft-dif.c + kdft-difsq.c + kdft-dit.c + kdft.c + nop.c + plan.c + problem.c + rader.c + rank-geq2.c + solve.c + vrank-geq1.c + zero.c + codelet-dft.h + ct.h + dft.h) + +include_directories("${TOP_SRCDIR}/kernel") +addObjects(dft ${dft_STAT_SRCS}) +#target_link_libraries(dft dft_scalar_codelets dft_scalar) +#IF(HAVE_SSE2) +#target_link_libraries(dft dft_sse2_codelets) +#ENDIF(HAVE_SSE2) + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel +#SUBDIRS = scalar simd +# +#noinst_LTLIBRARIES = libdft.la +# +## pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@ +## pkginclude_HEADERS = codelet-dft.h dft.h +# +#libdft_la_SOURCES = bluestein.c buffered.c conf.c ct.c dftw-direct.c \ +#dftw-directsq.c dftw-generic.c dftw-genericbuf.c direct.c generic.c \ +#indirect.c indirect-transpose.c kdft-dif.c kdft-difsq.c kdft-dit.c \ +#kdft.c nop.c plan.c problem.c rader.c rank-geq2.c solve.c vrank-geq1.c \ +#zero.c codelet-dft.h ct.h dft.h diff --git a/external/cmake/fftw-3.3/dft/scalar/CMakeLists.txt b/external/cmake/fftw-3.3/dft/scalar/CMakeLists.txt new file mode 100644 index 0000000000000..b79dd569d2ff9 --- /dev/null +++ b/external/cmake/fftw-3.3/dft/scalar/CMakeLists.txt @@ -0,0 +1,19 @@ +add_subdirectory(codelets) + +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft") + +########### next target ############### + +set(dft_scalar_STAT_SRCS + n.c + t.c + f.h + n.h + q.h + t.h) + +addObjects(dft_scalar ${dft_scalar_STAT_SRCS}) +#target_link_libraries(dft_scalar dft dft_scalar_codelets) + + +########### install files ############### diff --git a/external/cmake/fftw-3.3/dft/scalar/codelets/CMakeLists.txt b/external/cmake/fftw-3.3/dft/scalar/codelets/CMakeLists.txt new file mode 100644 index 0000000000000..733c7160d14f6 --- /dev/null +++ b/external/cmake/fftw-3.3/dft/scalar/codelets/CMakeLists.txt @@ -0,0 +1,206 @@ +########### next target ############### + +set(dft_scalar_codelets_STAT_SRCS $(BUILT_SOURCES)) + +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/dft/scalar") + +set(N1 +n1_2.c +n1_3.c +n1_4.c +n1_5.c +n1_6.c +n1_7.c +n1_8.c +n1_9.c +n1_10.c +n1_11.c +n1_12.c +n1_13.c +n1_14.c +n1_15.c +n1_16.c +n1_32.c +n1_64.c +n1_20.c +n1_25.c +#n1_30.c +#n1_40.c +#n1_50.c +) + +set(T1 +t1_2.c +t1_3.c +t1_4.c +t1_5.c +t1_6.c +t1_7.c +t1_8.c +t1_9.c +t1_10.c +t1_12.c +t1_15.c +t1_16.c +t1_32.c +t1_64.c +t1_20.c +t1_25.c +#t1_30.c +#t1_40.c +#t1_50.c +) + +set(T2 +t2_4.c +t2_8.c +t2_16.c +t2_32.c +t2_64.c +t2_5.c +t2_10.c +t2_20.c +t2_25.c) + +set(F1 +#f1_2.c +#f1_3.c +#f1_4.c +#f1_5.c +#f1_6.c +#f1_7.c +#f1_8.c +#f1_9.c +#f1_10.c +#f1_12.c +#f1_15.c +#f1_16.c +#f1_32.c +#f1_64.c +) + +set(F2 +#f2_4.c +#f2_8.c +#f2_16.c +#f2_32.c +#f2_64.c +) +set(Q1 +q1_2.c +q1_4.c +q1_8.c +q1_3.c +q1_5.c +q1_6.c) + +list(APPEND codelets ${N1} ${T1} ${T2} ${F1} ${F2} ${Q1}) + +addObjects(dft_scalar_codelets codlist.c ${codelets}) +#target_link_libraries(dft_scalar_codelets dft_scalar dft) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## This Makefile.am specifies a set of codelets, efficient transforms +## of small sizes, that are used as building blocks (kernels) by FFTW +## to build up large transforms, as well as the options for generating +## and compiling them. +# +## You can customize FFTW for special needs, e.g. to handle certain +## sizes more efficiently, by adding new codelets to the lists of those +## included by default. If you change the list of codelets, any new +## ones you added will be automatically generated when you run the +## bootstrap script (see "Generating your own code" in the FFTW +## manual). +# +############################################################################ +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/dft \ +#-I$(top_srcdir)/dft/scalar +#noinst_LTLIBRARIES = libdft_scalar_codelets.la +# +############################################################################ +## n1_ is a hard-coded FFT of size (base cases of FFT recursion) +#N1 = n1_2.c n1_3.c n1_4.c n1_5.c n1_6.c n1_7.c n1_8.c n1_9.c n1_10.c \ +#n1_11.c n1_12.c n1_13.c n1_14.c n1_15.c n1_16.c n1_32.c n1_64.c \ +#n1_20.c n1_25.c # n1_30.c n1_40.c n1_50.c +# +############################################################################ +## t1_ is a "twiddle" FFT of size , implementing a radix-r DIT step +#T1 = t1_2.c t1_3.c t1_4.c t1_5.c t1_6.c t1_7.c t1_8.c t1_9.c \ +#t1_10.c t1_12.c t1_15.c t1_16.c t1_32.c t1_64.c \ +#t1_20.c t1_25.c # t1_30.c t1_40.c t1_50.c +# +## t2_ is also a twiddle FFT, but instead of using a complete lookup table +## of trig. functions, it partially generates the trig. values on the fly +## (this is faster for large sizes). +#T2 = t2_4.c t2_8.c t2_16.c t2_32.c t2_64.c \ +# t2_5.c t2_10.c t2_20.c t2_25.c +# +############################################################################ +## The F (DIF) codelets are used for a kind of in-place transform algorithm, +## but the planner seems to never (or hardly ever) use them on the machines +## we have access to, preferring the Q codelets and the use of buffers +## for sub-transforms. So, we comment them out, at least for now. +# +## f1_ is a "twiddle" FFT of size , implementing a radix-r DIF step +#F1 = # f1_2.c f1_3.c f1_4.c f1_5.c f1_6.c f1_7.c f1_8.c f1_9.c f1_10.c f1_12.c f1_15.c f1_16.c f1_32.c f1_64.c +# +## like f1, but partially generates its trig. table on the fly +#F2 = # f2_4.c f2_8.c f2_16.c f2_32.c f2_64.c +# +############################################################################ +## q1_ is twiddle FFTs of size (DIF step), where the output is +## transposed. This is used for in-place transposes in sizes that are +## divisible by ^2. These codelets have size ~ ^2, so you should +## probably not use bigger than 8 or so. +#Q1 = q1_2.c q1_4.c q1_8.c q1_3.c q1_5.c q1_6.c +# +############################################################################ +#ALL_CODELETS = $(N1) $(T1) $(T2) $(F1) $(F2) $(Q1) +#BUILT_SOURCES= $(ALL_CODELETS) $(CODLIST) +# +#libdft_scalar_codelets_la_SOURCES = $(BUILT_SOURCES) +# +#SOLVTAB_NAME = X(solvtab_dft_standard) +#XRENAME=X +# +## special rules for regenerating codelets. +#include $(top_srcdir)/support/Makefile.codelets +# +#if MAINTAINER_MODE +#FLAGS_N1=$(DFT_FLAGS_COMMON) +#FLAGS_T1=$(DFT_FLAGS_COMMON) +#FLAGS_T2=$(DFT_FLAGS_COMMON) -twiddle-log3 -precompute-twiddles +#FLAGS_F1=$(DFT_FLAGS_COMMON) +#FLAGS_F2=$(DFT_FLAGS_COMMON) -twiddle-log3 -precompute-twiddles +#FLAGS_Q1=$(DFT_FLAGS_COMMON) -reload-twiddle +#FLAGS_Q2=$(DFT_FLAGS_COMMON) -twiddle-log3 -precompute-twiddles +# +#n1_%.c: $(CODELET_DEPS) $(GEN_NOTW) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW) $(FLAGS_N1) -n $* -name n1_$* -include "n.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t1_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(FLAGS_T1) -n $* -name t1_$* -include "t.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t2_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(FLAGS_T2) -n $* -name t2_$* -include "t.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#f1_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(FLAGS_F1) -dif -n $* -name f1_$* -include "f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#f2_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(FLAGS_F2) -dif -n $* -name f2_$* -include "f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#q1_%.c: $(CODELET_DEPS) $(GEN_TWIDSQ) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDSQ) $(FLAGS_Q1) -dif -n $* -name q1_$* -include "q.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#q2_%.c: $(CODELET_DEPS) $(GEN_TWIDSQ) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDSQ) $(FLAGS_Q2) -dif -n $* -name q2_$* -include "q.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#endif # MAINTAINER_MODE diff --git a/external/cmake/fftw-3.3/dft/simd/CMakeLists.txt b/external/cmake/fftw-3.3/dft/simd/CMakeLists.txt new file mode 100644 index 0000000000000..ed6662af7b1a3 --- /dev/null +++ b/external/cmake/fftw-3.3/dft/simd/CMakeLists.txt @@ -0,0 +1,279 @@ +function(configureSourceFiles codeletsVariable header binDir srcDir srcVar) +foreach(f ${${codeletsVariable}}) + file(WRITE ${binDir}/${f} "/* Generated automatically. DO NOT EDIT! */\n #define SIMD_HEADER \"${header}\" \n#include \"${srcDir}/../common/${f}.c\"") + list(APPEND srcVar_TMP ${f}) +endforeach() +set(${srcVar} "${srcVar_TMP}" PARENT_SCOPE) +endfunction() + +########### SIMD SOURCE ############### +# This file contains a standard list of DFT SIMD codelets. It is +# included by common/Makefile to generate the C files with the actual +# codelets in them. It is included by {sse,sse2,...}/Makefile to +# generate and compile stub files that include common/*.c + +# You can customize FFTW for special needs, e.g. to handle certain +# sizes more efficiently, by adding new codelets to the lists of those +# included by default. If you change the list of codelets, any new +# ones you added will be automatically generated when you run the +# bootstrap script (see "Generating your own code" in the FFTW +# manual). + +########################################################################### +# n1fv_ is a hard-coded FFTW_FORWARD FFT of size , using SIMD +set(N1F +n1fv_2.c +n1fv_3.c +n1fv_4.c +n1fv_5.c +n1fv_6.c +n1fv_7.c +n1fv_8.c +n1fv_9.c +n1fv_10.c +n1fv_11.c +n1fv_12.c +n1fv_13.c +n1fv_14.c +n1fv_15.c +n1fv_16.c +n1fv_32.c +n1fv_64.c +n1fv_128.c +n1fv_20.c +n1fv_25.c) + +# as above, with restricted input vector stride +set(N2F +n2fv_2.c +n2fv_4.c +n2fv_6.c +n2fv_8.c +n2fv_10.c +n2fv_12.c +n2fv_14.c +n2fv_16.c +n2fv_32.c +n2fv_64.c +n2fv_20.c) + +# as above, but FFTW_BACKWARD +set(N1B +n1bv_2.c +n1bv_3.c +n1bv_4.c +n1bv_5.c +n1bv_6.c +n1bv_7.c +n1bv_8.c +n1bv_9.c +n1bv_10.c +n1bv_11.c +n1bv_12.c +n1bv_13.c +n1bv_14.c +n1bv_15.c +n1bv_16.c +n1bv_32.c +n1bv_64.c +n1bv_128.c +n1bv_20.c +n1bv_25.c) + +set(N2B +n2bv_2.c +n2bv_4.c +n2bv_6.c +n2bv_8.c +n2bv_10.c +n2bv_12.c +n2bv_14.c +n2bv_16.c +n2bv_32.c +n2bv_64.c +n2bv_20.c) + +# split-complex codelets +set(N2S +n2sv_4.c +n2sv_8.c +n2sv_16.c +n2sv_32.c +n2sv_64.c) + +########################################################################### +# t1fv_ is a "twiddle" FFT of size , implementing a radix-r DIT step +# for an FFTW_FORWARD transform, using SIMD +set(T1F +t1fv_2.c +t1fv_3.c +t1fv_4.c +t1fv_5.c +t1fv_6.c +t1fv_7.c +t1fv_8.c +t1fv_9.c +t1fv_10.c +t1fv_12.c +t1fv_15.c +t1fv_16.c +t1fv_32.c +t1fv_64.c +t1fv_20.c +t1fv_25.c) + +# same as t1fv_*, but with different twiddle storage scheme +set(T2F +t2fv_2.c +t2fv_4.c +t2fv_8.c +t2fv_16.c +t2fv_32.c +t2fv_64.c +t2fv_5.c +t2fv_10.c +t2fv_20.c +t2fv_25.c) + +set(T3F +t3fv_4.c +t3fv_8.c +t3fv_16.c +t3fv_32.c +t3fv_5.c +t3fv_10.c +t3fv_20.c +t3fv_25.c) + +set(T1FU +t1fuv_2.c +t1fuv_3.c +t1fuv_4.c +t1fuv_5.c +t1fuv_6.c +t1fuv_7.c +t1fuv_8.c +t1fuv_9.c +t1fuv_10.c) + +# as above, but FFTW_BACKWARD +set(T1B +t1bv_2.c +t1bv_3.c +t1bv_4.c +t1bv_5.c +t1bv_6.c +t1bv_7.c +t1bv_8.c +t1bv_9.c +t1bv_10.c +t1bv_12.c +t1bv_15.c +t1bv_16.c +t1bv_32.c +t1bv_64.c +t1bv_20.c +t1bv_25.c) + +# same as t1bv_*, but with different twiddle storage scheme +set(T2B +t2bv_2.c +t2bv_4.c +t2bv_8.c +t2bv_16.c +t2bv_32.c +t2bv_64.c +t2bv_5.c +t2bv_10.c +t2bv_20.c +t2bv_25.c) + +set(T3B t3bv_4.c +t3bv_8.c +t3bv_16.c +t3bv_32.c +t3bv_5.c +t3bv_10.c +t3bv_20.c +t3bv_25.c) + +set(T1BU +t1buv_2.c +t1buv_3.c +t1buv_4.c +t1buv_5.c +t1buv_6.c +t1buv_7.c +t1buv_8.c +t1buv_9.c +t1buv_10.c) + +# split-complex codelets +set(T1S +t1sv_2.c +t1sv_4.c +t1sv_8.c +t1sv_16.c +t1sv_32.c) +set(T2S +t2sv_4.c +t2sv_8.c +t2sv_16.c +t2sv_32.c) + +########################################################################### +# q1fv_ is twiddle FFTW_FORWARD FFTs of size (DIF step), +# where the output is transposed, using SIMD. This is used for +# in-place transposes in sizes that are divisible by ^2. These +# codelets have size ~ ^2, so you should probably not use +# bigger than 8 or so. +set(Q1F +q1fv_2.c +q1fv_4.c +q1fv_5.c +q1fv_8.c) + +# as above, but FFTW_BACKWARD +set(Q1B +q1bv_2.c +q1bv_4.c +q1bv_5.c +q1bv_8.c) + +########################################################################### +list(APPEND SIMD_CODELETS ${N1F} ${N1B} ${N2F} ${N2B} ${N2S} ${T1FU} ${T1F} ${T2F} ${T3F} ${T1BU} ${T1B} ${T2B} ${T3B} ${T1S} ${T2S} ${Q1F} ${Q1B}) +list(APPEND ALL_CODELETS ${SIMD_CODELETS} genus.c codlist.c) +include_directories("${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/simd-support" "${TOP_SRCDIR}/dft/simd" "${TOP_SRCDIR}/dft/common" "${TOP_SRCDIR}/kernel") +add_subdirectory(common) +add_subdirectory(sse2) +add_subdirectory(avx) +add_subdirectory(altivec) + + +########### install files ############### + +set(fftw-dft-simd_EXTRA_DIST n1b.h +n1f.h +n2b.h +n2f.h +n2s.h +q1b.h +q1f.h +t1b.h +t1bu.h +t1f.h +t1fu.h +t2b.h +t2f.h +t3b.h +t3f.h +ts.h +codlist.mk +simd.mk) + + +#original Makefile.am contents follow: + +#SUBDIRS = common sse2 avx altivec +#EXTRA_DIST = n1b.h n1f.h n2b.h n2f.h n2s.h q1b.h q1f.h t1b.h t1bu.h \ +#t1f.h t1fu.h t2b.h t2f.h t3b.h t3f.h ts.h codlist.mk simd.mk diff --git a/external/cmake/fftw-3.3/dft/simd/altivec/CMakeLists.txt b/external/cmake/fftw-3.3/dft/simd/altivec/CMakeLists.txt new file mode 100644 index 0000000000000..34450b9eeac47 --- /dev/null +++ b/external/cmake/fftw-3.3/dft/simd/altivec/CMakeLists.txt @@ -0,0 +1,9 @@ +########### next target ############### +if(HAVE_ALTIVEC) +configureSourceFiles(ALL_CODELETS "simd-altivec.h" "${CMAKE_CURRENT_BINARY_DIR}" "${TOP_SRCDIR}/dft/simd/altivec" SOURCES) + +set(CMAKE_C_FLAGS ${ALTIVEC_CFLAGS}) +addObjects(dft_altivec_codelets ${SOURCES}) +endif() + +########### install files ############### diff --git a/external/cmake/fftw-3.3/dft/simd/avx/CMakeLists.txt b/external/cmake/fftw-3.3/dft/simd/avx/CMakeLists.txt new file mode 100644 index 0000000000000..e9eb2273e4ff2 --- /dev/null +++ b/external/cmake/fftw-3.3/dft/simd/avx/CMakeLists.txt @@ -0,0 +1,9 @@ +########### next target ############### +if(HAVE_AVX) +configureSourceFiles(ALL_CODELETS "simd-avx.h" "${CMAKE_CURRENT_BINARY_DIR}" "${TOP_SRCDIR}/dft/simd/avx" SOURCES) + +#set(CMAKE_C_FLAGS ${AVX_CFLAGS}) +addObjects(dft_avx_codelets ${SOURCES}) +endif() + +########### install files ############### diff --git a/external/cmake/fftw-3.3/dft/simd/common/CMakeLists.txt b/external/cmake/fftw-3.3/dft/simd/common/CMakeLists.txt new file mode 100644 index 0000000000000..71515d4a6843d --- /dev/null +++ b/external/cmake/fftw-3.3/dft/simd/common/CMakeLists.txt @@ -0,0 +1,80 @@ +########### install files ############### + + + + +#original Makefile.am contents follow: + +## include the list of codelets +# +#include $(top_srcdir)/dft/simd/codlist.mk +# +#ALL_CODELETS = $(SIMD_CODELETS) +#BUILT_SOURCES= $(SIMD_CODELETS) $(CODLIST) +#EXTRA_DIST = $(BUILT_SOURCES) genus.c +#INCLUDE_SIMD_HEADER="\#include SIMD_HEADER" +#XRENAME=XSIMD +#SOLVTAB_NAME = XSIMD(solvtab_dft) +# +## include special rules for regenerating codelets. +#include $(top_srcdir)/support/Makefile.codelets +# +#if MAINTAINER_MODE +# +#GFLAGS = -simd $(FLAGS_COMMON) -pipeline-latency 8 +#FLAGS_T2S=-twiddle-log3 -precompute-twiddles +#FLAGS_T3=-twiddle-log3 -precompute-twiddles -no-generate-bytw +# +#n1fv_%.c: $(CODELET_DEPS) $(GEN_NOTW_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW_C) $(GFLAGS) -n $* -name n1fv_$* -include "n1f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#n2fv_%.c: $(CODELET_DEPS) $(GEN_NOTW_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW_C) $(GFLAGS) -n $* -name n2fv_$* -with-ostride 2 -include "n2f.h" -store-multiple 2) | $(ADD_DATE) | $(INDENT) >$@ +# +#n1bv_%.c: $(CODELET_DEPS) $(GEN_NOTW_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW_C) $(GFLAGS) -sign 1 -n $* -name n1bv_$* -include "n1b.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#n2bv_%.c: $(CODELET_DEPS) $(GEN_NOTW_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW_C) $(GFLAGS) -sign 1 -n $* -name n2bv_$* -with-ostride 2 -include "n2b.h" -store-multiple 2) | $(ADD_DATE) | $(INDENT) >$@ +# +#n2sv_%.c: $(CODELET_DEPS) $(GEN_NOTW) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_NOTW) $(GFLAGS) -n $* -name n2sv_$* -with-ostride 1 -include "n2s.h" -store-multiple 4) | $(ADD_DATE) | $(INDENT) >$@ +# +#t1fv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t1fv_$* -include "t1f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t1fuv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t1fuv_$* -include "t1fu.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t2fv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t2fv_$* -include "t2f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t3fv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) $(FLAGS_T3) -n $* -name t3fv_$* -include "t3f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t1bv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t1bv_$* -include "t1b.h" -sign 1) | $(ADD_DATE) | $(INDENT) >$@ +# +#t1buv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t1buv_$* -include "t1bu.h" -sign 1) | $(ADD_DATE) | $(INDENT) >$@ +# +#t2bv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) -n $* -name t2bv_$* -include "t2b.h" -sign 1) | $(ADD_DATE) | $(INDENT) >$@ +# +#t3bv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE_C) $(GFLAGS) $(FLAGS_T3) -n $* -name t3bv_$* -include "t3b.h" -sign 1) | $(ADD_DATE) | $(INDENT) >$@ +# +#t1sv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(GFLAGS) -n $* -name t1sv_$* -include "ts.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#t2sv_%.c: $(CODELET_DEPS) $(GEN_TWIDDLE) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDDLE) $(GFLAGS) $(FLAGS_T2S) -n $* -name t2sv_$* -include "ts.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#q1fv_%.c: $(CODELET_DEPS) $(GEN_TWIDSQ_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDSQ_C) $(GFLAGS) -n $* -dif -name q1fv_$* -include "q1f.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#q1bv_%.c: $(CODELET_DEPS) $(GEN_TWIDSQ_C) +# ($(PRELUDE_COMMANDS_DFT); $(TWOVERS) $(GEN_TWIDSQ_C) $(GFLAGS) -n $* -dif -name q1bv_$* -include "q1b.h" -sign 1) | $(ADD_DATE) | $(INDENT) >$@ +# +# +#endif # MAINTAINER_MODE diff --git a/external/cmake/fftw-3.3/dft/simd/sse2/CMakeLists.txt b/external/cmake/fftw-3.3/dft/simd/sse2/CMakeLists.txt new file mode 100644 index 0000000000000..6eb134c32e49c --- /dev/null +++ b/external/cmake/fftw-3.3/dft/simd/sse2/CMakeLists.txt @@ -0,0 +1,9 @@ +########### next target ############### +if(HAVE_SSE2) +configureSourceFiles(ALL_CODELETS "simd-sse2.h" "${CMAKE_CURRENT_BINARY_DIR}" "${TOP_SRCDIR}/dft/simd/sse2" SOURCES) + +set(CMAKE_C_FLAGS ${SSE2_CFLAGS}) +addObjects(dft_sse2_codelets ${SOURCES}) +endif() + +########### install files ############### diff --git a/external/cmake/fftw-3.3/kernel/CMakeLists.txt b/external/cmake/fftw-3.3/kernel/CMakeLists.txt new file mode 100644 index 0000000000000..b98efc890f4e1 --- /dev/null +++ b/external/cmake/fftw-3.3/kernel/CMakeLists.txt @@ -0,0 +1,74 @@ +########### next target ############### + +set(kernel_STAT_SRCS + align.c + alloc.c + assert.c + awake.c + buffered.c + cpy1d.c + cpy2d-pair.c + cpy2d.c + ct.c + debug.c + extract-reim.c + hash.c + iabs.c + kalloc.c + md5-1.c + md5.c + minmax.c + ops.c + pickdim.c + plan.c + planner.c + primes.c + print.c + problem.c + rader.c + scan.c + solver.c + solvtab.c + stride.c + tensor.c + tensor1.c + tensor2.c + tensor3.c + tensor4.c + tensor5.c + tensor7.c + tensor8.c + tensor9.c + tile2d.c + timer.c + transpose.c + trig.c + twiddle.c + cycle.h + ifftw.h) + +include_directories("${top_srcdir}/simd") +addObjects(kernel ${kernel_STAT_SRCS}) + + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/simd +#noinst_LTLIBRARIES = libkernel.la +# +## pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@ +## pkginclude_HEADERS = ifftw.h cycle.h +# +#libkernel_la_SOURCES = align.c alloc.c assert.c awake.c buffered.c \ +#cpy1d.c cpy2d-pair.c cpy2d.c ct.c debug.c extract-reim.c hash.c iabs.c \ +#kalloc.c md5-1.c md5.c minmax.c ops.c pickdim.c plan.c planner.c \ +#primes.c print.c problem.c rader.c scan.c solver.c solvtab.c stride.c \ +#tensor.c tensor1.c tensor2.c tensor3.c tensor4.c tensor5.c tensor7.c \ +#tensor8.c tensor9.c tile2d.c timer.c transpose.c trig.c twiddle.c \ +#cycle.h ifftw.h diff --git a/external/cmake/fftw-3.3/libbench2/CMakeLists.txt b/external/cmake/fftw-3.3/libbench2/CMakeLists.txt new file mode 100644 index 0000000000000..8962dba03f599 --- /dev/null +++ b/external/cmake/fftw-3.3/libbench2/CMakeLists.txt @@ -0,0 +1,51 @@ +########### next target ############### + +set(bench2_STAT_SRCS + after-ccopy-from.c + after-ccopy-to.c + after-hccopy-from.c + after-hccopy-to.c + after-rcopy-from.c + after-rcopy-to.c + aligned-main.c + allocate.c + aset.c + bench-cost-postprocess.c + bench-exit.c + bench-main.c + can-do.c + caset.c + dotens2.c + info.c + main.c + mflops.c + mp.c + ovtpvt.c + pow2.c + problem.c + report.c + speed.c + tensor.c + timer.c + useropt.c + util.c + verify-dft.c + verify-lib.c + verify-r2r.c + verify-rdft2.c + verify.c + zero.c + bench-user.h + bench.h + verify.h + my-getopt.c + my-getopt.h) + +set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}) +string(REPLACE "${TOP_CMAKE_SRCDIR}" "" SRCDIR "${SRCDIR}") +prefixlist(bench2_STAT_SRCS "${TOP_SRCDIR}/${SRCDIR}/") + +add_library(bench2 STATIC ${bench2_STAT_SRCS}) + + +########### install files ############### diff --git a/external/cmake/fftw-3.3/mpi/CMakeLists.txt b/external/cmake/fftw-3.3/mpi/CMakeLists.txt new file mode 100644 index 0000000000000..c117a4e4b05ba --- /dev/null +++ b/external/cmake/fftw-3.3/mpi/CMakeLists.txt @@ -0,0 +1,224 @@ +########### next target ############### +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/api" "${TOP_SRCDIR}/tests" "${TOP_SRCDIR}/libbench2") + +set(TRANSPOSE_SRC +transpose-alltoall.c +transpose-pairwise.c +transpose-recurse.c +transpose-problem.c +transpose-solve.c +mpi-transpose.h) +set(DFT_SRC +dft-serial.c +dft-rank-geq2.c +dft-rank-geq2-transposed.c +dft-rank1.c +dft-rank1-bigvec.c +dft-problem.c +dft-solve.c +mpi-dft.h) +set(RDFT_SRC +rdft-serial.c +rdft-rank-geq2.c +rdft-rank-geq2-transposed.c +rdft-rank1-bigvec.c +rdft-problem.c +rdft-solve.c +mpi-rdft.h) +set(RDFT2_SRC +rdft2-serial.c +rdft2-rank-geq2.c +rdft2-rank-geq2-transposed.c +rdft2-problem.c +rdft2-solve.c +mpi-rdft2.h) +set(SRC +any-true.c +api.c +block.c +choose-radix.c +conf.c +dtensor.c +fftw3-mpi.h +ifftw-mpi.h +rearrange.c +wisdom-api.c +f03-wrap.c) + +if(THREADS) + set(CMAKE_C_COMPILER_CFLAGS ${PTHREAD_CFLAGS}) + if(NOT COMBINED_THREADS) + set(LIBFFTWTHREADS = libfftw3${PREC_SUFFIX}_threads) + endif() +elseif(OPENMP) + set(CMAKE_C_COMPILER_CFLAGS ${OPENMP_CFLAGS}) + set(LIBFFTWTHREADS libfftw3${PREC_SUFFIX}_omp) +endif() + +if(MPI) +list(APPEND fftw3${PREC_SUFFIX}_mpi_LIB_SRCS + ${SRC} + ${TRANSPOSE_SRC} + ${DFT_SRC} + ${RDFT_SRC} + ${RDFT2_SRC}) + +set(mpi_bench_SOURCES mpi-bench.c ${TOP_SRCDIR}/tests/fftw-bench.c ${TOP_SRCDIR}/tests/hook.c) + +add_executable(mpi-bench ${mpi_bench_SOURCES}) + +addObjects(fftw3${PREC_SUFFIX}_mpi ${fftw3${PREC_SUFFIX}_mpi_LIB_SRCS}) + +target_link_libraries(mpi-bench ${LIBFFTWTHREADS} fftw3${PREC_SUFFIX}_mpi fftw3${PREC_SUFFIX} bench2 ${MPILIBS} ${THREADLIBS}) + +set_target_properties(fftw3${PREC_SUFFIX}_mpi PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS fftw3${PREC_SUFFIX}_mpi ${INSTALL_TARGETS_DEFAULT_ARGS} DESTINATION lib) + +endif(MPI) + +########### install files ############### +configure_file(${TOP_SRCDIR}/mpi/fftw3-mpi.f03.in ${CMAKE_CURRENT_BINARY_DIR}/fftw3-mpi.f03) + +install(FILES ${TOP_SRCDIR}/mpi/fftw3-mpi.h DESTINATION include) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fftw3-mpi.f03 DESTINATION lib/pkgconfig) + +############ CHECKS ###################### +if(MPI) + +set(CHECK ${top_srcdir}/tests/check.pl) +set(NUMCHECK 10) +set(CHECKSIZE 10000) +set(CHECKOPTS --verbose --random --maxsize=${CHECKSIZE} -c=${NUMCHECK} ${CHECK_PL_OPTS}) + +FindPerl(PERL_EXECUTABLE PERL_FOUND) +if(NOT ${PERL_FOUND}) + message(WARNING "MPI checks will be disable dut to the lack of perl") +else() +add_custom_TARGET(check-local + ${PERL_EXECUTABLE} -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 1 `pwd`/mpi-bench" + COMMAND echo "--------------------------------------------------------------" + COMMAND echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 1 CPU" + COMMAND "--------------------------------------------------------------" + COMMAND ${PERL_EXECUTABLE} -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 2 `pwd`/mpi-bench" + COMMAND echo "--------------------------------------------------------------" + COMMAND echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 2 CPUs" + COMMAND echo "--------------------------------------------------------------" + COMMAND ${PERL_EXECUTABLE} -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 3 `pwd`/mpi-bench" + COMMAND echo "--------------------------------------------------------------" + COMMAND echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 3 CPUs" + COMMAND echo "--------------------------------------------------------------" + COMMAND ${PERL_EXECUTABLE} -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 4 `pwd`/mpi-bench" + COMMAND echo "--------------------------------------------------------------" + COMMAND echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 4 CPUs" + COMMAND echo "--------------------------------------------------------------" + DEPENDS mpi-bench + WORKING_DIRECOTRY ${CMAKE_CURRENT_BINARY_DIR}) + if(DEFINED SMP) + add_custom_TARGET(check-local-smp + COMMAND perl -w $(CHECK) $(CHECKOPTS) --mpi --nthreads=2 "$(MPIRUN) -np 3 `pwd`/mpi-bench" + COMMAND echo "--------------------------------------------------------------" + COMMAND echo " MPI FFTW threaded transforms passed "$(NUMCHECK)" tests!" + COMMAND echo "--------------------------------------------------------------" + DEPENDS mpi-bench) + add_dependencies(check-local check-local-smp) + endif(DEFINED SMP) +endif() + +endif(MPI) + +## TODO: bigcheck smallcheck + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/dft \ +#-I$(top_srcdir)/rdft -I$(top_srcdir)/api -I$(top_srcdir)/tests \ +#-I$(top_srcdir)/libbench2 +# +#if MPI +#lib_LTLIBRARIES = libfftw3@PREC_SUFFIX@_mpi.la +#include_HEADERS = fftw3-mpi.h +#nodist_include_HEADERS = fftw3-mpi.f03 +#noinst_PROGRAMS = mpi-bench +#endif +# +#CC=@MPICC@ +# +#EXTRA_DIST = testsched.c f03api.sh f03-wrap.sh genf03-wrap.pl fftw3-mpi.f03.in +#BUILT_SOURCES = fftw3-mpi.f03.in fftw3-mpi.f03 f03-wrap.c +# +#TRANSPOSE_SRC = transpose-alltoall.c transpose-pairwise.c transpose-recurse.c transpose-problem.c transpose-solve.c mpi-transpose.h +#DFT_SRC = dft-serial.c dft-rank-geq2.c dft-rank-geq2-transposed.c dft-rank1.c dft-rank1-bigvec.c dft-problem.c dft-solve.c mpi-dft.h +#RDFT_SRC = rdft-serial.c rdft-rank-geq2.c rdft-rank-geq2-transposed.c rdft-rank1-bigvec.c rdft-problem.c rdft-solve.c mpi-rdft.h +#RDFT2_SRC = rdft2-serial.c rdft2-rank-geq2.c rdft2-rank-geq2-transposed.c rdft2-problem.c rdft2-solve.c mpi-rdft2.h +#SRC = any-true.c api.c block.c choose-radix.c conf.c dtensor.c fftw3-mpi.h ifftw-mpi.h rearrange.c wisdom-api.c f03-wrap.c +# +#libfftw3@PREC_SUFFIX@_mpi_la_SOURCES = $(SRC) $(TRANSPOSE_SRC) $(DFT_SRC) $(RDFT_SRC) $(RDFT2_SRC) +# +#libfftw3@PREC_SUFFIX@_mpi_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ +# +#if THREADS +#mpi_bench_CFLAGS = $(PTHREAD_CFLAGS) +#if !COMBINED_THREADS +#LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_threads.la +#endif +#else +#if OPENMP +#mpi_bench_CFLAGS = $(OPENMP_CFLAGS) +#LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_omp.la +#endif +#endif +# +#mpi_bench_SOURCES = mpi-bench.c $(top_srcdir)/tests/fftw-bench.c $(top_srcdir)/tests/hook.c +#mpi_bench_LDADD = libfftw3@PREC_SUFFIX@_mpi.la $(LIBFFTWTHREADS) $(top_builddir)/libfftw3@PREC_SUFFIX@.la $(top_builddir)/libbench2/libbench2.a $(MPILIBS) $(THREADLIBS) +# +#CHECK = $(top_srcdir)/tests/check.pl +#NUMCHECK=10 +#CHECKSIZE=10000 +#CHECKOPTS = --verbose --random --maxsize=$(CHECKSIZE) -c=$(NUMCHECK) $(CHECK_PL_OPTS) +# +#if MPI +# +#check-local: mpi-bench$(EXEEXT) +# perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 1 `pwd`/mpi-bench" +# @echo "--------------------------------------------------------------" +# @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 1 CPU" +# @echo "--------------------------------------------------------------" +# perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 2 `pwd`/mpi-bench" +# @echo "--------------------------------------------------------------" +# @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 2 CPUs" +# @echo "--------------------------------------------------------------" +# perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 3 `pwd`/mpi-bench" +# @echo "--------------------------------------------------------------" +# @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 3 CPUs" +# @echo "--------------------------------------------------------------" +# perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 4 `pwd`/mpi-bench" +# @echo "--------------------------------------------------------------" +# @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 4 CPUs" +# @echo "--------------------------------------------------------------" +#if SMP +# perl -w $(CHECK) $(CHECKOPTS) --mpi --nthreads=2 "$(MPIRUN) -np 3 `pwd`/mpi-bench" +# @echo "--------------------------------------------------------------" +# @echo " MPI FFTW threaded transforms passed "$(NUMCHECK)" tests!" +# @echo "--------------------------------------------------------------" +#endif +# +#bigcheck: mpi-bench$(EXEEXT) +# $(MAKE) $(AM_MAKEFLAGS) NUMCHECK=100 CHECKSIZE=60000 check-local +# +#smallcheck: mpi-bench$(EXEEXT) +# $(MAKE) $(AM_MAKEFLAGS) NUMCHECK=2 check-local +# +#endif +# +#fftw3-mpi.f03: fftw3-mpi.f03.in +# sed 's/C_MPI_FINT/@C_MPI_FINT@/' $(srcdir)/fftw3-mpi.f03.in > $@ +# +#if MAINTAINER_MODE +# +#fftw3-mpi.f03.in: fftw3-mpi.h f03api.sh $(top_srcdir)/api/genf03.pl +# sh $(srcdir)/f03api.sh > $@ +# +#f03-wrap.c: fftw3-mpi.h f03-wrap.sh genf03-wrap.pl +# sh $(srcdir)/f03-wrap.sh > $@ +# +#endif diff --git a/external/cmake/fftw-3.3/rdft/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/CMakeLists.txt new file mode 100644 index 0000000000000..ba03f31415af5 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/CMakeLists.txt @@ -0,0 +1,87 @@ +include_directories ("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft") + +add_subdirectory(scalar) +add_subdirectory(simd) + + +########### next target ############### +set(RDFT2 +buffered2.c +direct2.c +nop2.c +rank0-rdft2.c +rank-geq2-rdft2.c +plan2.c +problem2.c +solve2.c +vrank-geq1-rdft2.c +rdft2-rdft.c +rdft2-tensor-max-index.c +rdft2-inplace-strides.c +rdft2-strides.c +khc2c.c +ct-hc2c.h +ct-hc2c.c +ct-hc2c-direct.c) + +set(rdft_STAT_SRCS + #,hc2hc.h + hc2hc.c + dft-r2hc.c + dht-r2hc.c + dht-rader.c + buffered.c + #codelet-rdft.h + conf.c + direct-r2r.c + direct-r2c.c + generic.c + hc2hc-direct.c + hc2hc-generic.c + khc2hc.c + kr2c.c + kr2r.c + indirect.c + nop.c + plan.c + problem.c + rank0.c + rank-geq2.c + #rdft.h + rdft-dht.c + solve.c + vrank-geq1.c + vrank3-transpose.c +) + +list(APPEND rdft_STAT_SRCS ${RDFT2}) + +include_directories("${top_srcdir}/kernel" "${top_srcdir}/dft") +addObjects(rdft ${rdft_STAT_SRCS}) +#target_link_libraries(rdft rdft_scalar rdft_scalar_r2cb rdft_scalar_r2cf rdft_scalar_r2r) + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/dft +#SUBDIRS = scalar simd +# +#noinst_LTLIBRARIES = librdft.la +# +## pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@ +## pkginclude_HEADERS = codelet-rdft.h rdft.h +# +#RDFT2 = buffered2.c direct2.c nop2.c rank0-rdft2.c rank-geq2-rdft2.c \ +#plan2.c problem2.c solve2.c vrank-geq1-rdft2.c rdft2-rdft.c \ +#rdft2-tensor-max-index.c rdft2-inplace-strides.c rdft2-strides.c \ +#khc2c.c ct-hc2c.h ct-hc2c.c ct-hc2c-direct.c +# +#librdft_la_SOURCES = hc2hc.h hc2hc.c dft-r2hc.c dht-r2hc.c dht-rader.c \ +#buffered.c codelet-rdft.h conf.c direct-r2r.c direct-r2c.c generic.c \ +#hc2hc-direct.c hc2hc-generic.c khc2hc.c kr2c.c kr2r.c indirect.c nop.c \ +#plan.c problem.c rank0.c rank-geq2.c rdft.h rdft-dht.c solve.c \ +#vrank-geq1.c vrank3-transpose.c $(RDFT2) diff --git a/external/cmake/fftw-3.3/rdft/scalar/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/scalar/CMakeLists.txt new file mode 100644 index 0000000000000..3f9c07bf28469 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/scalar/CMakeLists.txt @@ -0,0 +1,41 @@ +add_subdirectory(r2cf) +add_subdirectory(r2cb) +add_subdirectory(r2r) + + +########### next target ############### + +set(rdft_scalar_STAT_SRCS + hb.h + r2cb.h + r2cbIII.h + hf.h + hfb.c + r2c.c + r2cf.h + r2cfII.h + r2r.c + r2r.h + hc2c.c + hc2cf.h + hc2cb.h) + +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/rdft") +addObjects(rdft_scalar ${rdft_scalar_STAT_SRCS}) +#target_link_libraries(rdft_scalar rdft rdft_scalar_r2cb rdft_scalar_r2cf rdft_scalar_r2r) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/rdft +#SUBDIRS = r2cf r2cb r2r +#noinst_LTLIBRARIES = librdft_scalar.la +# +#librdft_scalar_la_SOURCES = hb.h r2cb.h r2cbIII.h hf.h hfb.c r2c.c \ +#r2cf.h r2cfII.h r2r.c r2r.h hc2c.c hc2cf.h hc2cb.h +# diff --git a/external/cmake/fftw-3.3/rdft/scalar/r2cb/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/scalar/r2cb/CMakeLists.txt new file mode 100644 index 0000000000000..3c058d194c922 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/scalar/r2cb/CMakeLists.txt @@ -0,0 +1,178 @@ +include_directories ("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/rdft/scalar") + +########### next target ############### + +set(R2CB +r2cb_2.c +r2cb_3.c +r2cb_4.c +r2cb_5.c +r2cb_6.c +r2cb_7.c +r2cb_8.c +r2cb_9.c +r2cb_10.c +r2cb_11.c +r2cb_12.c +r2cb_13.c +r2cb_14.c +r2cb_15.c +r2cb_16.c +r2cb_32.c +r2cb_64.c +r2cb_128.c +r2cb_20.c +r2cb_25.c +# r2cb_30.c +# r2cb_40.c +# r2cb_50.c +) +# +############################################################################ +## hb_ is a "twiddle" FFT of size , implementing a radix-r DIF +## step for a real-output FFT. Every hb codelet must have a +## corresponding r2cbIII codelet (see below)! +set(HB +hb_2.c +hb_3.c +hb_4.c +hb_5.c +hb_6.c +hb_7.c +hb_8.c +hb_9.c +hb_10.c +hb_12.c +hb_15.c +hb_16.c +hb_32.c +hb_64.c +hb_20.c +hb_25.c +# hb_30.c +# hb_40.c +# hb_50.c +) +# +## like hb, but generates part of its trig table on the fly (good for large n) +set(HB2 hb2_4.c +hb2_8.c +hb2_16.c +hb2_32.c +hb2_5.c +hb2_20.c +hb2_25.c) +# +## an r2cb transform where the output is shifted by half a sample (input +## is multiplied by a phase). This is needed as part of the DIF recursion; +## every hb_ or hb2_ codelet should have a corresponding r2cbIII_ +set(R2CBIII r2cbIII_2.c +r2cbIII_3.c +r2cbIII_4.c +r2cbIII_5.c +r2cbIII_6.c +r2cbIII_7.c +r2cbIII_8.c +r2cbIII_9.c +r2cbIII_10.c +r2cbIII_12.c +r2cbIII_15.c +r2cbIII_16.c +r2cbIII_32.c +r2cbIII_64.c +r2cbIII_20.c +r2cbIII_25.c +# r2cbIII_30.c +# r2cbIII_40.c +# r2cbIII_50.c +) +# +############################################################################ +## hc2cb_ is a "twiddle" FFT of size , implementing a radix-r DIF +## step for a real-input FFT with rdft2-style output. must be even. +set(HC2CB hc2cb_2.c +hc2cb_4.c +hc2cb_6.c +hc2cb_8.c +hc2cb_10.c +hc2cb_12.c +hc2cb_16.c +hc2cb_32.c +hc2cb_20.c +# hc2cb_30.c +) +# +set(HC2CBDFT hc2cbdft_2.c +hc2cbdft_4.c +hc2cbdft_6.c +hc2cbdft_8.c +hc2cbdft_10.c +hc2cbdft_12.c +hc2cbdft_16.c +hc2cbdft_32.c +hc2cbdft_20.c +# hc2cbdft_30.c +) +# +## like hc2cb, but generates part of its trig table on the fly (good +## for large n) +set(HC2CB2 hc2cb2_4.c +hc2cb2_8.c +hc2cb2_16.c +hc2cb2_32.c +hc2cb2_20.c +# hc2cb2_30.c +) +set(HC2CBDFT2 hc2cbdft2_4.c +hc2cbdft2_8.c +hc2cbdft2_16.c +hc2cbdft2_32.c +hc2cbdft2_20.c +# hc2cbdft2_30.c +) + +list(APPEND ALL_CODELETS ${R2CB} ${HB} ${HB2} ${R2CBIII} ${HC2CB} ${HC2CB2} ${HC2CBDFT} ${HC2CBDFT2}) + +list(APPEND ALL_CODELETS codlist.c) + + +addObjects(rdft_scalar_r2cb ${ALL_CODELETS}) +#target_link_libraries(rdft_scalar_r2cb rdft_scalar_r2cf rdft_scalar rdft rdft_scalar_r2r) + + +########### install files ############### + + +#if MAINTAINER_MODE +#FLAGS_R2CB=$(RDFT_FLAGS_COMMON) -sign 1 +#FLAGS_HB=$(RDFT_FLAGS_COMMON) -sign 1 +#FLAGS_HB2=$(RDFT_FLAGS_COMMON) -sign 1 -twiddle-log3 -precompute-twiddles +#FLAGS_HC2CB=$(RDFT_FLAGS_COMMON) -sign 1 +#FLAGS_HC2CB2=$(RDFT_FLAGS_COMMON) -sign 1 -twiddle-log3 -precompute-twiddles +#FLAGS_R2CBIII=$(RDFT_FLAGS_COMMON) -sign 1 +# +#r2cb_%.c: $(CODELET_DEPS) $(GEN_R2CB) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2CB) $(FLAGS_R2CB) -n $* -name r2cb_$* -include "r2cb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hb_%.c: $(CODELET_DEPS) $(GEN_HC2HC) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2HC) $(FLAGS_HB) -n $* -dif -name hb_$* -include "hb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hb2_%.c: $(CODELET_DEPS) $(GEN_HC2HC) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2HC) $(FLAGS_HB2) -n $* -dif -name hb2_$* -include "hb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#r2cbIII_%.c: $(CODELET_DEPS) $(GEN_R2CB) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2CB) $(FLAGS_R2CB) -n $* -name r2cbIII_$* -dft-III -include "r2cbIII.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cb_%.c: $(CODELET_DEPS) $(GEN_HC2C) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2C) $(FLAGS_HC2CB) -n $* -dif -name hc2cb_$* -include "hc2cb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cb2_%.c: $(CODELET_DEPS) $(GEN_HC2C) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2C) $(FLAGS_HC2CB2) -n $* -dif -name hc2cb2_$* -include "hc2cb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cbdft_%.c: $(CODELET_DEPS) $(GEN_HC2CDFT) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2CDFT) $(FLAGS_HC2CB) -n $* -dif -name hc2cbdft_$* -include "hc2cb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cbdft2_%.c: $(CODELET_DEPS) $(GEN_HC2CDFT) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2CDFT) $(FLAGS_HC2CB) -n $* -dif -name hc2cbdft2_$* -include "hc2cb.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#endif # MAINTAINER_MODE diff --git a/external/cmake/fftw-3.3/rdft/scalar/r2cf/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/scalar/r2cf/CMakeLists.txt new file mode 100644 index 0000000000000..39946d44fe2a8 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/scalar/r2cf/CMakeLists.txt @@ -0,0 +1,212 @@ +include_directories ("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/rdft/scalar") + +## r2cf_ is a hard-coded real-to-complex FFT of size (base cases +## of real-input FFT recursion) +set(R2CF +r2cf_2.c +r2cf_3.c +r2cf_4.c +r2cf_5.c +r2cf_6.c +r2cf_7.c +r2cf_8.c +r2cf_9.c +r2cf_10.c +r2cf_11.c +r2cf_12.c +r2cf_13.c +r2cf_14.c +r2cf_15.c +r2cf_16.c +r2cf_32.c +r2cf_64.c +r2cf_128.c +r2cf_20.c +r2cf_25.c +# r2cf_30.c +# r2cf_40.c +# r2cf_50.c +) + +## hf_ is a "twiddle" FFT of size , implementing a radix-r DIT +## step for a real-input FFT. Every hf codelet must have a +## corresponding r2cfII codelet (see below)! +set(HF +hf_2.c +hf_3.c +hf_4.c +hf_5.c +hf_6.c +hf_7.c +hf_8.c +hf_9.c +hf_10.c +hf_12.c +hf_15.c +hf_16.c +hf_32.c +hf_64.c +hf_20.c +hf_25.c +# hf_30.c +# hf_40.c +# hf_50.c +) + +## like hf, but generates part of its trig table on the fly (good for large n) +set(HF2 +hf2_4.c +hf2_8.c +hf2_16.c +hf2_32.c +hf2_5.c +hf2_20.c +hf2_25.c +) +# +## an r2cf transform where the input is shifted by half a sample (output +## is multiplied by a phase). This is needed as part of the DIT recursion; +## every hf_ or +#hf2_ codelet should have a corresponding r2cfII_ +set(R2CFII +r2cfII_2.c +r2cfII_3.c +r2cfII_4.c +r2cfII_5.c +r2cfII_6.c +r2cfII_7.c +r2cfII_8.c +r2cfII_9.c +r2cfII_10.c +r2cfII_12.c +r2cfII_15.c +r2cfII_16.c +r2cfII_32.c +r2cfII_64.c +r2cfII_20.c +r2cfII_25.c +# r2cfII_30.c +#r2cfII_40.c +#r2cfII_50.c +) +# +############################################################################ +## hc2cf_ is a "twiddle" FFT of size , implementing a radix-r DIT +## step for a real-input FFT with rdft2-style output. must be even. +set(HC2CF +hc2cf_2.c +hc2cf_4.c +hc2cf_6.c +hc2cf_8.c +hc2cf_10.c +hc2cf_12.c +hc2cf_16.c +hc2cf_32.c +hc2cf_20.c +# hc2cf_30.c +) +# +set(HC2CFDFT +hc2cfdft_2.c +hc2cfdft_4.c +hc2cfdft_6.c +hc2cfdft_8.c +hc2cfdft_10.c +hc2cfdft_12.c +hc2cfdft_16.c +hc2cfdft_32.c +hc2cfdft_20.c +# hc2cfdft_30.c +) +# +## like hc2cf, but generates part of its trig table on the fly (good +## for large n) +set(HC2CF2 +hc2cf2_4.c +hc2cf2_8.c +hc2cf2_16.c +hc2cf2_32.c +hc2cf2_20.c +# hc2cf2_30.c +) +set(HC2CFDFT2 +hc2cfdft2_4.c +hc2cfdft2_8.c +hc2cfdft2_16.c +hc2cfdft2_32.c +hc2cfdft2_20.c +# hc2cfdft2_30.c +) + +########### install files ############### + +list(APPEND ALL_CODELETS ${R2CF} ${HF} ${HF2} ${R2CFII} ${HC2CF} ${HC2CF2} ${HC2CFDFT} ${HC2CFDFT2}) +list(APPEND BUILT_SOURCES ${ALL_CODELETS} codlist.c) + +include_directories("${TOP_SCRDIR}/kernel" "${TOP_SCRDIR}/rdft" "${TOP_SCRDIR}/rdft/scalar") + +addObjects(rdft_scalar_r2cf ${BUILT_SOURCES}) +#target_link_libraries(rdft_scalar_r2cf rdft_scalar rdft rdft_scalar_r2cb rdft_scalar_r2r) + +#original Makefile.am contents follow: + +## This Makefile.am specifies a set of codelets, efficient transforms +## of small sizes, that are used as building blocks (kernels) by FFTW +## to build up large transforms, as well as the options for generating +## and compiling them. +# +## You can customize FFTW for special needs, e.g. to handle certain +## sizes more efficiently, by adding new codelets to the lists of those +## included by default. If you change the list of codelets, any new +## ones you added will be automatically generated when you run the +## bootstrap script (see "Generating your own code" in the FFTW +## manual). +# +############################################################################ +############################################################################ +#ALL_CODELETS = $(R2CF) $(HF) $(HF2) $(R2CFII) $(HC2CF) $(HC2CF2) \ +#$(HC2CFDFT) $(HC2CFDFT2) +# +#BUILT_SOURCES= $(ALL_CODELETS) $(CODLIST) +# +#librdft_scalar_r2cf_la_SOURCES = $(BUILT_SOURCES) +# +#SOLVTAB_NAME = X(solvtab_rdft_r2cf) +#XRENAME=X +# +## special rules for regenerating codelets. +#include $(top_srcdir)/support/Makefile.codelets +# +#if MAINTAINER_MODE +#FLAGS_R2CF=$(RDFT_FLAGS_COMMON) +#FLAGS_HF=$(RDFT_FLAGS_COMMON) +#FLAGS_HF2=$(RDFT_FLAGS_COMMON) -twiddle-log3 -precompute-twiddles +#FLAGS_HC2CF=$(RDFT_FLAGS_COMMON) +#FLAGS_HC2CF2=$(RDFT_FLAGS_COMMON) -twiddle-log3 -precompute-twiddles +#FLAGS_R2CFII=$(RDFT_FLAGS_COMMON) +# +#r2cf_%.c: $(CODELET_DEPS) $(GEN_R2CF) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2CF) $(FLAGS_R2CF) -n $* -name r2cf_$* -include "r2cf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hf_%.c: $(CODELET_DEPS) $(GEN_HC2HC) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2HC) $(FLAGS_HF) -n $* -dit -name hf_$* -include "hf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hf2_%.c: $(CODELET_DEPS) $(GEN_HC2HC) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2HC) $(FLAGS_HF2) -n $* -dit -name hf2_$* -include "hf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#r2cfII_%.c: $(CODELET_DEPS) $(GEN_R2CF) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2CF) $(FLAGS_R2CF) -n $* -name r2cfII_$* -dft-II -include "r2cfII.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cf_%.c: $(CODELET_DEPS) $(GEN_HC2C) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2C) $(FLAGS_HC2CF) -n $* -dit -name hc2cf_$* -include "hc2cf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cf2_%.c: $(CODELET_DEPS) $(GEN_HC2C) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2C) $(FLAGS_HC2CF2) -n $* -dit -name hc2cf2_$* -include "hc2cf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cfdft_%.c: $(CODELET_DEPS) $(GEN_HC2CDFT) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2CDFT) $(FLAGS_HC2CF) -n $* -dit -name hc2cfdft_$* -include "hc2cf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cfdft2_%.c: $(CODELET_DEPS) $(GEN_HC2CDFT) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2CDFT) $(FLAGS_HC2CF2) -n $* -dit -name hc2cfdft2_$* -include "hc2cf.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#endif # MAINTAINER_MODE diff --git a/external/cmake/fftw-3.3/rdft/scalar/r2r/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/scalar/r2r/CMakeLists.txt new file mode 100644 index 0000000000000..317d0eee0e205 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/scalar/r2r/CMakeLists.txt @@ -0,0 +1,195 @@ +include_directories ("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/rdft/scalar") + + +########### next target ############### +set(E00 +#e00_2.c +#e00_3.c +#e00_4.c +#e00_5.c +#e00_6.c +#e00_7.c +#e00_8.c +) +set(E01 +e01_8.c +# e01_2.c +# e01_3.c +# e01_4.c +# e01_5.c +# e01_6.c +# e01_7.c +) +set(E10 +e10_8.c +# e10_2.c +#e10_3.c +#e10_4.c +#e10_5.c +#e10_6.c +#e10_7.c +) +set(E11 +#e11_2.c +#e11_3.c +#e11_4.c +#e11_5.c +#e11_6.c +#e11_7.c +#e11_8.c +) + +## o_ is a hard-coded RODFT FFT (DST) of size +set(O00 +# o00_2.c +#o00_3.c +#o00_4.c +#o00_5.c +#o00_6.c +#o00_7.c +#o00_8.c +) +set(O01 +# o01_2.c +#o01_3.c +#o01_4.c +#o01_5.c +#o01_6.c +#o01_7.c +#o01_8.c +) +set(O10 +# o10_2.c +#o10_3.c +#o10_4.c +#o10_5.c +#o10_6.c +#o10_7.c +#o10_8.c +) +set(O11 +# o11_2.c +#o11_3.c +#o11_4.c +#o11_5.c +#o11_6.c +#o11_7.c +#o11_8.c +) +# +## dht_ is a hard-coded DHT of size +set(DHT +# dht_2.c +#dht_3.c +#dht_4.c +#dht_5.c +#dht_6.c +#dht_7.c +#dht_8.c +) + +########### install files ############### + +include_directories("${TOP_SCRDIR}/kernel" "${TOP_SCRDIR}/rdft" "${TOP_SCRDIR}/rdft/scalar") + +list(APPEND ALL_CODELETS ${E00} ${E01} ${E10} ${E11} ${O00} ${O01} ${O10} ${O11} ${DHT}) + +addObjects(rdft_scalar_r2r codlist.c ${ALL_CODELETS}) +#target_link_libraries(rdft_scalar_r2r rdft_scalar_r2cf rdft_scalar rdft rdft_scalar_r2cb) + +set(SOLVTAB_NAME "X(solvtab_rdft_r2r)") +set(XRENAME X) + + +#original Makefile.am contents follow: + +## This Makefile.am specifies a set of codelets, efficient transforms +## of small sizes, that are used as building blocks (kernels) by FFTW +## to build up large transforms, as well as the options for generating +## and compiling them. +# +## You can customize FFTW for special needs, e.g. to handle certain +## sizes more efficiently, by adding new codelets to the lists of those +## included by default. If you change the list of codelets, any new +## ones you added will be automatically generated when you run the +## bootstrap script (see "Generating your own code" in the FFTW +## manual). +# +############################################################################ +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/rdft \ +#-I$(top_srcdir)/rdft/scalar +#noinst_LTLIBRARIES = librdft_scalar_r2r.la +# +############################################################################ +## The following lines specify the REDFT/RODFT/DHT sizes for which to generate +## specialized codelets. Currently, only REDFT01/10 of size 8 (used in JPEG). +# +## e_ is a hard-coded REDFT FFT (DCT) of size +#E00 = # e00_2.c e00_3.c e00_4.c e00_5.c e00_6.c e00_7.c e00_8.c +#E01 = e01_8.c # e01_2.c e01_3.c e01_4.c e01_5.c e01_6.c e01_7.c +#E10 = e10_8.c # e10_2.c e10_3.c e10_4.c e10_5.c e10_6.c e10_7.c +#E11 = # e11_2.c e11_3.c e11_4.c e11_5.c e11_6.c e11_7.c e11_8.c +# +## o_ is a hard-coded RODFT FFT (DST) of size +#O00 = # o00_2.c o00_3.c o00_4.c o00_5.c o00_6.c o00_7.c o00_8.c +#O01 = # o01_2.c o01_3.c o01_4.c o01_5.c o01_6.c o01_7.c o01_8.c +#O10 = # o10_2.c o10_3.c o10_4.c o10_5.c o10_6.c o10_7.c o10_8.c +#O11 = # o11_2.c o11_3.c o11_4.c o11_5.c o11_6.c o11_7.c o11_8.c +# +## dht_ is a hard-coded DHT of size +#DHT = # dht_2.c dht_3.c dht_4.c dht_5.c dht_6.c dht_7.c dht_8.c +# +############################################################################ +#ALL_CODELETS = $(E00) $(E01) $(E10) $(E11) $(O00) $(O01) $(O10) $(O11) $(DHT) +# +#BUILT_SOURCES= $(ALL_CODELETS) $(CODLIST) +# +#librdft_scalar_r2r_la_SOURCES = $(BUILT_SOURCES) +# +#SOLVTAB_NAME = X(solvtab_rdft_r2r) +#XRENAME=X +# +## special rules for regenerating codelets. +#include $(top_srcdir)/support/Makefile.codelets +# +#if MAINTAINER_MODE +#FLAGS_E00=$(RDFT_FLAGS_COMMON) +#FLAGS_E01=$(RDFT_FLAGS_COMMON) +#FLAGS_E10=$(RDFT_FLAGS_COMMON) +#FLAGS_E11=$(RDFT_FLAGS_COMMON) +#FLAGS_O00=$(RDFT_FLAGS_COMMON) +#FLAGS_O01=$(RDFT_FLAGS_COMMON) +#FLAGS_O10=$(RDFT_FLAGS_COMMON) +#FLAGS_O11=$(RDFT_FLAGS_COMMON) +#FLAGS_DHT=$(RDFT_FLAGS_COMMON) +# +#e00_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_E00) -redft00 -n $* -name e00_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#e01_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_E01) -redft01 -n $* -name e01_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#e10_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_E10) -redft10 -n $* -name e10_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#e11_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_E11) -redft11 -n $* -name e11_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +# +#o00_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_O00) -rodft00 -n $* -name o00_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#o01_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_O01) -rodft01 -n $* -name o01_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#o10_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_O10) -rodft10 -n $* -name o10_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#o11_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_O11) -rodft11 -n $* -name o11_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +# +#dht_%.c: $(CODELET_DEPS) $(GEN_R2R) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_R2R) $(FLAGS_DHT) -dht -sign 1 -n $* -name dht_$* -include "r2r.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#endif # MAINTAINER_MODE diff --git a/external/cmake/fftw-3.3/rdft/simd/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/simd/CMakeLists.txt new file mode 100644 index 0000000000000..2f32b77c34c52 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/simd/CMakeLists.txt @@ -0,0 +1,48 @@ +########### install files ############### + +set(HC2CFDFTV +hc2cfdftv_2.c +hc2cfdftv_4.c +hc2cfdftv_6.c +hc2cfdftv_8.c +hc2cfdftv_10.c +hc2cfdftv_12.c +hc2cfdftv_16.c +hc2cfdftv_32.c +hc2cfdftv_20.c) + +set(HC2CBDFTV +hc2cbdftv_2.c +hc2cbdftv_4.c +hc2cbdftv_6.c +hc2cbdftv_8.c +hc2cbdftv_10.c +hc2cbdftv_12.c +hc2cbdftv_16.c +hc2cbdftv_32.c +hc2cbdftv_20.c) + +########################################################################### +list(APPEND SIMD_CODELETS ${HC2CFDFTV} ${HC2CBDFTV}) +list(APPEND ALL_CODELETS ${SIMD_CODELETS} genus.c codlist.c) + +function(configureSourceFiles codeletsVariable header binDir srcDir srcVar) +foreach(f ${${codeletsVariable}}) + file(WRITE ${binDir}/${f} "/* Generated automatically. DO NOT EDIT! */\n #define SIMD_HEADER \"${header}\" \n#include \"${srcDir}/../common/${f}.c\"") + list(APPEND srcVar_TMP ${f}) +endforeach() +set(${srcVar} "${srcVar_TMP}" PARENT_SCOPE) +endfunction() + +include_directories("${TOP_SRCDIR}/simd-support" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/rdft/simd" "${TOP_SRCDIR}/rdft/common" "${TOP_SRCDIR}/kernel") +add_subdirectory(common) +add_subdirectory(sse2) +add_subdirectory(avx) +add_subdirectory(altivec) + + + +#original Makefile.am contents follow: + +#SUBDIRS = common sse2 avx altivec +#EXTRA_DIST = hc2cbv.h hc2cfv.h codlist.mk simd.mk diff --git a/external/cmake/fftw-3.3/rdft/simd/altivec/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/simd/altivec/CMakeLists.txt new file mode 100644 index 0000000000000..7c50ed7b637e4 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/simd/altivec/CMakeLists.txt @@ -0,0 +1,27 @@ +if(HAVE_ALTIVEC) +configureSourceFiles(ALL_CODELETS "simd-altivec.h" "${CMAKE_CURRENT_BINARY_DIR}" "${TOP_SRCDIR}/rdft/simd/altivec" SOURCES) + +set(CMAKE_C_FLAGS ${ALTIVEC_CFLAGS}) +#add_library(rdft_altivec_codelets ${SOURCES}) +endif(HAVE_ALTIVEC) + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CFLAGS = $(ALTIVEC_CFLAGS) +#SIMD_HEADER=simd-altivec.h +# +#include $(top_srcdir)/rdft/simd/codlist.mk +#include $(top_srcdir)/rdft/simd/simd.mk +# +#if HAVE_ALTIVEC +# +#noinst_LTLIBRARIES = librdft_altivec_codelets.la +#BUILT_SOURCES = $(EXTRA_DIST) +#librdft_altivec_codelets_la_SOURCES = $(BUILT_SOURCES) +# +#endif diff --git a/external/cmake/fftw-3.3/rdft/simd/avx/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/simd/avx/CMakeLists.txt new file mode 100644 index 0000000000000..2ba409b1a448a --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/simd/avx/CMakeLists.txt @@ -0,0 +1,30 @@ +if(HAVE_AVX) +configureSourceFiles(ALL_CODELETS "simd-avx.h" "${CMAKE_CURRENT_BINARY_DIR}" "${TOP_SRCDIR}/dft/simd/avx" SOURCES) + +set(CMAKE_C_FLAGS ${AVX_CFLAGS}) +addObjects(rdft_avx_codelets ${SOURCES}) +endif(HAVE_AVX) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CFLAGS = $(AVX_CFLAGS) +#SIMD_HEADER=simd-avx.h +# +#include $(top_srcdir)/rdft/simd/codlist.mk +#include $(top_srcdir)/rdft/simd/simd.mk +# +#if HAVE_AVX +# +#noinst_LTLIBRARIES = librdft_avx_codelets.la +#BUILT_SOURCES = $(EXTRA_DIST) +#librdft_avx_codelets_la_SOURCES = $(BUILT_SOURCES) +# +#endif +# +# diff --git a/external/cmake/fftw-3.3/rdft/simd/common/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/simd/common/CMakeLists.txt new file mode 100644 index 0000000000000..2324c9d484949 --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/simd/common/CMakeLists.txt @@ -0,0 +1,35 @@ + +include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## include the list of codelets +# +#include $(top_srcdir)/rdft/simd/codlist.mk +# +#ALL_CODELETS = $(SIMD_CODELETS) +#BUILT_SOURCES= $(SIMD_CODELETS) $(CODLIST) +#EXTRA_DIST = $(BUILT_SOURCES) genus.c +#INCLUDE_SIMD_HEADER="\#include SIMD_HEADER" +#XRENAME=XSIMD +#SOLVTAB_NAME = XSIMD(solvtab_rdft) +# +## include special rules for regenerating codelets. +#include $(top_srcdir)/support/Makefile.codelets +# +#if MAINTAINER_MODE +#FLAGS_HC2C=-simd $(FLAGS_COMMON) -pipeline-latency 8 -trivial-stores -variables 32 -no-generate-bytw +# +#hc2cfdftv_%.c: $(CODELET_DEPS) $(GEN_HC2CDFT_C) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2CDFT_C) $(FLAGS_HC2C) -n $* -dit -name hc2cfdftv_$* -include "hc2cfv.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#hc2cbdftv_%.c: $(CODELET_DEPS) $(GEN_HC2CDFT_C) +# ($(PRELUDE_COMMANDS_RDFT); $(TWOVERS) $(GEN_HC2CDFT_C) $(FLAGS_HC2C) -n $* -dif -sign 1 -name hc2cbdftv_$* -include "hc2cbv.h") | $(ADD_DATE) | $(INDENT) >$@ +# +#endif # MAINTAINER_MODE diff --git a/external/cmake/fftw-3.3/rdft/simd/sse2/CMakeLists.txt b/external/cmake/fftw-3.3/rdft/simd/sse2/CMakeLists.txt new file mode 100644 index 0000000000000..5ee9b487e68ba --- /dev/null +++ b/external/cmake/fftw-3.3/rdft/simd/sse2/CMakeLists.txt @@ -0,0 +1,29 @@ +IF(HAVE_SSE2) +configureSourceFiles(ALL_CODELETS "simd-sse2.h" "${CMAKE_CURRENT_BINARY_DIR}" "${TOP_SRCDIR}/rdft/simd/sse2" SOURCES) + +set(CMAKE_C_FLAGS ${SSE2_CFLAGS}) +addObjects(rdft_sse2_codelets ${SOURCES}) +ENDIF() + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CFLAGS = $(SSE2_CFLAGS) +#SIMD_HEADER=simd-sse2.h +# +#include $(top_srcdir)/rdft/simd/codlist.mk +#include $(top_srcdir)/rdft/simd/simd.mk +# +#if HAVE_SSE2 +# +#BUILT_SOURCES = $(EXTRA_DIST) +#noinst_LTLIBRARIES = librdft_sse2_codelets.la +#librdft_sse2_codelets_la_SOURCES = $(BUILT_SOURCES) +# +#endif +# +# diff --git a/external/cmake/fftw-3.3/reodft/CMakeLists.txt b/external/cmake/fftw-3.3/reodft/CMakeLists.txt new file mode 100644 index 0000000000000..21eca88897e73 --- /dev/null +++ b/external/cmake/fftw-3.3/reodft/CMakeLists.txt @@ -0,0 +1,41 @@ + +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/rdft") + + +########### next target ############### + +set(reodft_STAT_SRCS + conf.c + reodft.h + reodft010e-r2hc.c + reodft11e-radix2.c + reodft11e-r2hc-odd.c + redft00e-r2hc-pad.c + rodft00e-r2hc-pad.c + reodft00e-splitradix.c) + +addObjects(reodft ${reodft_STAT_SRCS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/rdft +#SUBDIRS = +# +#noinst_LTLIBRARIES = libreodft.la +# +## pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@ +## pkginclude_HEADERS = reodft.h +# +## no longer used due to numerical problems +#EXTRA_DIST = reodft11e-r2hc.c redft00e-r2hc.c rodft00e-r2hc.c +# +#libreodft_la_SOURCES = conf.c reodft.h reodft010e-r2hc.c \ +#reodft11e-radix2.c reodft11e-r2hc-odd.c redft00e-r2hc-pad.c \ +#rodft00e-r2hc-pad.c reodft00e-splitradix.c +## redft00e-r2hc.c rodft00e-r2hc.c reodft11e-r2hc.c diff --git a/external/cmake/fftw-3.3/simd-support/CMakeLists.txt b/external/cmake/fftw-3.3/simd-support/CMakeLists.txt new file mode 100644 index 0000000000000..5c1a4ca87f9f2 --- /dev/null +++ b/external/cmake/fftw-3.3/simd-support/CMakeLists.txt @@ -0,0 +1,44 @@ +########### next target ############### + +set(simd_support_STAT_SRCS + taint.c + simd-common.h + simd-sse2.h + sse2.c + x86-cpuid.h + amd64-cpuid.h + avx.c + simd-avx.h + altivec.c + simd-altivec.h) + +include_directories("${TOP_SRCDIR}/kernel") +addObjects(simd_support ${simd_support_STAT_SRCS}) + + +########### next target ############### + +set(simd_sse2_nonportable_STAT_SRCS sse2-nonportable.c) + +set(CMAKE_C_FLAGS ${SSE2_CFLAGS}) +addObjects(simd_sse2_nonportable ${simd_sse2_nonportable_STAT_SRCS}) + + +########### install files ############### + + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel +#noinst_LTLIBRARIES = libsimd_support.la libsimd_sse2_nonportable.la +# +#libsimd_support_la_SOURCES = taint.c simd-common.h simd-sse2.h sse2.c \ +#x86-cpuid.h amd64-cpuid.h avx.c simd-avx.h altivec.c simd-altivec.h +# +## sse2-nonportable.c needs SSE2_CFLAGS, but Automake does not support +## per-object CFLAGS. Thus we build a separate library. +#libsimd_sse2_nonportable_la_CFLAGS = $(SSE2_CFLAGS) +#libsimd_sse2_nonportable_la_SOURCES = sse2-nonportable.c +# diff --git a/external/cmake/fftw-3.3/tests/CMakeLists.txt b/external/cmake/fftw-3.3/tests/CMakeLists.txt new file mode 100644 index 0000000000000..374a9ff2ae909 --- /dev/null +++ b/external/cmake/fftw-3.3/tests/CMakeLists.txt @@ -0,0 +1,114 @@ +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/libbench2" +"${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/reodft" +"${TOP_SRCDIR}/threads" "${TOP_SRCDIR}/api") + + +########### next target ############### + +set(bench_SRCS + bench.c + hook.c + fftw-bench.c + fftw-bench.h) + +set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}) +string(REPLACE "${TOP_CMAKE_SRCDIR}" "" SRCDIR "${SRCDIR}") +prefixlist(bench_SRCS "${TOP_SRCDIR}/${SRCDIR}/") + +add_executable(bench ${bench_SRCS} ) +add_library(bench_lib STATIC "${TOP_SRCDIR}/${SRCDIR}/fftw-bench.c" "${TOP_SRCDIR}/${SRCDIR}/bench.c") + +## Dertermine libraries to link ## + +target_link_libraries(bench fftw3${PREC_PREFIX} bench2) + +set_target_properties(bench +PROPERTIES +ENABLE_EXPORTS ON +RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + +########### install files ############### + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/libbench2 \ +#-I$(top_srcdir)/dft -I$(top_srcdir)/rdft -I$(top_srcdir)/reodft \ +#-I$(top_srcdir)/threads -I$(top_srcdir)/api +# +#noinst_PROGRAMS = bench +#EXTRA_DIST = check.pl README +# +#if THREADS +#bench_CFLAGS = $(PTHREAD_CFLAGS) +#if !COMBINED_THREADS +#LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_threads.la +#endif +#else +#if OPENMP +#bench_CFLAGS = $(OPENMP_CFLAGS) +#LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_omp.la +#endif +#endif +# +#bench_SOURCES = bench.c hook.c fftw-bench.c fftw-bench.h +#bench_LDADD = $(LIBFFTWTHREADS) \ +#$(top_builddir)/libfftw3@PREC_SUFFIX@.la \ +#$(top_builddir)/libbench2/libbench2.a $(THREADLIBS) +# +#check-local: bench$(EXEEXT) +# perl -w $(srcdir)/check.pl $(CHECK_PL_OPTS) -r -c=30 -v `pwd`/bench +# @echo "--------------------------------------------------------------" +# @echo " FFTW transforms passed basic tests!" +# @echo "--------------------------------------------------------------" +#if SMP +# perl -w $(srcdir)/check.pl $(CHECK_PL_OPTS) -r -c=30 -v --nthreads=2 `pwd`/bench +# @echo "--------------------------------------------------------------" +# @echo " FFTW threaded transforms passed basic tests!" +# @echo "--------------------------------------------------------------" +#endif +# +#bigcheck: bench$(EXEEXT) +# perl -w $(srcdir)/check.pl $(CHECK_PL_OPTS) -a -v `pwd`/bench +# @echo "--------------------------------------------------------------" +# @echo " FFTW transforms passed big tests!" +# @echo "--------------------------------------------------------------" +#if SMP +# perl -w $(srcdir)/check.pl $(CHECK_PL_OPTS) -a -v --nthreads=2 `pwd`/bench +# perl -w $(srcdir)/check.pl $(CHECK_PL_OPTS) -a -v --nthreads=3 `pwd`/bench +# perl -w $(srcdir)/check.pl $(CHECK_PL_OPTS) -a -v --nthreads=10 `pwd`/bench +# @echo "--------------------------------------------------------------" +# @echo " FFTW threaded transforms passed big tests!" +# @echo "--------------------------------------------------------------" +#endif +# +#smallcheck: bench$(EXEEXT) +# perl -w $(srcdir)/check.pl -r -c=1 -v `pwd`/bench +# perl -w $(srcdir)/check.pl -r --estimate -c=5 -v `pwd`/bench +# @echo "--------------------------------------------------------------" +# @echo " FFTW transforms passed a few tests!" +# @echo "--------------------------------------------------------------" +#if SMP +# perl -w $(srcdir)/check.pl -r --estimate -c=2 -v --nthreads=2 `pwd`/bench +# @echo "--------------------------------------------------------------" +# @echo " FFTW threaded transforms passed a few tests!" +# @echo "--------------------------------------------------------------" +#endif +# +#paranoid-check: bench$(EXEEXT) +#if SMP +# perl -w $(srcdir)/check.pl -a --patient --nthreads=10 --paranoid `pwd`/bench +# perl -w $(srcdir)/check.pl -a --patient --nthreads=7 --paranoid `pwd`/bench +# perl -w $(srcdir)/check.pl -a --patient --nthreads=3 --paranoid `pwd`/bench +# perl -w $(srcdir)/check.pl -a --patient --nthreads=2 --paranoid `pwd`/bench +#endif +# perl -w $(srcdir)/check.pl -a --patient --paranoid `pwd`/bench +# +#exhaustive-check: bench$(EXEEXT) +#if SMP +# perl -w $(srcdir)/check.pl -a --exhaustive --nthreads=10 --paranoid `pwd`/bench +# perl -w $(srcdir)/check.pl -a --exhaustive --nthreads=7 --paranoid `pwd`/bench +# perl -w $(srcdir)/check.pl -a --exhaustive --nthreads=3 --paranoid `pwd`/bench +# perl -w $(srcdir)/check.pl -a --exhaustive --nthreads=2 --paranoid `pwd`/bench +#endif +# perl -w $(srcdir)/check.pl -a --exhaustive --paranoid `pwd`/bench diff --git a/external/cmake/fftw-3.3/threads/CMakeLists.txt b/external/cmake/fftw-3.3/threads/CMakeLists.txt new file mode 100644 index 0000000000000..77bd9ed2ded63 --- /dev/null +++ b/external/cmake/fftw-3.3/threads/CMakeLists.txt @@ -0,0 +1,82 @@ +set(CMAKE_C_FLAGS ${STACK_ALIGN_CFLAGS}) +include_directories("${TOP_SRCDIR}/kernel" "${TOP_SRCDIR}/dft" "${TOP_SRCDIR}/rdft" "${TOP_SRCDIR}/api") +########### next target ############### +set(fftw3${PREC_SUFFIX}_threads_STAT_SRCS + api.c + conf.c + threads.c + threads.h + dft-vrank-geq1.c + ct.c + rdft-vrank-geq1.c + hc2hc.c + vrank-geq1-rdft2.c + f77api.c + f77funcs.h) + +set(libfftw3${PREC_SUFFIX}_omp_la_SOURCES +api.c +conf.c +openmp.c +threads.h +dft-vrank-geq1.c +ct.c +rdft-vrank-geq1.c +hc2hc.c +vrank-geq1-rdft2.c +f77api.c +f77funcs.h) + +if (HAVE_THREADS) + addObjects(fftw3${PREC_SUFFIX}_threads ${fftw3${PREC_SUFFIX}_threads_STAT_SRCS}) + if(NOT COMBINED_THREADS) + if(OPENMP) + addObjects(fftw3${PREC_SUFFIX}_omp ${libfftw3${PREC_SUFFIX}_omp_la_SOURCES}) + # install(TARGETS fftw3${PREC_SUFFIX}_omp DESTINATION lib) + endif() + # install(TARGETS fftw3${PREC_SUFFIX}_threads DESTINATION lib) + endif() + #set_target_properties(fftw3${PREC_SUFFIX}_threads PROPERTIES VERSION 1.0.0 SOVERSION 1) +elseif(HAVE_OPENMP) + addObjects(fftw3${PREC_SUFFIX}_omp ${libfftw3${PREC_SUFFIX}_omp_la_SOURCES}) + # install(TARGETS fftw3${PREC_SUFFIX}_omp DESTINATION lib) +endif() + +########### next target ############### + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/kernel -I$(top_srcdir)/dft \ +#-I$(top_srcdir)/rdft -I$(top_srcdir)/api +#AM_CFLAGS = $(STACK_ALIGN_CFLAGS) +# +#if OPENMP +#FFTWOMPLIB = libfftw3@PREC_SUFFIX@_omp.la +#else +#FFTWOMPLIB = +#endif +# +#if THREADS +#if COMBINED_THREADS +#noinst_LTLIBRARIES = libfftw3@PREC_SUFFIX@_threads.la +#else +#lib_LTLIBRARIES = libfftw3@PREC_SUFFIX@_threads.la $(FFTWOMPLIB) +#endif +#else +#lib_LTLIBRARIES = $(FFTWOMPLIB) +#endif +# +## pkgincludedir = $(includedir)/fftw3@PREC_SUFFIX@ +## pkginclude_HEADERS = threads.h +# +#libfftw3@PREC_SUFFIX@_threads_la_SOURCES = api.c conf.c threads.c \ +#threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \ +#vrank-geq1-rdft2.c f77api.c f77funcs.h +#libfftw3@PREC_SUFFIX@_threads_la_CFLAGS = $(PTHREAD_CFLAGS) +#libfftw3@PREC_SUFFIX@_threads_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ +# +#libfftw3@PREC_SUFFIX@_omp_la_SOURCES = api.c conf.c openmp.c \ +#threads.h dft-vrank-geq1.c ct.c rdft-vrank-geq1.c hc2hc.c \ +#vrank-geq1-rdft2.c f77api.c f77funcs.h +#libfftw3@PREC_SUFFIX@_omp_la_CFLAGS = $(OPENMP_CFLAGS) +#libfftw3@PREC_SUFFIX@_omp_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ diff --git a/external/cmake/fftw-3.3/tools/CMakeLists.txt b/external/cmake/fftw-3.3/tools/CMakeLists.txt new file mode 100644 index 0000000000000..3d39ecbc87049 --- /dev/null +++ b/external/cmake/fftw-3.3/tools/CMakeLists.txt @@ -0,0 +1,68 @@ +########### next target ############### + +if(THREADS) + set(CMAKE_C_COMPILER_CFLAGS ${PTHREAD_CFLAGS}) + if(NOT COMBINED_THREADS) + set(LIBFFTWTHREADS = libfftw3${PREC_SUFFIX}_threads) + endif() +elseif(OPENMP) + set(CMAKE_C_COMPILER_CFLAGS ${OPENMP_CFLAGS}) + set(LIBFFTWTHREADS libfftw3${PREC_SUFFIX}_omp) +endif() + +set(fftw${PREC_SUFFIX}-wisdom_SRCS fftw-wisdom.c) + +set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}) +string(REPLACE "${TOP_CMAKE_SRCDIR}" "" SRCDIR "${SRCDIR}") +prefixlist(fftw${PREC_SUFFIX}-wisdom_SRCS "${TOP_SRCDIR}/${SRCDIR}/") + +include_directories("${TOP_SRCDIR}/libbench2" "${TOP_SRCDIR}/tests" "${TOP_SRCDIR}/api") + +add_executable(fftw${PREC_SUFFIX}-wisdom ${fftw${PREC_SUFFIX}-wisdom_SRCS}) + +target_link_libraries(fftw${PREC_SUFFIX}-wisdom bench_lib ${LIBFFTWTHREADS} fftw3${PREC_PREFIX} bench2) + +#target_link_libraries(fftw${PREC_SUFFIX}-wisdom ${KDE4_KDECORE_LIBS}) + +install(TARGETS fftw${PREC_SUFFIX}-wisdom ${INSTALL_TARGETS_DEFAULT_ARGS} DESTINATION bin) + + +########### install files ############### + +install(PROGRAMS fftw-wisdom-to-conf DESTINATION bin) + + + +#original Makefile.am contents follow: + +#AM_CPPFLAGS = -I$(top_srcdir)/libbench2 -I$(top_srcdir)/api +# +#bin_SCRIPTS = fftw-wisdom-to-conf +#bin_PROGRAMS = fftw@PREC_SUFFIX@-wisdom +# +#BUILT_SOURCES = fftw-wisdom-to-conf fftw@PREC_SUFFIX@-wisdom.1 +#EXTRA_DIST = fftw-wisdom-to-conf.in +# +#dist_man_MANS = fftw-wisdom-to-conf.1 fftw@PREC_SUFFIX@-wisdom.1 +#EXTRA_MANS = fftw_wisdom.1.in +#fftw@PREC_SUFFIX@-wisdom.1: fftw_wisdom.1 +# rm -f $@ +# cp fftw_wisdom.1 $@ +# +#if THREADS +#fftw@PREC_SUFFIX@_wisdom_CFLAGS = $(PTHREAD_CFLAGS) +#if !COMBINED_THREADS +#LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_threads.la +#endif +#else +#if OPENMP +#fftw@PREC_SUFFIX@_wisdom_CFLAGS = $(OPENMP_CFLAGS) +#LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_omp.la +#endif +#endif +# +#fftw@PREC_SUFFIX@_wisdom_SOURCES = fftw-wisdom.c +#fftw@PREC_SUFFIX@_wisdom_LDADD = $(top_builddir)/tests/bench-bench.o \ +#$(top_builddir)/tests/bench-fftw-bench.o $(LIBFFTWTHREADS) \ +#$(top_builddir)/libfftw3@PREC_SUFFIX@.la \ +#$(top_builddir)/libbench2/libbench2.a $(THREADLIBS) diff --git a/external/cmake/tests.c b/external/cmake/tests.c new file mode 100644 index 0000000000000..85e1aaf0ee39b --- /dev/null +++ b/external/cmake/tests.c @@ -0,0 +1,17 @@ +#ifdef TIME_WITH_SYS_TIME +//Standard test for TIME_WITH_SYS_TIME + +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} + +#endif diff --git a/external/fdlibm/CMakeLists.txt b/external/fdlibm/CMakeLists.txt new file mode 100644 index 0000000000000..4d308f583fe03 --- /dev/null +++ b/external/fdlibm/CMakeLists.txt @@ -0,0 +1,167 @@ +cmake_minimum_required(VERSION 2.8) +project(fdlibm) + +enable_language(C) + +IF (NOT DEFINED FDLIBM_MODE) + set(FDLIBM_MODE _IEEE_LIBM) +ENDIF() +add_definitions("-D${FDLIBM_MODE}") + +include(TestBigEndian) + +TEST_BIG_ENDIAN(IS_BIG_ENDIAN) +if(${IS_BIG_ENDIAN}) +add_definitions("-D__BIG_ENDIAN") +else() +add_definitions("-D__LITTLE_ENDIAN") +endif() + +set(SOURCES +b_exp.c +b_log.c +b_tgamma.c +e_acos.c +e_acosf.c +e_acosh.c +e_acoshf.c +e_asin.c +e_asinf.c +e_atan2.c +e_atan2f.c +e_atanh.c +e_atanhf.c +e_cosh.c +e_coshf.c +e_exp.c +e_expf.c +e_fmod.c +e_fmodf.c +e_gamma.c +e_gamma_r.c +e_hypot.c +e_hypotf.c +e_j0.c +e_j0f.c +e_j1.c +e_j1f.c +e_jn.c +e_jnf.c +e_lgamma.c +e_lgamma_r.c +e_lgammaf_r.c +e_log.c +e_log10.c +e_log10f.c +e_log2.c +e_log2f.c +e_logf.c +e_pow.c +e_powf.c +e_rem_pio2.c +e_rem_pio2f.c +e_remainder.c +e_remainderf.c +e_scalb.c +e_scalbf.c +e_sinh.c +e_sinhf.c +e_sqrt.c +e_sqrtf.c +k_cos.c +k_cosf.c +k_rem_pio2.c +k_rem_pio2f.c +k_sin.c +k_sinf.c +k_standard.c +k_tan.c +k_tanf.c +s_asinh.c +s_asinhf.c +s_atan.c +s_atanf.c +s_cbrt.c +s_cbrtf.c +s_ceil.c +s_ceilf.c +s_copysign.c +s_copysignf.c +s_cos.c +s_cosf.c +s_erf.c +s_erff.c +s_exp2f.c +s_expm1.c +s_expm1f.c +s_fabs.c +s_fabsf.c +s_finite.c +s_finitef.c +s_floor.c +s_floorf.c +s_fmaxf.c +s_fminf.c +s_frexp.c +s_frexpf.c +s_ilogb.c +s_ilogbf.c +s_isnan.c +s_ldexp.c +s_lib_version.c +s_log1p.c +s_log1pf.c +s_logb.c +s_logbf.c +s_matherr.c +s_modf.c +s_modff.c +s_nextafter.c +s_nextafterf.c +s_remquof.c +s_rint.c +s_rintf.c +s_roundf.c +s_scalbn.c +s_scalbnf.c +s_signbit.c +s_signgam.c +s_significand.c +s_significandf.c +s_sin.c +s_sinf.c +s_tan.c +s_tanf.c +s_tanh.c +s_tanhf.c +s_trunc.c +s_truncf.c +w_acos.c +w_acosh.c +w_asin.c +w_atan2.c +w_atanh.c +w_cosh.c +w_dremf.c +w_exp.c +w_fmod.c +w_gamma.c +w_gamma_r.c +w_gammaf.c +w_hypot.c +w_j0.c +w_j1.c +w_jn.c +w_lgamma.c +w_lgamma_r.c +w_lgammaf.c +w_log.c +w_log10.c +w_pow.c +w_remainder.c +w_scalb.c +w_sinh.c +w_sqrt.c +) + +add_library(fdlibm STATIC ${SOURCES}) \ No newline at end of file diff --git a/external/fdlibm/libm387/CMakeLists.txt b/external/fdlibm/libm387/CMakeLists.txt new file mode 100644 index 0000000000000..5454f53eee856 --- /dev/null +++ b/external/fdlibm/libm387/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 2.8) +project(libm387) + +enable_language(ASM) + +set(CMAKE_ASM_FLAGS_RELEASE -m32 -fPIC) +set(CMAKE_ASM_FLAGS_RELEASE -m32 -fPIC) + +set(CMAKE_SHARED_LINKER_FLAGS -nostdlib -m32) + +set(SOURCES e_exp.S +e_fmod.S +e_log.S +e_log10.S +e_log10f.S +e_logf.S +e_remainder.S +e_remainderf.S +e_remainderl.S +e_sqrt.S +e_sqrtf.S +e_sqrtl.S +s_ceil.S +s_ceilf.S +s_ceill.S +s_copysign.S +s_copysignf.S +s_copysignl.S +s_cos.S +s_fabs.S +s_fabsf.S +s_finite.S +s_floor.S +s_floorf.S +s_floorl.S +s_llrint.S +s_llrintf.S +s_llrintl.S +s_logb.S +s_logbf.S +s_logbl.S +s_lrint.S +s_lrintf.S +s_lrintl.S +s_remquo.S +s_remquof.S +s_remquol.S +s_rint.S +s_rintf.S +s_rintl.S +s_scalbn.S +s_scalbnf.S +s_scalbnl.S +s_significand.S +s_significandf.S +s_sin.S +s_tan.S +s_trunc.S +s_truncf.S +s_truncl.S +) + +add_library(libm387 SHARED ${SOURCES}) \ No newline at end of file diff --git a/external/fdlibm/libm64/CMakeLists.txt b/external/fdlibm/libm64/CMakeLists.txt new file mode 100644 index 0000000000000..4edd2d345d262 --- /dev/null +++ b/external/fdlibm/libm64/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 2.8) +project(libm64) + +enable_language(ASM) + +set(CMAKE_ASM_FLAGS_RELEASE -m64 -fPIC) +set(CMAKE_ASM_FLAGS_RELEASE -m64 -fPIC) + +set(CMAKE_SHARED_LINKER_FLAGS -nostdlib -m64) + +set(SOURCES e_remainder.S +e_remainderf.S +e_remainderl.S +e_sqrt.S +e_sqrtf.S +e_sqrtl.S +s_fabs.S +s_fabsf.S +s_llrint.S +s_llrintf.S +s_llrintl.S +s_logbl.S +s_lrint.S +s_lrintf.S +s_lrintl.S +s_remquo.S +s_remquof.S +s_remquol.S +s_rintl.S +s_scalbn.S +s_scalbnf.S +s_scalbnl.S) + +add_library(libm64 SHARED ${SOURCES}) \ No newline at end of file