Fixed boost dependency. Fixed I/O in test bispectrum

This commit is contained in:
Guilhem Lavaux 2016-11-26 21:43:49 +01:00
parent c61daed876
commit 8b2f0f7557
3 changed files with 6 additions and 2 deletions

View File

@ -155,9 +155,11 @@ if (INTERNAL_BOOST)
set(Boost_INCLUDE_DIRS ${BOOST_SOURCE_DIR} CACHE STRING "Boost path" FORCE) set(Boost_INCLUDE_DIRS ${BOOST_SOURCE_DIR} CACHE STRING "Boost path" FORCE)
set(Boost_LIBRARIES ${BOOST_SOURCE_DIR}/stage/lib/libboost_python.a CACHE STRING "Boost libraries" FORCE) set(Boost_LIBRARIES ${BOOST_SOURCE_DIR}/stage/lib/libboost_python.a CACHE STRING "Boost libraries" FORCE)
set(Boost_FOUND YES) set(Boost_FOUND YES)
set(Boost_DEP boost)
ELSE (INTERNAL_BOOST) ELSE (INTERNAL_BOOST)
find_package(Boost 1.53) find_package(Boost 1.53)
set(Boost_DEP)
endif (INTERNAL_BOOST) endif (INTERNAL_BOOST)
mark_as_advanced(Boost_INCLUDE_DIRS Boost_LIBRARIES) mark_as_advanced(Boost_INCLUDE_DIRS Boost_LIBRARIES)

View File

@ -54,7 +54,9 @@ if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS})
add_library(_cosmo_bispectrum MODULE _cosmo_bispectrum.cpp) add_library(_cosmo_bispectrum MODULE _cosmo_bispectrum.cpp)
target_link_libraries(_cosmo_bispectrum ${MATH_LIBRARY}) target_link_libraries(_cosmo_bispectrum ${MATH_LIBRARY})
add_dependencies(_cosmo_bispectrum boost) if (Boost_DEP)
add_dependencies(_cosmo_bispectrum ${Boost_DEP})
endif()
SET(ct_TARGETS ${ct_TARGETS} _cosmo_bispectrum) SET(ct_TARGETS ${ct_TARGETS} _cosmo_bispectrum)
endif() endif()

View File

@ -17,7 +17,7 @@ def myfun(N):
y = BB/x y = BB/x
np.savez("bispec_%d.npy" % N, y=y, B=B, P=P, rho=rho); np.savez("bispec_%d.npz" % N, y=y, B_nt=B[0], B_r=B[1], P_n=P[0], P=P[1], rho=rho);
print( timeit.timeit('from __main__ import myfun; myfun(16)', number=1) ) print( timeit.timeit('from __main__ import myfun; myfun(16)', number=1) )