From 413e2f1d7da6a2ebabd7ce54495a1034296c83d4 Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Mon, 14 Aug 2023 16:17:41 +0200 Subject: [PATCH] debug clang --- .github/workflows/release.yml | 2 +- build.sh | 71 ++--------------------------------- test.cpp | 9 +++++ 3 files changed, 14 insertions(+), 68 deletions(-) create mode 100644 test.cpp diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9bbac72..fb0d9b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: env: INSTALL_PREFIX: "/opt/smelibs" SUDOCMD: "sudo" - MACOSX_DEPLOYMENT_TARGET: "11" + # MACOSX_DEPLOYMENT_TARGET: "11" OS_TARGET: "osx" DUNE_USE_FALLBACK_FILESYSTEM: "ON" # CXX: "g++-13" diff --git a/build.sh b/build.sh index 7d74f7c..0983450 100755 --- a/build.sh +++ b/build.sh @@ -2,73 +2,10 @@ set -e -x -DEPSDIR=${INSTALL_PREFIX} +#export PATH="/usr/local/opt/llvm/bin:$PATH" -echo "SME_DEPS_COMMON_VERSION: ${SME_DEPS_COMMON_VERSION}" -echo "DUNE_COPASI_VERSION: ${DUNE_COPASI_VERSION}" -echo "PATH: $PATH" -echo "MSYSTEM: $MSYSTEM" +/usr/local/opt/llvm/bin/clang++ -o x test.cpp -std=c++20 -L/usr/local/opt/llvm/lib/c++ -static-libstdc++ -I/usr/local/opt/llvm/include -L/usr/local/opt/llvm/lib -which g++ -which cmake -g++ --version -gcc --version -cmake --version +ls -export PATH="/usr/local/opt/llvm/bin:$PATH" - -echo "Downloading static libs for OS_TARGET: $OS_TARGET" -wget "https://github.com/spatial-model-editor/sme_deps_common/releases/download/${SME_DEPS_COMMON_VERSION}/sme_deps_common_${OS_TARGET}.tgz" -tar xf sme_deps_common_${OS_TARGET}.tgz -# copy libs to desired location: workaround for tar -C / not working on windows -if [[ "$OS_TARGET" == *"win"* ]]; then - mv c/smelibs /c/ - # ls /c/smelibs -else - $SUDOCMD mv opt/* /opt/ - # ls /opt/smelibs -fi - -# export vars for duneopts script to read -export DUNE_COPASI_USE_STATIC_DEPS=ON -export BUILD_SHARED_LIBS=FALSE -export CMAKE_INSTALL_PREFIX=$DEPSDIR -export MAKE_OPTIONS="-j2 VERBOSE=1" -export CMAKE_CXX_FLAGS="'-I/usr/local/opt/llvm/include -L/usr/local/opt/llvm/lib -fvisibility=hidden -D_GLIBCXX_USE_TBB_PAR_BACKEND=0 -L/usr/local/opt/llvm/lib/c++ -static-libstdc++'" -export DUNE_PDELAB_ENABLE_TRACING=OFF -export DUNE_COPASI_USE_PARAFIELDS=OFF -export DUNE_ENABLE_PYTHONBINDINGS=OFF -export CMAKE_DISABLE_FIND_PACKAGE_MPI=ON -export CC=/usr/local/opt/llvm/bin/clang -export CXX=/usr/local/opt/llvm/bin/clang++ -if [[ $MSYSTEM ]]; then - # on windows add flags to support large object files - # https://stackoverflow.com/questions/16596876/object-file-has-too-many-sections - export CMAKE_CXX_FLAGS='-fvisibility=hidden -Wa,-mbig-obj' -fi - -# clone dune-copasi -git clone -b ${DUNE_COPASI_VERSION} --depth 1 https://gitlab.dune-project.org/copasi/dune-copasi.git -cd dune-copasi - -# check opts -bash dune-copasi.opts - -# build & install dune (excluding dune-copasi) -bash .ci/setup_dune $PWD/dune-copasi.opts - -# build & install dune-copasi -bash .ci/install $PWD/dune-copasi.opts - -cd .. - -# patch DUNE to skip deprecated FindPythonLibs/FindPythonInterp cmake that breaks subsequent FindPython cmake -sed -i.bak 's|find_package(Python|#find_package(Python|' ${INSTALL_PREFIX}/share/dune/cmake/modules/DunePythonCommonMacros.cmake -# also patch out any dune_python_find_package() calls as this can crash on windows -sed -i.bak 's|dune_python_find_package(|#dune_python_find_package(|' ${INSTALL_PREFIX}/share/dune/cmake/modules/DunePythonCommonMacros.cmake -cat ${INSTALL_PREFIX}/share/dune/cmake/modules/DunePythonCommonMacros.cmake - -# ls $DEPSDIR -mkdir artefacts -cd artefacts -tar -zcf sme_deps_${OS_TARGET}.tgz $DEPSDIR/* +otool -L x diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..96b4c6d --- /dev/null +++ b/test.cpp @@ -0,0 +1,9 @@ +#include +#include +#include + +int main(){ + +std::vector v(6000000, 0.5); +return static_cast(std::reduce(std::execution::par_unseq, v.begin(), v.end(), 0.0)); +}