diff --git a/.gitlab/build.sh b/.gitlab/build.sh index ee9deb703b62a7874e927f53000ebb94ecfbcabe..bd7b9259e6b1c7ff8388906d6c550b130da28699 100755 --- a/.gitlab/build.sh +++ b/.gitlab/build.sh @@ -11,11 +11,19 @@ SCAN="" if [[ "$SYSTEM" != "windows" ]]; then if [[ "$SYSTEM" == "macosx" ]]; then - if brew ls --versions starpu > /dev/null; then - echo "Starpu is already installed with brew"; + # check starpu is already installed and install it if necessary + DEP_INSTALLED=`brew ls --versions starpu | cut -d " " -f 2` + if [[ -z "${DEP_INSTALLED}" ]]; then + # dep is not installed, we have to install it + brew install --build-from-source ./tools/homebrew/starpu.rb else - echo "Start installing Starpu with brew"; - brew install --build-from-source ~/brew-repo/starpu.rb; + # dep is already installed, check the version with our requirement + DEP_REQUIRED=`brew info --json ./tools/homebrew/starpu.rb |jq -r '.[0].versions.stable'` + if [[ "${DEP_INSTALLED}" != "${DEP_REQUIRED}" ]]; then + # if the installed version is not the required one, re-install + brew remove --force --ignore-dependencies starpu + brew install --build-from-source ./tools/homebrew/starpu.rb + fi fi # clang is used on macosx and it is not compatible with MORSE_ENABLE_COVERAGE=ON # to avoid the Accelerate framework and get Openblas we use BLA_PREFER_PKGCONFIG diff --git a/example/mpi/CMakeLists.txt b/example/mpi/CMakeLists.txt index c06e975b7b80779b9381c678b142545a6009bf1a..88a20b21d9e0af5f64470a8f77a350a29f0de2a5 100644 --- a/example/mpi/CMakeLists.txt +++ b/example/mpi/CMakeLists.txt @@ -2,8 +2,8 @@ # # @file CMakeLists.txt # -# @copyright 2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, -# Univ. Bordeaux. All rights reserved. +# @copyright 2024-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, +# Univ. Bordeaux. All rights reserved. # ### # @@ -14,7 +14,7 @@ # @version 1.3.0 # @author Florent Pruvost # @author Mathieu Faverge -# @date 2024-03-19 +# @date 2024-05-06 # ### diff --git a/example/mpi/comm_split.c b/example/mpi/comm_split.c index 834582be6db35ee8a4b2b2229f230cc400165005..4b167ac13bb5a8e27ea21cd5a848aad4a1398c70 100644 --- a/example/mpi/comm_split.c +++ b/example/mpi/comm_split.c @@ -2,8 +2,8 @@ * * @file comm_split.c * - * @copyright 2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, - * Univ. Bordeaux. All rights reserved. + * @copyright 2024-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, + * Univ. Bordeaux. All rights reserved. * *** * @@ -12,7 +12,7 @@ * @version 1.3.0 * @author Florent Pruvost * @author Mathieu Faverge - * @date 2024-03-19 + * @date 2024-05-06 * */ #include "comm_split.h" diff --git a/example/mpi/comm_split.h b/example/mpi/comm_split.h index ecbd19f5aa438475f654ffbdda3ee9bcaa3adcf8..90e76f6cb9344667aba51254b284536cc612d772 100644 --- a/example/mpi/comm_split.h +++ b/example/mpi/comm_split.h @@ -2,8 +2,8 @@ * * @file comm_split.h * - * @copyright 2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, - * Univ. Bordeaux. All rights reserved. + * @copyright 2024-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, + * Univ. Bordeaux. All rights reserved. * *** * @@ -12,7 +12,7 @@ * @version 1.3.0 * @author Florent Pruvost * @author Mathieu Faverge - * @date 2024-03-19 + * @date 2024-05-06 * */ #ifndef _comm_split_h_ diff --git a/tools/check_header.sh b/tools/check_header.sh index c5f5ed6300939a280718fc6f9803affcedf1c9e3..2348bee3d7e780c075572cfb47e71813d9fa6de2 100755 --- a/tools/check_header.sh +++ b/tools/check_header.sh @@ -4,10 +4,10 @@ # @copyright 2016-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, # Univ. Bordeaux. All rights reserved. # -# @version 1.2.0 +# @version 1.3.0 # @author Florent Pruvost # @author Mathieu Faverge -# @date 2022-02-22 +# @date 2024-05-06 # # This script check that basic informations is present and correct in # headers of source files. @@ -193,7 +193,8 @@ files=$( git ls-files | grep -v "distrib/debian/.*" | grep -v "tools/bench/jube/requirements.txt" | grep -v "\.org" | - grep -v "\.scm" ) + grep -v "\.scm" | + grep -v "\.rb") if [ $# -gt 0 ] then files=$* diff --git a/tools/homebrew/starpu.rb b/tools/homebrew/starpu.rb new file mode 100644 index 0000000000000000000000000000000000000000..3bacca558d529100c73b85785e309db2716cc9f2 --- /dev/null +++ b/tools/homebrew/starpu.rb @@ -0,0 +1,61 @@ +### +# +# @file starpu.rb +# @copyright 2013-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, +# Univ. Bordeaux. All rights reserved. +# +# @brief Homebrew formula for StarPU +# +# @version 1.3.0 +# @date 2024-05-06 +# +### +class Starpu < Formula + desc "StarPU is a task programming library for hybrid architectures" + homepage "https://starpu.gitlabpages.inria.fr/" + url "https://files.inria.fr/starpu/starpu-1.4.5/starpu-1.4.5.tar.gz" + sha256 "28f389b34df57a2a4e4743b40554b0f8d098ff2199e9eb8fbbe20aa377b64541" + license "GNU GPL v2.1" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + depends_on "pkg-config" => [:build, :test] + depends_on "hwloc" + depends_on "openmpi" + + def install + system "./autogen.sh" if build.head? + system "./configure", *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~EOS + #include <stdio.h> + #include <stdlib.h> + #include <starpu.h> + + struct starpu_codelet cl = + { + .where = STARPU_NOWHERE, + }; + + int main(int argc, char* argv[]) + { + int ret = starpu_init(NULL); + STARPU_CHECK_RETURN_VALUE(ret, "starpu_init"); + ret = starpu_task_insert(&cl, 0); + STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_insert"); + ret = starpu_task_wait_for_all(); + STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_wait_for_all"); + starpu_shutdown(); + return 0; + } + EOS + + pkg_config_flags = `pkg-config --cflags --libs starpu-1.4`.chomp.split + system ENV.cc, "test.c", *pkg_config_flags + system "./a.out" + end +end