Running Xcode 4 locally, executing code externally? - xcode

We have a CUDA server at work that is running Linux.
I am running Xcode on my Mac which does not have a CUDA device. I wondered if it was possible to use Xcode 4 as an IDE to develop the code, but executing/building and debugging the code on the external CUDA server?
In other words, I want to store the files etc, on the CUDA server (I have SSH access), but manage the project/files from my Mac. When I press the build button in Xcode, I want everything to be build on the CUDA server.
Is this possible or do I have to use ssh and vim to develop my code?

How about mounting the Linux server over SFTP through the Finder, and then using Xcode to start a project directly on the server? It might be tricky to tell Xcode where to find the nvcc compiler and other necessary stuff on the Linux server, but I would try that first.

Related

Is there a workaround for a slow X11 server running from WSL?

I recently cloned a GitHub repository into my Windows 10 PC. As the code was mostly in C++ it had to be compiled and built to be able to generate a working GUI.
To do so I used WSL, which allowed me to compile, build and run (using CMake), but as WSL doesn't have it's own display I had to use an X11 program (VcXsrv) for visualization. This last one seems to be making the interface rather slow, because the FPS indicator never goes above 15 and I'm told that the native build works at 60 FPS.
I'd like to know if there is a simple workaround that I can try from WSL to make it faster, as my other option is to try and learn Visual Studio.
The code run in WSL Ubuntu 20.04 is:
git clone --recurse-submodules https://github.com/nmwsharp/vector-heat-demo.git
cd vector-heat-demo
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
export DISPLAY=localhost:0
./bin/vector_heat /path/to/your/mesh.obj
And on the Windows side, I'm using VcXsrv settings: multiple windows, display 0, start no client, disable native opengl, from this answer.
The reason why it’s slow is the architecture of wsl1. See below.
Comparison WSL1 and WSL2
In WSL1 linux kernel is kind of emulated, there is a software layer which maps linux syscalls to windows syscalls (this means you loose some time when accessing devices) which will lead to low FPS in your case.
In WSL2 microsoft created a hypervisor on which win10 and the microsoft linux kernel is running (your ubuntu, debian, ... runs on top of that), which means WSL2 is way faster because of skipping that translation layer (more information can be found here: differences WSL1 & WSL2
I've also created a guide how to use it with X11 see here (which works for me)
VSCode connect to WSL
it’s just for coding not for running your gui
In this scenario a headless VSCode (Server) is started in your WSL. The VSCode on your Windows will than connect to this instance (meaning you'll have the linux filesystem + gcc toolchain available.
VSCode Remote WSL Documentation from microsoft

Building Xcode project without a provisioning profile

I'm sorry if it's already answered here but I wasn't able to find it.
I want to play a bit with DriverKit and SEXTs but I'm not in the Apple Developer Program. Is there a way to build a project using DriverKit in Xcode without using a provisioning profile? Or can I generate a 'fake' one manually? I'm trying to build a DriverKit project by Scott Knight but I'm getting ""USBApp" requires a provisioning profile with the System Extension feature." and ""MyUserUSBInterfaceDriver" requires a provisioning profile." errors.
I tried to run a small demo which uses the Endpoint Security framework. I built it using clang and ran it in a virtual machine with SIP disabled. However, I'd like to try to develop a bigger project (and to also try writing DEXT) and I don't want to build it using clang every time neither to use Xcode in the virtual machine (I don't even know if I would be able to build it using Xcode in the VM plus disk space limitations).
My goal is to develop and build in the comfort of my host machine without need of the VM, and then to run (and debug) it in the virtual machine.
P.S.: For ones that want to build the same demo (got SIGSEGV but I was able to build it and run it on Catalina 10.15.3):
clang -framework Foundation -framework SystemConfiguration /usr/lib/libEndpointSecurity.dylib /usr/lib/libbsm.dylib EndpointSecurityDemo.m -o esdemo

How to emulate clean mac environment to test .app

I created the .app with Qt application that I'd like to distribute. It works fine on my developer machine and now I want to test it on clean mac system to check if all dependencies bundled and it works correctly. But I don't have another clean mac.
Is there a way to emulate clean environment on dev machine to check the .app?
You can install macOS on a virtual machine, using Parallels or VMware Fusion.
This can be useful to ensure your app is deployed correctly, with all the dependencies in the right place.
However, keep in mind that the VM won't support accelerate graphics, so if your app is using OpenGL, you will not be able to test it in this kind of environment.

Use Xcode with Docker (cross-compiling)

Now I know this might sound weird, but I have a library that is distributed with Docker, but I want to use my IDE, Xcode.
Has anyone ever attempted to use (cross-compiling) Xcode with a software running on docker?
My needs are the simplest: compile, link, run, debug.
You could share the data via a volume, but Xcode itself needs to run on a Mac and Docker needs to run on Linux, so you would be limited to sharing networked data.

How to run LibTool?

Currently I have tested my tool with clang-llvm installed on the machine I'm developing it on. All I have to do is go into build/bin to run my tool.
However, I now want to try running this tool on another machine.
What should I be doing here to run the tool I develop?
Do I have to setup the entire clang-llvm environment too? That's very time consuming and the entire folder is about 22+ GB in size..
The tool I'm creating is running RecursiveASTVisitor (same environment as the link below)
http://clang.llvm.org/docs/LibASTMatchersTutorial.html
Since you are just trying to run the tools on another machine, you can just transfer the whole llvm files and build files. IF you are running it on a different OS, you have to build the whole llvm and clang again as different OS (such as Windows) need extra tools such as cygwin .

Resources