I am trying to use the Tensorflow C api in an xcode project. As soon as the app starts running a BAD_INSTRUCTION error is generated on the main thread. This error comes from:
tensorflow::monitoring::MetricDef<(tensorflow::monitoring::MetricKind)1, long long, 2>::MetricDef<char [11], char [7]>(absl::lts_2020_02_25::string_view, absl::lts_2020_02_25::string_view, char const (&) [11], char const (&) [7]) ()
I installed the api using: https://www.tensorflow.org/install/lang_c
I am building for x86_64 architectures (Using Rosetta to translate) and linked the library through specifying a runpath search path to the .dylib's directory. I also included this path as a regular search path and added the header search path too. Finally, I added both .dylibs to the 'link binary with libraries' list.
I am running xcode 12.4 on a M1 macbook pro. If anyone knows any way to get more information about the crash out of xcode that'd be useful too.
I have tried installing on an intel MacBook and that worked fine.
The M1 processor is ARM.
You compiled for x86_64 (Intel architecture) this means, that it isn't compatible.
You'd have to compile it for ARM, otherwise it won't run. (That's like trying to run JVM Bytecode in .NET, it just won't work)
For more information, see this answer
Related
I'm updating an R package that I last released (with no problems) on R3.6. I've since updated to R 4.0.0 and Rtools 40.
The package builds and runs successfully on 64-bit R. But I see that on win builder, the package's testthat tests fail on win32 (but not win64).
To diagnose the failure, I'm building the package on my 64-bit Windows 10 machine, using a 32-bit version of R and devtools::install(args= "--no-multiarch").
I've edited the PATH environment variable, replacing:
C:\Program Files\R\R-4.0.0\bin\x64 with C:\Program Files\R\R-4.0.0\bin\i386
C:\rtools40\mingw64\bin with C:\rtools40\mingw32\bin (and I've also tried C:\rtools40\clang32\bin)
The install process is indeed looking to mingw32 for the g++ and gcc executables. Installation is successful, with no warnings or errors.
However, when I attempt to load the package with devtools::load_all(), I see:
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/path/to/PACKAGENAME/src/PACKAGENAME.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
If I instead run library('PACKAGENAME'), then run tests, the R GUI freezes and exits silently -- paralleling the failure on win builder.
I'm struggling to diagnose why a DLL that works perfectly on 64-bit won't work on a 32-bit architecture. The only substantive change I've made to the C++ code is to replace some ints with typedef int16_t xint.
The problem seems to have been the existence of 64-bit dlls in the package's source folder (as insinuated by the error message), created by 'devtools'.
Once these files were deleted load_all would happily re-create them using the 32-bit compilers.
i'm trying to create an installer for my opencv project. The Projects runs just fine, no error while compiling or at runtime.
And i need the program to run on other machines as well, so i thought of making an installer. I've read that MS VS 2013 has discontinued the Deployment tool and so i am using InstallShied Limited.
I'm setting everything according to their tutorial and i am adding the opencv libs, it builds and i can install my application. But as soon as install it on other machine i get the following errer message:
The procedure entry point _except1 could not be located in the dynamic link library opencv_imgproc.dll
I also get this error if i just copy the dll files to another machine along with the exe file. Does this mean, that the dlls are not compatible with the system? i am using windows 8.1 on both machines. and its also weird that it runs when i build it from VS.
Any advice is greatly appreciated.
regards,
hh
Solution: i had the 64bit dlls included and runnning on 32bit. The 32 Bit dlls are in vc10
I'm having a problem trying to cross-compile a wxWidgets sample program.
The host is a PC running Debian (a VM if it matters), and the target is a BeagleBone Black (BBB) also running Debian.
As a background note, I'm a C/C++ programmer, but strictly in the embedded and Windows world. I know just enough about Linux to be able to break it.
I've successfully cross-compiled a simple C++ program, and it runs fine on the BBB. I used the tutorial from Derek Molloy to get Eclipse installed and cross-compiling:
https://www.youtube.com/watch?v=hzZHcH5quow
Next, I downloaded wxWidgets and compiled it on the BBB (not on the PC) into static libraries. Here's the config I used:
../configure --enable-debug --enable-debug_info --disable-shared --enable-stl --enable-sockets --enable-gif --enable-pcx --with-libpng --with-libjpeg
It compiled fine. I then built a bunch of the demos and samples and they all compiled and ran fine on the BBB.
Next I wanted to be able to cross-compile so I could use some decent development tools.
I copied all the wxWidgets libraries over to the PC, then I also copied all the include directories I would need (GTK, cairo, pango, glib...) and their libraries (from the BBB to the PC).
After a lot of trial and error, I finally got it all to compile and link. Almost.
The linker is giving the following errors (5 of them, all very similar):
`.LTHUNK0' referenced in section
`.text._ZN17wxWindowWithItemsI9wxControl15wxItemContainerED1Ev[_ZN17wxWindowWithItemsI9wxControl15wxItemContainerED1Ev]'
of
/home/dave/BeagleBoneResources/lib/wx/libwx_gtk2u_core-3.0.a(corelib_choiccmn.o):
defined in discarded section
`.text._ZN17wxWindowWithItemsI9wxControl15wxItemContainerED2Ev[_ZN17wxWindowWithItemsI9wxControl15wxItemContainerED5Ev]'
of
/home/dave/BeagleBoneResources/lib/wx/libwx_gtk2u_core-3.0.a(corelib_choiccmn.o)
I see it's referencing libwx_gtk2u_core-3.0.a, which is one of the wxWidgets libraries I built on the BBB.
Can anyone tell me how to fix this? I sure hope I don't have to rebuild all the dependencies with the cross compiler, there's a LOT of them, and I wouldn't even know where to start.
libcurl is what I am going to try to use for posting messages to a JMS queue from a C program running on Windows XP compiled using Visual Studio 6.
With this I need to link in libcurl.lib - but where do i get this from?
I link numerous lib's to my program (wsock32.lib, kernel32.lib, etc) so once I can get hold of it I can't see a problem.
I have downloaded all of the Win32-Generic binaries etc (http://curl.haxx.se/download.html) but none of them contain the lib/headers I need.
Anyone out there know where I get get them from.
thanks for any help.
Problems running on a 64bit machine now - please see my 'answer' post
I have used the link you supplied (direct link). I now link in the libcurl_imp.lib to my dll and it compiles fine. My app can call my new library routines that call the curl methods fine and works a treat - BUT ONLY ON A 64BIT MACHINE? - if I try to run the same dll/binary app on a 32bit XP machine it just dumps out immediately. In fact all my applications abort - and they make no reference to my new library routines, they just use the dll. It seems that just because I build in the cURL calls into my dll it immediately aborts the spawned process– I just get –
1 + Done(134) testapp
5656 Abort testapp
I have a printf statement immediately after main but I get no output on the command line.
I then removed all my new library functions from the dll apart from one, and in this all I do is –
CURLcode res = curl_global_init(CURL_GLOBAL_DEFAULT);
This one line causes all my apps to fail on 32bit when built into my dll – comment it out and they all work.
As stated, the same dll/binary works fine on my 64bit machine. The 64bit machine has the same curllib.dll as the one on my 32bit machine.
For info, my build machine is 32bit, we have productions machines that are both 32 and 64 bit.
Is the link you sent me actually 64bit only?
I started playing with the Kinect and I would like to use skeleton tracking using OpenNI.
Since my knowledge of c++ is limited, the easiest option is to use the ofxOpenNI addon for OpenFrameworks.
I've downloaded the addon, and successfully compiled the example, but the application can't load a dylib:
[Session started at 2011-02-24 11:46:27 +0000.]
dyld: Library not loaded: #executable_path/./../../../data/openni/lib/libnimCodecs.dylib
Referenced from: /Users/george/Downloads/FirefoxDownloads/of_preRelease_v0062_osx_FAT/apps/examples/NI_userIsolation_4/bin/emptyExampleDebug.app/Contents/MacOS/emptyExampleDebug
Reason: no suitable image found. Did find:
/Users/george/Downloads/FirefoxDownloads/of_preRelease_v0062_osx_FAT/apps/examples/NI_userIsolation_4/bin/emptyExampleDebug.app/Contents/MacOS/./../../../data/openni/lib/libnimCodecs.dylib: unknown required load command 0x80000022
/Users/george/Downloads/FirefoxDownloads/of_preRelease_v0062_osx_FAT/apps/examples/NI_userIsolation_4/bin/emptyExampleDebug.app/Contents/MacOS/./../../../data/openni/lib/libnimCodecs.dylib: unknown required load command 0x80000022
/usr/lib/libnimCodecs.dylib: unknown required load command 0x80000022
The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).
I am using XCode on osx 10.5.8 with OpenFrameworks 062.
This was a bit of background, but I imagine the dylib problem is something general.
I have the requested dylib files in my project, and the path seems ok.
Any clues ?
Sounds like the libs, though present, aren't compatible with your system -- it finds them but can't load them.
And indeed, checking the README on the OpenNI github page, in the section "Release Notes", we find the following:
* MacOSX: Only OSX 10.6 (Snow Leopard) with an Intel based CPU is currently supported.
You have the source, obviously, but fixing this yourself would probably be quite a chore. Otherwise, you could wait and see if future releases add Leopard compatibility, or you could upgrade your OS.