Run Cuda project in XCode - xcode

I found some great tutorials about CUDA but they are for windows.
All I want is to get started a.s.a.p.
I made my project files with CMake.
If I press the play button in XCode then I can see "Build succeeded".
I added std::cout << "Hello World!"; cause I would love to see some console output. But I don't see anything.
I did activate the console.
What are the necessary steps to make it working?

Pressing the play button is not enough in this case.
In the Debug folder there was the build:
(to run it you can check: Running an executable in Mac Terminal)

Related

How to Hot Reload flutter when running from xcode

I'm trying to do Hot Reload when running flutter code from xcode but nothing I seem to do works.
I see a console within xcode. I can see my logs there but I don't see the normal "Flutter run commands" output. When I type "r" or "R" there it just writes "r" or "R" with no change to my running app.
I have tried running flutter run from the terminal and I also can't type "r" or "R" without it only typing that letter into the console.
I can do do hot reload via VSCode but I'm running into this issue (I can temporarily fix this issue but it comes up every other build).
I was able to debug my flutter code that was ran from xcode by attaching a flutter debugger.
I had to use VScode to attach the debugger. I installed the flutter extension. Second, I searched for the commend Flutter: Attach to Flutter on Device. Once you have that running, there are options to click to hot reload or hot restart.
The Xcode console doesn't work the way you're trying to do so.
Here are a few commands to Clean, Build and Run Xcode Project. Also there is no hot reload in Xcode. You can simply use these commands anywhere in Xcode except Console.
Shift + CMD + K to clean.
CMD + B to build.
CMD + R to run.

QtCreator crashes on startup "File Error"

I am running QtCreator#4.6.1 based on Qt#5.11.0 on Arch Linux#4.16.12-1-ARCH
When starting QtCreator with an active cmake project, the program crashes immidiatley with a notification window titled "File Error". If I delete the folder <PATH>/.config/QtProject, it starts without problems.
Starting with qtcreator -noload Welcome I can see the a start of cmake server in the shell. No error output in the shell from where I called the project.
How can I debug that behaviour? I really would like to keep my previous projects/sessions and settings.
I just ran in the same problem. Removing ~/.config/QtProject/qtcreator/helpcollection.qhc fixed the problem.
Edit: fixed path, forgot "qtcreator"

How do I Compile a Framework in Xcode?

Ever since I switched to Yosemite, I have been getting an Xcode quit unexpectedly error whenever I try to run SDL2. I can't even get a "hello world" to run.
I am trying the fix it by following the directions on this page:
Xcode 5 crashes when running an app with SDL 2
But I don't know how to "Compile the "Framework" target in Xcode/SDL/SDL.xcodeproj" I tried just simply building it but that doesn't seem to work because I don't see any framework file showing up.
Can someone help me figure out how to get rid of this error?
I assume you have got the latest version of the code either by doing hg clone http://hg.libsdl.org/SDL or by downloading the latest snapshot from https://www.libsdl.org/hg.php
This should give you a directory called SDL which contains the source and all of the projects. You will want to open 'Xcode/SDL/SDL.xcodeproj'
Then ensure the following is set as your build target - Framework > My Mac (64-bit) You can change it by clicking on it.
Then hit CMD+B (or select Product->Build from the menu) to build the framework. You will then be able to find the SDL2.framework in the following location:
/Users/*yourusername*/Library/Developer/Xcode/DerivedData/SDL2-*randomstring*/Build/Products/<*Debug/Release*>
Copy the framework to /Library/Frameworks

OS X app on Lion 10.7.2 Xcode 4.3 :: error: failed to launch <exe path> -- SBTarget is invalid

The app builds with zero errors and has a single line of output after Xcode displays "Running AppName : AppName"
error: failed to launch '/tmp/HungryMeProduct/Debug/HungryMe.app/Contents/MacOS/HungryMe'
-- SBTarget is invalid
The App will not run in Xcode.
This is my first OS X app. It was doing fine until
I changed the Project Name and the name of the xcodeproj file name recently.
ProjectName, Executable Name are the same.
Deployment Target 10.6
The executable at .../Contents/MacOS/HungryMe runs when I double click it.
Terminal window displays output.
The code signing identity remains my Developer Identity
In the schemes I see that LLDB is selected not GDB. Is this a debugger problem? What is SBTarget?
This happened to me, and the issue I had was the schema Target was correct but 64 bit was selected in as the architecture instead of 32 bit, for a 32 bit only project. Once I made the switch, it started working again.
GDB had the same issue but did not report it so elegantly, instead it reported "warning: posix_spawn failed, trying execvp, error: 86". It did launch the app but could not debug it.
This can easily happen if you debug without building the project, after switching the schema, or if the schema gets switched for you due to an external change to the project file (updating or reverting your source repository using git, svn, ...)
I tried everything metioned here. Nothing worked. It seems that I somehow imported the Info.plist twice. To fix it I selected the project and pressed the "Validate Settings" button. Afterwards it works for me.
Try to change Target's Architectures in Build Settings

Can I use my gdb to debug an XCode project

I have a XCode which builds and runs under XCode.
I would like to know if it is possible to debug it using a gdb I build under Mac OSX (gdb 7 to be specified). If yes, can you please tell me how can I do that?
Thank you.
gdb-7.0 reverse debugging currently can only work with two classes of targets:
1) a remote simulator/emulator/virtual-machine that supports going backwards, or
2) the built in "process record" target, which at present has only been ported to x86-linux, x86-64 linux, and moxie linux.
Well, now -- I take that back. I recently discovered that process record can work with any remote x86 target, so if you're connecting with your macintosh target via "target remote", you might just be able to do it!
There is an online tutorial for process record here:
http://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial
More info about process record here:
http://www.sourceware.org/gdb/wiki/ProcessRecord
And about gdb reverse debugging here:
http://www.sourceware.org/gdb/wiki/ReverseDebug
So you want to use your own version of gdb to debug your executable? Easy!
Open Terminal, and do something like this:
$ cd <directory where Xcode project lives>
$ cd build/Debug (for example - depends on project configuration)
$ /usr/local/bin/my-gdb ./MyExecutable
Of course, specifying the actual path to your custom gdb version.
XCode's debugger is gdb (likely with Apple-specific modifications.) When you debug an application you can get to the gdb command line by opening the Console from the Run menu.
What requirements are imposed on your application that would require you to debug with your own version of gdb?

Resources