No usable M4 in $PATH or /usr5bin - windows

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...

Related

cygwin bash not returning a valid result

I am following this :
Step 2: Installing Cygwin
Cygwin can be downloaded from http://www.cygwin.com
Run the setup file.
Install from internet. Specify C:\cygwin as the root directory.
In the Select Packages dialog box, select the packages required. gcc-core, gcc-g++, gdb, and make packages are most important. These are the C core, C++ core, the GNU Debugger and the GNU version of ‘make’ utility. These packages will be under the ‘Devel’ category.
Complete the installation.
Step 3: Testing Cygwin
To test whether Cygwin was installed properly, try the following by opening the bash shell:
cygcheck -c cygwin
gcc --version
g++ --version
make --version
gdb --version
If the version details are displayed for all these commands, the installation of Cygwin has been successful.
I got this from here
But the result I get is:
What is wrong or missing with my installation.
Follow up question:
I wanted to use the terminal window in netbeans that is why I installed this.
In this terminal widnow I also have problem. I cant type anything on it. Is this the reason for it?
Try to run /usr/bin/g++. If it is not found, then you don't have g++ installed (installation may have had problems).
You can follow the same procedure for the rest of your commands
If /usr/bin/g++ runs successfully, it means you don't have /usr/bin in your PATH (which is very unlikely). You can put that in your PATH in your startup file.

How can i use ghost4j on OS X 10.9

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.

Problem with gcc 4.6 installation on ubuntu

I am trying to install gcc 4.6 (mainly for having C++0x better supported) in my ubuntu 9.10 (via virtualbox). I referred to previous questions, but I am getting a different error.
I am referring this link for the installation. Now, I have done till the ./gcc-xx/configure ... step. Though it was giving some flex package related error. Mostly due to that make is also failing with below errors:
build/gengtype.o: In function
adjust_field_rtx_def':
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:978:
undefined reference tolexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1032:
undefined reference to lexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1042:
undefined reference tolexer_line' ...............
Now this is giving me a hard time figuring it out because I have already flex/bison latest versions installed. I searched over internet for 2 days almost but no luck. Any help would be really appreciated. Also note that, I already have gcc 4.4 installed in /usr/bin/gcc and I have unzipped the gcc 4.6 tar in my home directory local folder.
[Note: I am also ok with installing ubuntu 11.10 too (which has gcc 4.6) as last resort. But I don't know if its .iso image is available.]
I got this fixed. I followed following procedure:
[Note: run all the commands with sudo, if you are not login as root. e.g. sudo ls -ltr; sudo make install;
As mentioned in the link in my
question, download the gcc4.6...tar
file in a temporary place
Now find the place where current
gcc is stored. e.g. My earlier
gcc4.4 was stored in
/usr/lib/gcc/i486-linux-gnu. Which
has a folder called 4.4, 4.4.1
Create a folder named 4.6 (or
4.6.1/2/3 etc.) and put that
.tar file inside it. Untar the
file as shown in link.
Follow all the procedure as per the
link. Use nohup <command> & to
track the logs. i.e. nohup make
clean all & followed by tail -f
nohup.out
If some error comes, it means some
package is missing. Mostly those
package will be present in your
current gcc version. You can
install them there itself. For
example, in my case zlib was
missing. I ran sudo apt-get install
zlib1g-dev libssl-dev and it worked
fine. Otherwise download from internet and install it.
Once your gcc is installed, you
can simply check it using type
gcc-4.6. In my case it showed that
it's stored as
/usr/local/bin/g++-4.6.
Either you can use the same path to
compile or you can put an alias in
your bash/tcsh/ksh. e.g.
/usr/local/bin/g++-4.6 -std=c++0x
-Wall test.cpp
FWIW Debian testing and unstable have gcc-4.6 as a standard package. So you can simply install that distro inside of virtualbox or, as I've done on my Ubuntu 11.04 server at home, via kvm. In the past, I also used to use dchroot build environments.
There may also be prepackaged gcc-4.6 binaries at launchpad.

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.

Compiling Unix Version 6 in Snow Leopard

Hi i downloaded souce for unix version 6, i want to study it and test it. I am running Snow Leopard on a macbook pro.
1)Is there a way to compile it in mac. If i comile using make or gmake i am getting the following error.
*** Error: Couldn't find an i386-*-elf version of GCC/binutils.
*** Is the directory with i386-jos-elf-gcc in your PATH?
*** If your i386-*-elf toolchain is installed with a command
*** prefix other than 'i386-jos-elf-', set your GCCPREFIX
*** environment variable to that prefix and run 'make' again.
*** To turn off this error, run 'gmake GCCPREFIX= ...'.
2)I also want to run it in a virtual machine,I have VMWare installed on my machine. I don't know how to do that.
Download tarballs for gcc and binutils, expand them, then:
$ cd binutils-2.15
$ ./configure --target=i386-jos-elf
$ make
$ make install
$ cd ../gcc-3.4.1
$ ./configure --target=i386-jos-elf
$ make
$ make install
You will of course need to update the paths. (I got these instructions from MIT's OpenCourseWare.)
You'll have to go through the process of creating a new virtual machine and formatting and installing the OS onto its disk. I've used VirtualBox with some success, but I have no experience with VMWare; you're on your own there.
You might look into macports.org. It has several packages that look useful, notably "i386-elf-binutils". It installs into /opt/local/*, so you may need to make sure /opt/local/bin/ is in your path. (Although I believe it takes care of that by default.)
EDIT: Or maybe not. After a little more research, I wonder if these instructions and downloads are what you're looking for.
EDIT again: Corrected the download link. Sorry about that!
The build system you are using seems to require an ELF tool chain (used by Linux).
You could try to figure out if that can be changed, but since you have VMWare, try to compile it under a virtualized Linux (minimal Debian is quite light-weight).
As an alternative you may compile bournesh on Mac OS X.
http://freshmeat.net/projects/bournesh/

Resources