2

I want to install petrify -- a tool for simulation of Asynchronous Circuits -- so I downloaded the file and in this folder there is an INSTALL file that says:

 You should define properly define the variables PATH and MANPATH
 of your environment including the "bin" and "man" directories
 of petrify respectively.

What should I do?

1

From the Petrify website, I downloaded the "New version 4.2 (only for Linux)" (clicking will download the file).

I unpacked it using tar:

tar xfz petrify-4.2-linux.tgz

Inside the created petrify directory is the INSTALL file you quoted from, and the directories it refers to, bin and man. The files are all ready to use and no compiling is required. The two symlinks to the petrify binary in bin apparently require a program called Dot, but the link to that program on the Petrify website is broken, so I did not attempt to get those two commands working.

Firstly I suggest testing the petrify binary. Because it's a 32-bit binary, if you are using a 64-bit system, you will probably get this baffling error:

bash: ./petrify: No such file or directory

This is explained in this answer by Gilles.

For me it was sufficient to install libc6:i386:

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386

Now the program should run, but it won't do anything without input. If you don't have any files to work on, you can download some examples (clicking will download) from the site for testing. This file will need to be unpacked with tar xfz <file> too. I tested it, but I have no idea how to interpret the output, so I can only tell you that some output files were generated, and there weren't any errors!

To answer your actual question (finally), the reason you might want to set those environment variables is so that you can run petrify and man petrify from anywhere. Rather than modifying your PATH or setting MANPATH, you could simply copy the files to appropriate locations. Assuming you are in the petrify directory where you found the INSTALL file, you could run

mkdir -p ~/bin
cp bin/petrify ~/bin

This directory is automatically prepended to your PATH if it exists by a piece of code in the default ~/.profile on Ubuntu. You need to source ~/.profile to have it adjusted immediately, or log out and log back in for it to take effect (you only have to do that once). Now you can run petrify anywhere.

Alternatively, you could copy to /usr/local/bin:

sudo cp bin/petrify /usr/local/bin

This is already in the default PATH. This is the better option if multiple users need access to the program. You can also copy the symlinks from the bin directory to the same location as petrify.

For the man, I copied the file to /usr/share/man/man1 where the other man files on my system live:

chmod 644 man/man1/petrify.1
sudo cp man/man1/petrify.1 /usr/share/man/man1

Running man petrify now brings up a comprehensive man page.

If you prefer to configure the PATH and keep the files isolated, you can set the environment variables in your ~/.profile instead. You can add a line like this to append to the PATH:

PATH="$PATH:/path/to/petrify/bin"

replacing /path/to/petrify/bin with the actual path to the parent directory of the petrify binary file, wherever you put it.

Setting MANPATH can also be done in ~/.profile. Note that the directory structure is

man
└── man1
    └── petrify.1

If the full path of petrify.1 were

/home/zanna/petrify/man/man1/petrify.1

I would set the MANPATH in ~/.profile like this (without man1):

export MANPATH=":$HOME/petrify/man"

The leading colon is important here and must not be omitted. Also note that you do not need to export PATH (it is already exported, and changes to it will be inherited) but you do need to export MANPATH.

| improve this answer | |
  • 1
    and also if anyone wants to use draw_astg , he must be install grapviz in advance so type this in the terminal sudo apt-get install graphviz – Milad Sabri Apr 28 '18 at 12:20
  • @MiladSabri that's really helpful information. If you want to, you could add an answer yourself about getting the draw_astg program working that way. I don't know what it should do, so I don't think I can do a good job of testing it; I think you would manage a lot better than me and it would probably be helpful to others – Zanna Apr 29 '18 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.