How can i use ghost4j on OS X 10.9 - macos

When i want to use ghost4j on OS X 10.9, i see this error:
Unable to load library 'gs': dlopen(libgs.dylib, 9): image not found
I have installed ghostscript library on my macbook using this site.
how can i fix this problem. I can not install ghostscript using port and brew for some reason.

First you need to find the file libgs.dylib which was installed by the installer package compile the libgs.dylib library from source, and make a note of where you installed it to.
Hopefully it should have been installed to a standard library location, and there should be nothing more you need to do. If not, you need to set the environment variable DYLD_LIBRARY_PATH. In a terminal this would be done by typing export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/directory, replacing /directory with the full path of the actual directory containing libgs.dylib. After typing this, in that terminal, if you run your application, it should work. To make it take effect permanently you would need to add the export command to your ~/.bash_profile. Or to make it take effect for all user accounts on your computer, you could add it to your /etc/profile.
If this doesn't work, I suppose the Ghostscript library could be 32-bit - you would need a 64-bit library I think.

A bit of an old thread but maybe useful for people still looking for an answer.
Install ghostscript using port
port install ghostscript
That done, you need to create a link so ghost4j finds the dylib.
cd /usr/lib
sudo ln -s /opt/local/lib/libgs.9.10.dylib libgs.dylib
Once I did that it worked like a charm.

Related

Where does Linux install Pocketsphinx program?

I am new in Linux and don't know much about it's installation manner. It's interesting for me to know where does it install the pockesphinx program?
where is continuous.cfile?
How Linux can find and execute this command: pocketsphinx_continuous -inmic yes ?
Where stuff is installed depends on how it was installed. Usually: If you were using your package manager, refer to your distrobutions documentation. If you extracted a tarball or installed using a script from a projects website, refer to their documentation.
If you are able to invoke the program from your terminal from everywhere, it will probably reside somewhere on your $PATH. You can show which directories are included in your path by issuing cat $PATH in your terminal of choice.
Also, the locate command is useful if you need to locate a file on your disk. I.e. locate pocketsphinx would give you all files that has the pocketsphinx string in its name, and its location. If you just installed the program, you might need to run a sudo updatedb to rebuild the index.

ImageMagick + El Capitan Unable to Locate Module

UPDATE: Solved with the solution here
I have spent the better part of my day trying to get ImageMagick to work with Grunt, with no luck. Grunt seems to be okay, but ImageMagick not so much, even though I've run the test on ImageMagick.org to make sure that it's installed correctly (I used HomeBrew for the install).
I get this error when trying to run a task:
Warning: Command failed: identify: unable to load module
'/usr/local/Cellar/imagemagick/6.9.2-4/lib/ImageMagick//modules-
Q16/coders/jpeg.la': file not found # error/module.c/OpenModule/1300.
identify: no decode delegate for this image format 'JPEG' #
error/constitute.c/ReadImage/501.
I've tried the solutions here and here, but none of them have helped.
(FYI I'm new to using the command line.)
Help?
As with any homebrew problem, I would suggest you run
brew doctor
first, to try and sort things out. It is an excellent diagnosis tool.
Now, to your specific problem... mmmm... the /opt/X11 part of your error message worries me because homebrew installs in /usr/local/bin and /usr/local/Cellar so your ImageMagick should not be looking anywhere in /opt at all. I guess you have installed freetype via MacPorts or some method other than homebrew.
I would suggest you install the freetype stuff using homebrew, i.e.
brew install freetype
Then I would suggest uninstalling any other freetype stuff you have installed any other way. Finally, I would suggest you check your PATH environment variable and make it point to /usr/local/bin before anything in /opt. You will need to log out and back in for the new PATH to take effect - you can check your PATH like this:
echo $PATH
and change it by editing $HOME/.profile if you need to.
The homebrew version of freetype provides version 19 of the library and is therefore compatible with the homebrew ImageMagick version.
Also, I am a little disconcerted by the X11 part in your error message - modern Macs don't really use X11 any more and it doesn't ship with OSX. Let's see if the above ideas sort you out before worrying about that too much though - unless you know, and can say for sure, that you need X11.

installing scipy on mac 10.6.8

I try to install scipy on my mac 10.6.8 but always have problem with it. I've installed ipython (sudo /usr/bin/easy_install-2.6 ipython) and numpy (python setup.py build/install), but when I installed scipy by the same way, I got always this error message:
RuntimeError: Running cythonize failed!
Could someone tell me how to solve this problem?
Have you tried using the binaries provided for OSX? That should ensure everything works.
EDIT
The easiest way I've found to keep package dependencies under control is to use MacPorts as much as possible because unlike Homebrew, the packages are designed to work together and dependencies are (almost always) automagically installed when you try to install something.
So, first, install MacPorts using the installer for Snow Leopard. Choose the option to install ports in a unique directory like /opt/local, so they don't conflict with whatever built-in versions the OS depends on. Also, ensure that /opt/local/bin and /opt/local/sbin are added to your $PATH before the system directories like /usr/bin, /bin, /sbin etc. so that when you run python from the command prompt you get the version you want. Your ~/.profile should have something like export PATH="/opt/local/bin:/opt/local/sbin:$PATH as its last line.
After MacPorts has been installed, you may want to restart just for fun to ensure that all of your environment variable are set up properly. Start Terminal.app (or your favorite replacement) and enter which port, which should return /opt/local/bin/port if everything worked correctly. Next, run sudo port selfupdate just to make sure everything is synced properly. Once that is done, we can install python and some modules. port allows you to pass a list of ports to be installed, so a command like sudo port install foo bar baz will install the latest versions of the foo, bar, and baz ports, along with any dependencies they may require, in the correct order. Some ports have binary distributions, and others are compiled as needed, so the first time you run it there may be a lot of dependencies to install. A nice feature of MacPorts is that you can have multiple versions of some packages installed at the same time, and you can switch between them if needed. Also, if port search is giving too many results, the online search engine can help you find what you're looking for.
To get a decent IPython-based Python 2 development environment going, you'll need the following:
python27
py27-ipython
py27-numpy
py27-scipy
py27-matplotlib (if you like drawing pretty pictures, but mainly so you can get pylab)
py27-pandas (DataFrames are your friend!)
and perhaps py27-pyqt4 if you run ipython via the qtconsole option
I'd also install py-pip and py27-distribute so you can install modules on your own if there is no MacPort version.
Finally, if you're a forward-looking person and want to use numpy et al. on Python 3, MacPorts has you covered! There are py32- and py33-based versions of all of the above packages except scipy, which is only py32 for now. However, I was able to install it just fine with pip, although I have a whole bunch of other devel tools on my machine, and I'm running 10.8.2, so YMMV.
Good luck!

No usable M4 in $PATH or /usr5bin

As part of a long, sordid story whose end goal is simply to get GMP installed for use with code::blocks in Windows, I am trying to configure gmp. I do this with the following command:
./configure --prefix=${gmp_install}
Everything starts out well enough. After a few minutes and a bit of progress, everything grinds to a halt and I get this message:
configure: error: No usable M4 in $PATH or /usr5bin
I don't even know what M4 is, but I discover that it is some sort of macro processor. So I download it, and add the folder to my Path variable. Then I start the configure again, but same result.
Is there something that I need to do to M4 to get it working? I'm truly at a loss. Thanks for your help.
If you're using debian based OS, do sudo apt-get install m4. If internet isn't there or you have just the package of m4, copy it in /opt, configure it and later on change the $PATH value to the one you have now.
If you are using cygwin, the setup installer has a working package of m4. Then there's no need to download m4 or change $PATH.
I came up with your same problem, I solved it by running the Mingw package installer, and search for msys-m4 in the list, select all and then Apply Changes, it should let you ./configure just fine :)
Assuming you are on MSYS2 (You seem to have a sh), you can install m4 via pacman -S m4.
Be careful that if you run configure through a shell, that you don't pick WSL's bash accidentally (which is in %System32%/bash.exe). Which is what happened in our build system...

Trouble trying to install MIT-Scheme on MacOSX Snow Leopard

I am trying to install MIT-Scheme so that i can use it off my terminal instead of using an IDE, however, I am having difficulty trying to find tutorials that are actually up to date and works.
You can install MIT Scheme through Macports, and it will probably take a long time (it's compiling it from source, I think). You can also get a precompiled binary from here which will install an MIT-Scheme.app which starts Edwin an Emacs port or something which includes a Scheme debugger and REPL. But you can also start it from the command line.
Check to see where it installed to, on my machine it's here /Applications/mit-scheme.app/Contents/Resources/ but that might vary. Add this directory to your PATH by editing ~/.bash_profile and adding this:
export PATH=$PATH":/Applications/mit-scheme.app/Contents/Resources/"
Check with which mit-scheme to make sure it installed correctly.
As for Racket, there's also a precompiled binary available from here. (It might be in Macports but it might not be, or in Fink, I don't know. I try to avoid those and use Homebrew if possible.) This is a dmg file which you can extract and put wherever you want. I put mine in ~/bin and added ~/bin/racket/bin/ to my PATH as well, same process as above, but you can put it anywhere, /Applications/ or whatever.
Good luck.
This seems like a odd answer since it's about Racket for a question that was originally about MIT Scheme, but since you tried Racket too...
To run Racket from the terminal, you need to use the racket executable, which is found in the bin subdirectory. For example, if you install it at /Applications/Racket-5.1, then you'd run /Applications/Racket-5.1/bin/racket. (And you could modify your $PATH or add some symlink to make it possible to run without specifying the full path.)
You can find the detailed answer here.
Here is a short version:
Download .dmg file of MIT-Scheme. 32-bit or 64-bit based on your hardware architecture.
After installation run the following commands
For 32-bit package:
sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-i386
sudo ln -s /usr/local/lib/mit-scheme-i386/mit-scheme /usr/bin/scheme
For 64-bit package:
sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-x86-64
sudo ln -s /usr/local/lib/mit-scheme-x86-64/mit-scheme /usr/bin/scheme
To run MIT-Scheme from your terminal just type 'scheme' in the command prompt.

Resources