Missing FFTW support on 5.34.26 (VC++ 12 release version)

I am trying to use the FFTW wrappers through the FFT.C script under tutorials. The script fails to load FFTW.dll and reports an error:

root [0] .L C:\root\5.34.26\tutorials\fft\fft.c root [1] FFT() Error in <TWinNTSystem::DynamicPathName>: FFTW does not exist in C:\root\5.34.26\bin;C:\Program Files (x86)\Git\git-cheetah\..\;C:\fftw\bin\;.;C:\root\5.34.26/bin;C:\root\5.34.26/lib;C:\root\5.34.26/cint/cint/stl;C:\root\5.34.26\bin, or has wrong file extension (.dll) Error in <TVirtualFFT::FFT>: handler not found Error: illegal pointer to class object hm 0x0 1396 C:\root\5.34.26\tutorials\fft\fft.c(95) *** Interpreter error recovered *** root [2]

I have added the win32 version of fftw3 (fftw-3.3.4-dll32) to my path but still I see no change. Also I have noticed that none of the precompiled versions of FFTW presented in http://www.fftw.org/install/windows.html contain FFTW.dll. Just to be on the safe side I have tested this on all three release versions of 5.34.26 for windows (VC++10,VC++11,VC++12) as well as the release versions of 5.34.21 and 5.34.23 with no success.

After looking at [url]RooFit error: <TVirtualFFT::FFT>: handler not found I run root-config --has-fftw3 in all of the above cases and it seems that none of them have FFTW support enabled.

Is it possible that FFTW was somehow left out of the latest root versions? If so could one of the package maintainers be so kind as to upload an FFTW enabled version to the 5.34 production version downloads page?

Hi,

Since it is now easy to build ROOT from source on Windows (with CMake), we only provide a minimal set of externals (e.g. Python, GSL)

Cheers, Bertrand.

[quote=“bellenot”]Hi,

Since it is now easy to build ROOT from source on Windows (with CMake), we only provide a minimal set of externals (e.g. Python, GSL)

Cheers, Bertrand.[/quote]

Dear Bertrand,

I have a almost same problem as BQstel’s, and have been dealing with FFTW error (missing libFFTW.dll) whole day but in vain.
Then I follow your suggestion and the instruction on web https://root.cern.ch/drupal/content/building-root-cmake, tring to build ROOT v5.34.26 VC++ 12 with CMake.

But after typing

or use Cmake-gui to configure and generate binary,

what exactly should I do to complete building?
I cannot find where I can get a complete instruction for WIndows.
Please forgive my ignorance…

Best regards,
Shih-Hao

Dear Shih-Hao,

Once you generated the solution file with CMake, you have two options:
[ul][li]Open the generated ROOT.sln with Visual Studio and build it[/li]
[li]Use the command line and type: cmake --build . --config Release (or Debug)[/li][/ul]
And BTW, if you want to use FFTW, you have to add the FFTW include directory in FFTW_INCLUDE_DIR, the fftw library in FFTW_LIBRARY, and check the fftw checkbox

Cheers, Bertrand.

Dear bellenot,
I am trying to do a build on a pure copy of the v5-34-00-patches branch. To do that I use the latest cmake (as suggested) and run the following commands:

c:\root\wrk> cmake -G"Visual Studio 11 2012" ..\src\root\ -DCMAKE_BUILD_TYPE=Release
c:\root\wrk> cmake --build . --config Release

The build process always fails irrespective of which method I use to do the build (command line or from the VS IDE). The error output at the end is as follows (I am including the full log here: err_log_build.txt (142 KB)):

Done Building Project "c:\root\wrk\ALL_BUILD.vcxproj" (default targets) -- FAILED.

Build FAILED.
"c:\root\wrk\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\root\wrk\graf2d\asimage\ASImage.vcxproj" (default target) (2) ->
"C:\root\wrk\graf2d\graf\Graf.vcxproj" (default target) (25) ->
"C:\root\wrk\hist\hist\Hist.vcxproj" (default target) (26) ->
"C:\root\wrk\math\mathcore\MathCore.vcxproj" (default target) (27) ->
(CustomBuild target) ->
  CUSTOMBUILD : warning : Error occurred during reading source files [C:\root\wrk\math\mathcore\MathCore.vcxproj]
  CUSTOMBUILD : warning : Error occurred during dictionary source generation [C:\root\wrk\math\mathcore\MathCore.vcxproj]

"c:\root\wrk\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\root\wrk\graf2d\asimage\ASImage.vcxproj" (default target) (2) ->
"C:\root\wrk\graf2d\graf\Graf.vcxproj" (default target) (25) ->
"C:\root\wrk\io\io\RIO.vcxproj" (default target) (29) ->
  CUSTOMBUILD : warning : Error occurred during reading source files [C:\root\w
rk\io\io\RIO.vcxproj]
  CUSTOMBUILD : warning : Error occurred during dictionary source generation [C
:\root\wrk\io\io\RIO.vcxproj]


"c:\root\wrk\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\root\wrk\graf2d\asimage\ASImage.vcxproj" (default target) (2) ->
"C:\root\wrk\graf2d\graf\Graf.vcxproj" (default target) (25) ->
"C:\root\wrk\hist\hist\Hist.vcxproj" (default target) (26) ->
"C:\root\wrk\math\mathcore\MathCore.vcxproj" (default target) (27) ->
(CustomBuild target) ->
  CUSTOMBUILD : Syntax error : defined(R__AIX)||defined(R__SOLARIS_CC50)|| C:/r
oot/src/root/math/mathcore/inc\TMath.h(369) [C:\root\wrk\math\mathcore\MathCore
.vcxproj]
  CUSTOMBUILD : error : ..\..\bin\rootcint_tmp.exe: error loading headers... [C
:\root\wrk\math\mathcore\MathCore.vcxproj]


"c:\root\wrk\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\root\wrk\graf2d\asimage\ASImage.vcxproj" (default target) (2) ->
"C:\root\wrk\graf2d\graf\Graf.vcxproj" (default target) (25) ->
"C:\root\wrk\io\io\RIO.vcxproj" (default target) (29) ->
  CUSTOMBUILD : Syntax error : (defined(__linux)||defined(__APPLE__))&& C:/root/wrk/include\Bytes.h(44) [C:\root\wrk\io\io\RIO.vcxproj]
  CUSTOMBUILD : Syntax error : (defined(_MSC_VER)&&(_MSC_VER<1300))||defined(R__ALPHA)|| C:/root/src/root/io/io/inc\TStreamerInfo.h(38) [C:\root\wrk\io\io\RIO.vcxproj]
  CUSTOMBUILD : error : ..\..\bin\rootcint_tmp.exe: error loading headers... [C:\root\wrk\io\io\RIO.vcxproj]

    4 Warning(s)
    5 Error(s)

Time Elapsed 00:03:27.16

err_log.txt (1.06 KB)

This is most probably due to a Windows line endings issue. If you use git to checkout ROOT, please make sure your gitconfig file (in C:\Program Files (x86)\Git\etc) contains: “autocrlf = input”. And checkout again

Cheers, Bertrand.

[quote=“bellenot”]Dear Shih-Hao,

Once you generated the solution file with CMake, you have two options:
[ul][li]Open the generated ROOT.sln with Visual Studio and build it[/li]
[li]Use the command line and type: cmake --build . --config Release (or Debug)[/li][/ul]
And BTW, if you want to use FFTW, you have to add the FFTW include directory in FFTW_INCLUDE_DIR, the fftw library in FFTW_LIBRARY, and check the fftw checkbox

Cheers, Bertrand.[/quote]

Thanks for reply, Bertrand!
I tried the following commands to build, but there’s still errors popping out:

  1. I create a directory under the unzipped source directory as workdir:
C:\Users\ShihHao\Downloads\root_v5.34.26.source/temp
  1. generate binary with fftw path specified
cmake -G"Visual Studio 12 2013"  ..\root -DCMAKE_INSTALL_PREFIX=C:\root_5.34.26 
-DFFTW_INCLUDE_DIR=C:\Users\ShihHao\Documents\fftw-3.3.4-dll32 -DFFTW_LIBRARY=C:\Users\ShihHao\Documents\fftw-3.3.4-dll32\libfftw3-3.dll
  1. check if FFTW boolean in CMakeCache.txt is on:
//Fast Fourier Transform support, requires libfftw3
fftw3:BOOL=ON

so far so good

  1. build,
cmake --build . --config Release

then 51 warnings and 101 errors occur:

Warnings are like the following for several files:

C:\Users\ShihHao\Downloads\root_v5.34.26.source\root\cint\cint\src\decl.cxx(1560): warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss. [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\cint\cint\Cint_static.vcxproj]

after google it, I open those files in VS and save in UTF-8 format and rebuild, then 51 warning reduces to 2.

Errors are:

C:\Users\ShihHao\Documents\fftw-3.3.4-dll32\libfftw3-3.dll : fatal error LNK1107: invalid or corrupt file: cannot read at location: 0x420  [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\math\fftw\FFTW.vcxproj]

and

  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6132): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6133): error C2059: Syntax error : '{' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6133): error C2059: Syntax error : ',' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6134): error C2059: Syntax error : ',' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6135): error C2059: Syntax error : ',' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6136): error C2059: Syntax error : ',' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6137): error C2059: Syntax error : ',' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6138): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6139): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6140): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6141): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6142): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6143): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6144): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6146): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6147): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6148): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6149): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6150): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]

......

  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6251): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.EXE"' : 傳回碼 '0x2' [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6252): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6253): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  c:\users\shihhao\downloads\root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h(6254): error C2001: Newline in constant [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]
  guniprop.c(913): fatal error C1004: unexpected end of file found [C:\Users\ShihHao\Downloads\root_v5.34.26.source\temp\graf2d\win32gdk\glib.vcxproj]

(I translate some of error message from Chinese so it may not be exact)

I open \root_v5.34.26.source\temp\graf2d\win32gdk\gdk\src\glib\gunichartables.h in VS, and the code with errors is

/* Table of casefolding cases that can't be derived by lowercasing
 */
static struct {
  guint16 ch;
  gchar data[7];
} casefold_table[] = {
{ 0xb5, "μ" },
{ 0xdf, "ss" },
{ 0x131, "i" },
{ 0x149, "ʼn" },
{ 0x17f, "s" },
{ 0x1f0, "ǰ" },
{ 0x345, "ι" },
{ 0x390, "ΐ" },
{ 0x3b0, "ΰ" },
{ 0x3c2, "σ" },
{ 0x3d0, "β" },
{ 0x3d1, "θ" },
{ 0x3d5, "φ" },
...
{ 0xfb14, "մե" },
{ 0xfb15, "մի" },
{ 0xfb16, "վն" },
{ 0xfb17, "մխ" },
};

What’s wrong with these? and how can I fix it?

Shih-Hao

Hi Shih-Hao,

[quote=“wsh4180”]1. I create a directory under the unzipped source directory as workdir:[/quote]I would advise to not mix everything, but keep source directories separated, to avoid confusion…

[quote=“wsh4180”]2. generate binary with fftw path specified

cmake -G"Visual Studio 12 2013"  ..\root -DCMAKE_INSTALL_PREFIX=C:\root_5.34.26 
-DFFTW_INCLUDE_DIR=C:\Users\ShihHao\Documents\fftw-3.3.4-dll32 -DFFTW_LIBRARY=C:\Users\ShihHao\Documents\fftw-3.3.4-dll32\libfftw3-3.dll

[/quote]Don’t specify the .dll, but the .lib On Windows, you must link against a .lib library (see for example this link)

And for the other errors, I have no idea. How did you take the source code? from the tar file or with git?
Since it seems you are new to programming on Windows, could you ask one of your colleagues to give you some help?

Cheers, Bertrand.

Apparently FFTW is supported under 5.34.26 after all. I tried to do a build from sources as bellenot suggested and still I had no luck running the FFTW demo (I had set all required FFTW variables in the cmake configuration). I downloaded the two previous binary releases of root and I encountered the exact same issue(the FFTW demo does not work either in v5.34.23 or in v5.34.21 under Windows 8).
The solution was to simply copy all files from the FFTW 32-bit binary version into the bin folder. After that everything worked fine. I think this must be some issue in Windows 8 related to the way root uses the path variable.