macOS + LLVM 6.0.1: Python unittests failed

I’ve built LLVM 6.0.1 from sources and added it to build/config.cmake file:

grep USE_LLVM build/config.cmake set(USE_LLVM /tvm-issue-1/llvm/bin/llvm-config)

TVM builds fine but tests from this section:

are failing:

test_autotvm_executor.test_local_measure_async ... ERROR
test_autotvm_executor.test_timeout ... ERROR
test task and tuner without measurement ... ERROR
test_autotvm_measure.test_check_correctness ... ERROR
test_autotvm_xgboost_model.test_fit ... ERROR

Exception ignored in: <bound method XGBoostCostModel.__del__ of <tvm.autotvm.tuner.xgboost_cost_model.XGBoostCostModel object at 0x1078d7320>>
Traceback (most recent call last):
  File "/tvm-issue-1/tvm/python/tvm/autotvm/tuner/xgboost_cost_model.py", line 305, in __del__
    self._close_pool()
  File "/tvm-issue-1/tvm/python/tvm/autotvm/tuner/xgboost_cost_model.py", line 148, in _close_pool
    if self.pool:
AttributeError: 'XGBoostCostModel' object has no attribute 'pool'
test_autotvm_xgboost_model.test_tuner ... ERROR

test_codegen_llvm.test_llvm_lookup_intrin ... Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"), function init, file /tvm-issue-1/llvm-6.0.1.src/lib/IR/Instructions.cpp, line 299.
./tests/scripts/task_python_unittest.sh: line 7: 19576 Abort trap: 6           TVM_FFI=ctypes python -m nose -v tests/python/unittest

Step by step instructions I’ve used and environment details can be found here:

test_autotvm_executor.test_local_measure_async ... ERROR
test_autotvm_executor.test_timeout ... ERROR
test task and tuner without measurement ... ERROR
test_autotvm_measure.test_check_correctness ... ERROR
test_autotvm_xgboost_model.test_fit ... ERROR

Fixed by installing Python dependencies:

The only test that is still failing is test_codegen_llvm.test_llvm_lookup_intrin.
Assertion failed here:

The workaround is to build LLVM with Release (enable NDEBUG macro).