"No rule to make target Darwin-UNSUPPORTED.gmk" on Mac OS X 10.9
Closed this issue · 2 comments
I ran the setup script for the first time today on Mac OS X 10.9:
bash megalib_setup.sh --release=rel --debug=strong
ROOT and Geant compiled fine, but while compiling MEGAlib I had the following error:
Making dependency for file src/MCActivator.cc ...
Making dependency for file src/MC2DStripSD.cc ...
Making dependency for file src/MC2DStripHit.cc ...
make[2]: *** No rule to make target `/Users/markbandstra/Software/MEGAlib/external/geant4_v9.5.p02/share/Geant4-9.5.2/geant4make/config/sys/Darwin-UNSUPPORTED.gmk'. Stop.
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [cos] Error 2
make: *** [cos] Error 2
ERROR: Something went wrong while compiling MEGAlib!
Since the other relevant gmk files are Darwin-clang.gmk
and Darwin-g++.gmk
, it would appear that the configure script is not identifying my compiler. I am using gcc installed using Homebrew, although the latest clang and g++ are also available on my system from the updated Xcode command-line tools.
Here's my Makefile.config:
#----------------------------------------------------------------
#
# Makefile for MEGAlib
#
# Architecture: MacOSX 10.2 or higher
#
# Author: Andreas Zoglauer, Robert Andritschke
#
#----------------------------------------------------------------
CMODE = "MacOSX, software mode, gcc"
ARCH = macosx
DLL = dylib
# Basic flags generated by ROOT
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLIBS = $(shell root-config --libs)
ROOTGLIBS = $(shell root-config --glibs)
# Compiler & linker options:
CXX = c++
CXXFLAGS = $(OPT) -pipe -Wall -fPIC -D_REENTRANT -I$(IN) -I$(CT) -I. $(ROOTCFLAGS) -D___MACOSX___
#-fno-common -fno-exceptions
DEFINES = -UHARDWARE
LD = c++
LDFLAGS = $(OPT) -Xlinker -bind_at_load -flat_namespace -D___MACOSX___
SOFLAGS = -dynamiclib -flat_namespace -undefined suppress
LIBS = $(ROOTLIBS) -lpthread -lThread -lMinuit -lX3d -lGeom -lSpectrum
GLIBS = $(ROOTGLIBS)
LINK = ln -s -f
Hi Mark,
It's a Geant4 problem: Geant4 is not yet completely compatible with Maverick. I hope they release 9.6.3 soon...
Cannot do anything about it at the moment.
Ciao,
Andreas
You are absolutely right, Andreas. It turns out to be a known Geant4 problem that clang is not properly detected, but as of 10.9 Mavericks clang is the default c++ compiler. Here's a mention of the problem (quite old -- July 2012!):
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1491.html
A successful workaround for me was to copy Darwin-clang.gmk
to Darwin-UNSUPPORTED.gmk
and in line 7 to change
ifeq ($(G4SYSTEM),Darwin-clang)
to
ifeq ($(G4SYSTEM),Darwin-UNSUPPORTED)
Then everything works!