Skip to content

Commit

Permalink
Changes needed to compile on macOS (#761)
Browse files Browse the repository at this point in the history
Currently, tests/jlm/util/TestBijectiveMap.cpp causes a compilation
error on macOS

In file included from tests/jlm/util/TestBijectiveMap.cpp:9:
In file included from ./jlm/util/BijectiveMap.hpp:11:

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:680:17:
fatal error: no viable overloaded '='
        __ref() = __v.__get_value();
        ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:1779:47:
note: in instantiation of member
function 'std::__1::__hash_value_type<int, const
std::__1::basic_string<char> >::operator=' requested here
                __cache->__upcast()->__value_ = *__first;

---------

Co-authored-by: Nico Reissmann <[email protected]>
Co-authored-by: caleridas <[email protected]>
  • Loading branch information
3 people authored Feb 2, 2025
1 parent 0ea2f6c commit 8a11b3f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
2 changes: 0 additions & 2 deletions scripts/build-circt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ git -C ${CIRCT_GIT_DIR} checkout ${GIT_COMMIT}
cmake -G Ninja \
${CIRCT_GIT_DIR} \
-B ${CIRCT_BUILD_DIR} \
-DCMAKE_C_COMPILER=${LLVM_BINDIR}/clang \
-DCMAKE_CXX_COMPILER=${LLVM_BINDIR}/clang++ \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_DIR=${LLVM_CMAKEDIR} \
-DMLIR_DIR=${LLVM_CMAKEDIR}/../mlir \
Expand Down
5 changes: 2 additions & 3 deletions scripts/build-mlir.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -eu

GIT_COMMIT=3cdd282061b1f167fe4c3cb79f89b55666a4cff8
GIT_COMMIT=50fca6b034e909087c3bf24f4edb8ede59f8cd0b

# Get the absolute path to this script and set default build and install paths
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
Expand Down Expand Up @@ -74,10 +74,9 @@ git -C ${MLIR_GIT_DIR} checkout ${GIT_COMMIT}
cmake -G Ninja \
${MLIR_GIT_DIR} \
-B ${MLIR_BUILD_DIR} \
-DCMAKE_C_COMPILER=${LLVM_BINDIR}/clang \
-DCMAKE_CXX_COMPILER=${LLVM_BINDIR}/clang++ \
-DLLVM_DIR=${LLVM_CMAKEDIR} \
-DMLIR_DIR=${LLVM_CMAKEDIR}/../mlir \
-DCMAKE_PREFIX_PATH=${LLVM_CMAKEDIR}/../mlir \
-DCMAKE_INSTALL_PREFIX=${MLIR_INSTALL} \
-Wno-dev
ninja -C ${MLIR_BUILD_DIR}
Expand Down
8 changes: 6 additions & 2 deletions scripts/run-hls-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eu

# URL to the benchmark git repository and the commit to be used
GIT_REPOSITORY=https://github.com/phate/hls-test-suite.git
GIT_COMMIT=1365c30074f921733dec6c5fc949bd1cb64ae001
GIT_COMMIT=52adc8e870025d1c8d99e547d598b8cd6f9a1414

# Get the absolute path to this script and set default JLM paths
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
Expand All @@ -15,7 +15,11 @@ BENCHMARK_DIR=${JLM_ROOT_DIR}/usr/hls-test-suite
BENCHMARK_RUN_TARGET=run

# Execute benchmarks in parallel by default
PARALLEL_THREADS=`nproc`
if [[ "$OSTYPE" == "darwin"* ]]; then
PARALLEL_THREADS=`sysctl -n hw.ncpu`
else
PARALLEL_THREADS=`nproc`
fi

function commit()
{
Expand Down
21 changes: 19 additions & 2 deletions scripts/run-polybench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eu

# URL to the benchmark git repository and the commit to be used
GIT_REPOSITORY=https://github.com/phate/polybench-jlm.git
GIT_COMMIT=6d43f31b4790e180c9d3672bf77afba39414f8b2
GIT_COMMIT=2d784cc86cc8680e3a1fe6d79a54804e218fe1b9

# Get the absolute path to this script and set default JLM paths
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
Expand All @@ -14,6 +14,13 @@ JLM_BIN_DIR=${JLM_ROOT_DIR}/build
BENCHMARK_DIR=${JLM_ROOT_DIR}/usr/polybench
BENCHMARK_RUN_TARGET=check

# Execute benchmarks in parallel by default
if [[ "$OSTYPE" == "darwin"* ]]; then
PARALLEL_THREADS=`sysctl -n hw.ncpu`
else
PARALLEL_THREADS=`nproc`
fi

function commit()
{
echo ${GIT_COMMIT}
Expand All @@ -25,6 +32,8 @@ function usage()
echo ""
echo " --benchmark-path PATH The path where to place the polybench suite."
echo " [${BENCHMARK_DIR}]"
echo " --parallel #THREADS The number of threads to run in parallel."
echo " Default=[${PARALLEL_THREADS}]"
echo " --get-commit-hash Prints the commit hash used for the build."
echo " --help Prints this message and stops."
}
Expand All @@ -36,6 +45,11 @@ while [[ "$#" -ge 1 ]] ; do
BENCHMARK_DIR=$(readlink -m "$1")
shift
;;
--parallel)
shift
PARALLEL_THREADS=$1
shift
;;
--get-commit-hash)
commit >&2
exit 1
Expand All @@ -50,10 +64,13 @@ done
if [ ! -d "$BENCHMARK_DIR" ] ;
then
git clone ${GIT_REPOSITORY} ${BENCHMARK_DIR}
else
git -C ${BENCHMARK_DIR} fetch origin
fi

export PATH=${JLM_BIN_DIR}:${PATH}
cd ${BENCHMARK_DIR}
git checkout ${GIT_COMMIT}
make clean
make -j `nproc` -O ${BENCHMARK_RUN_TARGET}
echo "make -j ${PARALLEL_THREADS} -O ${BENCHMARK_RUN_TARGET}"
make -j ${PARALLEL_THREADS} -O ${BENCHMARK_RUN_TARGET}

0 comments on commit 8a11b3f

Please sign in to comment.