...
 
Commits (4)
......@@ -17,7 +17,7 @@ if ( NOT WIN32 )
endif ()
if( NOT DEFINED ITA_FFT_WITH_FFTW3 )
set( ITA_FFT_WITH_FFTW3 ON CACHE BOOL "Build with FFTW3 for fast fourier transforms" )
set( ITA_FFT_WITH_FFTW3 ON CACHE BOOL "Build with FFTW3 for fast fourier transforms (will force the ITA libraries to select the GNU GPL license)" )
endif( )
if( NOT DEFINED ITA_FFT_WITH_INTEL_MKL10 )
......@@ -51,9 +51,10 @@ set( ITAFFTSources
src/ITAFFTUtils.cpp
)
set( ITA_SELECTIVE_LICENSE_DEPENDENCY_GPL OFF )
if( ITA_FFT_WITH_FFTW3 )
set( ITAFFTSources "${ITAFFTSources}" src/FFTW3Backend.h src/FFTW3Backend.cpp )
add_definitions( -DITAFFT_WITH_FFTW3 )
add_definitions( -DITAFFT_WITH_FFTW3 )
endif( )
if( ITA_FFT_WITH_INTEL_MKL10 )
......@@ -62,7 +63,6 @@ if( ITA_FFT_WITH_INTEL_MKL10 )
endif( )
# compiler settings
# compiler settings
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
......@@ -83,6 +83,30 @@ add_library( ITAFFT ${ITAFFTHeader} ${ITAFFTSources} )
target_link_libraries( ITAFFT ${VISTA_USE_PACKAGE_LIBRARIES} )
# selective license
if( ITA_FFT_WITH_FFTW3 )
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
# Take care of license here
message( "FFTW3 requires copying under the terms of the GNU General Public License. This license includes a copyleft and may require your source code to be published under the same terms. Please respect the license agreements. Will include the GNU GPL COPYING file into distribution." )
set( SELECTED_LICENSE "GNU General Public License" )
set( GPL_DEPENDENCIES "FFTW3" )
configure_file( COPYING.proto ${CMAKE_CURRENT_SOURCE_DIR}/COPYING @ONLY )
install( FILES COPYING DESTINATION . )
else( )
# Pass it on to parent
set( ITA_SELECTIVE_LICENSE_DEPENDENCY_GPL ON PARENT_SCOPE )
endif( )
endif( )
# config
vista_configure_lib( ITAFFT )
vista_install( ITAFFT )
......
Copyright 2015-2018 Institute of Technical Acoustics (ITA), RWTH Aachen University
This binary packages, although generated from code published under
Apache License, Version 2.0 requires distribution under the terms of
the @SELECTED_LICENSE@. Options in the build configuration have been
selected that require linking against libraries that include a copyleft.
GNU GPL dependencies: @GPL_DEPENDENCIES@
> This distribution is subject to VA's selective license dependency and may require you to publish your derived work under a copyleft license as well. The details are described in [README.md](https://git.rwth-aachen.de/ita/ITACoreLibs/) of ITACoreLibs.
This program is free software: you can redistribute it and/or modify
it under the terms of the @SELECTED_LICENSE@ as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the @SELECTED_LICENSE@
along with this program. If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
## ITADataSources
## ITAFFT
ITAFFT is a backend-configurable C++ library for fast Fourier transformations. Currently, FFTW and Intel MKL is supported.
ITAFFT is a component of [ITACoreLibs](https://git.rwth-aachen.de/ita/ITACoreLibs), a collection of C++ libraries for virtual acoustics.
......
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_FFT
#define INCLUDE_WATCHER_ITA_FFT
......
......@@ -3,7 +3,7 @@
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
* RWTH Aachen University, Germany, 2015-2018
*
* ----------------------------------------------------------------
* ____ __________ _______
......
......@@ -3,7 +3,7 @@
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
* RWTH Aachen University, Germany, 2015-2018
*
* ----------------------------------------------------------------
* ____ __________ _______
......
......@@ -15,10 +15,14 @@
#endif
ITAFFT::ITAFFT() : m_pRealization(NULL) {}
ITAFFT::ITAFFT() : m_pRealization( NULL )
{
}
ITAFFT::ITAFFT(int type, int size, float* in, float* out, int iPlannungMethod) : m_pRealization(NULL) {
plan(type, size, in, out, iPlannungMethod);
ITAFFT::ITAFFT( int type, int size, float* in, float* out, int iPlannungMethod )
: m_pRealization( NULL )
{
plan( type, size, in, out, iPlannungMethod );
}
ITAFFT::~ITAFFT()
......@@ -26,18 +30,20 @@ ITAFFT::~ITAFFT()
delete m_pRealization;
}
bool ITAFFT::isPlanned() {
return (m_pRealization != NULL);
bool ITAFFT::isPlanned()
{
return ( m_pRealization != NULL );
}
void ITAFFT::plan(int type, int size, float* in, float* out, int iPlannungMethod) {
void ITAFFT::plan( int type, int size, float* in, float* out, int iPlannungMethod )
{
// Falls bereits geplant wurde, wird der alte Plan verworfen
delete m_pRealization;
unsigned int uiFlags = 0;
if (iPlannungMethod == PLAN_USING_MEASUREMENT)
if( iPlannungMethod == PLAN_USING_MEASUREMENT )
uiFlags |= FFTW_MEASURE;
if (iPlannungMethod == PLAN_USING_ESTIMATION)
if( iPlannungMethod == PLAN_USING_ESTIMATION )
uiFlags |= FFTW_ESTIMATE;
#ifdef ITAFFT_WITH_FFTW3
......@@ -45,26 +51,27 @@ void ITAFFT::plan(int type, int size, float* in, float* out, int iPlannungMethod
#endif
#ifdef ITAFFT_WITH_MKL10
m_pRealization = MKL10Backend::getInstance()->plan(type, size, in, out, uiFlags);
m_pRealization = MKL10Backend::getInstance()->plan( type, size, in, out, uiFlags );
#endif
if (m_pRealization == NULL) ITA_EXCEPT1(UNKNOWN, "Planning of the FFT failed");
if( m_pRealization == NULL )
ITA_EXCEPT1( UNKNOWN, "Planning of the FFT failed" );
}
void ITAFFT::execute()
void ITAFFT::execute()
{
if (m_pRealization == NULL)
ITA_EXCEPT1(MODAL_EXCEPTION, "Attempt to execute unplanned ITAFFT");
if( m_pRealization == NULL )
ITA_EXCEPT1( MODAL_EXCEPTION, "Attempt to execute unplanned ITAFFT" );
m_pRealization->execute();
}
void ITAFFT::execute(float* in, float* out)
void ITAFFT::execute( float* in, float* out )
{
if (m_pRealization == NULL)
ITA_EXCEPT1(MODAL_EXCEPTION, "Attempt to execute unplanned ITAFFT");
m_pRealization->execute(in, out);
if( m_pRealization == NULL )
ITA_EXCEPT1( MODAL_EXCEPTION, "Attempt to execute unplanned ITAFFT" );
m_pRealization->execute( in, out );
}
std::string ITAFFT::toString() {
return (m_pRealization == NULL ? std::string("unplanned ITAFFT") : m_pRealization->toString());
return ( m_pRealization == NULL ? std::string( "unplanned ITAFFT" ) : m_pRealization->toString() );
}
/*
* ITAFFT, eine Wrapper-Bibliothek fr schnelle Fouriertransformationen
* ----------------------------------------------------------------
*
* Autor: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* (c) Copyright Institut fr Technische Akustik (ITA), RWTH Aachen
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
// $Id: ITAFFTBackend.h,v 1.2 2009-02-10 22:37:42 stienen Exp $
#ifndef INCLUDE_WATCHER_ITA_FFT_BACKEND
#define INCLUDE_WATCHER_ITA_FFT_BACKEND
......
/*
* ITAFFT, eine Wrapper-Bibliothek fr schnelle Fouriertransformationen
* ----------------------------------------------------------------
*
* Autor: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* (c) Copyright 2008 Institut fr Technische Akustik (ITA), RWTH Aachen
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
// $Id: ITAFFTFactory.h,v 1.1 2008-02-07 19:14:44 fwefers Exp $
#ifndef INCLUDE_WATCHER_ITA_FFT_FACTORY
#define INCLUDE_WATCHER_ITA_FFT_FACTORY
......
/*
* ITAFFT, eine Wrapper-Bibliothek für schnelle Fouriertransformationen
* ----------------------------------------------------------------
*
* Autor: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* (c) Copyright Institut für Technische Akustik (ITA), RWTH Aachen
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
// $Id: ITAFFTRealization.h,v 1.2 2009-02-10 22:37:42 stienen Exp $
#ifndef INCLUDE_WATCHER_ITA_FFT_REALIZATION
#define INCLUDE_WATCHER_ITA_FFT_REALIZATION
......
/*
* ITAFFT, eine Wrapper-Bibliothek fr schnelle Fouriertransformationen
* ----------------------------------------------------------------
*
* Autor: Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* (c) Copyright Institut fr Technische Akustik (ITA), RWTH Aachen
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
// $Id: MKL10Backend.h,v 1.1 2009-12-14 10:19:17 fwefers Exp $
#ifndef __MKL10_BACKEND_H__
#define __MKL10_BACKEND_H__
#ifndef IW_MKL10_BACKEND
#define IW_MKL10_BACKEND
#ifdef WITH_MKL10
#ifdef ITAFFT_WITH_FFTW3
// Hinweis: Diese Implementierung nutzt derzeit das FFTW3-Interface der MKL
......@@ -20,7 +27,8 @@
#include <ITAFFTBackend.h>
#include <ITAFFTRealization.h>
class MKL10Realization : public ITAFFTRealization {
class MKL10Realization : public ITAFFTRealization
{
public:
MKL10Realization(int type, int size, float* in, float* out);
~MKL10Realization();
......@@ -38,7 +46,8 @@ private:
std::string m_sInfo;
};
class MKL10Backend : public ITAFFTBackend {
class MKL10Backend : public ITAFFTBackend
{
public:
static MKL10Backend* getInstance();
......@@ -48,10 +57,6 @@ private:
static MKL10Backend* m_pInstance; // Singleton-Instanz
};
#endif // WITH_MKL10
#endif // __MKL10_BACKEND_H__
#endif // ITAFFT_WITH_FFTW3
#endif // IW_MKL10_BACKEND