Commit 9af1ffe1 authored by jcl's avatar jcl

new SVN structure

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@55 ce2cc22f-6084-46ce-a062-084b172ee5dc
parents
To compile UNSIO library, you need to install CMAKE utility
(Cf http://www.cmake.org/)
*) compilation
proceed as following :
cd build
cmake .
make
*) installation
make install
it will install the project into $HOME/local directory, unless the
environnement variable LOCAL was defined in another place before
running "cmake ." command.
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2011
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Laboratoire d'Astrophysique de Marseille
# Pole de l'Etoile, site de Chateau-Gombert
# 38, rue Frederic Joliot-Curie
# 13388 Marseille cedex 13 France
# CNRS U.M.R 6110
# ============================================================================
# CMakeListst.txt file for UNS library
# ============================================================================
cmake_minimum_required(VERSION 2.6)
#INCLUDE(CPack)
# project name
project (UNSIO)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
# extra path for NEMO
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_BINARY_DIR})
SET(OSX FALSE)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(OSX TRUE)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
FIND_PACKAGE(NEMO)
FIND_PACKAGE(SQLITE3)
IF (NOT NEMO_INSTALLED)
MESSAGE(FATAL_ERROR "NEMO environment not loaded !!!")
ELSE (NOT NEMO_INSTALLED)
set(NEMOLIB $ENV{NEMOLIB})
set(NEMOINC $ENV{NEMOINC})
ENDIF (NOT NEMO_INSTALLED)
MESSAGE( STATUS "NEMOLIB : " ${NEMOLIB} )
# contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
# contains the full path to the root of your project source directory,
# i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
# Find all the sources for the LIB
FILE(GLOB LIBSOURCES ../src/*.cc)
# Destination path for the lib
SET(LIBRARY_OUTPUT_PATH ../lib)
# compilation options
add_definitions(-Wall -g -Wswitch -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -ggdb ${DNOSQLITE3})
# create library "uns"
add_library (unsio SHARED ${LIBSOURCES} )
if(OSX)
set_target_properties(unsio PROPERTIES LINK_FLAGS "-L${NEMOLIB} -lnemo -lsqlite3")
endif(OSX)
#
# ------------------
# TEST PROGRAM
# ------------------
# Enable Fortran support
ENABLE_LANGUAGE(Fortran)
#SET(CMAKE_Fortran_COMPILER ${FORT_COMP})
SET(CMAKE_Fortran_COMPILER gfortran)
# Executbale output path
set(EXECUTABLE_OUTPUT_PATH ../bin)
MESSAGE( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} )
# Make sure the compiler can find include files from our Hello library.
include_directories (${UNSIO_SOURCE_DIR}/../src $ENV{NEMOINC} ${NEMOLIB} ${SQLITE3_H_PATH})
# Make sure the linker can find the Hello library once it is built.
link_directories (${UNSIO_BINARY_DIR}/lib /usr/X11/lib ${SQLITE3_LIB_PATH} ${NEMOLIB} ${FC_GFORT_PATH} ${FC_G77_PATH})
# Find all LIB's sources files
FILE(GLOB exe_sources ../test_src/*.F)
# ----------------------------------------------------------
# Make sure the compiler can find include files from our Hello library.
#include_directories (${UNS_SOURCE_DIR}/src $ENV{NEMOINC} ${NEMOLIB})
# Find all LIB's sources files
FILE(GLOB execpp_sources ../test_src/*.cc)
# build cpp executables according to the source
FOREACH(exe_cpp ${execpp_sources})
get_filename_component(exe ${exe_cpp} NAME_WE)
MESSAGE( STATUS "New executable ==> " ${exe})
add_executable (${exe} ${exe_cpp})
# Link the executable to the Hello library.
target_link_libraries (${exe} unsio nemo ${SQLITE3_LIB} X11 pgplot ${FC_GFORT_LIB} ${FC_G77_LIB} stdc++)
ENDFOREACH(exe_cpp ${execpp_sources})
# build Fortran executables according to the source
# compilation options
FOREACH(exe_f ${exe_sources})
get_filename_component(exe ${exe_f} NAME_WE)
MESSAGE( STATUS "New executable ==> " ${exe})
add_executable (${exe} ${exe_f})
# Link the executable to the Hello library.
#target_link_libraries (${exe} unsio nemomaing77 nemo g2c sqlite3 stdc++)
target_link_libraries (${exe} unsio nemomaing77 nemo ${SQLITE3_LIB} ${FC_LIB} stdc++)
SET_TARGET_PROPERTIES(${exe} PROPERTIES LINKER_LANGUAGE Fortran)
# add "-lstdc++"
#SET(CMAKE_Fortran_LINK_FLAGS "-L${NEMOLIB} ") #-lstdc++")
ENDFOREACH(exe_f ${exe_sources})
# ----------------------------------------------------------
# install target
IF (NEMO_INSTALLED)
set (CMAKE_INSTALL_PREFIX $ENV{NEMO})
# lib
IF (OSX) # Mac OSX
INSTALL(FILES ${UNSIO_BINARY_DIR}/../lib/libunsio.dylib DESTINATION lib)
ELSE (OSX) # Linux
INSTALL(FILES ${UNSIO_BINARY_DIR}/../lib/libunsio.so DESTINATION lib)
ENDIF(OSX)
# includes
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/uns.h DESTINATION inc/uns)
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/unsdebug.h DESTINATION inc/uns)
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/snapshotinterface.h DESTINATION inc/uns)
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/componentrange.h DESTINATION inc/uns)
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/ctools.h DESTINATION inc/uns)
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/userselection.h DESTINATION inc/uns)
ENDIF (NEMO_INSTALLED)
# man
INSTALL(FILES ${UNSIO_BINARY_DIR}/../man/man3/unsiof.3 DESTINATION man/man3)
#set (CMAKE_INSTALL_PREFIX $ENV{NEMOBIN})
#INSTALL(PROGRAMS ${UNSIO_BINARY_DIR}/../bin/unscpp DESTINATION bin)
SET(NEMO_INSTALLED FALSE)
FILE(GLOB GLOB_TEMP_VAR $ENV{NEMO})
IF(GLOB_TEMP_VAR)
SET(NEMO_INSTALLED TRUE)
# Detect fortran compiler from ${NEMOLIB}/makedefs
# files (variable FC = )
FILE(READ $ENV{NEMOLIB}/makedefs MAKEDEFS)
STRING(REGEX MATCH "FC = gfortran" GFORTRAN_IS_SET ${MAKEDEFS})
IF ("FC = gfortran" STREQUAL "${GFORTRAN_IS_SET}")
MESSAGE("GFortran compiler Detected......")
SET (FORT_COMP gfortran)
ELSE("FC = gfortran" STREQUAL "${GFORTRAN_IS_SET}")
# g77 stuffs
MESSAGE("Assuming G77 compiler")
SET (FORT_COMP g77)
ENDIF ("FC = gfortran" STREQUAL "${GFORTRAN_IS_SET}")
# gfortran stuffs
SET (FC_GFORT_LIB "")
SET (FC_GFORT_PATH "")
set (GFORTPATH "")
execute_process(COMMAND gfortran -print-file-name=libgfortran.a
OUTPUT_VARIABLE GFORTPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
IF (NOT ${GFORTPATH} STREQUAL "")
MESSAGE("GFORTRAN compiler exist, adding libgfortran......")
execute_process(COMMAND dirname ${GFORTPATH}
OUTPUT_VARIABLE FC_GFORT_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
SET (FC_GFORT_LIB gfortran)
ENDIF(NOT ${GFORTPATH} STREQUAL "")
# g77 stuffs
SET (FC_G77_LIB "")
SET (FC_G77_PATH "")
set (G2CFPATH "")
execute_process(COMMAND g77 -print-file-name=libg2c.a
OUTPUT_VARIABLE G2CFPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
IF (NOT ${G2CFPATH} STREQUAL "")
MESSAGE("G77 compiler exist, adding libg2c......")
execute_process(COMMAND dirname ${G2CFPATH}
OUTPUT_VARIABLE FC_G77_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
SET (FC_G77_LIB g2c)
ENDIF(NOT ${G2CFPATH} STREQUAL "")
ENDIF(GLOB_TEMP_VAR)
if (NOT NEMO_INSTALLED)
MESSAGE(STATUS "NEMO environement not loaded.... using nemo_light")
endif (NOT NEMO_INSTALLED)
# --------------------------------------------------------
# CMake module to detect SQLITE3 library
# --------------------------------------------------------
SET(SQLITE3_FOUND FALSE)
SET(DNOSQLITE3 "-DNOSQLITE3") # if sqlite3 does not exist
SET(SQLITE3_LIB_PATH "")
SET(SQLITE3_H_PATH "")
SET(SQLITE3_LIB "")
find_file(SQLITE3_H NAMES "sqlite3.h" PATH /usr/local/include)
IF (SQLITE3_H)
get_filename_component(SQLITE3_H_PATH ${SQLITE3_H} PATH)
MESSAGE(STATUS "Found sqlite3.h:" ${SQLITE3_H})
MESSAGE(STATUS "Found sqlite3.h path:" ${SQLITE3_H_PATH})
find_library(SQLITE3 NAMES sqlite3 PATH /usr/local/lib)
IF (SQLITE3)
SET(SQLITE3_FOUND TRUE)
SET(DNOSQLITE3 "") # SQLITE3 exist
SET(SQLITE3_LIB sqlite3)
MESSAGE(STATUS "Found library here :" ${SQLITE3})
get_filename_component(SQLITE3_LIB_PATH ${SQLITE3} PATH)
MESSAGE(STATUS "Found library PATH :" ${SQLITE3_LIB_PATH})
ENDIF(SQLITE3)
ENDIF(SQLITE3_H)
.TH UNS "05 Dec 2011"
.SH NAME
\fBUNSIOF -- Unified Nbody Snapshot\fP Library (fortran version).
.SH DESCRIPTION
\fIUNSIOF\fP is a high level C++ library which allows
Input operations in a generic way on Nbody snapshot files,
from a FORTRAN program. Currently, NEMO, Gadget 1 and 2 little and
bigendian, and list of separated snapshots in a text file are supported.
The use of this set of functions is very simple and doesn't require any
knowledge of the internal file structure of the snapshot.
The library can manage multiple reading of different snapshots in the
same program. Every snapshots is identified by a unique identifier
provided by the library.
.PP
The process to read data is done in 3 steps:
1) Initialisation of the library
2) Data loading
3) Data extracting
.SH INITIALISATION
.TP 3
\fBinteger uns_init(filename, selected_component, selected_time)\fP
It returns an integer as a unique identifier. A returned value less
than 0 means that the simulation does not exist or a file format
unknown.
\fIfilename\fP: (character * (*))
Is the input simulation filename. It can be an absolute
filename path or just a simulation name (eg "gas001"). In the later
case, all the parameters of the simulation, if it exists, will be
automatically collected from the simulation database filename stored
in the usual place (/pil/programs/DB/simulation.dbl).
\fIselected_component\fP: (character * (*))
select components or range of particles that you want to load. The
following data can be
requested:\fBdisk,gas,halo,bulge,stars,bndry,all\fP. A range
with the value \fB"0:299999"\fP select the particles between 0 and
299999. For NEMO simulation, range and components of the selected
simulation will be taken from the file \fI/pil/programs/DB/simulation.dbl\fP.
You can request several data separated with a "," like this:
"disk,gas". The order of your selection will be respected when you
will get the data.
\fIselected_time\fP: (character * (*))
select a range of time from where you want to select the
particles. You can request several range of times separated with a
",".
Example: "700:750,800:900" will only proceed on particles in the time
range [700:750] and [800:900].
\fBinteger uns_sim_type(ident)\fP
This function return an integer matching to the type of the snaphot identified by
the integer \fBident\fP.
It returns \fB"0"\fP for \fBnemo\fP snapshot, \fB"1"\fP for \fBgadget\fP snapshot.
.SH DATA LOADING
.TP 3
\fBinteger uns_load(ident)\fP
This function load the next time step of the snaphot identified by
the integer \fBident\fP.
It returns \fB"1"\fP if the snapshot has been successfully loaded or \fB"0"\fP at
the end of the snapshot.
.TP 3
\fBinteger uns_load_opt(ident,selected_values)\fP
This is an optimized version of the uns_load() function.
This function load the next time step of the snaphot identified by
the integer \fBident\fP.
It returns \fB"1"\fP if the snapshot has been successfully loaded or \fB"0"\fP at
the end of the snapshot.
\fIselected_values\fP: (character * (*))
The extra variable \fBselected_values\fP allows to restrict the loading of
selected values only. It can speedup the file
loading and reduce the memory footprint. Each value is specified by a
character. Here is all the possibilities :
'm' mass
'x' position
'v' velolcity
'p' potential
'a' acceleration
'e' softening
'k' keys array (from nemo)
'X' aux array (from nemo)
'R' density
'I' particles's Id
'U' Internal energy
'M' metallicity
'A' stars's age
'H' hsml
'T' temperature
example: \fB"mxR"\fP will load mass, position and density only.
.SH DATA EXTRACTING (uns_get_value/ uns_get_array)
In the following text, we assume that character variable \fIcomponent\fP can take the following values:
"all","gas","disk","halo","stars","bulge","bndry"
Each functions return 1 if success or 0 if it fails.
There is a set of \fBuns_get_value\fP functions to get data value (float or integer) from the
snapshot. Each functions take as first parameter an integer \fBident\fP, returned by the function \fIuns_init(...)\fP.
\fBfunction integer uns_get_value_i(ident,tag,data)\fP Put in the integer variable \fBdata\fP, the requested \fItag\fP value. Tag is a string variable.
tag="nsel" => set data with number of particles selected
\fBfunction integer uns_get_value_f(ident,tag,data)\fP Put in the real*4 variable \fBdata\fP, the requested \fItag\fP value. Tag is a string variable.
tag="time" => set data with snapshot time
.nf
tag="redshift" => set data with snapshot redshift
\fBfunction integer uns_get_array_i(ident,component,tag,data,n)\fP
Put in the integer array variable \fBdata(n)\fP, the requested combination of \fItag\fP value and \fIcomponent\fP. Tag and component are string variables.
tag="id" => set data array with component ids
tag="nbody" => set n value with component nbody
\fBfunction integer uns_get_array_f(ident,component,tag,data,n)\fP
Put in the real*4 array variable \fBdata(n)\fP, the requested combination of \fItag\fP value and \fIcomponent\fP. Tag and component are string variables.
tag="pos" => set data array with component position
.nf
tag="vel" => set data array with component velocity
.nf
tag="mass" => set data array with component mass
.nf
tag="acc" => set data array with component acceleration
.nf
tag="pot" => set data array with component potential
.nf
tag="rho " => set data array with component density
.nf
tag="u" => set data array with component internal energy
.nf
tag="hsml" => set data array with component hydro smooth length
.nf
tag="age" => set data array with component age
.nf
tag="metal" => set data array with component metalicity
.nf
tag="temp" => set data array with component temperature
.SH DATA EXTRACTING (uns_get_XXXX)
There is a set of \fBuns_get_XXXX\fP functions to get data from the
snapshot. Each functions take as the first parameter an integer
\fBident\fP returned by the function \fIuns_init(...)\fP.
\fBsubroutine uns_get_nbody(ident,nbody)\fP
Put in the integer variable \fBnbody\fP the #bodies resquested
according to the \fIselected_component\fP variable (Cf uns_init(...) function).
\fBsubroutine uns_get_time(ident,time)\fP
Put in the floating variable \fBtime\fP the current time of the simulation.
\fBsubroutine uns_get_pos(ident,pos,size_array)\fP
Put in the two dimensional floating array \fBpos(3,size_array)\fP,
all the positions requested.
\fBsubroutine uns_get_vel(ident,vel,size_array)\fP
Put in the two dimensional floating array \fBvel(3,size_array)\fP,
all the velocities requested.
\fBsubroutine uns_get_mass(ident,mass,size_array)\fP
Put in the one dimensional floating array \fBmass(size_array)\fP,
all the masses requested.
\fBfunction integer uns_get_age(ident,age,size_array)\fP
Put in the one dimensional floating array \fBage(size_array)\fP,
all the particles with an age (stars). It returns the number of stars particles or 0.
\fBfunction integer uns_get_metal(ident,metal,size_array)\fP
Put in the one dimensional floating array \fBmetal(size_array)\fP,
all the particles with metalicity (gas+stars) in the respective order
gas then stars. It returns the number of gas+stars particles or 0.
\fBfunction integer uns_get_metal_gas(ident,metal,size_array)\fP
Put in the one dimensional floating array \fBmetal(size_array)\fP,
metalicity of the gas particles. It returns the number of gas particles or 0.
\fBfunction integer uns_get_metal_stars(ident,metal,size_array)\fP
Put in the one dimensional floating array \fBmetal(size_array)\fP,
metalicity of the stars particles. It returns the number of stars particles or 0.
\fBfunction integer uns_get_u(ident,u,size_array)\fP
Put in the one dimensional floating array \fBu(size_array)\fP,
internal energy of the gas particles. It returns the number of gas particles or 0.
\fBfunction integer uns_get_temp(ident,temp,size_array)\fP
Put in the one dimensional floating array \fBtemp(size_array)\fP,
temperature of the gas particles. It returns the number of gas particles or 0.
\fBfunction integer uns_get_rho(ident,rho,size_array)\fP
Put in the one dimensional floating array \fBrho(size_array)\fP,
density of the gas particles. It returns the number of gas particles or 0.
\fBinteger uns_get_range(ident,component,nbody,first,last)\fP
This function give the particles's range for a selected
component. You give in a string variable
\fBcomponent\fP, the name of the component, and the function return
an integer variable \fBnbody\fP (#bodies), \fBfirst\fP and \fBlast\fP,
the first and the last index of the component in the array. First and
last values are given in fortran array convention (starts from index 1).
It returns \fB"1"\fP if the component exist, and \fB"0"\fP otherwise.
Example to get halo's particles range:
status = uns_get_range(ident,"halo",n,first,last)
\fBinteger uns_get_eps(ident,component,eps)\fP
This function give the softening for a selected component. You give
in a string variable \fBcomponent\fP, the name of the component, and
the function return a float variable \fBeps\fP.
It returns \fB"1"\fP if the softening exist for the component, and
\fB"0"\fP otherwise.
This function will only work if the simulation requested belong to
the database file \fI/pil/programs/DB/simulation.dbl\fP.
Example to get halo's softening:
status = uns_get_eps(ident,"halo",eps)
\fBinteger uns_get_cod(ident,component,time,tcod[7])\fP
This function give the COD for a selected component (or a set of
components separeted with ","), at the selected time. You give
in a string variable \fBcomponent\fP, the name of the component, and
the function return a float array \fBtcod[7]\fP filled with respectively
the time, x,y,z,vx,vy,vz of the COD.
It returns \fB"1"\fP if the cod exist for the requested component
and time. It returns \fB"0"\fP if the cod does not exits for the
requested time. It returns \fB"-1"\fP if the COD file does not exist.
This function will only work if the simulation requested belong to
the database file \fI/pil/programs/DB/simulation.dbl\fP.
Example to get "disk,stars"'s cod at time=0.1:
status = uns_get_cod(ident,"disk,stars",0.1,tcod)
.SH EXAMPLE
.nf
! -----------------------------------------------------------
program testlib
implicit none
integer iargc, lnblnk, narg, uns_init, uns_load, valid, ident,
$ nbody
character arg1 * 80, arg2 * 80, arg3 * 80
narg = command_argument_count()
if (narg.ne.3) then
write(0,*) "You must give 3 parameters:"
write(0,*) "filename selected_component selected_time"
stop
endif
call get_command_argument(1,arg1) ! get filename
call get_command_argument(2,arg2) ! get selected component
call get_command_argument(3,arg3) ! get selected time
! initialyze UNS engine
ident=uns_init(arg1, arg2, arg3) ! return identifier for the snaphot
! ident must be positive
if (ident.gt.0) then
valid = 1
do while (valid .gt. 0) ! loop on all the time step
valid = uns_load(ident) ! load data belonging to ident snapshot
if (valid .gt. 0) then ! it goes fine
call uns_get_nbody(ident, nbody) ! get #bodies
call start(ident,nbody)
endif
enddo
endif
end
! -----------------------------------------------------------
subroutine start(ident,nbody)
implicit none
! input parameters
integer ident,nbody
! UNS variable
integer status
integer uns_get_range
real *4 time, pos(3,nbody), vel(3,nbody), mass(3,nbody)
! various
integer io_nemo_f
character * 90 out
integer n,first,last
call uns_get_time(ident,time ) ! read time
call uns_get_pos (ident,pos ,nbody) ! read pos
call uns_get_vel (ident,vel ,nbody) ! read vel
call uns_get_mass(ident,mass,nbody) ! read mass
status = uns_get_range(ident,"gas",n,first,last) ! gas's range
out = "nemo.out"
write(0,*) "nbody=",nbody," time=",time
status = io_nemo_f(out,80,nbody,"float,save,3n,n,t,x,v,m",
$ nbody,time,pos,vel,mass)
end
! -----------------------------------------------------------
.PP
.SH COMPILATION
A fortran program which use the UNS library must link against NEMO
library (-lnemo) and C++ library (-lstdc++). Here is an example of
Makefile using gfortran compiler.
.nf
# ----------------------------------------
# MAKEFILE to use UNS
# ----------------------------------------
# find libg2c.a library
LIB_G77 := $(shell g77 -print-libgcc-file-name 2> /dev/null)
LIB_G77 := $(shell dirname $(LIB_G77) 2> /dev/null)
# path for NEMO Library, UNS library and G2C
UNS_LIB_PATH := $(LOCAL)/lib
LIBS := -L$(NEMOLIB) -L$(UNS_LIB_PATH) -L$(LIB_G77)
# - - - - - - - - - - - - - - - - - - - -
# compilation with gfortran compiler
# - - - - - - - - - - - - - - - - - - - -
GFORTFLAGS = -Wall -O2 -ggdb -Wl,-rpath,$(UNS_LIB_PATH)
testlibF : testlib.F
gfortran $(GFORTFLAGS) -o $@ testlib.F $(LIBS) \\
-lnemomaing77 -lunsio -lnemo -lg2c -lstdc++ -lm
# ----------------------------------------
.fi
.SH SEE ALSO
.nf
nemo(1NEMO), snapshot(5NEMO), gadget2nemo, uns_tonemo, uns_density, uns_2dplot
.fi
.SH AUTHOR
Jean-Charles LAMBERT
.SH BUGS and COMMENT
Please, report all bugs and comment to :
.nf
Jean-Charles.Lambert@oamp.fr
.fi
.SH "UPDATE HISTORY"
.nf
.ta +1.0i +4.0i
11-Dec-08 created JCL
09-Jun-11 a lot of improvement JCL
.fi
#
nemocvs:
rsync -CRav --exclude-from=exclude.txt build/CMakeLists.txt build/FindNEMO.cmake . ${NEMO}/usr/jcl/unsio
tar :
cd ..;tar czhvf unsio/unsio.tar.gz `ls unsio/src/*.{f,F,cc,h} unsio/test_src/*.{f,F,cc,h} unsio/build/CMakeLists.txt unsio/build/*.cmake unsio/doc/*.{odp,pdf,txt} unsio/HOWTO_INSTALL unsio/mmakefile 2> /dev/null`
#
[Dolphin]
Timestamp=2009,9,18,9,28,5
ViewMode=1
# -*-makefile-*-
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2008
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Laboratoire d'Astrophysique de Marseille
# Pole de l'Etoile, site de Chateau-Gombert
# 38, rue Frederic Joliot-Curie
# 13388 Marseille cedex 13 France
# CNRS U.M.R 6110
# ============================================================================
#include $(NEMOLIB)/makedefs
SHELL = /bin/csh -f
# Compilation otions
CPP = g++
CPPFLAGS = -I$(NEMOINC) -I$(NEMOLIB) -Wall -g
LNEMO = -L$(NEMOLIB) -lnemo++ -lnemo
OS = linux
ifeq (${OS},linux)
LDL=-ldl
else
LDL=
endif
# Files OBJ
FOBJ = obj
# Files BIN
# FILES SOURCES
FSRC = ./
# targets
lib : dirs $(FOBJ)/libuns.a testlib
bin : dirs info gad
info : dirs $(FBIN)/g2info
gad : dirs $(FBIN)/gadget2nemo
nem : dirs $(FBIN)/nemo2gadget
#install: info gad
# \cp -p $(FBIN)/gadget2nemo $(FBIN)/g2info ${NEMOBIN}
# chmod 755 ${NEMOBIN}/gadget2nemo ${NEMOBIN}/g2info
#nemo_bin: install
clean:
@/bin/rm $(OBJLIB) $(LIB) >& /dev/null
#--
# LIBs
#
LIB := $(FOBJ)/libuns.a
#--
IO := $(FOBJ)/gadgetio.o
COMP := $(FOBJ)/componentrange.o
USER := $(FOBJ)/userselection.o
UNS := $(FOBJ)/unsengine.o
UNSI := $(FOBJ)/unsidentifier.o
UNSW := $(FOBJ)/unsfwrapper.o
INTER := $(FOBJ)/snapshotinterface.o
SNAPGAD := $(FOBJ)/snapshotgadget.o
OBJLIB := $(IO) $(COMP) $(USER) $(UNS) $(UNSI) $(UNSW) $(SNAPGAD)