Closed haesleinhuepf closed 4 years ago
Hi Robert
I just added clFFT.lib to the git repo. Let me know if you can build the Java part now.
I also have been working on some build instructions
It's a work in progress. I tried to make it possible to build the java part independent of the c++ part. Please if you run into issues building and/or running let me know.
Hey Brian,
awesome! Thanks a lot, one step ahead. Now the linker complains with this error:
Copyright (C) Microsoft Corporation. All rights reserved.
/out:jniclij2fftWrapper.dll
/ltcg
/dll
/implib:jniclij2fftWrapper.lib
/OUT:jniclij2fftWrapper.dll
/LIBPATH:C:\structure\code\clij2-fft/lib/win64/
/LIBPATH:C:\structure\code\clij2-fft/lib/linux64/
/LIBPATH:C:\structure\code\clij2-fft/lib/macosx/
clFFT.lib
clij2fft.lib
psapi.lib
jniclij2fftWrapper.obj
Creating library jniclij2fftWrapper.lib and object jniclij2fftWrapper.exp
jniclij2fftWrapper.obj : error LNK2001: unresolved external symbol _conv3d_32f_lp
jniclij2fftWrapper.obj : error LNK2001: unresolved external symbol _fft2d_32f_lp
jniclij2fftWrapper.obj : error LNK2001: unresolved external symbol _deconv3d_32f_lp
jniclij2fftWrapper.dll : fatal error LNK1120: 3 unresolved externals
But these methods should be within clij2fftWrapper, they are no external symbols, right?
That's strange. Did you update all the library files or just grap clFFT.lib??
You also need clij2fft.lib and clij2fft.dll from this commit
I did git pull, yes. Here is the complete output:
C:\structure\code\clij2-fft>mvn clean install [INFO] Scanning for projects... [INFO] [INFO] --------------------< net.haesleinhuepf:clij2-fft >-------------------- [INFO] Building clij2-fft 2.1.1.9-BETA [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ clij2-fft --- [INFO] Deleting C:\structure\code\clij2-fft\target [INFO] [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ clij2-fft --- [INFO] Skipping Rule Enforcement. [INFO] [INFO] --- build-helper-maven-plugin:3.0.0:regex-property (sanitize-version) @ clij2-fft --- [INFO] [INFO] --- build-helper-maven-plugin:3.0.0:regex-property (guess-package) @ clij2-fft --- [INFO] [INFO] --- buildnumber-maven-plugin:1.4:create (default) @ clij2-fft --- [INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD" [INFO] Working directory: C:\structure\code\clij2-fft [INFO] Storing buildNumber: 313098ea7f5c4d21df1ee08f1651ea3560317a25 at timestamp: 1598800651264 [INFO] Storing buildScmBranch: master [INFO] [INFO] --- scijava-maven-plugin:1.1.0:set-rootdir (set-rootdir) @ clij2-fft --- [INFO] Setting rootdir: C:\structure\code\clij2-fft [INFO] [INFO] --- jacoco-maven-plugin:0.8.4:prepare-agent (jacoco-initialize) @ clij2-fft --- [INFO] argLine set to -javaagent:C:\Users\rober\.m2\repository\org\jacoco\org.jacoco.agent\0.8.4\org.jacoco.agent-0.8.4-runtime.jar=destfile=C:\structure\code\clij2-fft\target\jacoco.exec [INFO] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ clij2-fft --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] Copying 0 resource [INFO] skip non existing resourceDirectory C:\structure\code\clij2-fft\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ clij2-fft --- [INFO] Compiling 4 source files to C:\structure\code\clij2-fft\target\classes [INFO] /C:/structure/code/clij2-fft/src/main/java/net/haesleinhuepf/clijx/plugins/OpenCLFFTUtility.java: Some input files use unchecked or unsafe operations. [INFO] /C:/structure/code/clij2-fft/src/main/java/net/haesleinhuepf/clijx/plugins/OpenCLFFTUtility.java: Recompile with -Xlint:unchecked for details. [INFO] [INFO] --- javacpp:1.3:build (process-classes) @ clij2-fft_ --- [INFO] Detected platform "windows-x86_64" [INFO] Building for platform "windows-x86_64" [INFO] Generating C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp [INFO] Compiling C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\windows-x86_64\jniclij2fftWrapper.dll [INFO] cl /IC:\structure\code\clij2-fft\src\main\java /IC:\structure\code\clij2-fft/native/clij2fft/ "/IC:\Program Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot\include" "/IC:\Program Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot\include\win32" C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp /Oi /O2 /EHsc /Gy /GL /MD /LD /W3 /link /OUT:jniclij2fftWrapper.dll /LIBPATH:C:\structure\code\clij2-fft/lib/win64/ /LIBPATH:C:\structure\code\clij2-fft/lib/linux64/ /LIBPATH:C:\structure\code\clij2-fft/lib/macosx/ clFFT.lib clij2fft.lib psapi.lib Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28315 for x86 Copyright (C) Microsoft Corporation. All rights reserved.
jniclij2fftWrapper.cpp C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(289): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(133): note: see declaration of 'strcpy' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(291): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(338): note: see declaration of 'strncpy' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(496): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(514): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(565): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(579): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(579): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(594): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(613): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(626): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(645): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(711): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(785): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(266): note: see declaration of 'strncat' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(819): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(90): note: see declaration of 'strcat' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(841): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(338): note: see declaration of 'strncpy' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(875): warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(440): note: see declaration of 'strtok' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(938): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(133): note: see declaration of 'strcpy' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(954): warning C4996: 'strerror': This function or variable may be unsafe. Consider using strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\string.h(182): note: see declaration of 'strerror' C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1051): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1110): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1169): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1228): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1287): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1346): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1386): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1417): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1448): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1479): warning C4244: 'initializing': conversion from 'jlong' to 'unsigned int', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1488): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1503): warning C4244: 'argument': conversion from 'jlong' to 'size_t', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1518): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1518): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1518): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1518): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1518): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data C:\structure\code\clij2-fft\target\classes\net\haesleinhuepf\clijx\plugins\jniclij2fftWrapper.cpp(1518): warning C4244: 'argument': conversion from 'jlong' to 'long', possible loss of data Microsoft (R) Incremental Linker Version 14.24.28315.0 Copyright (C) Microsoft Corporation. All rights reserved.
/out:jniclij2fftWrapper.dll /ltcg /dll /implib:jniclij2fftWrapper.lib /OUT:jniclij2fftWrapper.dll /LIBPATH:C:\structure\code\clij2-fft/lib/win64/ /LIBPATH:C:\structure\code\clij2-fft/lib/linux64/ /LIBPATH:C:\structure\code\clij2-fft/lib/macosx/ clFFT.lib clij2fft.lib psapi.lib jniclij2fftWrapper.obj Creating library jniclij2fftWrapper.lib and object jniclij2fftWrapper.exp jniclij2fftWrapper.obj : error LNK2001: unresolved external symbol _conv3d_32f_lp jniclij2fftWrapper.obj : error LNK2001: unresolved external symbol _fft2d_32f_lp jniclij2fftWrapper.obj : error LNK2001: unresolved external symbol _deconv3d_32f_lp jniclij2fftWrapper.dll : fatal error LNK1120: 3 unresolved externals
C:\structure\code\clij2-fft>
Looking at your output it seems you may be using the 32 bit compiler
In your output: Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28315 for x86
In mine: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64
To set up a cmd prompt with x64 tools I run ‘x64 Native Tools Command Prompt for VS 2019' from the start menu. If you use the 64 bit compiler does it fix the problem?
YES! Brian, you are a remote-debugging hero! Thanks a lot! Will test a bit the library now :-)
Hey Brian @bnorthan ,
I just tried to build this library on Windows and it doesn't find some file... Would you mind uploading clFFT.lib as javacpp searches for it here? I'm also not an expert one multi-os builds, but I think we should upload all lib and h files necessary for compiling the jar file to make it as easy as possible for anyone trying to reproduce the build.
What do you think?
Thanks!
Cheers, Robert
P.S.: Thats my console output: