Commit 05ea1ca4 authored by jclamber's avatar jclamber

update installation process

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@111 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent 5b5420df
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012
# 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 nemo library
# ============================================================================
cmake_minimum_required(VERSION 2.6)
# project name
project (nemo)
# set CMAKE Module PATH (NEMO)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_BINARY_DIR})
MESSAGE( STATUS "CMAKE_MODULE_PATH=" ${CMAKE_MODULE_PATH} )
# detect MacOS
SET(OSX FALSE)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(OSX TRUE)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
# Lib : libnemo.so
# Find all the sources for the utils LIB
FILE(GLOB LIBUTILS ../src/*.c )
# create the library "libnemo.so"
add_library (nemo SHARED ${LIBUTILS})
# Lib : libnemomaing77.so
# Find all the sources for old fortran compiler
FILE(GLOB LIBUTILS ../src/fortran_old_gcc/*.c )
# create the library "libnemomaing77.so"
add_library (nemomaing77 SHARED ${LIBUTILS})
if(OSX)
set_target_properties(MNESSutils PROPERTIES LINK_FLAGS "-undefined suppress -flat_namespace")
endif(OSX)
# Destination path for the lib
SET(LIBRARY_OUTPUT_PATH ../lib)
# compilation options
add_definitions(-Wall -O2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE)
# SET NEMOPATH
SET(NEMOLIB ${PROJECT_SOURCE_DIR}/../lib)
SET(NEMOINC ${PROJECT_SOURCE_DIR}/../src/inc)
# Make sure the compiler can find include files from our Hello library.
include_directories (../src/inc )
# ----------------------------------------------------------
# install target
set (CMAKE_INSTALL_PREFIX $ENV{NEMO})
IF (OSX) # Mac OSX
SET(SOEXT "dylib")
ELSE (OSX) # Linux
SET(SOEXT "so")
ENDIF(OSX)
#
# install bin targets
#
/* =================================================================
| Copyright Jean-Charles LAMBERT - 2008
| e-mail: Jean-Charles.Lambert@oamp.fr
| address: Dynamique des galaxies
| Laboratoire d'Astrophysique de Marseille
| 2, place Le Verrier
| 13248 Marseille Cedex 4, France
| CNRS U.M.R 7326
| ==================================================================
|* Functions prototypes
+---------------------------------------------------------------- */
#ifndef IO_NEMO_H
#define IO_NEMO_H
typedef struct {
char
* pos, ** pos_p, /* position */
* vel, ** vel_p, /* velocity */
* phase, ** phase_p, /* phase */
* pot, ** pot_p, /* potential */
* acc, ** acc_p, /* acceleration */
* mass, ** mass_p, /* mass */
* aux , ** aux_p, /* aux */
* dens, ** dens_p, /* density */
* keys, ** keys_p, /* keys */
* eps, ** eps_p, /* softening */
* timu, ** time_p, /* time steps */
* selt, ** selt_p, /* selected time */
*SelectionString123; /* selected particles */
int
* nbody, ** nbody_p, /* nbody */
* bits, ** bits_p; /* control bits */
} t_ion_data;
#ifdef __cplusplus
extern "C" {
#endif
void reajust_ptr();
int io_nemo(char * , char * , ...);
int close_io_nemo(char * );
#ifdef __cplusplus
}
#endif
#endif /* IO_NEMO_H */
/* ----------------------------------------------------------------
| End of io_nemo.h
+---------------------------------------------------------------- */
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012
# Copyright Jean-Charles LAMBERT - 2009-2012
# 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
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# 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
# CMakeListst.txt file for nemo 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(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# load setup flags
include(SetupFlags)
SET(OSX FALSE)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(OSX TRUE)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# 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} )
MESSAGE( STATUS "CMAKE_BUILD_TYPE =" ${CMAKE_BUILD_TYPE} )
MESSAGE( STATUS "CMAKE_CXX_FLAGS =" ${CMAKE_CXX_FLAGS} )
MESSAGE( STATUS "LIBRARY TYPE =" ${LIBTYPE} )
MESSAGE( STATUS "core OPT =" ${OPT} )
FIND_PACKAGE(NEMO)
FIND_PACKAGE(SQLITE3)
......@@ -30,8 +51,8 @@ set (NEMO_INSTALLED FALSE) # fore NEMO not installed
IF (NOT NEMO_INSTALLED)
MESSAGE(STATUS "NEMO LIGHT will be build")
add_subdirectory(${PROJECT_SOURCE_DIR}/../3rdparty/nemolight/build ${PROJECT_BINARY_DIR}/../3rdparty/nemolight/build )
set(NEMOLIGHT ${PROJECT_SOURCE_DIR}/../3rdparty/nemolight)
add_subdirectory(${PROJECT_SOURCE_DIR}/3rdparty/nemolight/build ${PROJECT_BINARY_DIR}/../3rdparty/nemolight/build )
set(NEMOLIGHT ${PROJECT_SOURCE_DIR}/3rdparty/nemolight)
set(NEMOLIB ${NEMOLIGHT}/lib)
set(NEMOINC ${NEMOLIGHT}/src/inc)
......@@ -42,24 +63,18 @@ ENDIF (NOT NEMO_INSTALLED)
MESSAGE( STATUS "NEMOLIB : " ${NEMOLIB} )
MESSAGE( STATUS "NEMOINC : " ${NEMOINC} )
# 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)
FILE(GLOB LIBSOURCES src/*.cc)
# Destination path for the lib
SET(LIBRARY_OUTPUT_PATH ../lib)
SET(LIBRARY_OUTPUT_PATH lib)
# compilation options
add_definitions(-Wall -g -Wswitch -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -ggdb -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE ${DNOSQLITE3})
add_definitions(-Wall ${OPT} -Wswitch -Wcast-align -Wreturn-type -Wno-unused-function -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE ${DNOSQLITE3})
# create library "uns"
add_library (unsio SHARED ${LIBSOURCES} )
add_library (unsio ${LIBTYPE} ${LIBSOURCES} )
if(OSX)
set_target_properties(unsio PROPERTIES LINK_FLAGS "-L${NEMOLIB} -lnemo -lsqlite3")
......@@ -74,17 +89,17 @@ ENABLE_LANGUAGE(Fortran)
SET(CMAKE_Fortran_COMPILER gfortran)
# Executbale output path
set(EXECUTABLE_OUTPUT_PATH ../bin)
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 ${NEMOINC} ${NEMOLIB} ${SQLITE3_H_PATH})
include_directories (${UNSIO_SOURCE_DIR}/src ${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)
FILE(GLOB exe_sources test_src/*.F)
# ----------------------------------------------------------
......@@ -92,7 +107,7 @@ FILE(GLOB exe_sources ../test_src/*.F)
#include_directories (${UNS_SOURCE_DIR}/src $ENV{NEMOINC} ${NEMOLIB})
# Find all LIB's sources files
FILE(GLOB execpp_sources ../test_src/*.cc)
FILE(GLOB execpp_sources test_src/*.cc)
# build cpp executables according to the source
FOREACH(exe_cpp ${execpp_sources})
......@@ -140,12 +155,13 @@ ENDIF ()#NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
MESSAGE( STATUS "--------> CMAKE_INSTALL_PREFIX =" ${CMAKE_INSTALL_PREFIX})
# 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)
# unsio lib
FILE(GLOB unsio_files ${UNSIO_BINARY_DIR}/lib/libunsio.*)
FOREACH(file_lib ${unsio_files})
MESSAGE( STATUS " files: " ${file_lib})
INSTALL(FILES ${file_lib} DESTINATION lib)
ENDFOREACH()
# UNS specific includes
INSTALL(FILES ${UNSIO_BINARY_DIR}/../src/uns.h DESTINATION inc/uns)
......@@ -177,6 +193,7 @@ IF (NOT NEMO_INSTALLED)
ENDIF()
# man
INSTALL(FILES ${UNSIO_BINARY_DIR}/../man/man3/unsiof.3 DESTINATION man/man3)
# some binaries
#set (CMAKE_INSTALL_PREFIX $ENV{NEMOBIN})
#INSTALL(PROGRAMS ${UNSIO_BINARY_DIR}/../bin/unscpp DESTINATION bin)
CONFIGURATION
=============
To configure UNSIO, type
mkdir build
cd build
cmake ..
in the directory that contains this INSTALL file. You can add several options
to this command. The most important ones are
-DCMAKE_INSTALL_PREFIX=<dir> installation directory [${HOME}/local/unsio]
-DCMAKE_BUILD_TYPE=<Debug|Release> build type [Debug]
-DBUILD_SHARED_LIBS=<TRUE|FALSE> shared or static libraries [TRUE]
-DCMAKE_C_COMPILER=<program> C compiler [gcc]
-DCMAKE_CXX_COMPILER=<program> C++ compiler [g++]
Note that CMake maintains a cache name "CMakeCache.txt". If you change options
(or your environment changes), it is best to remove that file to avoid
problems.
BUILDING
========
To build the UNSIO libraries, type
make (or nmake in a Windows command prompt)
If you want, you can install the UNSIO header and libraries. To do so, type
make install
A list of all available make targets can be obtained by
make help
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# 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 nemo library
# ============================================================================
SET(NEMO_INSTALLED FALSE)
FILE(GLOB GLOB_TEMP_VAR $ENV{NEMO})
......
# --------------------------------------------------------
# CMake module to detect SQLITE3 library
# --------------------------------------------------------
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# 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
# ============================================================================
# CMake module to detect SQLITE3 library
# ============================================================================
SET(SQLITE3_FOUND FALSE)
SET(DNOSQLITE3 "-DNOSQLITE3") # if sqlite3 does not exist
......
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2009-2012
# e-mail: Jean-Charles.Lambert@oamp.fr
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# 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
# ============================================================================
if ( NOT SETUP_FLAGS_INCLUDED )
set( SETUP_FLAGS_INCLUDED 1 )
macro( typed_cache_set type doc var )
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE )
endmacro()
typed_cache_set ( STRING "setup flags" SETUP_FLAGS_INCLUDED 1 )
# Set a default build type if none is given
if ( NOT CMAKE_BUILD_TYPE ) # Debug default
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Debug )
else () # else Release
typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Release )
endif()
# set optimizer flag
if ( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
typed_cache_set (STRING "Optimizer" OPT "-g -ggdb")
else ()
typed_cache_set (STRING "Optimizer" OPT "-O3")
endif ()
# SHARED lib ?
if ( NOT BUILD_SHARED_LIBS ) # Debug TRUE
typed_cache_set ( BOOL "Build SHARED" BUILD_SHARED_LIBS FALSE )
else () # else FALSE
typed_cache_set ( BOOL "Build SHARED" BUILD_SHARED_LIBS TRUE)
endif()
# set library type , SHARED or STATIC
if ( BUILD_SHARED_LIBS )
typed_cache_set ( STRING "LIB TYPE" LIBTYPE SHARED )
else ()
typed_cache_set ( STRING "LIB TYPE" LIBTYPE STATIC )
endif()
endif( NOT SETUP_FLAGS_INCLUDED )
# ============================================================================
......@@ -4,7 +4,7 @@ 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 unsio/3rdparty/nemolight/build/CMakeLists.txt unsio/3rdparty/nemolight/src/*.{c,h} unsio/3rdparty/nemolight/src/inc/*.{c,h} unsio/3rdparty/nemolight/src/inc/snapshot/*.{c,h} unsio/3rdparty/nemolight/src/fortran_old_gcc/*.{c,h} 2> /dev/null`
cd ..;tar czhvf unsio/unsio.tar.gz `ls unsio/src/*.{f,F,cc,h} unsio/test_src/*.{f,F,cc,h} unsio/CMakeLists.txt unsio/cmake/*.cmake unsio/doc/*.{odp,pdf,txt} unsio/HOWTO_INSTALL unsio/mmakefile unsio/man/man3/* unsio/3rdparty/nemolight/build/CMakeLists.txt unsio/3rdparty/nemolight/src/*.{c,h} unsio/3rdparty/nemolight/src/inc/*.{c,h} unsio/3rdparty/nemolight/src/inc/snapshot/*.{c,h} unsio/3rdparty/nemolight/src/fortran_old_gcc/*.{c,h} 2> /dev/null`
#
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment