From ba18690cda80ed8b299d6cf5277598fa359f8081 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 6 Apr 2021 09:41:43 +0200 Subject: [PATCH 1/3] Update README --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4e61e05..0ff0b5b 100644 --- a/README.md +++ b/README.md @@ -59,24 +59,24 @@ The VIDE tools are all packaged in the `vide` package. Running with simulation ----------------------- -!! Temporary measure !! - -After build the vide package and installing it with `python3 setup.py install` (for example), it is possible to find the -script to build the pipeline for simulations in `build/temp.[SOMETHING]/pipeline/prepareInputs.py`. Just copy that script where -you want the analysis and execute it directly with the parameter file as an argument. - -For example: +Using simulation requires a preliminary step, consisting in using the script +`vide_prepare_simulation` which is installed during the installation procedure. +The script generates mock catalog and a default pipeline to handle simulations. +An example of the complete procedure is given here-below: ``` mkdir $HOME/my_vide_test -cp build/temp.[SOMETHING]/pipeline/prepareInputs.py $HOME/my_vide_test cp python_tools/void_pipeline/datasets/example_simulation.py $HOME/my_vide_test mkdir $HOME/my_vide_test/examples cp examples/example_simulation_z0.0.dat $HOME/my_vide_test/examples cd $HOME/my_vide_test -python3 prepareInputs.py --all --parm example_simulation.py +vide_prepare_simulation --all --parm example_simulation.py python3 -m void_pipeline example_simulation/sim_ss1.0.py ``` +The example copies the required data in a separate directory. Then, we execute +the `vide_prepare_simulation` script to generate the auxiliary pipeline. The +`void_pipeline` is finally executed on this generated script. + Notes for CONDA --------------- From 08074d2e8a666e3d53db3369b9e521d00c8378b7 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 15 Apr 2021 15:00:05 +0200 Subject: [PATCH 2/3] Improve boost configuration --- external/configure_boost.cmake | 17 ++++++++++++++ external/external_build.cmake | 41 +++++++++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 external/configure_boost.cmake diff --git a/external/configure_boost.cmake b/external/configure_boost.cmake new file mode 100644 index 0000000..ca125be --- /dev/null +++ b/external/configure_boost.cmake @@ -0,0 +1,17 @@ +MESSAGE(STATUS "Reconfiguring using compiler flags=\"${COMPILER_EXTRA_FLAGS}\" and linker flags=\"${LINKER_EXTRA_FLAGS}\"") +FILE(WRITE ${SRC_DIR}/tools/build/src/user-config.jam + "using ${TOOLSET} : cmake : \"${COMPILER}\" : \"${COMPILER_EXTRA_FLAGS}\" \"${LINKER_EXTRA_FLAGS}\" ;\n" +) + +#FILE(APPEND ${SRC_DIR}/boost/regex/user.hpp +# "#define BOOST_REGEX_MATCH_EXTRA 1\n" +#) + +execute_process( + COMMAND "${SRC_DIR}/bootstrap.sh" --prefix=${INSTALL_PATH} toolset=${TOOLSET}-cmake + RESULT_VARIABLE okcode +) + +IF (NOT "${okcode}" STREQUAL "0") + MESSAGE(FATAL_ERROR "Cannot execute configure command") +ENDIF() diff --git a/external/external_build.cmake b/external/external_build.cmake index a95a182..ac895ca 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -39,10 +39,10 @@ IF(INTERNAL_NETCDF) ENDIF(INTERNAL_NETCDF) IF(INTERNAL_BOOST) - SET(BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.69.0/boost_1_69_0.tar.gz/download" CACHE STRING "URL to download Boost from") + SET(BOOST_URL "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz" CACHE STRING "URL to download Boost from") mark_as_advanced(BOOST_URL) ELSE(INTERNAL_BOOST) - find_package(Boost 1.69.0 COMPONENTS format spirit phoenix python FATAL_ERROR) + find_package(Boost 1.74.0 COMPONENTS format spirit phoenix python FATAL_ERROR) ENDIF(INTERNAL_BOOST) IF(INTERNAL_QHULL) @@ -202,13 +202,44 @@ mark_as_advanced(NETCDF_LIBRARY NETCDFCPP_LIBRARY NETCDF_INCLUDE_PATH NETCDFCPP_ if (INTERNAL_BOOST) SET(cosmotool_DEPS ${cosmotool_DEPS} boost) SET(BOOST_SOURCE_DIR ${BUILD_PREFIX}/boost-prefix/src/boost) + + set(LINKER_EXTRA_FLAGS) + message(STATUS "Compiler version is ${CMAKE_CXX_COMPILER_VERSION}") + string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1" ToolsetVer "${CMAKE_CXX_COMPILER_VERSION}") + IF(CMAKE_CXX_COMPILER_ID MATCHES "^Intel$") + SET(b2_toolset intel) + SET(COMPILER_EXTRA_FLAGS "-fPIC") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + SET(b2_toolset darwin) + else() + SET(b2_toolset gcc) + SET(COMPILER_EXTRA_FLAGS "-fPIC -std=gnu++14") + endif() + add_definitions("-Wno-unused-local-typedefs") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + SET(b2_toolset darwin) + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + SET(b2_toolset clang) + endif() + SET(COMPILER_EXTRA_FLAGS "${COMPILER_EXTRA_FLAGS} -I${EXT_INSTALL}/include") + SET(LINKER_EXTRA_FLAGS "${LINKER_EXTRA_FLAGS} -L${EXT_INSTALL}/lib") + + message(STATUS "Building boost with toolset ${b2_toolset}") + + SET(BOOST_LIBRARIES + ${EXT_INSTALL}/lib/libboost_exception.a + ) + ExternalProject_Add(boost URL ${BOOST_URL} + URL_HASH SHA1=107cebeec706988639cf2932fc0ce43200de4c0a PREFIX ${BUILD_PREFIX}/boost-prefix - CONFIGURE_COMMAND ${BOOST_SOURCE_DIR}/bootstrap.sh --prefix=${EXT_INSTALL} + CONFIGURE_COMMAND ${CMAKE_COMMAND} -DTOOLSET=${b2_toolset} "-DCOMPILER:STRING=${CMAKE_CXX_COMPILER}" "-DCOMPILER_EXTRA_FLAGS=${COMPILER_EXTRA_FLAGS}" "-DINSTALL_PATH:STRING=${EXT_INSTALL}" "-DLINKER_EXTRA_FLAGS=${LINKER_EXTRA_FLAGS}" "-DSRC_DIR:STRING=${BOOST_SOURCE_DIR}" -P ${CMAKE_SOURCE_DIR}/external/configure_boost.cmake BUILD_IN_SOURCE 1 - BUILD_COMMAND ${BOOST_SOURCE_DIR}/b2 --with-exception - INSTALL_COMMAND ${BOOST_SOURCE_DIR}/b2 install --with-exception + BUILD_COMMAND ${BOOST_SOURCE_DIR}/b2 --with-exception toolset=${b2_toolset}-cmake variant=release + INSTALL_COMMAND ${BOOST_SOURCE_DIR}/b2 install --with-exception + BUILD_BYPRODUCTS ${BOOST_LIBRARIES} ) set(Boost_INCLUDE_DIRS ${BOOST_SOURCE_DIR} CACHE STRING "Boost path" FORCE) set(Boost_INTERNAL_INSTALL ${EXT_INSTALL}) From 8858bea397ebca6522de817ab88604f24823b2ff Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 4 Jun 2021 12:01:01 +0200 Subject: [PATCH 3/3] Purge spurious file --- python_tools/PKG-INFO | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 python_tools/PKG-INFO diff --git a/python_tools/PKG-INFO b/python_tools/PKG-INFO deleted file mode 100644 index 94703da..0000000 --- a/python_tools/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: voidProject -Version: 1.0 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN