From 7ae0de3a06dbd4be4eecf37449e617a83f0401f0 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong" Date: Sun, 23 May 2021 22:53:48 +0200 Subject: [PATCH] Some improvements in build, some comments added --- CMakeLists.txt | 19 ++++++++++++------- README.md | 8 ++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 790bcf1..ef99a47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,11 @@ add_definitions(-DLASP_MAX_NUM_CHANNELS=80) add_definitions(-DLASP_MAX_NFFT=33554432) # 2**25 # ####################################### End of user-adjustable variables section - +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_C_STANDARD 11) # ############### Choose an fft backend here -if(LASP_FFTW_BACKEND AND LASP_FFTPACK_BACKEND) +if(((LASP_FFTW_BACKEND AND LASP_FFTPACK_BACKEND) OR ((NOT (LASP_FFTPACK_BACKEND) AND (NOT LASP_FFTW_BACKEND))))) message(FATAL_ERROR "Either FFTW or Fftpack backend should be chosen. Please disable one of them") endif() @@ -61,6 +62,7 @@ if(LASP_FLOAT STREQUAL "double") add_definitions(-DLASP_FLOAT=64) add_definitions(-DLASP_DOUBLE_PRECISION) else() + # TODO: This has not been tested for a long time. add_definitions(-DLASP_FLOAT=32) add_definitions(-DLASP_SINGLE_PRECISION) endif(LASP_FLOAT STREQUAL "double") @@ -78,19 +80,22 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra -Wno-type-limits \ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") set(win32 true) + set(home $ENV{USERPROFILE}) + # set(miniconda_dir ${home}\\Miniconda3) + message("Building for Windows") include_directories( ..\\rtaudio C:\\mingw\\mingw64\\include\\OpenBLAS - link_directories(C:\\Users\\User\\miniconda3\\Library\\include) + link_directories(${home}\\miniconda3\\Library\\include) ) + set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} $miniconda_dir\\Lib\\cmake") + # include( add_definitions(-DMS_WIN64) link_directories(C:\\mingw\\mingw64\\lib) - LINK_DIRECTORIES(C:\\Users\\User\\miniconda3) - link_directories(C:\\mingw\\mingw64\\bin) link_directories(C:\\mingw\\mingw64\\bin) link_directories(..\\rtaudio) - link_directories(C:\\Users\\User\\Miniconda3) + link_directories(${home}\\Miniconda3) add_definitions(-DHAS_RTAUDIO_WIN_WASAPI_API) else() # Linux compile set(win32 false) @@ -142,7 +147,7 @@ set(CYTHON_EXTRA_C_FLAGS "-Wno-sign-compare -Wno-cpp -Wno-implicit-fallthrough - set(CYTHON_EXTRA_CXX_FLAGS "-Wno-sign-compare -Wno-cpp -Wno-implicit-fallthrough -Wno-strict-aliasing") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra \ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra \ -Wno-type-limits") # Debug make flags diff --git a/README.md b/README.md index be7c5ba..cdb46df 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,14 @@ compilation: - libopenblas-base - libopenblas-dev +#### Windows specific + +Tested using a Anacond / Miniconda Python environment. Please first run the following command: + +`conda install fftw` + +in case you want the *FFTW* fft backend. + ### Dependencies #### Ubuntu / Linux Mint