open MP setup in Xcode - openmp

I am setting up open MP in the Xcode. In the build phase I have to add file libomp.dylib, but when I searching in the finder it shows nothing.
I have tried the command 'brew install libomp' also but couldn't find the file.
please help me out.

It is tricky, you can find more information here:
https://mac.r-project.org/openmp/

Related

XCode performs custom behavior .sh script failed with The operation couldn’t be completed,Exec format error

As you can see near the screenshot Logs infos pic, the .sh Script can run normal inside terminal, but failed to run via Xcode custom behavior, Is there missing some configuration? I've Googled a lot of infos. still can't solve it. I really need someone's help. Thanks
XCode version: Version 8.3.2 (8E2002)
Add a New Run Script Phase in your projects Build Phases to run a Shell script. You do not need to open -a Terminal:
Update:
How I understand your comment, your actual question is how to get the Xcode project directory. Xcode provides a enviromental variable for this, ${PROJECT_DIR}:
prints:
You can find a list of Xcodes enviromental variables in this repo and helpful information in Apples documentation.

Xcode 8.2.1 install xvim plugin not working?

This is the first time I tried to use xvim.
I downloaded xvim from github, then follow the instuctions in README.
Recodesign Xcode
then sudo make
build succeeded.
But when I opened xcode, didn't see any changes. I dont know whether I install xvim correctly, or just xvim did'nt start.
Where should I open xvim? Please give me a hint.
Well, I fixed this problem myself.
I believe the problem is that others could simply run make,
but I had to run sudo make to successfully built Xvim, which caused XVim.xcplugin to install in
/private/var/root/Library/ApplicationSupport/Developer/Shared/Xcode/Plug-ins
While you open Xcode as a normal user, Xcode needs plugins from
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
so I copied XVim.xcplugin to the right place ,then problem solved...
I had the same issue (though it showed after xcode update). To fix it I had to re-codesign Xcode.
Instructions:
https://github.com/XVimProject/XVim2/blob/master/SIGNING_Xcode.md
After that I did make and XVim was working

graphviz error: dot: can't open hello.dot (OSX El Capitan)

I'm trying to install and use graphviz using Mac (El Capitan). As recommended on the graphviz website in the comments, I have installed xcode, xcode command tools, macports and updated macports. I have then installed graphviz via macports using the command
sudo port install graphviz-gui
I checked that graphviz installed correctly by typing
dot -h
in terminal, and got the response
$ dot -h
dot: option -h unrecognized
Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)]
... (etc.)
indicating that the installation was successful.
I then created two test files in text editor (named hello.dot and hello.gv).
When I type
dot -Tpng -O hello.dot
in terminal, I get
Error: dot: can't open hello.dot
Same with hello.gv
I have also tried opening hello.dot and hello.gv directly with graphviz.app but I get an error window pop-up that says "The document “hello.dot” could not be opened." or "The document “hello.gv” could not be opened."
I have tried restarting terminal and restarting my computer, neither works.
I have downloaded the .pkg installer for the latest version of graphviz, but am afraid to install it in case it interpheres with the macports-installed version of the app. Please can anyone advise if this is the case?
I am not great with computers and this is my first time using terminal... so I'm really hoping that there is a really simple, silly thing that I'm doing wrong - I have watched every graphviz youtube tutorial and been through every help page I can find online, with no luck. I am at a loss - I can't figure out what is going wrong and would so appreciate some help - thanks in advance!
Select hello.dot file in the Finder window
Type Command-I to open an information dialog on hello.dot
Go down to Open with: and select Graphviz
Also select Change All...
That should do it. You can also type open hello.dot in the terminal window now. And you don't need Graphviz to be in your PATH.

-bash : rvictl: command not found, Mac book pro OS X 10.7.5 & Xcode 4.6

I want to debug some network bug with my application ,I found a way to create rvi to trace, But I even can't finish step 1 :
rvictl -s
-bash : rvictl: command not found
what should I do ?
I follow the site:
https://developer.apple.com/library/mac/qa/qa1176/_index.html
help! thanks
Mavericks and beyond: You need to install XCode from the App Store, and then you need to launch XCode once, and accept installation of additional tools. Restart your terminal. Good to go.
I found the solution here.
In summary, the link above explains that the issue may stem from installing Xcode without installing the additional components.
Check rvictl is installed by looking for the /usr/bin/rvictl folder. If it does not exist, then rvictl is not installed. To install the packages, open your application folder through finder, right click on the Xcode app, and follow the path below to find the items which need to be installed manually:
Xcode.app/Contents/Resources/Packages/MobileDevice.pkg
Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg
Restart your terminal and.... Voila !! it should work now.
CATALINA UPDATE.
Based #KarthicRaghupathi's comments. the rvictl location was changed in Catalina. The rvictl file is now located at /Library/Apple/usr/bin.
The rest of the process stays the same as above.
I'm using macOS Catalina and Xcode 11, Could able to find rvictl file in /Library/Apple/usr/bin. but still got the same error
-bash : rvictl: command not found
Tried all provided solution nothing worked for me. Adding sudo saved me,
sudo rvictl -s [DEVICE UDID]
[or]
sudo /Library/Apple/usr/bin/rvictl -s [DEVICE UDID]
This may help some one.
You need to install the Command Line Tools for Xcode, available here:
https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-#
That includes the rvictl program.
It seems like default location and installed location of rvictl on Catalina are different.
rvictl should be installed by Xcode. Look for it at path: /Library/Apple/usr/bin/rvictl. The default shell has /Library/Apple/usr/bin/ in its path, either customise it or provide full qualified path i.e
/Library/Apple/usr/bin/rvictl -s 00008020-XXXXXXXXXXXXXXXX
Source: https://forums.developer.apple.com/message/392193#392193
When you say: the command line tools for 10.10 apparently do not include the rvictl program - I get the error message: command not found
You need to see the comment above: Mavericks and beyond: You need to install XCode from the App Store, and then you need to launch XCode once, and accept installation of additional tools. Restart your terminal.
It will then appear.

How to Get Xcode to Not Automatically Open Previously Opened Projects

So, I opened a xib file from an older project and it caused a crash. That's not the issue. The issue is that now when I restart Xcode, it tries to open all previously opened projects (and files) and the crash re-occurs. Where does Xcode store the list of previously open files, and how can I get it to start 'clean' without any open projects?
Update: As a note - this is the latest version of Xcode 4.2 on Lion.
Press option+Shift when clicking on the Xcode icon in the dock. Xcode then starts without opening previously used projects. This is related to version Version 4.5.2 (4G2008a) but I am almost sure that I used it in older versions as well.
I've recently had a similar problem. I tried the methods above and could launch Xcode from the command line, but as soon as I tried to open from the finder, it would try to open the "bad" document and hang.
I eventually resolved it by removing the contents of :
~/Library/Autosave Information/
~/Library/Saved Application State/com.apple.dt.Xcode.savedState
This seems to have fixed it for me.
I just spent half the day stressing over a very similar issue. I had tried updating and reinstalling Xcode - but the problem still persisted. Thankfully, a few minutes ago, I managed to solve this by doing what your question states with the help of this post.
Basically, I opened another Xcode project (it can be any file, though) from the terminal using the following command:
open -a /Applications/Xcode.app app.xcodeproj/ --args -ApplePersistenceIgnoreState YES
This successfully launched Xcode with the standard 'Welcome to Xcode' dialog box you usually get. Hope that helps!
I was able to do it with the following command line in Mavericks:
open -a /Applications/Xcode.app --args -ApplePersistenceIgnoreState YES
Not specific to Xcode:
Please make sure Close windows when quitting an application checkbox is checked under System Preferences > General.
You can stop Xcode from opening the last project by running the following command:
defaults write com.apple.dt.Xcode ApplePersistenceIgnoreState -bool YES
This and other useful commands are here.
Instead of looking for the file that contains Xcode's settings, take a look at the settings themselves using the defaults command:
% defaults read com.apple.xcode | more
I notice two keys that might be relevant: NSRecentXCFileDocuments and NSRecentXCProjectDocuments. Both appear to be arrays, so you could reset one like this:
% defaults write com.apple.xcode NSRecentXCFileDocuments -array ""
Alternately, you could use the defaults read command to dump the settings into a text file, edit that, and then use defaults write to update the settings:
% defaults read com.apple.xcode > xcsettings.plist
// edit xcsettins.plist with your favorite editor
% defaults write com.apple.xcode < xcsettings.plist
Given the project name "MyProject" in directory ~/Documents/Projects/MyProject do the following:
cd ~/Documents/Projects
mv MyProject MyProject.x
open -a Xcode
close MyProject (Option+Command+W)
mv MyProject.x MyProject
open -a Xcode
The this solved the crash for me... however my Storboard was corrupt. Fortunately the Time Machine backup of the folder was intact, I just restored it.
For me it wasn't a project that was causing the crash on startup, it was a particular file (an sks to be exact), so Kay's answer didn't work. When I went to open my particular project, it would still crash.
I simply temporarily deleted the file. Then I opened the project, cleaned, and re-added the file, and all was well.
I think Xcode may update its cache when you quit. It solved my issue to:
close projects
quit Xcode
reopen Xcode.

Resources