| Summary: | Creating dylib on MacOsX | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | garnier |
| Component: | config | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | CLOSED LATER | ||
| Severity: | normal | CC: | barrand |
| Priority: | P4 | ||
| Version: | other | ||
| Hardware: | Other | ||
| OS: | Other | ||
|
Description
garnier
2006-04-04 06:00:20 CEST
Functionality of dynamic libraries on the latest versions of MacOSX is currently broken. We are investigating how to overcome the restrictions imposed by the system for static and external symbols, although it is not clear at the moment if all are solvable in a clean way. The problem is fixed by modifying the compiler options for generating the
libraries and linking.
The fix is included in the internal tag "config-V08-00-00" and will be
part of a next release or patch.
You can try it out by cut&paste the text below (after ------) and replace the
contents in the file:
geant4/config/sys/Darwin-g++.gmk
in your setup.
------
#
# ------ MacOS-X ------
# MacOS 10.3 gcc-3.3
# MacOS 10.4 gcc-4.0
#
# Original author: Helmut Burkhardt - CERN
# Revisions: Guy Barrand - LAL
# Gabriele Cosmo - CERN
#
ifeq ($(G4SYSTEM),Darwin-g++)
CXX := g++
CXXFLAGS := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
ifdef G4OPTIMISE
CXXFLAGS += -O
FCFLAGS := -O
CCFLAGS := -O
else
ifdef G4DEBUG
CXXFLAGS += -g
FCFLAGS := -g
CCFLAGS := -g
endif
endif
ifdef G4PROFILE
CXXFLAGS += -pg
FCFLAGS += -pg
CCFLAGS += -pg
endif
FC := g77
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
LDFLAGS += -bind_at_load
FCLIBS := -lg2c -lnsl
ECHO := /bin/echo -n
SHEXT := dylib
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
XMFLAGS := -I/sw/include
# XMFLAGS := -I/usr/X11R6/include ##### some installations.
XMLIBS := -L/sw/lib -lXm -lXpm
# XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations.
DLDLIBS := -ldl
ifndef OGLHOME
OGLHOME := /usr/X11R6
endif
ifndef OGLFLAGS
OGLFLAGS := -I$(OGLHOME)/include
endif
ifndef OGLLIBS
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
endif
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
g++ -dynamiclib -single_module -undefined dynamic_lookup \
-o $$libdir/$(@F) $(INTYLIBS) *.o
endef
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
g++ -dynamiclib -single_module -undefined dynamic_lookup \
-o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
endef
endif
|