Error building Omnet++: Cannot build Tcl/Tk apps on Mountain lion - compilation

I'm trying to Compile Omnet++ 4.1 on Mountain Lion. When I type:
./configure
I get the following error:
configure: error: Cannot build Tcl/Tk apps, probably due to misconfigured or missing X11 headers or libs. Check config.log for more info!
I remember compiling it on Lion without any problems, any ideas how to get it working on Mountain Lion?

Found a solution for this over on the omnetpp google group, I'll paste it in here:
Hi all,
just tried Mountain Lion, which was released yesterday. Unfortunately,
the new MacOSX does not include X11 by default. I really HATE this
decision. As a result, it does not pass the Tcl/Tk checks when we do
./configure.
After hours of efforts, I finally figured out how to work around this:
download and install XQuartz at http://xquartz.macosforge.org/landing/
make a symbolic link at /usr/include: sudo ln -s /opt/X11/include/X11 /usr/include
and you are all set. In 2, you may also set some environment variables
accordingly instead of making the symbolic link.
Future OMNet++ releases may consider setting associated environment
variables so that the compiler looks for Xlib.h in
/opt/X11/include/X11 with Mountain Lion.
Just successfully compiled the simulator and haven't encountered other
problems yet.
Have fun,
TS

If you have the same problem on Linux (ubuntu) a solution is run this in the console:
sudo apt-get install build-essential gcc g++ bison flex perl tcl-dev tk-dev blt libxml2-dev zlib1g-dev openjdk-6-jre doxygen graphviz openmpi-bin libopenmpi-dev libpcap-dev

Installing XQuartz is still the solution to overcome this problem.

Related

Set up g++ on OS X

I just updated to OS X Mavericks and it seems it messed up my whole compiler setup. Not only do I have to reinstall a JDK in order to use a Java compiler, I get the following error when I'm trying to compile C/C++ using GCC/G++:
/usr/local/Cellar/gcc/4.7.2/gcc/lib/gcc/x86_64-apple-darwin12.2.1/4.7.2/../../../../include/c++/4.7.2/cwchar:46:19: fatal error: wchar.h: No such file or directory
Not sure what to think other than upgrading messed it up. My question is: how do I set up g++ to compile on OS X? If it's already set up, what is the problem here?
If I can provide more information, please let me know.
Note: I've installed gcc 4.7 using homebrew, but it doesn't seem to work. When I use g++-4.7 code.cpp specifically, I get the same error.
Installing the Command Line Tools (OS X Mavericks) for Xcode - Late October 2013 solved it for me. Here is the link:
OSX: Xcode Downloads
The often mentioned xcode-select --install command kept saying it cannot find the requested software.
To clarify: You need to already have gcc-4.7 installed using Homebrew. The update to the latest version of CMD Tools only fixes compatibility issues caused by upgrading from Mountain Lion to Mavericks.

Downgrade or remove GCC 4.8 from Mac OS X Mountain Lion

I am in the process of trying to essentially start from scratch with getting homebrew, GCC and RVM 1.9.3 on to my mac OS x 10.8.2 after determining that my problems with RVM were "related to a messy environment which can not be fixed automatically without what we plan for RVM2" in a thread that began here on SO and ended as a github for ticket RVM.
I had XCode 4.6 with Command Line Tools installed as was recommended here but at this point have completely deleted XCode (by trashing it- due to the version sudo /Developer/Library/uninstall-devtools --mode=all did not work), I uninstalled homebrew by running
cd `brew --prefix`
brew install libtool
rm -rf Cellar
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
and imploded my rvm. However, I am not sure how to go about 'refreshing' my GCC situation. Which is as follows:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-apple-darwin12.2.0
Configured with: ../gcc-4.8-20130113/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.8.0 20130113 (experimental) (GCC)
I have Time Machine backups from various stages of my undoing and made a bootable USB of Mountain Lion but was hoping to try reinstalling a fresh copy of Xcode or running the GCC-10.7 program installer before using either of those methods. However, I don't know if I can or how I would rectify the GCC situation before doing so.
From reading Change to GCC 4.7.., it seems that there might be a way of pointing/directing my system to a different version of GCC, but I don't know how to do that without MacPorts or homebrew.
Is there a way to get rid of the experimental GCC 4.8 so it doesn't come back in the future?
I have run a VM of my system with a copy of /usr/local/ from before I had ever installed XCode CLT or any of these other libraries, but my $ gcc -v still came back with gcc version 4.8.0
Sorry if I omitted and/or added necessary/unnecessary information and thank you in advance for any help.
This is a confusing dump of information. You don't want to use MacPorts or Homebrew? I seriously recommend you go with Homebrew. That should get the latest GCC 4.8 onto OR OFF OF your box with ease. If you can't figure out where your current gcc 4.8 is, try typing "which gcc" and that will tell you where it's located. It's not coming back. Clearly you never removed it if typing gcc brings up gcc. It's probably in /usr/local/opt.
If you insist on wiping out ALL the homebrew stuff manually, you COULD just zap /usr/local/opt to get rid of the symlinks, and /usr/local/Cellar to get rid of the real stuff, but I don't recommend it. Why? Zapping directories by hand could cause you to lose data especially if you're prone to making mistakes. Use MacPorts or Homebrew to REMOVE whatever you used it to install.

Compiling sphinx search on Mac OSX Lion

I am trying to install sphinx on Lion.
I've tried versions 0.9.9, 2.0.2, and trunk (as of now).
However, ./configure breaks: "universal endianness not supported".
I have only seen this configure error on Lion; Snow Leopard and earlier OSX versions work fine.
I've tried forcing little endian via CFLAGS etc., but I'm not sure what flag needs tweaking. Can anyone help?
You can install it via MacPorts. Caveat is that your mysql / postgres must also have been installed from ports to satisfy a dependency.
If you're on Lion, the comment in this bug report is useful:
https://trac.macports.org/ticket/31666
sudo port clean sphinx;
sudo port install sphinx configure.compiler=llvm-gcc-4.2

How should I upgrade Xcode after upgrading to OS X Lion?

I've just found out, that my homebrew doesn't work anymore after I upgraded to OS X Lion.
$ brew install clojure
Warning: Xcode is not installed! Builds may fail!
Error: No such file or directory - /usr/bin/cc
and
$ brew doctor
We couldn't detect gcc 4.2.x. Some formulae require this compiler.
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
You have no /usr/bin/cc. This will cause numerous build issues. Please
reinstall Xcode.
Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
after some googling, I found out that I should upgrade Xcode to version 4.1. The problem is, I have version 3.2.5 installed and I can't find any way of uninstalling it.
When I look at App Store, it looks like I don't have Xcode installed at all. I'm afraid that if I install it via App Store, it will somehow conflict with the version I have currently installed. However I can't find it in Applications, and I can't find any update function either.
Software Update doesn't prompt me to update Xcode, and I also don't see it in Installed Software.
What should I do?
Thanks to the readme found at /Developer, I found a way to uninstall Xcode via
$ sudo /Developer/Library/uninstall-devtools --mode=all
edit: I just ran the installer for Xcode 4, and it detected old version of Xcode, offering me to move it to /Developer-old.
I fixed it by
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

Problem installing node on Mac OSX 10.6.7

I'm getting this error when I try and install node on my new mac
error: could not configure a cxx compiler!
The error always occurs when I get to the ./configure part of the installation
I found this problem which applies to a linux build with the same error, but the solution does not seem to apply in my case:
How to compile/install node.js(could not configure a cxx compiler!) (Ubuntu).
I also took a look at the troubleshoot guide on the node wiki here:
https://github.com/joyent/node/wiki/Troubleshooting-Installation
and tried this solution:
export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make
But I get the same problem when I get to the ./configure step
Any advice, insights or help would be much appreciated here.
Thanks
When you install Mac OS X Developer Tools (XCode, etc) ensure you have the Unix Tools option checked. I had to remember to install Developer Tools/Unix tools when I set up my new MBP and it resolved this error for me.
Optionally, you could remove and try installing with Homebrew. However, it still has the same requirements (XCode/Dev Tools) so ensure that you have those installed.
Hope this helps.
I had this problem too, I resolved this in a different way, as far as I know xcode 4.3.1 doesnt come with an Install Xcode.app file from the appstore, if you are under this case, just run xcode, go to preferences -> downloads and click on the Install button for the command line tools option. I did just that and all the errors on the .configure and make commands were gone :)
I had the same problem on OSX 10.7 with Xcode 4.2. I was trying to build node v0.4.7. I kept getting "unable to configure a c compiler" error. What finally worked for me is installing the GCC compiler seperately. I found a nice package for that here:
https://github.com/kennethreitz/osx-gcc-installer/
configure is currently broken for some versions of MacOS; for more details, see How to compile Node.js v0.4.2 on MacOS 10.5.8. The working approach cited there is as follows:
export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make
This worked for me .
Al
After installing XCode 4.3.2 (in Mac OS X Lion) I still had the error.
Open XCode, Preferences, Downloads and installed Command Line Tools.
After it gets installed ./configure runs ok.

Resources