Fixed compilation option for CosmoTool. Show a message to indicate which variant is used to build the python modules
This commit is contained in:
parent
beb651c79a
commit
68bdc4fb31
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
@ -208,6 +210,8 @@ def get_mean_density(fdir, smin, step):
|
||||
def get_mean_density_fdir(fdir,init,steps):
|
||||
""" estimate ensemble mean
|
||||
"""
|
||||
import progressbar as pb
|
||||
|
||||
print('-'*60)
|
||||
print('Get 3D ensemble mean density field')
|
||||
print('-'*60)
|
||||
@ -227,7 +231,7 @@ def get_mean_density_fdir(fdir,init,steps):
|
||||
norm0=0.
|
||||
norm1=0.
|
||||
|
||||
for fn in fname0:
|
||||
for fn in pb.ProgressBar(len(fname0))(fname0):
|
||||
auxborg=read_borg_vol(fn)
|
||||
auxdata0 = auxborg.density
|
||||
MEAN0+=auxdata0
|
||||
@ -236,7 +240,7 @@ def get_mean_density_fdir(fdir,init,steps):
|
||||
del auxdata0
|
||||
del auxborg
|
||||
|
||||
for fn in fname1:
|
||||
for fn in pb.ProgressBar(len(fname1))(fname1):
|
||||
auxborg1=read_borg_vol(fn)
|
||||
auxdata1 = auxborg1.density
|
||||
MEAN1+=auxdata1
|
||||
|
@ -1,4 +1,3 @@
|
||||
add_definitions(-fPIC)
|
||||
|
||||
SET(CosmoTool_SRCS
|
||||
fortran.cpp
|
||||
@ -75,9 +74,11 @@ if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries(CosmoTool ${CosmoTool_LIBS})
|
||||
if (BUILD_STATIC_LIBS)
|
||||
add_library(CosmoTool_static STATIC ${CosmoTool_SRCS})
|
||||
set_target_properties(CosmoTool_static PROPERTIES COMPILE_FLAGS "${CMAKE_C_COMPILE_OPTIONS_PIC}")
|
||||
endif(BUILD_STATIC_LIBS)
|
||||
else (BUILD_SHARED_LIBS)
|
||||
add_library(CosmoTool STATIC ${CosmoTool_SRCS})
|
||||
set_target_properties(CosmoTool PROPERTIES COMPILE_FLAGS "${CMAKE_C_COMPILE_OPTIONS_PIC}")
|
||||
endif (BUILD_SHARED_LIBS)
|
||||
|
||||
install(TARGETS CosmoTool
|
||||
|
Loading…
Reference in New Issue
Block a user