Index: /trunk/SophyaLib/Mgr/GNUmakefile
===================================================================
--- /trunk/SophyaLib/Mgr/GNUmakefile	(revision 2744)
+++ /trunk/SophyaLib/Mgr/GNUmakefile	(revision 2744)
@@ -0,0 +1,195 @@
+# include files defining compiler/linker options 
+MODULECXXREPNAME := PI
+include Mgr/Makefile.h
+include Mgr/Makefile.slb
+
+LIBF =  $(LIB)libBaseTools.a $(LIB)libSysTools.a $(LIB)libSUtils.a $(LIB)libTArray.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libSkyMap.a $(LIB)libSamba.a $(LIB)libSkyT.a
+LIBS = -L$(LIB) -lBaseTools -lSysTools -lSUtils -lTArray -lNTools -lHiStats -lSkyMap -lSamba -lSkyT
+
+defaut: libs
+
+all: libs extlibs PI
+
+libs: cxxlibs
+
+extlibs: cxxextlibs
+
+cxxlibs:  BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT
+
+cxxextlibs:  FitsIOServer IFFTW LinAlg XAstroPack
+#--- Create directory and copy includes for install
+depend:
+ifdef SOPHYADEVREP
+ifdef SOPHYACXX
+	@echo "Sophya will be installed under:"
+	@echo "  $(SOPHYADEVREP)/Include" 
+	@echo "  $(SOPHYADEVREP)/`uname`-$(SOPHYACXX)" 
+	if [ -d Mgr ] ; then cd Mgr; \
+	./crerep_sophya $(SOPHYADEVREP) `uname`-$(SOPHYACXX); \
+	./makefileuser.csh; \
+	./mkmflien -copy ; \
+	fi
+else
+	@echo "Variable SOPHYACXX must be define with setenv"
+endif
+else
+	@echo "Variable SOPHYADEVREP must be define with setenv"
+endif
+#--------------------------------------------------------------------
+
+.PHONY:  BaseTools
+BaseTools:
+	if [ -d BaseTools ] ; then cd  BaseTools ; $(MAKE) ; fi
+
+.PHONY:  SysTools
+SysTools:
+	if [ -d SysTools ] ; then cd  SysTools ; $(MAKE) ; fi
+
+.PHONY:  SUtils
+SUtils:
+	if [ -d SUtils ] ; then cd  SUtils ; $(MAKE) ; fi
+
+.PHONY:  TArray
+TArray:
+	if [ -d TArray ] ; then cd  TArray ; $(MAKE) ; fi
+
+.PHONY:  NTools
+NTools:
+	if [ -d NTools ] ; then cd  NTools ; $(MAKE) ; fi
+
+.PHONY:  HiStats
+HiStats:
+	if [ -d HiStats ] ; then cd  HiStats ; $(MAKE) ; fi
+
+.PHONY:  SkyMap
+SkyMap:
+	if [ -d SkyMap ] ; then cd  SkyMap ; $(MAKE) ; fi
+
+.PHONY:  Samba
+Samba:
+	if [ -d Samba ] ; then cd  Samba ; $(MAKE) ; fi
+
+.PHONY:  SkyT
+SkyT:
+	if [ -d SkyT ] ; then cd  SkyT ; $(MAKE) ; fi
+
+.PHONY:  FitsIOServer
+FitsIOServer:
+	if [ -d FitsIOServer ] ; then cd  FitsIOServer ; $(MAKE) ; fi
+
+.PHONY:  IFFTW
+IFFTW:
+	if [ -d IFFTW ] ; then cd  IFFTW ; $(MAKE) ; fi
+
+.PHONY:  LinAlg
+LinAlg:
+	if [ -d LinAlg ] ; then cd  LinAlg ; $(MAKE) ; fi
+
+.PHONY:  XAstroPack
+XAstroPack:
+	if [ -d XAstroPack ] ; then cd  XAstroPack ; $(MAKE) ; fi
+
+.PHONY: PI
+PI:
+	if [ -d PI ] ; then cd PI ; $(MAKE) ; fi
+	if [ -d PIGcont ] ; then cd PIGcont ; $(MAKE) ; fi
+	if [ -d PIext ] ; then cd PIext ; $(MAKE) ; fi
+#  Shared library creation part of the Makefile
+
+#  List of libraries (.a)
+PSLB =  $(LIB)libBaseTools.a $(LIB)libSysTools.a $(LIB)libSUtils.a $(LIB)libTArray.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libSkyMap.a $(LIB)libSamba.a $(LIB)libSkyT.a
+EXTPSLB =  $(LIB)libFitsIOServer.a $(LIB)libIFFTW.a $(LIB)libLinAlg.a $(LIB)libXAstroPack.a
+PIPSLB =  $(LIB)libPI.a $(LIB)libPIGcont.a $(LIB)libPIext.a
+#  List of external library references
+EXTLIBL  = -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+EXTSLBL  = -L$(EXTSLBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+
+# defining the other external libraries needed on different systems
+
+# On Linux   lapack and blas and f2c/g2c are needed
+ifeq ($(MACHEROS),Linux)
+#EXTLIB = $(EXTLIBL) -llapack -lblas -lf2c
+#EXTSLB = $(EXTSLBL) -llapack -lblas -lf2c
+EXTLIB = $(EXTLIBL) -llapack -lblas -lg2c
+EXTSLB = $(EXTSLBL) -llapack -lblas -lg2c
+endif
+# On OSF1 libdxml contains part of Lapack, and the fortran support library is needed
+#  (we still need to add liblapack.a to supply missing lapack routines in dxml)
+#  (some OSF dxml versions are not OK, please use  -lblas instead of  -ldxml)
+ifeq ($(MACHEROS),OSF1)
+EXTLIB = $(EXTLIBL) -llapack -ldxml -lfor
+###EXTLIB = $(EXTLIBL) -llapack -lblas -lfor
+EXTSLB = $(EXTSLBL) -llapack -ldxml -lfor
+###EXTSLB = $(EXTSLBL) -llapack -lblas -lfor
+endif
+
+# On IRIX , complib.sgimath contains Lapack
+ifeq ($(MACHEROS),IRIX64)
+EXTLIB = $(EXTLIBL) -lcomplib.sgimath 
+EXTSLB = $(EXTSLBL) -lcomplib.sgimath 
+endif
+
+XPILIBS = $(LIBXPIPATH) $(LIBXPILIST)
+
+#  main dependence list
+slball : slb slbext slbpi 
+slb : $(SLB)libsophya.so
+slbext : $(SLB)libextsophya.so
+slbpi : $(SLB)libPI.so
+
+# List of .o files for each module
+OBJBaseTools = $(shell echo `cat ./BaseTools/BaseTools.o.list `)
+OBJSysTools = $(shell echo `cat ./SysTools/SysTools.o.list `)
+OBJSUtils = $(shell echo `cat ./SUtils/SUtils.o.list `)
+OBJTArray = $(shell echo `cat ./TArray/TArray.o.list `)
+OBJNTools = $(shell echo `cat ./NTools/NTools.o.list `)
+OBJHiStats = $(shell echo `cat ./HiStats/HiStats.o.list `)
+OBJSkyMap = $(shell echo `cat ./SkyMap/SkyMap.o.list `)
+OBJSamba = $(shell echo `cat ./Samba/Samba.o.list `)
+OBJSkyT = $(shell echo `cat ./SkyT/SkyT.o.list `)
+ALLOBJS = $(OBJBaseTools) $(OBJSysTools) $(OBJSUtils) $(OBJTArray) $(OBJNTools) $(OBJHiStats) $(OBJSkyMap) $(OBJSamba) $(OBJSkyT)
+
+# List of .o files modules with reference to external libraries
+OBJFitsIOServer = $(shell echo `cat ./FitsIOServer/FitsIOServer.o.list `)
+OBJIFFTW = $(shell echo `cat ./IFFTW/IFFTW.o.list `)
+OBJLinAlg = $(shell echo `cat ./LinAlg/LinAlg.o.list `)
+OBJXAstroPack = $(shell echo `cat ./XAstroPack/XAstroPack.o.list `)
+ALLEXTOBJS = $(OBJFitsIOServer) $(OBJIFFTW) $(OBJLinAlg) $(OBJXAstroPack)
+
+# List of .o files for PI modules 
+OBJPI = $(shell echo `cat ./PI/PI.o.list `)
+OBJPIGcont = $(shell echo `cat ./PIGcont/PIGcont.o.list `)
+OBJPIext = $(shell echo `cat ./PIext/PIext.o.list `)
+ALLPIOBJS = $(OBJPI) $(OBJPIGcont) $(OBJPIext)
+
+# Building Sophya shared library
+$(SLB)libsophya.so : $(PSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libsophya.so  \
+	$(FGSHLACXX) $(ALLOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) $(LIBLSHL)
+
+# Building ExtSophya shared library
+$(SLB)libextsophya.so : $(EXTPSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libextsophya.so  \
+	$(FGSHLACXX) $(ALLEXTOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) -lsophya $(EXTLIB) $(LIBLSHL)
+
+# Building PI shared library
+$(SLB)libPI.so : $(PIPSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libPI.so  \
+	$(FGSHLACXX) $(ALLPIOBJS) $(FGSHLNCXX) \
+	-L$(SLB) -lsophya -lextsophya $(EXTLIB) $(XPILIBS) $(LIBLSHL)
+
+
+clean:
+	if [ -d $(LIB) ] ; then cd $(LIB)/. ; rm -f *.a  ; fi
+	if [ -d $(SLB) ] ; then cd $(SLB)/. ; rm -f *.so ; fi
+	if [ -d $(OBJ) ] ; then cd $(OBJ)/. ; rm -f *.o  rm -rf cxxrep* ; fi
+#	if [ -d PI ]     ; then cd PI/.     ; $(MAKE) clean ; fi
+
Index: /trunk/SophyaLib/Mgr/MakefileUser.h
===================================================================
--- /trunk/SophyaLib/Mgr/MakefileUser.h	(revision 2744)
+++ /trunk/SophyaLib/Mgr/MakefileUser.h	(revision 2744)
@@ -0,0 +1,596 @@
+#  -*- makefile -*-
+# #########################  Sophya ############################# 
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+# ############################################################### 
+# General setup GNU Makefile for Sopyha/Planck. To be included in all makefiles.  
+# Define  makefile variables according to CPU 
+# MACHEROSD = `uname | sed 's/-//'`   i.e. { AIX HPUX OSF1 Linux ... }
+# and compilers {g++, cxx, KCC, xlC, aCC, ...}
+# 
+# Makefile variables set are:
+# - Path to Exec, Include, Libs, Obj directories (from SOPHYADEVREP env. var.)
+#     i.e. variables LIB, OBJ, EXE, INC 
+#---------------------------------------------------------------------------
+
+# define MACHEROS from uname
+MACHEROS := $(shell echo `uname`)
+# define the -D option
+MACHEROSD := $(shell echo `uname | sed 's/-//'`)
+# Le sous-repertoire des objets specifique machine-compilo
+#   OSF1 : Alpha avec gcc
+#   OSF1-cxx : Alpha avec cxx
+
+#### C++
+ifdef SOPHYACXX
+  CXX := $(SOPHYACXX)
+endif
+
+ifeq ($(CXX),gcc)
+  override CXX := g++
+endif
+
+ifeq ($(SOPHYACXX),egcs++)
+  # en fait de compilo de egcs++ s'appelle g++ !
+  # comme il faut bien differentier ln -s /usr/bin/g++ /usr/bin/egcs++
+  override CXX := egcs++
+endif
+
+ifeq ($(CC),xlC)
+  override CXX := xlC
+endif
+
+#### C
+ifeq ($(CXX), xlC)
+  override CC := xlC
+endif
+
+ifeq ($(CXX), g++)
+  CC := gcc
+endif
+
+ifeq ($(SOPHYACXX), egcs++)
+  CC := egcs
+endif
+
+#### Fortran (tout ce qui est lie au Fortran est defini ici #############
+FC = f77
+ifeq (${MACHEROS},Linux)
+#  override FC := f77
+  override FC := g77
+endif
+
+ifeq (${MACHEROS},OSF1)
+  LIBFORT = -lfor -lFutil -lots -lUfor
+endif
+ifeq (${MACHEROS},Linux)
+  #LIBFORT = -lf2c
+  LIBFORT = -lg2c
+endif
+#########################################################################
+
+
+MACHDIR := $(MACHEROS)-$(CXX)
+
+
+#-
+#-   Define Makefile paths
+#-  (NE PAS TOUCHER CES LIGNES: generation automatique de MakefileUser.h)
+#-  
+PP  := ${SOPHYABASEREP}/${MACHDIR}/
+PPH := ${HOME}/${MACHDIR}/
+LIB := ${PP}/Libs/
+SLB := ${PP}/ShLibs/
+OBJ := ${PPH}/Objs/
+EXE := ${PPH}/Exec/
+INC := ${SOPHYABASEREP}/Include/
+GLB := /usr/local/lib/
+#--
+
+#  Si Makefile.h utilise pour la construction d'autres librairies
+ifdef MYBUILDDEVREP
+  MYPP := ${MYBUILDDEVREP}/${MACHDIR}/
+  MYLIB := ${MYPP}/Libs/
+  MYSLB := ${MYPP}/ShLibs/
+  OBJ := ${MYPP}/Objs/
+  EXE := ${MYPP}/Exec/  
+endif
+
+#-   Flag for optimisation/ debug
+# Pour forcer sans debug, DBGFLAG = -g0
+ifndef OPTFLAG
+  OPTFLAG  := -O
+  ifeq (${MACHEROS},OSF1)
+    ifeq ($(CXX), cxx)
+      override OPTFLAG := -O -pthread
+    endif
+  endif
+endif
+
+ifndef DBGFLAG
+  DBGFLAG  := -g
+#  Probleme sur DEC/OSF1 -g avec g++/egcs pose probleme a l'assembleur
+#                    Reza 09/99 - On met -gcoff
+  ifeq (${MACHEROS},OSF1)
+    ifeq ($(CXX), g++)
+      override DBGFLAG := -gcoff
+    endif
+  endif
+endif
+
+# DBGFLAG a -g0 veut dire pas de debug. Tout le monde a ca par defaut...
+ifeq ($(DBGFLAG), -g0)
+  override DBGFLAG :=
+endif
+
+# xlC ne connait pas -O0, par defaut il n'optimise pas.
+ifeq ($(OPTFLAG), -O0)
+  ifeq ($(CC), xlC)
+    override OPTFLAG :=
+  endif
+endif
+
+AR       := ar
+ARFLAGS  := -rcs
+ARARGS   := ?
+
+# le gnu ar ne fonctionne pas bien sur OSF...
+ifeq (${MACHEROS},OSF1)
+AR       := /usr/bin/ar
+endif
+# et sur AIX il nous sort des tas de warnings inutiles
+ifeq ($(MACHEROS),AIX)
+AR := /usr/bin/ar
+endif
+
+ifeq ($(MACHEROS),Darwin)
+AR := libtool
+ARFLAGS := -static -o
+ARARGS := ^
+SOPHYACXX := c++
+CXX := c++
+CC := cc
+# Pour enlever les erreurs au link des slb en -O. Pas d'avenir!
+# Reza:Mai 2005 : On tente les flags -fast -mcpu=7450 ET -fPIC 
+# OPTFLAG := -g -fast -mcpu=7450 -fPIC
+# Apple dit qu'il faut mettre -fastf pour le c++ : Ca marche avec GCC 3.3 !
+# OPTFLAG := -g 
+OPTFLAG := -g -fastf -mtune=G4 -fPIC
+endif
+
+#   Avec certains compilateurs C++ (KCC, aCC) , il faut fabriquer les librairies et 
+# les shared libs avec la meme commande 
+override ARCXX := $(AR) 
+override ARCXXFLAGS := $(ARFLAGS) 
+#RZ0999 ifeq ($(CXX),KCC)
+#RZ0999 override  ARCXX  := KCC
+#RZ0999 override ARCXXFLAGS  := -o
+#RZ0999 endif
+ifeq ($(CXX),aCC)
+override ARCXX  := aCC 
+override ARCXXFLAGS  := -o
+endif
+
+# Les chemins speciaux pour includes systemes et bibliotheques
+ifeq (${MACHEROS},HP-UX)
+  XLDLIBS := -L.
+  XCFLAGS := 
+  XCPPFLAGS :=  
+endif
+
+
+#  Pour compiler PI, sous Linux, les includes et libs se trouve souvent ds /usr/X11/include /usr/X11/lib/
+ifeq (${MACHEROS},Linux)
+  XLDLIBS := -L/usr/X11/lib -L/usr/X11R6/lib
+  XCPPFLAGS := -I/usr/X11/include -I/usr/X11R6/include
+  LDLIBS := -ldl
+endif
+
+ifeq (${MACHEROS},Darwin)
+  XLDLIBS := -L/usr/X11R6/lib 
+  XCPPFLAGS := -I/usr/X11R6/include -I/sw/include
+#  XCPPFLAGS := -I/usr/X11R6/include 
+#  XCFLAGS := -fkeep-inline-functions -fno-common -fcoalesce
+  XCFLAGS := -fno-common
+endif
+
+# Chemin pour les include et fichiers d'autres librairies
+EXTINCPI := 
+EXTLIBPL := 
+EXTSLBPL := 
+EXTINCPATH := 
+EXTLIBPATH := 
+EXTSLBPATH := 
+
+ifdef EXTLIBDIR
+ EXTINCPI := -I$(EXTLIBDIR)/Include/
+ EXTLIBPL := -L$(EXTLIBDIR)/$(MACHDIR)/Libs/
+ EXTSLBPL := -L$(EXTLIBDIR)/$(MACHDIR)/ShLibs/
+ EXTINCPATH := $(EXTLIBDIR)/Include/
+ EXTLIBPATH := $(EXTLIBDIR)/$(MACHDIR)/Libs/
+ EXTSLBPATH := $(EXTLIBDIR)/$(MACHDIR)/ShLibs/
+endif
+
+#  S'il y a des flags particulier pour un module de compilation
+#ifndef MODULECPPFLAGS
+  override MODULECPPFLAGS :=
+#endif
+
+CPPFLAGS     :=  -I${INC} $(EXTINCPI) $(XCPPFLAGS) -D${MACHEROSD} $(MODULECPPFLAGS)
+
+#  Si la variable d'environnement SOPHYA_DEBUG est definie : Activation des 
+#  compilations conditionnelles pour le debug/bound-checking/... ds le code
+ifdef SOPHYA_DEBUG 
+  CPPFLAGS   := $(CPPFLAGS) -DSOPHYA_DEBUG
+endif
+
+# Les options selon les divers compilateurs
+# GNU
+ifeq ($(CC), gcc)
+  CFLAGS       := -Wall -Wpointer-arith \
+                  -Wmissing-prototypes -I$(INC) $(XCFLAGS) \
+                  $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+  LDLIBS       := $(LDLIBS) $(XLDLIBS)
+endif
+ifeq ($(CC), egcs)
+  CFLAGS       := -Wall -Wpointer-arith \
+                  -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
+                  $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+  LDLIBS       := $(LDLIBS) $(XLDLIBS)
+endif
+
+ifeq ($(CXX), g++)
+  CXXFLAGS       := -Wall -Wpointer-arith \
+                    -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
+                    $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
+  LDLIBS      := $(LDLIBS) $(XLDLIBS)
+#  ifdef NOSHLIB 
+#    LDFLAGS := -static
+#  endif
+endif
+ifeq ($(CXX), egcs++)
+  CXXFLAGS       := -Wall -Wpointer-arith \
+                    -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
+                    $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
+  LDLIBS      := $(LDLIBS) $(XLDLIBS)
+  ifdef NOSHLIB 
+    LDFLAGS := -static
+  endif
+endif
+
+# Compilateur natif (GNU-gcc) sous MacOSX (Darwin)
+ifeq (${MACHEROS},Darwin)
+  CFLAGS       := -Wall -Wpointer-arith \
+                  -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
+                  $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+  CXXFLAGS       := -Wall -Wpointer-arith \
+                    -Wmissing-prototypes -Wsynth -I$(INC) $(XCFLAGS) \
+                    $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
+  LDLIBS       := -Xlinker -bind_at_load $(LDLIBS) $(XLDLIBS)
+endif
+
+# Compilateur C natif HP-UX
+ifeq (${MACHEROS},HP-UX)
+ifeq ($(CC),cc)                                    
+  CFLAGS       :=  +Z -Aa -Ae $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
+  FFLAGS       :=  -Aa -I${INC}   -D${MACHEROSD}  
+  CPPFLAGS     :=  -I${INC}  -I$(INC)/tnt -D${MACHEROSD} \
+               -D_HPUX_SOURCE $(MODULECPPFLAGS)
+  LDLIBS      := $(XLDLIBS)
+  override NOSHLIB := Y
+
+endif
+ifeq ($(CXX),aCC)
+  CXXFLAGS := $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) +Z -D__aCC__
+#  -DCOMPILER_EXCEPTIONS -D__ANSI_TEMPLATES__  definis ds defs.h
+endif
+endif
+
+# AIX, xlC comme compilateur C et C++
+ifeq ($(CXX), xlC)
+  CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) $(XCFLAGS)
+  CPPFLAGS := -I$(INC)/Syst -I${INC}  -I$(INC)/tnt -D${MACHEROSD} $(MODULECPPFLAGS)
+  CXXFLAGS     := $(CFLAGS) -D__xlC 
+# -DCOMPILER_EXCEPTIONS defini ds defs.h
+  LDLIBS      := $(XLDLIBS)
+
+# Pour faire des bibliotheques partagees, il faut faire un truc du
+# style 
+#ld -o shrsub.o subs1.o subs2.o -bE:shrsub.exp -bM:SRE -lc
+
+# Pour le moment on ne se fatigue pas, tant pis
+  override NOSHLIB := Y
+
+# Et puis 1540-293: (W) est un FAUX warning, on supprime les warnings
+  CXXFLAGS := -qflag=e $(CXXFLAGS)
+endif
+
+
+ifeq ($(CXX), cxx)
+  ifeq ($(DBGFLAG), -g)
+    ifdef OPTFLAG
+      override DBGFLAG := -g1
+    endif
+#    ifdef XOPT
+#      override DBGFLAG := -g1
+#    endif
+  endif
+
+# chemin pour repository CXX
+ REP := $(OBJ)/cxxrep/
+ REPPI := $(OBJ)/cxxrep_PI/
+ REPCXX := -ptr $(OBJ)/cxxrep/
+ ifdef MODULECXXREPNAME
+   REPCXX := -ptr $(OBJ)/cxxrep_$(MODULECXXREPNAME)/  -ptr $(OBJ)/cxxrep/
+   REPM := $(OBJ)/cxxrep_$(MODULECXXREPNAME)/
+ endif
+
+  LDLIBS      := $(XLDLIBS) -lrt
+
+  CXXFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)   \
+              $(REPCXX) -no_implicit_include 
+# $(REPCXX) -no_implicit_include -D__USE_STD_IOSTREAM  passe pas avec cxx 6.0 Reza 23/12/99
+  CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+#  CXXFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)  \
+#	      -nopt -define_templates
+  ifeq ($(XOPT), 1)
+    override DBGFLAG :=
+    CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \
+	        $(REPCXX) -fp_reorder \
+	        -O5 -inline speed -tune host
+  endif
+  ifeq ($(XOPT), 2)
+    override DBGFLAG :=
+    CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \
+	      $(REPCXX) -fp_reorder \
+	      -O5 -inline speed -tune host \
+	      -assume trusted_short_alignment
+  endif
+  ifeq ($(XOPT), 3)
+    override DBGFLAG :=
+    CXXFLAGS := $(DBGFLAG) $(MYCFLAGS)  \
+	      $(REPCXX) -fp_reorder \
+	      -O5 -inline speed -tune host \
+	      -assume trusted_short_alignment \
+	      -non_shared -om
+    override NOSHLIB := Y
+  endif
+
+# le fichier X11/Xlib.h contient des declarations de fonctions sans type
+# Cela genere un grand nombre de warning avec cxx V6
+# La variable MODULEDECCXXFLAGS permet de specifier des options de compilation 
+# pour un module donne  
+  ifdef MODULEDECCXXFLAGS
+    CXXFLAGS := $(CXXFLAGS) $(MODULEDECCXXFLAGS)
+  endif
+endif
+ifeq ($(CC),cc)
+  ifeq ($(MACHEROS),OSF1)
+  ifeq ($(XOPT), 1)
+    CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \
+	      -O4 -inline speed -tune host
+  endif
+  ifeq ($(XOPT), 2)
+    CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \
+	      -O4 -inline speed -tune host \
+	      -assume trusted_short_alignment -fast
+  endif
+  ifeq ($(XOPT), 3)
+    CFLAGS :=  $(DBGFLAG) $(MYCFLAGS) -fp_reorder \
+	      -O4 -inline speed -tune host \
+	      -assume trusted_short_alignment -fast \
+	      -non_shared -om
+  endif
+  endif
+endif
+
+# --- Compilateur KAI  (OK pour v 3.3)
+ifeq ($(CXX), KCC)
+  CXXFLAGS     :=  --exceptions --rtti  --auto_instantiation --one_instantiation_per_object -D__KCC__
+  CXXFLAGS  := $(CXXFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+  CFLAGS := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+# Flag --one_instantiation_per_object mis - Reza 02/03/99
+endif
+
+# --- Systeme IRIX64 de Silixon Graphics (SGI) 
+ifeq ($(MACHEROS), IRIX64)
+# --- Compilateur natif CC de SGI 
+  ifeq ($(CXX), CC)
+    CFLAGS  := $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
+    CXXFLAGS := -prelink -D__SGICC__ -LANG:std $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+    LINK.cc := CC $(CPPFLAGS) -D__SGICC__ -LANG:std $(DBGFLAG) $(OPTFLAG)
+#  sur SGI, les libs/executables ont deux formats 32 et 64 bits (trois avec o32)
+#  -n32 Generates a (new) 32-bit object default to -mips3 if -mips4 has not been specified
+#  -64 Generates a 64-bit object - defaults to -mips4 if -mips3 has not been specified
+#  La variable d'environnement SOPHYA_SGI64 controle cette option
+    ifdef SOPHYA_SGI64
+      CFLAGS  := -64 -DSGI_ARCH64 $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS) 
+      CXXFLAGS := -64 -prelink -DSGI_ARCH64 -D__SGICC__ -LANG:std $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+      LINK.cc := CC -64 $(CPPFLAGS) -D__SGICC__ -LANG:std $(DBGFLAG) $(OPTFLAG)
+    endif
+  endif
+  ifeq ($(CXX), g++)
+    ifdef SOPHYA_SGI64
+      CFLAGS  := $(CFLAGS) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64
+      CXXFLAGS := $(CXXFLAGS) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64
+      LINK.cc := $(LINK.cc) -DSGI_ARCH64 -mips4 -mlong64 -mfp64 -mgp64 -mabi=64
+    endif
+  endif
+endif
+
+# Autres compilateurs natifs.
+
+#  CFLAGS       :=  -I$(INC) $(XCFLAGS) $(OPTFLAG) $(DBGFLAG) $(MYCFLAGS)
+#  CXXFLAGS     := $(CFLAGS)
+#  LDLIBS      := $(XLDLIBS)
+
+#- redefine implicit rule. Les .o sont dans $(OBJ).
+$(OBJ)%.o:%.c
+	$(COMPILE.c) -o $@ $<
+
+$(OBJ)%.o:%.cc
+	$(COMPILE.cc) -o $@ $<
+
+$(OBJ)%.o:%.f
+	$(COMPILE.f) -o $@ $< 
+
+#OSF1
+#LDFC est f77
+#LDFCFLAGS est rien
+
+#parfois
+#LDFC est cc
+#LDFCFLAGS est -ltruc
+
+#------------------------------------------------- End of Makefile.h ------- 
+# fin gene auto MakefileUser.h
+
+
+##############################################################################
+##############################################################################
+#################### include des librairies pour le link #####################
+##############################################################################
+##############################################################################
+
+###############################################################################
+# Link :                                                                      #
+# - without Shared Libraries > make NOSHLIB=y                                 #
+# - without Extern Libraries > make NOEXTLIB=y                                #
+# - without Fortan Libraries > make NOLFORT=y                                 #
+# - with PI Libraries        > make USELIBPI=y                                #
+# - with Personal Libraries  > make MYLIBS='-L/home/mylibs -lmylib1 -lmylib2' #
+###############################################################################
+
+LIBF =
+LIBS =
+ELIBF =
+ELIBS =
+SLIBF =
+MLIBS =
+
+#------------------------------------------------------#
+#------------------ Archive Libraries -----------------#
+#------------------------------------------------------#
+ifdef NOSHLIB
+
+#--------- lib sophya ---------
+LIBF := $(LIBF) $(LIB)libBaseTools.a $(LIB)libSysTools.a $(LIB)libSUtils.a $(LIB)libNTools.a $(LIB)libTArray.a $(LIB)libHiStats.a 
+LIBF := $(LIBF) $(LIB)libSamba.a $(LIB)libSkyMap.a $(LIB)libSkyT.a
+LIBS := $(LIBS) -L$(LIB) -lBaseTools -lSysTools -lSUtils -lNTools -lTArray -lHiStats -lSamba -lSkyMap -lSkyT
+
+#--------- lib sophya interface externes ---------
+ifndef NOEXTLIB
+LIBF := $(LIBF) $(LIB)libFitsIOServer.a $(LIB)libIFFTW.a $(LIB)libLinAlg.a $(LIB)libXAstroPack.a
+LIBS := $(LIBS) -lFitsIOServer -lIFFTW -lLinAlg -lXAstroPack
+#LIBF := $(LIBF)libBlitz.a
+#LIBS := $(LIBS) -lBlitz
+endif
+
+#--------- lib piapp ---------
+ifdef USELIBPI
+LIBF := $(LIBF) $(LIB)libPI.a $(LIB)libPIext.a
+LIBS := $(LIBS) -lPI -lPIext
+endif
+
+#--------- Other Extern Libraries ---------
+ifndef NOEXTLIB
+ELIBF := $(ELIBF) $(EXTLIBPATH)libcfitsio.a $(EXTLIBPATH)libfftw.a $(EXTLIBPATH)librfftw.a $(EXTLIBPATH)libxastro.a
+ELIBS := $(ELIBS) -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+ifeq ($(MACHEROS),OSF1)
+###ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a 
+ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a
+###ELIBS := $(ELIBS) -llapack -lblas
+ELIBS := $(ELIBS) -llapack -ldxml
+endif
+ifeq ($(MACHEROS),Linux)
+ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a 
+ELIBS := $(ELIBS) -llapack -lblas
+endif
+ifeq ($(MACHEROS),IRIX64)
+ELIBS := $(ELIBS) -lcomplib.sgimath 
+endif
+endif
+
+#--------- lib system ---------
+# librairie des instances de templates cxx Sophya
+ifeq ($(CXX),cxx)
+SLIBS := $(SLIBS) -lertcxx
+endif
+SLIBS := $(SLIBS) -lm
+# Librairies pour le fortran
+ifndef NOLFORT
+ifeq ($(MACHEROS),OSF1)
+SLIBS := $(SLIBS) -lfor
+endif
+ifeq ($(MACHEROS),Linux)
+#SLIBS := $(SLIBS) -lf2c
+SLIBS := $(SLIBS) -lg2c
+endif
+endif
+
+#-----------------------------------------------------#
+#------------------ Shared Libraries -----------------#
+#-----------------------------------------------------#
+else
+
+#--------- lib sophya ---------
+LIBF := $(LIBF) $(SLB)libsophya.so 
+LIBS := $(LIBS) -L$(SLB) -lsophya
+
+#--------- lib sophya interface externes ---------
+ifndef NOEXTLIB
+LIBF := $(LIBF) $(SLB)libextsophya.so 
+LIBS := $(LIBS) -lextsophya
+endif
+
+#--------- lib piapp ---------
+ifdef USELIBPI
+LIBF := $(LIBF) $(SLB)libPI.so 
+LIBS := $(LIBS) -lPI
+endif
+
+#--------- Other Extern Libraries ---------
+# ATTENTION actuellement les blabla.a sont appelees,
+# on pourrait appeller les blabla.so (EXTSLBPATH) si on les avait crees
+ifndef NOEXTLIB
+ELIBF := $(ELIBF) $(EXTLIBPATH)libcfitsio.a $(EXTLIBPATH)libfftw.a $(EXTLIBPATH)librfftw.a $(EXTLIBPATH)libxastro.a
+ELIBS := $(ELIBS) -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw  -lxastro
+ifeq ($(MACHEROS),OSF1)
+###ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a
+ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a
+###ELIBS := $(ELIBS) -llapack -lblas
+ELIBS := $(ELIBS) -llapack -ldxml
+endif
+ifeq ($(MACHEROS),Linux)
+ELIBF := $(ELIBF) $(EXTLIBPATH)liblapack.a $(EXTLIBPATH)libblas.a
+ELIBS := $(ELIBS) -llapack -lblas
+endif
+ifeq ($(MACHEROS),IRIX64)
+ELIBS := $(ELIBS) -lcomplib.sgimath 
+endif
+endif
+
+#--------- lib systeme ---------
+SLIBS := $(SLIBS) -lm
+# Librairies pour le fortran
+ifndef NOLFORT
+ifeq ($(MACHEROS),OSF1)
+SLIBS := $(SLIBS) -lfor
+endif
+ifeq ($(MACHEROS),Linux)
+#SLIBS := $(SLIBS) -lf2c
+SLIBS := $(SLIBS) -lg2c
+endif
+endif
+
+endif
+
+#--------- PERSONAL Libraries ---------
+ifdef MYLIBS
+  MLIBS := $(MLIBS) $(MYLIBS)
+endif
+
+#--------- LIBF et LIBS ---------
+LIBF := $(LIBF) $(ELIBF)
+LIBS := $(LIBS) $(ELIBS) $(MLIBS) $(SLIBS)
+
+##############################################################################
Index: /trunk/SophyaLib/Mgr/install_from_tar.csh
===================================================================
--- /trunk/SophyaLib/Mgr/install_from_tar.csh	(revision 2744)
+++ /trunk/SophyaLib/Mgr/install_from_tar.csh	(revision 2744)
@@ -0,0 +1,86 @@
+#!/bin/csh
+set version = V1.1
+
+if($#argv <= 0)  then
+  echo "Give the directory where Sophya should be installed"
+  echo "usage: install_from_tar.csh directory_name"
+  exit(-1)
+endif
+set dir = $1
+if( ! -e $dir ) then
+  echo Directory $dir does not exist
+  exit(-1)
+endif
+touch $dir/toto
+if( $status != 0 ) then
+  echo Writing impossible in $dir
+  exit(-1)
+endif
+rm -rf $dir/toto $dir/env.csh $dir/$version
+
+################################
+#### Creation du fichier env.csh
+################################
+cat >! $dir/env.csh <<EOF
+#!/bin/csh
+#  Definition d'environnement SOPHYA sous Linux
+#                           R. Ansari   03/2001
+#
+set sversion = pro
+set ostype = Linux
+setenv SOPHYACXX g++
+if (\$#argv > 0)  then
+  if (\$1 == '-h') then
+    echo 'Usage: source env.csh [pro/new/old]' 
+    echo '  Defines the environment for using SOPHYA '
+    echo '  First optional argument defines the library version (pro/new/... Default=pro)'
+    exit -1
+  endif
+  set sversion = \$1
+endif
+
+echo ' env.csh : setting environment variables for SOPHYA '
+
+setenv SOPHYABASEREP $dir/$version
+setenv EXTLIBDIR  $dir/ExtLibs
+
+if( \$?LD_LIBRARY_PATH ) then 
+  setenv LD_LIBRARY_PATH .:\${LD_LIBRARY_PATH}:\${SOPHYABASEREP}/\${ostype}-\${SOPHYACXX}/ShLibs
+else 
+  setenv LD_LIBRARY_PATH .:\${SOPHYABASEREP}/\${ostype}-\${SOPHYACXX}/ShLibs
+endif
+
+set path = (\$path \$SOPHYABASEREP/\${ostype}-\${SOPHYACXX}/Exec)
+
+echo 'SOPHYACXX=    ' \$SOPHYACXX
+echo 'SOPHYABASEREP= ' \$SOPHYABASEREP
+echo 'EXTLIBDIR=  ' \$EXTLIBDIR
+echo 'LD_LIBRARY_PATH= ' \$LD_LIBRARY_PATH 
+echo 'PATH= ' \$path
+
+exit 0
+
+EOF
+chmod +x $dir/env.csh
+
+#############################
+#### extract des fichiers tar
+#############################
+foreach f ( sophya_src.tar.gz sophya_linux.tar.gz sophya_extlibs_linux.tar.gz)
+  if( -e $f ) then
+    cp $f $dir/.
+    pushd $dir > /dev/null
+    tar -xzvf $f
+    rm -f $f
+    popd > /dev/null
+  endif
+end
+
+#############################
+#### Creation du lien sur pro
+#############################
+pushd $dir > /dev/null
+ln -s -f ./$version ./pro
+popd > /dev/null
+
+exit 0
