clij / clij2-fft

21 stars 6 forks source link

Can't build the source `CL/cl.h` not found. #28

Closed NicoKiaru closed 7 months ago

NicoKiaru commented 7 months ago

Hello!

I'm trying to run the code in my IDE (intellij) and try to follow the build instructions (https://clij.github.io/clij2-fft/docs/buildlibs/build).

Step 1: I've dowloaded the zipped windows release (I have win 11) of clFFT (v2.12.2), unpacked it and made sure this directory was valid: "C:/OpenCL/clFFT-2.12.2-Windows-x64/lib64/import/" Step 2: I already have Git installed and Visual Studio Community 2022 c++ compiler. I assumed version 2022 vs 2019 should be ok Step 3: I modified one path of cppbuild.sh because my CUDA toolkit is v11.3 and not v11.2 (C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.3/include/)

Still when running cppbuild.sh in the shell precised in the instructions I get this error:

chiarutt@SV-01-099 MINGW64 ~/Dropbox/BIOP/clij2-fft/native (master)
$ ./cppbuild.sh
Detected platform "windows-x86_64"
Building for platform "windows-x86_64"
Installing "clij2fft"
~/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild ~/Dropbox/BIOP/clij2-fft/native
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/chiarutt/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild

Microsoft (R) Program Maintenance Utility Version 14.35.32215.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[ 33%] Converting totalvarationterm.cl to string.
calling python stringify
[ 33%] Built target generate_preamble
[ 66%] Building CXX object CMakeFiles/clij2fft.dir/clij2fft.cpp.obj
clij2fft.cpp
C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\clij2fft.cpp(15): fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\clij2fft.dir\clij2fft.cpp.obj.d --working-dir=C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\cppbuild --filter-prefix="Note: including file: " -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe @C:\Users\chiarutt\AppData\Local\Temp\nm3F32.tmp' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\clij2fft.dir\build.make /nologo -SL                 CMakeFiles\clij2fft.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S                  all' : return code '0x2'
Stop.

Any idea what could be wrong ? What did I forget ? I don't get where CL/cl.h should be...

NicoKiaru commented 7 months ago

I've deleted the previously generated cppbuild folder and relaunch the script. The console output is a bit longer but I think I get the same error:

./cppbuild.sh
Detected platform "windows-x86_64"
Building for platform "windows-x86_64"
Installing "clij2fft"
~/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild ~/Dropbox/BIOP/clij2-fft/native
-- The C compiler identification is MSVC 19.35.32215.0
-- The CXX compiler identification is MSVC 19.35.32215.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for CL_VERSION_3_0
-- Looking for CL_VERSION_3_0 - found
-- Found OpenCL: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/lib/x64/OpenCL.lib (found version "3.0")
-- Found Python3: C:/ProgramData/miniforge3/python.exe (found version "3.10.12") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/chiarutt/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild

Microsoft (R) Program Maintenance Utility Version 14.35.32215.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[ 33%] Converting totalvarationterm.cl to string.
calling python stringify
[ 33%] Built target generate_preamble
[ 66%] Building CXX object CMakeFiles/clij2fft.dir/clij2fft.cpp.obj
clij2fft.cpp
C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\clij2fft.cpp(15): fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\clij2fft.dir\clij2fft.cpp.obj.d --working-dir=C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\cppbuild --filter-prefix="Note: including file: " -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe @C:\Users\chiarutt\AppData\Local\Temp\nm8095.tmp' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\clij2fft.dir\build.make /nologo -SL                 CMakeFiles\clij2fft.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S                  all' : return code '0x2'
Stop.
NicoKiaru commented 7 months ago

I have several CUDA toolkit installed (11.3, 12.1, 10.0). If I attempt to use 12.1, I think I get a different error:

chiarutt@SV-01-099 MINGW64 ~/Dropbox/BIOP/clij2-fft/native (master)
$ ./cppbuild.sh
Detected platform "windows-x86_64"
Building for platform "windows-x86_64"
Installing "clij2fft"
~/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild ~/Dropbox/BIOP/clij2-fft/native
-- The C compiler identification is MSVC 19.35.32215.0
-- The CXX compiler identification is MSVC 19.35.32215.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for CL_VERSION_3_0
-- Looking for CL_VERSION_3_0 - found
-- Found OpenCL: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/lib/x64/OpenCL.lib (found version "3.0")
-- Found Python3: C:/ProgramData/miniforge3/python.exe (found version "3.10.12") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/chiarutt/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild

Microsoft (R) Program Maintenance Utility Version 14.35.32215.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[ 33%] Converting totalvarationterm.cl to string.
calling python stringify
[ 33%] Built target generate_preamble
[ 66%] Building CXX object CMakeFiles/clij2fft.dir/clij2fft.cpp.obj
clij2fft.cpp
C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\clij2fft.cpp(15): fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\clij2fft.dir\clij2fft.cpp.obj.d --working-dir=C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\cppbuild --filter-prefix="Note: including file: " -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe @C:\Users\chiarutt\AppData\Local\Temp\nm8095.tmp' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\clij2fft.dir\build.make /nologo -SL                 CMakeFiles\clij2fft.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S                  all' : return code '0x2'
Stop.

chiarutt@SV-01-099 MINGW64 ~/Dropbox/BIOP/clij2-fft/native (master)
$ ./cppbuild.sh
Detected platform "windows-x86_64"
Building for platform "windows-x86_64"
Installing "clij2fft"
~/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild ~/Dropbox/BIOP/clij2-fft/native
-- The C compiler identification is MSVC 19.35.32215.0
-- The CXX compiler identification is MSVC 19.35.32215.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for CL_VERSION_3_0
-- Looking for CL_VERSION_3_0 - found
-- Found OpenCL: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/lib/x64/OpenCL.lib (found version "3.0")
-- Found Python3: C:/ProgramData/miniforge3/python.exe (found version "3.10.12") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/chiarutt/Dropbox/BIOP/clij2-fft/native/clij2fft/cppbuild

Microsoft (R) Program Maintenance Utility Version 14.35.32215.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[ 33%] Converting totalvarationterm.cl to string.
calling python stringify
[ 33%] Built target generate_preamble
[ 66%] Building CXX object CMakeFiles/clij2fft.dir/clij2fft.cpp.obj
clij2fft.cpp
cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)
[100%] Linking CXX shared library clij2fft.dll
LINK: command "C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\clij2fft.dir\objects1 /out:clij2fft.dll /implib:clij2fft.lib /pdb:C:\Users\chiarutt\Dropbox\BIOP\clij2-fft\native\clij2fft\cppbuild\clij2fft.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO -LIBPATH:\Users\haase\code\ops-experiments\ops-experiments-opencl\native -LIBPATH:C:\OpenCL\clFFT-2.12.2-Windows-x64\lib64\import clFFT.lib C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\lib\x64\OpenCL.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:clij2fft.dll.manifest" failed (exit code 1181) with the following output:
LINK : fatal error LNK1181: cannot open input file 'clFFT.lib'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\clij2fft.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\clij2fft.dir\objects1 @C:\Users\chiarutt\AppData\Local\Temp\nmB74C.tmp' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\clij2fft.dir\build.make /nologo -SL                 CMakeFiles\clij2fft.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\nmake.exe" -s -f CMakeFiles\Makefile2 /nologo -S                  all' : return code '0x2'
Stop.
bnorthan commented 7 months ago

It looks like it can't find 'clFFT.lib' however based on your first comment you put it in the right spot (C:\OpenCL\clFFT-2.12.2-Windows-x64\lib64\import). Any chance it is still open in the unzip program or something?

NicoKiaru commented 7 months ago

It's there apparently:

image

Maybe there's some rights issues. I'll move the folder somewhere else.

EDIT nope. Moving it to my user folder does not change anything

NicoKiaru commented 7 months ago

I'll get back to this next week. It could be just a stupid path issue. I'll re-DL the zip. Maybe I'll try a lower version number just in case.

NicoKiaru commented 7 months ago

I forgot a -Full in the path 😓 :

C:\OpenCL\clFFT-**Full**-2.12.2-Windows-x64\lib64\import

Now it works