error C4996: 'tensorflow::int64': Use int64_t instead - tensorflow

I build tensorflow-cc from vcpkg.
And I created a test project to test the lib.
When I compile the project, the error message output is as follows.
error C4996: 'tensorflow::int64': Use int64_t instead.

Related

Kotlin/Native compilation fails on windows with Java ZipException

I've created a new Kotlin/Native application using IntelliJ Idea and it fails to compile.
I hadn't change anything.
I'm sure it fails at compilation time because it says "Compilation ended with errors"
Stack trace: java.util.zip.ZipException: invalid stored block lengths...

Gradle annotation processor order (Android)

I'm writing a library based on code generation.
This library generating dagger's module via annotations. How do I run my annotation processor before dagger's code generation?
Now it crashes on build because dagger trying to build the component before modules was generated.
Error:
.ktC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:6: error: cannot find symbol
#dagger.Component(modules = {BookModule.class})
^
symbol: class BookModuleC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:7: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public abstract interface AppComponent {
^Attempt to reopen a file for path C:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\generated\source\kapt\debug\dev\syncended\blade\BookModule.kt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
* Try:

Specify Fortran module compile order with CMake

My Fortran project has a target comprised of a module containing helper functions and a few generated source files for tests. The test modules all use the helper module (i.e. use test_tools). I'm building with CMake, so the source list looks like
add_custom_command(
# here's where I'm doing the stuff to generate test_SR#.F90
GENERATED
)
set(SOURCES
test_tools.F90
test_SR1.F90 # contains `use test_tools`
test_SR2.F90 # contains `use test_tools`
...
test_SR20.F90 # contains `use test_tools`
)
This compiles fine on macOS and Linux, but on Windows with the Visual Studio 15 2017 generator test_tools.F90 is not compiled before test_SR#.F90 so on the first attempt the compile fails.
6> ... Done. Results in C:/Users/rmudafor/Desktop/openfast453/build/unit_tests/tests/beamdyn/test_BD_CrvMatrixH.F90
6>Generating ../tests/beamdyn/test_BD_InputGlobalLocal.F90
6>Processing file C:/Users/rmudafor/Desktop/openfast453/unit_tests/../modules/beamdyn/tests/test_BD_InputGlobalLocal.F90
6> ... Done. Results in C:/Users/rmudafor/Desktop/openfast453/build/unit_tests/tests/beamdyn/test_BD_InputGlobalLocal.F90
6>Compiling with Intel(R) Visual Fortran Compiler 19.1.1.216 [Intel(R) 64]...
6>test_BD_InputGlobalLocal.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InputGlobalLocal.F90(19): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InputGlobalLocal.F90(47): error #6404: This name does not have a type, and must have an explicit type. [CALCROTATIONMATRIX]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InputGlobalLocal.F90 (code 1)
6>test_BD_InitShpDerJaco.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InitShpDerJaco.F90(9): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InitShpDerJaco.F90(54): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEPARAMETERTYPE]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_InitShpDerJaco.F90 (code 1)
6>test_BD_DistrLoadCopy.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(9): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(32): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEPARAMETERTYPE]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(33): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEMISCVARTYPE]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90(34): error #6404: This name does not have a type, and must have an explicit type. [SIMPLEINPUTTYPE]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_DistrLoadCopy.F90 (code 1)
6>test_BD_CrvCompose.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_CrvCompose.F90(14): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_CrvCompose.F90(48): error #6404: This name does not have a type, and must have an explicit type. [CALCROTATIONMATRIX]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_CrvCompose.F90 (code 1)
6>test_BD_GaussPointWeight.F90
6>C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_GaussPointWeight.F90(13): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [TEST_TOOLS]
6>compilation aborted for C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\tests\beamdyn\test_BD_GaussPointWeight.F90 (code 1)
6>test_tools.F90 <---- HERE: this one should be compiled before the ones above
6>test_BD_diffmtc.F90
6>test_ExtractRelativeRotation.F90
6>test_BD_CrvMatrixH.F90
6>test_BD_QPData_mEta_rho.F90
6>test_BD_CrvMatrixR.F90
6>test_BD_GenerateGLL.F90
6>test_BD_CrvExtractCrv.F90
6>test_BD_GravityForce.F90
6>test_BD_CheckRotMat.F90
6>driver.F90
6>
6>Build log written to "file://C:\Users\rmudafor\Desktop\openfast453\build\unit_tests\beamdyn\beamdyn_utest.dir\Release\BuildLog.htm"
6>beamdyn_utest - 16 error(s), 0 warning(s)
========== Build: 5 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
If I let the build continue to the end, then test_tools will have been compiled and it will succeed the second time. This isn't an issue when I'm doing this manually, but it does prevent automating the build and test sequence.
I'd like to somehow indicate to CMake that it must compile test_tools before any of the test_SR#.F90 modules.
I'm using CMake 3.17 on Windows, Visual Studio 15 2017, and Intel 2020 tools.

React native build getting failed :app:transformClassesWithDexForDebug

I am getting error while building react-native app using command react-native run-android
Error
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzav;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzav;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
:app:transformClassesWithDexForDebug FAILED
Failure
Build failed with an exception.
What went wrong
Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
Dependencies in android/app/build.gradle
delete android/app/build dir
This work for me.
As mentionned on this comment, you have to compile everything yourself. Add this in your android/app/build.gradle.
I don't know if you have the exact same problem, but everytime I ran in dex problems, this was the solution.
compile "com.google.android.gms:play-services-base:11.4.2"
compile "com.google.android.gms:play-services-base-license:11.4.2"
compile "com.google.android.gms:play-services-ads:11.4.2"
compile "com.google.android.gms:play-services-ads-lite:11.4.2"
compile "com.google.android.gms:play-services-ads-license:11.4.2"
compile "com.google.android.gms:play-services-analytics:11.4.2"
compile "com.google.android.gms:play-services-analytics-impl:11.4.2"
compile "com.google.android.gms:play-services-auth:11.4.2"
compile "com.google.android.gms:play-services-auth-base:11.4.2"
compile "com.google.android.gms:play-services-fitness:11.4.2"
compile "com.google.android.gms:play-services-gcm:11.4.2"
compile "com.google.android.gms:play-services-identity:11.4.2"
compile "com.google.android.gms:play-services-maps:11.4.2"
compile "com.google.android.gms:play-services-wallet:11.4.2"

Build Linux Kernel module with warning i2c_register_board_info undefined

I follow an example in kernel.org to write an i2c driver but unfortunately when i compile i got this warning
WARNING: "i2c_register_board_info" [/home/pi/builddriver/samplei2c/pn535.ko] undefined!
Although compile with 1 warning and no error, I cannot insmod module. this is error when insmod
insmod: ERROR: could not insert module pn535.ko: Invalid module format
My question is how to solve the warning above?, I think it make .ko file to be invalid. Here is my source code on
pastebin
thank for your help!
That is not possible in a kernel module simply because the function i2c_register_board_info is not exported from the kernel source tree to the kernel modules (built using obj-m targets). You can achieve this by building your driver within the kernel source tree using (obj-y targets).