From 68bdc4fb317f4f214cce17d5b2184ac98b13f294 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 10 Feb 2015 13:43:05 +0100 Subject: [PATCH] Fixed compilation option for CosmoTool. Show a message to indicate which variant is used to build the python modules --- CMakeLists.txt | 8 +++++--- python/cosmotool/borg.py | 42 ++++++++++++++++++++++------------------ src/CMakeLists.txt | 3 ++- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2abed15..1693040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,11 +22,13 @@ option(INTERNAL_HDF5 "Build internal version of HDF5" OFF) option(INTERNAL_NETCDF "Build internal version of NETCDF" OFF) option(INTERNAL_BOOST "Build internal version of BOOST" OFF) -IF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) +IF(NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) SET(CosmoTool_local CosmoTool_static) -ELSE(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) +ELSE(NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) SET(CosmoTool_local CosmoTool) -ENDIF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) +ENDIF(NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) + +MESSAGE(STATUS "Using the target ${CosmoTool_local} to build python module") include(${CMAKE_SOURCE_DIR}/external/external_build.cmake) diff --git a/python/cosmotool/borg.py b/python/cosmotool/borg.py index 736a3d0..2deac20 100644 --- a/python/cosmotool/borg.py +++ b/python/cosmotool/borg.py @@ -154,6 +154,8 @@ def get_grid_values(xx,data, ranges): def get_mean_density(fdir, smin, step): """ estimate ensemble mean """ + import progressbar as pb + print('-'*60) print('Get 3D ensemble mean density field') print('-'*60) @@ -174,23 +176,23 @@ def get_mean_density(fdir, smin, step): fname1 = fdir + 'final_density_'+str(idat)+'.dat' #and (idat