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

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.

Related

zsh - OSX - visual studio command line won't stick

which code
code not found
Selecting the Install 'code' command in Path option from the VSCode command palette only fixes the problem temporarily.
The code command works then, even when I restart the terminal.
However, when I restart my computer I am back to
code not found
I can see that code is at /usr/local/bin/code
/usr/local/bin is already in my path.
Check that the symlink /usr/bin/local/code isn't pointing to a translocated version of the VSCode binary. Mine was.
$ ls -l /usr/local/bin/code
code -> /private/var/folders/hz/w...n/T/AppTranslocation/...
To fix
Ensure your VSCode installation is not running in App Translocation. This can happen if you move the VSCode binary to /Applications by, for example, using an Alfred workflow. You must manually drag the binary in to the folder in Finder. (What a drag. Ha ha. But seriously, WTF Apple?)
You can fix this by dragging your existing binary out to the Desktop then back to the Applications folder.
Delete the broken symlink: sudo rm /usr/local/bin/code.
Re-install the link using the command in VSCode ("Install 'code' command in 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.

Mac installing libraries using the terminal

I have researched this and found answers on SO on this topic yet remain confused.
Trying to get started with Git. I'm new to shell scripting too so hopefully after this I'll be more familiar with it.
I'm reading this page about how to get up and running with Git: http://git-scm.com/book/en/Getting-Started-Installing-Git
I created a directory on my desktop called "git" and navigated to it in the terminal. With my level of experience in shell scripting this was a victory. Then, following a blog post on how to download fromt he terminal ran this command:
curl -O http://git-scm.com/download
That worked, or at least a new file was added to the "git" directory that I created.
Reading down the instructions one is told that "To install Git, you need to have the following libraries that Git depends on: curl, zlib, openssl, expat, and libiconv"
OK. Um. How? I did read some blog posts and SO answers on how to do this but failed. The first one for example - type zlib and hit enter - command not found? How do I either check if it's already installed or how do I install it? What about the others?
I tried following this blog post: http://www.neuraladvance.com/using-open-source-libraries-on-mac-os-x.html
I typed:
./configure
make
sudo make install
Wasn't even sure what to expect. The first two commands said not found the last one asked me for a password.
I then tried ./configure --help
Was then told "No such file or directory"
Needless to say I don't know what to do next. How do I install the libraries on a Mac using the terminal? curl, zlib, openssl, expat, and libiconv
I'm pretty sure all those libraries are preinstalled on your Mac.
If not, installing Xcode (free on the AppStore) would do the trick.
Xcode actually comes with git (but not the latest version) so if you install Xcode you don't need to install git separately.
To answer your question more generally, you might want to install Homebrew.
It's a command line tool to install software and libraries and it's pretty easy to use.
It's great that you are discovering the shell. You should read some tutorials for beginners. If you like it, you will learn very fast and in a few weeks, you will understand exactly why the command you tried didn't work. Have fun learning!
As Simon suggested you should install Xcode, however the CLI tools are not installed automatically. They must be downloaded through Xcode's, preferences. In Preferences click the Downloads tab then install next to Command Line Tools.
If any of the required tools are not automatically installed with Xcode, Homebrew is a great, easy to use, utility that can install nearly any UNIX or Linux command with the following syntax:
brew install <SomeAppName>
The Homebrew website has easy to follow instructions for setting it up initially. So if anything you need is missing try using that.
In Xcode 5, to download Command Line Tools, choose Open Developer Tool under "Xcode", then More Developer Tools> from the sub Menu. This takes you to an Apple web page - you'll need a Developer username/password to get to the Downloads page.
Choose the right CLT for your system, download and install from the dmg/pkg.

How to build OpenCASCADE on MAC (Mountain Lion)

I am trying to build OpenCASCADE on Mac, but I am not having any luck.
I downloaded it from Github in tar.gz, but I am really new to Mac and I am stuck.
Can anybody explain what should be my next step?
(I found some terminal commands what I should use, but I am not familiar with them. So if it is the right way to build OpenCASCADE on Mac please write down the terminal commands with details. Thank you!)
EDIT:
I understood the command line commands now from the link below. I understood it before too, but I was mistaken, because my main problem was, that I didn't had gcc installed (XCode does not installs gcc automatically...). So anyways, now finally I can run the cmake command. It starts but it ends with this:
CMake Error at /Applications/CMake
2.8-9.app/Contents/share/cmake-2.8/Modules/FindX11.cmake:420 (MESSAGE): Could not find X11 Call Stack (most recent call first):
CMakeLists.txt:313 (FIND_PACKAGE)
Anybody have any idea what to do? I tryed to search this too here, and google...and I found some "solutions" but those didn't work for me.
EDIT EDIT:
The solution for the last edit is that Mountain Lion doesn't install X11. So open up an app that uses X11 or Xquartz and it will install automatically.
Unfortunetly it still doesn't work. My next error message is the following after the make command in terminal:
In file included from
/Users/davidbirkas/Documents/tpaviot-oce-6c9a06a/src/AlienImage/AlienImage_X11XWDAlienData.cxx:14:
/Users/davidbirkas/Documents/tpaviot-oce-6c9a06a/inc/Aspect_XWD.hxx:5:12:
fatal error:
'X11/XWDFile.h' file not found
# include
^ 1 error generated. make[2]: * [adm/cmake/TKService/CMakeFiles/TKService.dir/_/_/__/src/AlienImage/AlienImage_X11XWDAlienData.cxx.o]
Error 1 make1:
[adm/cmake/TKService/CMakeFiles/TKService.dir/all] Error 2 make: **
[all] Error 2
Any ideas how to fix this?
Ensure that, together with XCode, you also install the X11 support from Apple's Devtools. Your error message is indicating that it is missing.
FWIW, I have written a blog post about OCC and PythonOCC on Mac some time ago. Maybe you'll find some detailed info there.
http://cad-3d.blogspot.com/2011/10/pythonocc-open-source-interactive-cad.html
In this post, I still talk about using the binary installer, but recent updates to the OCE edition compile usually without problems out-of-the-box, also on OSX (that is NOT the case with the official OpenCASCADE release).
I spent a little time on this and I think I have it. Here is what I did step by step:
Preparation phase:
Installing Xcode (with command line tools) = Apple developer site
// If Xcode doesn't install gcc, than you can still download it from the developer site as Command Line Tools for Xcode.
Installing Cmake (with command line tools) = Google
// You can download it from the official site with a .dmg/.pkg file extension. Easy install.
X11 under Mountain Lion "changed" to Xquartz. Probably it is not installed by default, but it is easy to check it. Just go to the folder "Application" and start the X11 app. If X11/Xquartz is not installed than it will install automatically!
Installing FTGL = MacPorts = Google
// Download MacPorts from their official site, install it with the installer, than write this to the terminal:
sudo port install ftgl
Download OCE and extract it (.OCE-0.9.0.tar.gz file) = https://github.com/tpaviot/oce/wiki/Download
Installing phase:
I. Open Terminal.
II. Run this command
// This will set the proper PATH.
ln -s /opt/X11/include/X11 /usr/local/include/X11
III. Than from the Terminal go to the directory where you extracted the OCE file (the original extracted file name should be: tpaviot-oce-6c9a06a).
IV. Than write these commands:
// You make a build directory to the extracted OCE folder.
mkdir build
cd build
V. After this you give out the cmake command:
cmake -DOCE_INSTALL_PREFIX:PATH=$HOME/OCE \
-DOCE_WITH_FREEIMAGE:BOOL=ON \
-DOCE_WITH_GL2PS:BOOL=ON \
-DOCE_DRAW:BOOL=ON \
..
VI. And at the end the make commands:
make
make install/strip
If you did everything exactly like this, than it should work!
Give OCE a try. Compiling for osx is a walk in the park

Can't launch anything from terminal after uninstalling fink! Mac Lion

I've got a big problem, I can't launch anything from the terminal, not python, not emacs (or aquamacs), not even 'which'.
I was using homebrew to try to install ffmpeg and was having difficulties so I decided to pay attention to the warning that always come up advising me to uninstall fink. I removed the sw directory from my root directory, which is what the fink website told me to do and was confirmed on many blogs and message boards after a quick google search.
And since then nothing has worked, I'm almost certain that this was the cause of the problem because after removing sw I immediately tried home brew again and it said 'brew: command not found'. I get the same warning with any and every program I try to launch.
I use Mac OS Lion on a 6 year old MacBook.
Any ideas?
You probably busted your PATH. You can use absolute paths to commands until you get it fixed. For example:
/bin/mv ~/.profile ~/.profile.bak
/bin/mv ~/.bash_profile ~/.bash_profile.bak
Then open a new Terminal window, where standard things should now work. and repair your profile script.

Resources