diff --git a/.github/workflows/linux-conda.yml b/.github/workflows/linux-conda.yml index 4b4fcb7be..1364f70e4 100644 --- a/.github/workflows/linux-conda.yml +++ b/.github/workflows/linux-conda.yml @@ -1,6 +1,13 @@ name: Linux Conda package -on: [push] +on: + push: + # branches-ignore: + # - gh247 + paths-ignore: + - README.md + - document/** + - environment/** jobs: build: @@ -8,7 +15,7 @@ jobs: strategy: matrix: os: ["ubuntu-20.04"] - python-version: ["3.9"] + python-version: [3.9] fail-fast: false runs-on: ${{ matrix.os }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 850fbbc3d..23c7e61c9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,6 +1,13 @@ name: Linux CI -on: [push] +on: + push: + # branches-ignore: + # - gh247 + paths-ignore: + - README.md + - document/** + - environment/** jobs: build: diff --git a/.github/workflows/macos-conda.yml b/.github/workflows/macos-conda.yml index 94c2e60d0..94344a033 100644 --- a/.github/workflows/macos-conda.yml +++ b/.github/workflows/macos-conda.yml @@ -1,6 +1,13 @@ name: macOS Conda package -on: [push] +on: + push: + # branches-ignore: + # - gh247 + paths-ignore: + - README.md + - document/** + - environment/** jobs: build: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5472d1657..8ebc33c90 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,13 @@ name: macOS CI -on: [push] +on: + push: + # branches-ignore: + # - gh247 + paths-ignore: + - README.md + - document/** + - environment/** jobs: build: diff --git a/.github/workflows/windows-conda.yml b/.github/workflows/windows-conda.yml index 9c4d56131..b6d15b2b4 100644 --- a/.github/workflows/windows-conda.yml +++ b/.github/workflows/windows-conda.yml @@ -1,6 +1,13 @@ name: Windows Conda package -on: [push] +on: + push: + # branches-ignore: + # - gh247 + paths-ignore: + - README.md + - document/** + - environment/** jobs: build: @@ -9,6 +16,7 @@ jobs: matrix: os: ["windows-2019"] python-version: [3.9] + fail-fast: false runs-on: ${{ matrix.os }} @@ -16,5 +24,20 @@ jobs: steps: - - name: checkout lue + - name: checkout LUE uses: actions/checkout@v2 + + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: false + python-version: ${{ matrix.python-version }} + channels: conda-forge + mamba-version: "*" + - shell: bash -l {0} + run: | + mamba install boa -c conda-forge + + - name: Build + shell: bash -l {0} + run: | + conda mambabuild environment/configuration/receipe --channel conda-forge --override-channels diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ef0add72b..a5ee0ab54 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,13 @@ name: Windows CI -on: [push] +on: + push: + # branches-ignore: + # - gh247 + paths-ignore: + - README.md + - document/** + - environment/** jobs: build: @@ -78,12 +85,8 @@ jobs: - name: test lue shell: bash -l {0} run: | - # TODO https://github.com/computationalgeography/lue/issues/445 cd $GITHUB_WORKSPACE/../build - ctest --build-config Release -R package_link - ctest --test-dir source/data_model --build-config Release - - # cmake --config Release --target run_tests + ctest --extra-verbose --output-on-failure --build-config Release - name: install lue lue_runtime component shell: bash -l {0} diff --git a/environment/configuration/receipe/bld.bat b/environment/configuration/receipe/bld.bat index de4a560d6..0dde5179f 100644 --- a/environment/configuration/receipe/bld.bat +++ b/environment/configuration/receipe/bld.bat @@ -1,45 +1,86 @@ @echo on rem We need to create an out of source build -mkdir ../build -if errorlevel 1 exit 1 +md %TMPDIR%\build -cd ../build +if %errorlevel% neq 0 exit /b %errorlevel% -if errorlevel 1 exit 1 +cd %TMPDIR%\build + +if %errorlevel% neq 0 exit /b %errorlevel% rem Ensure desired Boost version is selected by CMake set "BOOST_ROOT=%PREFIX%" set "BOOST_NO_SYSTEM_PATHS=ON" - -cmake %SRC_DIR% -G"Ninja" ^ +cmake %SRC_DIR% ^ + -G "Visual Studio 16 2019" -A x64 ^ + -D FETCHCONTENT_QUIET=FALSE ^ -D CMAKE_BUILD_TYPE=Release ^ -D CMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^ - -D CMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ - -D LUE_DATA_MODEL_WITH_PYTHON_API=ON ^ - -D LUE_DATA_MODEL_WITH_UTILITIES=ON ^ - -D LUE_BUILD_VIEW=ON ^ - -D Boost_USE_STATIC_LIBS=OFF ^ + -D CMAKE_INSTALL_PREFIX:PATH="%PREFIX%" ^ + -D CMAKE_INSTALL_LIBDIR=lib ^ + -D LUE_INSTALL_PYTHON_PACKAGE_DIR="%SP_DIR%/lue" ^ + -D LUE_BUILD_DATA_MODEL=TRUE ^ + -D LUE_DATA_MODEL_WITH_PYTHON_API=TRUE ^ + -D LUE_DATA_MODEL_WITH_UTILITIES=TRUE ^ + -D LUE_BUILD_FRAMEWORK=TRUE ^ + -D LUE_FRAMEWORK_WITH_PYTHON_API=TRUE ^ + -D LUE_BUILD_VIEW=TRUE ^ + -D LUE_BUILD_TEST=TRUE ^ + -D LUE_TEST_NR_LOCALITIES_PER_TEST=1 ^ + -D LUE_TEST_NR_THREADS_PER_LOCALITY=2 ^ + -D LUE_BUILD_QA=TRUE ^ + -D LUE_QA_WITH_PYTHON_API=TRUE ^ + -D LUE_BUILD_HPX=TRUE ^ + -D HPX_USE_CMAKE_CXX_STANDARD=TRUE ^ + -D HPX_WITH_MALLOC="system" ^ + -D HPX_WITH_FETCH_ASIO=TRUE ^ + -D HPX_WITH_PKGCONFIG=FALSE ^ + -D HPX_WITH_EXAMPLES=FALSE ^ + -D HPX_WITH_TESTS=FALSE ^ -D LUE_HAVE_BOOST=TRUE ^ + -D LUE_HAVE_DOCOPT=FALSE ^ + -D LUE_HAVE_FMT=FALSE ^ -D LUE_HAVE_GDAL=TRUE ^ + -D LUE_HAVE_GLFW=FALSE ^ -D LUE_HAVE_HDF5=TRUE ^ - -D LUE_HAVE_FMT=TRUE ^ - -D HDF5_USE_STATIC_LIBRARIES=OFF ^ - -D Python3_FIND_STRATEGY="LOCATION" ^ - -D Python3_EXECUTABLE="%PYTHON%" ^ - -D PYTHON_EXECUTABLE="%PYTHON%" ^ - -D Python_ROOT_DIR="%PREFIX%/bin" ^ - -D Python3_ROOT_DIR="%PREFIX%/bin" + -D LUE_HAVE_NLOHMANN_JSON=FALSE ^ + -D LUE_HAVE_PYBIND11=FALSE ^ + -D Boost_USE_STATIC_LIBS=FALSE ^ + -D HDF5_USE_STATIC_LIBRARIES=FALSE ^ + -D HWLOC_ROOT="%LIBRARY_LIB%" ^ + -D HWLOC_LIBRARY="%LIBRARY_LIB%/hwloc.dll.lib" ^ + -D Python3_EXECUTABLE="%PYTHON%" + +if %errorlevel% neq 0 exit /b %errorlevel% + +cmake --build . --config Release --target all_build --parallel 2 +if %errorlevel% neq 0 exit /b %errorlevel% -if errorlevel 1 exit 1 +rem rem Use parallel build for as many targets as possible, but not for framework/algorithm +rem cmake --build . --target ^ +rem source/data_model/all ^ +rem source/view/all ^ +rem source/framework/core/all ^ +rem source/framework/partitioned_array/all +rem +rem if %errorlevel% neq 0 exit /b %errorlevel% +rem +rem rem Build remaining targets with fewer cores. Compiling these modules requires more memory. +rem cmake --build . --target all --parallel 2 +rem +rem if %errorlevel% neq 0 exit /b %errorlevel% -cmake --build . --target all +ctest --extra-verbose --output-on-failure --build-config Release -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit /b %errorlevel% -cmake --build . --target install +cmake --install . --component core +cmake --install . --component parallelism +cmake --install . --component runtime +cmake --install . --component lue_runtime -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/environment/configuration/receipe/build.sh b/environment/configuration/receipe/build.sh index 3f875b19b..b3a9ff372 100644 --- a/environment/configuration/receipe/build.sh +++ b/environment/configuration/receipe/build.sh @@ -20,7 +20,6 @@ PATH=$PREFIX/bin:$PATH CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" \ -D CMAKE_INSTALL_PREFIX:PATH="${PREFIX}" \ -D CMAKE_INSTALL_LIBDIR=lib \ -D LUE_INSTALL_PYTHON_PACKAGE_DIR="${SP_DIR}/lue" \ - -D Python3_EXECUTABLE="${PYTHON}" \ -D LUE_HAVE_BOOST:BOOL=TRUE \ -D LUE_HAVE_FMT:BOOL=TRUE \ -D LUE_HAVE_PYBIND11:BOOL=TRUE \ @@ -43,7 +42,8 @@ PATH=$PREFIX/bin:$PATH CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" \ -D HPX_WITH_MALLOC="tcmalloc" \ -D HPX_WITH_PKGCONFIG=OFF \ -D HPX_WITH_EXAMPLES=OFF \ - -D HPX_WITH_TESTS=OFF + -D HPX_WITH_TESTS=OFF \ + -D Python3_EXECUTABLE="${PYTHON}" # Use parallel build for as many targets as possible, but not for framework/algorithm cmake --build . --target source/{data_model,view}/all source/framework/{core,partitioned_array}/all diff --git a/environment/configuration/receipe/meta.yaml b/environment/configuration/receipe/meta.yaml index a83c160df..a5a6859dd 100644 --- a/environment/configuration/receipe/meta.yaml +++ b/environment/configuration/receipe/meta.yaml @@ -12,6 +12,8 @@ source: build: number: 0 + script_env: + - TMPDIR requirements: diff --git a/source/data_model/python/test/CMakeLists.txt b/source/data_model/python/test/CMakeLists.txt index ad5cd93c0..876d99cc7 100644 --- a/source/data_model/python/test/CMakeLists.txt +++ b/source/data_model/python/test/CMakeLists.txt @@ -7,13 +7,20 @@ add_test( --pattern "*_test.py" ) -set_tests_properties( - lue_py_data_model_python_test - PROPERTIES +set_property( + TEST + lue_py_data_model_python_test + APPEND + PROPERTY # Add the path to our Python modules to PYTHONPATH. - ENVIRONMENT_MODIFICATION "\ -PYTHONPATH=path_list_prepend:$/..;\ -" + ENVIRONMENT_MODIFICATION + PYTHONPATH=path_list_prepend:$/.. +) +set_property( + TEST + lue_py_data_model_python_test + APPEND + PROPERTY FIXTURES_REQUIRED lue_py_test_fixture ) diff --git a/source/framework/algorithm/test/CMakeLists.txt b/source/framework/algorithm/test/CMakeLists.txt index 22afd4178..daa05aa89 100644 --- a/source/framework/algorithm/test/CMakeLists.txt +++ b/source/framework/algorithm/test/CMakeLists.txt @@ -129,13 +129,21 @@ foreach(name ${names}) "$" ) - set_tests_properties( - ${test_name} - PROPERTIES - # On Windows, add the path to the HPX dlls. Only if HPX::hpx target is defined. - ENVIRONMENT_MODIFICATION - PATH=path_list_prepend:$<$,$>:$> - ) + if(WIN32) + # Ensure required DLLs can be found at runtime + set_property( + TEST + ${test_name} + APPEND + PROPERTY + ENVIRONMENT_MODIFICATION + PATH=path_list_prepend:$ + PATH=path_list_prepend:$ + PATH=path_list_prepend:$ + PATH=path_list_prepend:$ + PATH=path_list_prepend:$ + ) + endif() endforeach() foreach(name ${local_operation_names}) @@ -180,11 +188,15 @@ foreach(name ${names}) COMMAND ${test_name} ) - set_tests_properties( - ${test_name} - PROPERTIES - # On Windows, add the path to the HPX dlls. Only if HPX::hpx target is defined. - ENVIRONMENT_MODIFICATION - PATH=path_list_prepend:$<$,$>:$> - ) + if(WIN32) + # Ensure required DLLs can be found at runtime + set_property( + TEST + ${test_name} + APPEND + PROPERTY + ENVIRONMENT_MODIFICATION + PATH=path_list_prepend:$ + ) + endif() endforeach() diff --git a/source/framework/core/test/CMakeLists.txt b/source/framework/core/test/CMakeLists.txt index 275757138..71ec2fe81 100644 --- a/source/framework/core/test/CMakeLists.txt +++ b/source/framework/core/test/CMakeLists.txt @@ -32,11 +32,15 @@ foreach(name ${names}) COMMAND ${test_name} ) - set_tests_properties( - ${test_name} - PROPERTIES - # On Windows, add the path to the HPX dlls. Only if HPX::hpx target is defined. - ENVIRONMENT_MODIFICATION - PATH=path_list_prepend:$<$,$>:$> - ) + if(WIN32) + # Ensure required DLLs can be found at runtime + set_property( + TEST + ${test_name} + APPEND + PROPERTY + ENVIRONMENT_MODIFICATION + PATH=path_list_prepend:$ + ) + endif() endforeach() diff --git a/source/framework/io/test/CMakeLists.txt b/source/framework/io/test/CMakeLists.txt index e2d6c375c..850bf9d02 100644 --- a/source/framework/io/test/CMakeLists.txt +++ b/source/framework/io/test/CMakeLists.txt @@ -35,11 +35,16 @@ foreach(name ${names}) "$" ) - set_tests_properties( - ${test_name} - PROPERTIES - # On Windows, add the path to the HPX dlls. Only if HPX::hpx target is defined. - ENVIRONMENT_MODIFICATION - PATH=path_list_prepend:$<$,$>:$> - ) + if(WIN32) + # Ensure required DLLs can be found at runtime + set_property( + TEST + ${test_name} + APPEND + PROPERTY + ENVIRONMENT_MODIFICATION + PATH=path_list_prepend:$ + PATH=path_list_prepend:$ + ) + endif() endforeach() diff --git a/source/framework/model/test/CMakeLists.txt b/source/framework/model/test/CMakeLists.txt index 795382bf1..3007cb670 100644 --- a/source/framework/model/test/CMakeLists.txt +++ b/source/framework/model/test/CMakeLists.txt @@ -21,11 +21,15 @@ foreach(name ${names}) COMMAND ${test_name} ) - set_tests_properties( - ${test_name} - PROPERTIES - # On Windows, add the path to the HPX dlls. Only if HPX::hpx target is defined. - ENVIRONMENT_MODIFICATION - PATH=path_list_prepend:$<$,$>:$> - ) + if(WIN32) + # Ensure required DLLs can be found at runtime + set_property( + TEST + ${test_name} + APPEND + PROPERTY + ENVIRONMENT_MODIFICATION + PATH=path_list_prepend:$ + ) + endif() endforeach() diff --git a/source/framework/partitioned_array/test/CMakeLists.txt b/source/framework/partitioned_array/test/CMakeLists.txt index 063104535..d2c37d934 100644 --- a/source/framework/partitioned_array/test/CMakeLists.txt +++ b/source/framework/partitioned_array/test/CMakeLists.txt @@ -28,11 +28,16 @@ foreach(name ${names}) "$" ) - set_tests_properties( - ${test_name} - PROPERTIES - # On Windows, add the path to the HPX dlls. Only if HPX::hpx target is defined. - ENVIRONMENT_MODIFICATION - PATH=path_list_prepend:$<$,$>:$> - ) + if(WIN32) + # Ensure required DLLs can be found at runtime + set_property( + TEST + ${test_name} + APPEND + PROPERTY + ENVIRONMENT_MODIFICATION + PATH=path_list_prepend:$ + PATH=path_list_prepend:$ + ) + endif() endforeach() diff --git a/source/framework/python/test/CMakeLists.txt b/source/framework/python/test/CMakeLists.txt index fab5e20db..76ff05dfc 100644 --- a/source/framework/python/test/CMakeLists.txt +++ b/source/framework/python/test/CMakeLists.txt @@ -13,16 +13,30 @@ add_test( --pattern "*_test.py" ) -set_tests_properties( - lue_py_framework_python_test - PROPERTIES +set_property( + TEST + lue_py_framework_python_test + APPEND + PROPERTY # Preload the tcmalloc shared library, if necessary. ENVIRONMENT $<$>,$>:$,DYLD_INSERT_LIBRARIES,LD_PRELOAD>=${TCMALLOC_LIBRARY}> +) +set_property( + TEST + lue_py_framework_python_test + APPEND + PROPERTY # Add the path to our Python modules to PYTHONPATH. - ENVIRONMENT_MODIFICATION "\ -PYTHONPATH=path_list_prepend:${CMAKE_CURRENT_SOURCE_DIR}:$/..;\ -" + ENVIRONMENT_MODIFICATION + PYTHONPATH=path_list_prepend:$/.. + PYTHONPATH=path_list_prepend:${CMAKE_CURRENT_SOURCE_DIR} +) +set_property( + TEST + lue_py_framework_python_test + APPEND + PROPERTY FIXTURES_REQUIRED lue_py_test_fixture ) diff --git a/source/python/CMakeLists.txt b/source/python/CMakeLists.txt index 5e299dcb3..86f27234c 100644 --- a/source/python/CMakeLists.txt +++ b/source/python/CMakeLists.txt @@ -69,7 +69,7 @@ if(WIN32) add_custom_command( TARGET lue_py POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ $ + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ COMMAND_EXPAND_LISTS ) endif()