LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 01-03-2011, 03:12 PM   #1
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Rep: Reputation: 18
Help doing UML with graphviz


I'm doing a group project using some UML stuff. I tried install graphiz and it installed find but apparently it keeps telling me I'm missing dot when compiling the UML (tells me dot should be at /usr/bin/dot which it is, but it can't find it). I also tried a command "java -jar plantuml.jar -testdot" (which was suggested where the UML should have been) and the jar file couldn't be found.

Any suggestions to make this work for me?
 
Old 01-03-2011, 09:46 PM   #2
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Rep: Reputation: 51
Try creating this simple file I called testfile.gv and storing it in your home directory:
Code:
digraph testgraph {
	hi -> bye -> done;
}
Now, open a terminal, cd to your home directory, and enter this:
Code:
james@darkstar:~$ dot -Tpng -O testfile.gv
james@darkstar:~$ ls testfile.gv*
testfile.gv      testfile.gv.png  
james@darkstar:~$ xv testfile.gv.png
if all that went well you should see this:
Attached Images
File Type: png testfile.gv.png (7.1 KB, 7 views)

Last edited by jamesf; 01-03-2011 at 09:47 PM.
 
Old 01-04-2011, 08:27 AM   #3
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
That worked fine
 
Old 01-04-2011, 08:58 AM   #4
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Rep: Reputation: 51
Weird. Which UML software are you using? And, are you sure that the UML support offered by the software was actually selected during compilation?

I use graphviz a lot in my Windows-centric day job and I've used it a bit here at home, but only from the command line 'dot' command and family.
 
Old 01-04-2011, 10:18 AM   #5
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
All I know is that I'm using graphviz and whatever came with it. I'm using it with latex to make pdf files.
 
Old 01-04-2011, 02:04 PM   #6
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Rep: Reputation: 51
Please post the output of 'dot -v' (you'll probably have to control-c after that command), the output of 'which dot', and the command / program you're using that errors out and the errors themselves.

thanks!

Edit: are you embedding latex in dot graphs, or dot graphs in latex documents?

Last edited by jamesf; 01-04-2011 at 02:05 PM. Reason: additional question
 
Old 01-04-2011, 02:53 PM   #7
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
Outputs are as follows:

dot -v:
Code:
dot - graphviz version 2.26.3 (20100126.1600)
Activated plugin library: libgvplugin_pango.so.6
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.so.6
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
	/usr/lib/graphviz/config6
		was successfully loaded.
    render	:  cairo dot fig gd map ps svg tk vml vrml xdot
    layout	:  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout	:  textlayout
    device	:  bmp canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gtk gv ico imap imap_np ismap jpe jpeg jpg pdf plain plain-ext png ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp x11 xdot xlib
    loadimage	:  (lib) eps gd gd2 gif jpe jpeg jpg png ps svg xbm
which dot:
Code:
/usr/bin/dot
I'm using makefiles to build the latex from multiple folders of stuff, so here's the makefile:
Code:
MODULES := latex uml
TEXINPUTS := .:uml/img/:latex/:graphs/:output/:bib/:
export BIBINPUTS:= bib/
TEXOUT = -output-directory=output
LATEXFILES :=
GFXFILES :=
UMLFILES :=


# include the description for each module
include $(patsubst %, %/module.mk,$(MODULES))

all: $(UMLFILES) $(LATEXFILES)

#compile latex
$(LATEXFILES) : 
	pdflatex $(TEXOUT) latex/$@
	#bibtex output/$@
	pdflatex $(TEXOUT) latex/$@
	#pdflatex $(TEXOUT) latex/$@

#UML File Generation
#$(UMLFILES): $(addprefix uml/,$(addsuffix .uml,$(basename $(notdir $(UMLFILES)))))
%.png: 
	cat $(addprefix uml/,$(addsuffix .uml,$(basename $(notdir $(@))))) | java -jar uml/compiler/plantuml.jar -pipe > $@

clean:
	rm output/*.* uml/img/*

# Personal (for dev-ing)
dan : all
	AcroRd32.exe output/report.pdf
I am embedding the UML in the latex documents, and the error shows up as pictures with the following text:
Code:
Dot executable: /usr/bin/dot
File does not exist
Cannot find Graphviz: try 'java -jar plantuml.jar -testdot'
When I do what this error message recommends, I get this output:
Code:
Unable to access jarfile plantuml.jar
 
Old 01-04-2011, 04:37 PM   #8
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Rep: Reputation: 51
Assuming that you're running this from the command line, is your current directory the directory that contains plantuml.jar?

Since dot works (per tests above) I'm leaning towards a java configuration / plantuml configuration problem. Try the stuff
at this url: http://plantuml.sourceforge.net/faqinstall.html

If that doesn't work, then as root 'updatedb' and 'locate -i plantuml.jar'. 'exit' root, 'cd' to the directory that contains plantuml.jar, then try the -testdot option like this:
Code:
user@machine$ java -jar plantuml.jar -testdot
and see what happens.

There is an environment variable, GRAPHVIZ_DOT, that plantuml will use. You could try (assuming bash):
Code:
user@machine$ export GRAPHVIZ_DOT=/usr/bin/dot make whatever_your_target_is
Also, the plantuml website on sourceforge says that they're a continuous integration development model, so you might try updating the plantuml installation if there is a newer one. But let us focus on other things first.
 
Old 01-04-2011, 05:02 PM   #9
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
I found the plantuml.jar and the -testdot works in that directory, but nowhere else
 
Old 01-04-2011, 09:31 PM   #10
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Rep: Reputation: 51
Quote:
I found the plantuml.jar and the -testdot works in that directory, but nowhere else
Ok. This is (close to) nailed. Unfortunately, I'm not at my best with java programming and setup. I'm a C#/Mono guy. :v(

However, I _think_ the problem is either your CLASSPATH is wrong -or- you need to be in the plantuml.jar directory to run plantuml.jar.

Your make file is probably _not_ in this directory (if I had to guess), so, when you try to 'make' your target the .jar gets run _but_ something inside it gets confused. Perhaps another java class or utility file can't be found.

If you use a file manager to navigate to the plantuml.jar directory and double-click the .jar does everything work as expected?

Also, try moving your makefile to the directory containing plantuml.jar and running it from there. I notice that you'll have to remove the uml/compiler/ from your java command if you try this, among other changes.

Last edited by jamesf; 01-04-2011 at 09:38 PM. Reason: additional suggestion
 
Old 01-05-2011, 01:48 PM   #11
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
Instead of moving the makefile to the uml/compile/ directory, I moved plantuml.jar to the directory containing the makefile (because plantuml.jar was the only thing in uml/compile). I changed the reference in the makefile and the -testdot works, but it still will not compile into my latex document correctly (still complaining the error that I mentioned above).

Edit: Apparently I am needed to export the GRAPHVIZ_DOT variable in bash. I tried creating a .bashrc file in my home directory and putting the export in there but it won't work, so I have to do it manually every time. How do I make bash automatically export this whenever I start it?

Edit 2: Figured out how to export automatically, use .bash_profile instead of .bashrc and it'll run every time you log in.

Thanks for all the help.

Last edited by spudgunner; 01-05-2011 at 02:05 PM. Reason: Problem Solved
 
Old 01-05-2011, 04:49 PM   #12
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12 and higher
Posts: 229

Rep: Reputation: 51
Quote:
Originally Posted by spudgunner View Post
Edit: Apparently I am needed to export the GRAPHVIZ_DOT variable in bash. I tried creating a .bashrc file in my home directory and putting the export in there but it won't work, so I have to do it manually every time. How do I make bash automatically export this whenever I start it?

Edit 2: Figured out how to export automatically, use .bash_profile instead of .bashrc and it'll run every time you log in.

Thanks for all the help.
You're very welcome. Now, with KDE starting bash you put it in the right spot. If you use (I think) xfce then the export won't appear because they each start bash a little differently (on my standard-install -current box). I had to end up source-ing /etc/profile and ~/.bash_profile in .bashrc to get consistent results across most environments.

I'm really glad it is working for you, though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GraphViz - Nodes stack to the right Vinter Linux - Software 1 11-16-2010 05:09 AM
Graphviz compile error, please help! Domine Slackware 6 03-15-2010 09:40 PM
external library of graphviz needed to install ????? wahaha Linux - Networking 0 08-13-2006 12:42 AM
Create relationship diagrams with Graphviz LinuxLala Linux - News 0 11-22-2005 06:01 AM
how to use graphviz abd_bela Debian 2 02-11-2004 04:41 AM


All times are GMT -5. The time now is 10:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration