build tvm failed with  libbacktrace.a :   ld: symbol(s) not found for architecture x86_64

[ 14%] Linking CXX shared library libtvm_runtime.dylib
ld: warning: ignoring file libbacktrace/lib/libbacktrace.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
"_backtrace_create_state", referenced from:
__GLOBAL__sub_I_logging.cc in logging.cc.o
"_backtrace_full", referenced from:
tvm::runtime::Backtrace() in logging.cc.o
"_backtrace_syminfo", referenced from:
tvm::runtime::(anonymous namespace)::BacktraceFullCallback(void*, unsigned long, char const*, int, char const*) in logging.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libtvm_runtime.dylib] Error 1
make[1]: *** [CMakeFiles/tvm_runtime.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 99%] Built target tvm_objs
make: *** [all] Error 2

on mac os 11.2.1

cc @tkonolige

https://github.com/apache/tvm/pull/7706 provide a temp patch to disable libbacktrace on MacOS and fallback to the old behavior

Are you on an M1 Mac?

@comaniac did you have problem on linux?

@comaniac did you have problem on linux?

Turns out that I didn't use set(CMAKE_BUILD_TYPE Debug)  in my config.cmake. I supposed I was building on debug mode by default until today...I guess this could be a common issue for most people as we didn't specify this in the default config.cmake.

not happend on linux .> @comaniac did you have problem on linux?

on mac os 11.2.1 mbp pro 2018 > Are you on an M1 Mac?

Are you on an M1 Mac?

no .
on my 2018 mpb pro

@xiebaiyuan would you like to try #7706?

@xiebaiyuan would you like to try #7706?

ok i will try it later .
1 day later maybe.

Thanks a lot! I just built #7706 locally on my 2019 mbp and it seems to work :-)

yeah it work well on 7706~

@xiebaiyuan Can you provide more info on this so I can debug? Which compiler and linker are you using? And could you provide the full build log?

Thanks @xiebaiyuan , yes it would be great to learn further about what happened in your case.

cmake ..
=====>
-- The C compiler identification is AppleClang <IP_ADDRESS>00032
-- The CXX compiler identification is AppleClang <IP_ADDRESS>00032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build with RPC support...
-- Build with Graph runtime support...
-- Build with profiler...
-- VTA build with VTA_HW_PATH=/Users/xiebaiyuan/workspace/tvm/3rdparty/vta-hw
-- Build VTA runtime with target: sim
-- Build with contrib.random
-- Build with contrib.sort
-- Build with contrib.hybriddump
-- Git found: /usr/local/bin/git
-- Found TVM_GIT_COMMIT_HASH=c976a07fa24efe91e8ac4f9d088a14442bb8d161
-- Performing Test SUPPORT_CXX14
-- Performing Test SUPPORT_CXX14 - Success
-- Building with libbacktrace...
-- Building with TVM Map...
-- Build with thread support...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/xiebaiyuan/workspace/tvm/build

➜  build git:(c976a07fa) ✗
make -j16
=======>
Scanning dependencies of target project_libbacktrace
Scanning dependencies of target tvm_objs
[  0%] Creating directories for 'project_libbacktrace'
[  1%] No download step for 'project_libbacktrace'
[  1%] No checkout step for 'project_libbacktrace'
[  1%] No update step for 'project_libbacktrace'
[  1%] No patch step for 'project_libbacktrace'
[  1%] Performing configure step for 'project_libbacktrace'
checking build system type... x86_64-apple-darwin20.3.0
checking host system type... x86_64-apple-darwin20.3.0
checking target system type... x86_64-apple-darwin20.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... [  1%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/analyzer.cc.o
[  2%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/bound_deducer.cc.o
[  2%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/const_int_bound.cc.o
[  2%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/domain_touched.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/canonical_simplify.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/detect_linear_equation.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/int_set.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/iter_affine_map.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/int_constraints.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/ir_mutator_with_analyzer.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/modular_set.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/rewrite_simplify.cc.o
[  5%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/solve_linear_equation.cc.o
[  5%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/solve_linear_inequality.cc.o
[  5%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/auto_schedule.cc.o
yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/local/bin/ggrep
checking for egrep... /usr/local/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
/Users/xiebaiyuan/workspace/tvm/3rdparty/libbacktrace/missing: Unknown --is-lightweight' option Try /Users/xiebaiyuan/workspace/tvm/3rdparty/libbacktrace/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking for dwz... no
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for fgrep... /usr/local/bin/ggrep -F
checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/local/bin/nm -B output from gcc object... ok
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking unwind.h usability... yes
checking unwind.h presence... yes
checking for unwind.h... yes
checking for _Unwind_Backtrace... yes
checking for -funwind-tables option... yes
checking for -frandom-seed=string option... yes
checking whether gcc supports -W... yes
checking whether gcc supports -Wall... yes
checking whether gcc supports -Wwrite-strings... yes
checking whether gcc supports -Wstrict-prototypes... yes
checking whether gcc supports -Wmissing-prototypes... yes
checking whether gcc supports -Wold-style-definition... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether gcc supports -Wcast-qual... yes
checking for _Unwind_GetIPInfo... yes
checking __sync extensions... yes
checking __atomic extensions... yes
checking output filetype... macho
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking link.h usability... no
checking link.h presence... [  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/compute_dag.cc.o
no
checking for link.h... no
checking mach-o/dyld.h usability... yes
checking mach-o/dyld.h presence... yes
checking for mach-o/dyld.h... yes
checking sys/ldr.h usability... no
checking sys/ldr.h presence... no
checking for sys/ldr.h... no
checking for fcntl... [  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/cost_model.cc.o
yes
checking whether strnlen is declared... [  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/feature.cc.o
yes
checking whether getpagesize is declared... yes
checking for lstat... yes
checking for readlink... [  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/loop_state.cc.o
[  7%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/measure.cc.o
yes
checking for getexecname... no
checking for KERN_PROC... no
checking for KERN_PROG_ARGS... no
checking for clock_gettime... yes
checking whether -pthread is supported... yes
checking whether -gdwarf-5 is supported... [  7%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/measure_record.cc.o
yes
checking for compress in -lz... yes
checking whether --compress-debug-sections is supported... no
checking for objcopy... objcopy
checking for readelf... readelf
checking whether objcopy supports debuglink... yes
checking for dsymutil... dsymutil
checking for nm... /usr/local/bin/nm -B
checking for xz... xz
checking for comm... comm
checking for lzma_auto_decoder in -llzma... yes
checking whether tests can run... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
[  7%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/search_policy/empty_policy.cc.o
[  7%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/search_policy/search_policy.cc.o
[  8%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/search_policy/sketch_policy.cc.o
config.status: creating Makefile
config.status: creating backtrace-supported.h
config.status: creating install-debuginfo-for-buildid.sh
config.status: creating config.h
config.status: executing libtool commands
config.status: executing default commands
[  9%] Performing build step for 'project_libbacktrace'
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=atomic.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/atomic.c  -fno-common -DPIC -o atomic.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=dwarf.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/dwarf.c  -fno-common -DPIC -o dwarf.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=fileline.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/fileline.c  -fno-common -DPIC -o fileline.o
[  9%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/search_policy/sketch_policy_rules.cc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=posix.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/posix.c  -fno-common -DPIC -o posix.o
[  9%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/search_policy/utils.cc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=print.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/print.c  -fno-common -DPIC -o print.o
[ 10%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/search_task.cc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=sort.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/sort.c  -fno-common -DPIC -o sort.o
[ 10%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/transform_step.cc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/state.c  -fno-common -DPIC -o state.o
[ 10%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/utils.cc.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=backtrace.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/backtrace.c  -fno-common -DPIC -o backtrace.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=simple.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/simple.c  -fno-common -DPIC -o simple.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=macho.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/macho.c  -fno-common -DPIC -o macho.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=mmapio.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/mmapio.c  -fno-common -DPIC -o mmapio.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I.   Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/tvm_objs.dir/src/tir/transforms/inject_copy_intrin.cc.o] Interrupt: 2
make[2]: *** [CMakeFiles/tvm_objs.dir/src/tir/transforms/inject_double_buffer.cc.o] Interrupt: 2
make[2]: *** [CMakeFiles/tvm_objs.dir/src/tir/transforms/hoist_if_then_else.cc.o] Interrupt: 2
make[2]: *** [CMakeFiles/tvm_objs.dir/src/te/schedule/schedule_lang.cc.o] Interrupt: 2
make[1]: *** [CMakeFiles/tvm_objs.dir/all] Error 2
make: *** [all] Interrupt: 2

config.cmake:
➜  build git:(c976a07fa) ✗ cat config.cmake
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
#--------------------------------------------------------------------
Template custom cmake configuration for compiling

This file is used to override the build options in build.
If you want to change the configuration, please use the following
steps. Assume you are on the root directory. First copy the this
file so that any local changes will be ignored by git

$ mkdir build
$ cp cmake/config.cmake build

Next modify the according entries, and then compile by

$ cd build
$ cmake ..

Then build in parallel with 8 threads

$ make -j8
#--------------------------------------------------------------------
#---------------------------------------------
Backend runtimes.
#---------------------------------------------
Whether enable CUDA during compile,

Possible values:
- ON: enable CUDA with cmake's auto search
- OFF: disable CUDA
- /path/to/cuda: use specific path to cuda toolkit
set(USE_CUDA OFF)
Whether enable ROCM runtime

Possible values:
- ON: enable ROCM with cmake's auto search
- OFF: disable ROCM
- /path/to/rocm: use specific path to rocm
set(USE_ROCM OFF)
Whether enable SDAccel runtime
set(USE_SDACCEL OFF)
Whether enable Intel FPGA SDK for OpenCL (AOCL) runtime
set(USE_AOCL OFF)
Whether enable OpenCL runtime

Possible values:
- ON: enable OpenCL with cmake's auto search
- OFF: disable OpenCL
- /path/to/opencl-sdk: use specific path to opencl-sdk
set(USE_OPENCL OFF)
Whether enable Metal runtime
set(USE_METAL OFF)
Whether enable Vulkan runtime

Possible values:
- ON: enable Vulkan with cmake's auto search
- OFF: disable vulkan
- /path/to/vulkan-sdk: use specific path to vulkan-sdk
set(USE_VULKAN OFF)
Whether enable OpenGL runtime
set(USE_OPENGL OFF)
Whether enable MicroTVM runtime
set(USE_MICRO OFF)
Whether enable RPC runtime
set(USE_RPC ON)
Whether to build the C++ RPC server binary
set(USE_CPP_RPC OFF)
Whether embed stackvm into the runtime
set(USE_STACKVM_RUNTIME OFF)
Whether enable tiny embedded graph runtime.
set(USE_GRAPH_RUNTIME ON)
Whether enable tiny graph runtime with CUDA Graph
set(USE_GRAPH_RUNTIME_CUDA_GRAPH OFF)
Whether to enable the profiler for the graph runtime and vm
set(USE_PROFILER ON)
Whether enable uTVM standalone runtime
set(USE_MICRO_STANDALONE_RUNTIME OFF)
Whether build with LLVM support
Requires LLVM version >= 4.0

Possible values:
- ON: enable llvm with cmake's find search
- OFF: disable llvm, note this will disable CPU codegen
which is needed for most cases
- /path/to/llvm-config: enable specific LLVM when multiple llvm-dev is available.
set(USE_LLVM OFF)
#---------------------------------------------
Contrib libraries
#---------------------------------------------
Whether to build with BYODT software emulated posit custom datatype

Possible values:
- ON: enable BYODT posit, requires setting UNIVERSAL_PATH
- OFF: disable BYODT posit

set(UNIVERSAL_PATH /path/to/stillwater-universal) for ON
set(USE_BYODT_POSIT OFF)
Whether use BLAS, choices: openblas, atlas, apple
set(USE_BLAS none)
Whether to use MKL
Possible values:
- ON: Enable MKL
- /path/to/mkl: mkl root path
- OFF: Disable MKL
set(USE_MKL /opt/intel/mkl) for UNIX
set(USE_MKL ../IntelSWTools/compilers_and_libraries_2018/windows/mkl) for WIN32
set(USE_MKL ) if using pip install mkl
set(USE_MKL OFF)
Whether use MKLDNN library, choices: ON, OFF, path to mkldnn library
set(USE_MKLDNN OFF)
Whether use OpenMP thread pool, choices: gnu, intel
Note: "gnu" uses gomp library, "intel" uses iomp5 library
set(USE_OPENMP none)
Whether use contrib.random in runtime
set(USE_RANDOM ON)
Whether use NNPack
set(USE_NNPACK OFF)
Possible values:
- ON: enable tflite with cmake's find search
- OFF: disable tflite
- /path/to/libtensorflow-lite.a: use specific path to tensorflow lite library
set(USE_TFLITE OFF)
/path/to/tensorflow: tensorflow root path when use tflite library
set(USE_TENSORFLOW_PATH none)
Required for full builds with TFLite. Not needed for runtime with TFLite.
/path/to/flatbuffers: flatbuffers root path when using tflite library
set(USE_FLATBUFFERS_PATH none)
Possible values:
- OFF: disable tflite support for edgetpu
- /path/to/edgetpu: use specific path to edgetpu library
set(USE_EDGETPU OFF)
Possible values:
- ON: enable cuDNN with cmake's auto search in CUDA directory
- OFF: disable cuDNN
- /path/to/cudnn: use specific path to cuDNN path
set(USE_CUDNN OFF)
Whether use cuBLAS
set(USE_CUBLAS OFF)
Whether use MIOpen
set(USE_MIOPEN OFF)
Whether use MPS
set(USE_MPS OFF)
Whether use rocBlas
set(USE_ROCBLAS OFF)
Whether use contrib sort
set(USE_SORT ON)
Whether use MKL-DNN (DNNL) codegen
set(USE_DNNL_CODEGEN OFF)
Whether to use Arm Compute Library (ACL) codegen
We provide 2 separate flags since we cannot build the ACL runtime on x86.
This is useful for cases where you want to cross-compile a relay graph
on x86 then run on AArch.

An example of how to use this can be found here: docs/deploy/arm_compute_lib.rst.

USE_ARM_COMPUTE_LIB - Support for compiling a relay graph offloading supported
operators to Arm Compute Library. OFF/ON
USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME - Run Arm Compute Library annotated functions via the ACL
runtime. OFF/ON/"path/to/ACL"
set(USE_ARM_COMPUTE_LIB OFF)
set(USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME OFF)
Whether to build with Arm Ethos-N support
Possible values:
- OFF: disable Arm Ethos-N support
- path/to/arm-ethos-N-stack: use a specific version of the
Ethos-N driver stack
set(USE_ETHOSN OFF)
If USE_ETHOSN is enabled, use ETHOSN_HW (ON) if Ethos-N hardware is available on this machine
otherwise use ETHOSN_HW (OFF) to use the software test infrastructure
set(USE_ETHOSN_HW OFF)
Whether to build with TensorRT codegen or runtime
Examples are available here: docs/deploy/tensorrt.rst.

USE_TENSORRT_CODEGEN - Support for compiling a relay graph where supported operators are
offloaded to TensorRT. OFF/ON
USE_TENSORRT_RUNTIME - Support for running TensorRT compiled modules, requires presense of
TensorRT library. OFF/ON/"path/to/TensorRT"
set(USE_TENSORRT_CODEGEN OFF)
set(USE_TENSORRT_RUNTIME OFF)
Whether use VITIS-AI codegen
set(USE_VITIS_AI OFF)
Build Verilator codegen and runtime
set(USE_VERILATOR OFF)
Build ANTLR parser for Relay text format
Possible values:
- ON: enable ANTLR by searching default locations (cmake find_program for antlr4 and /usr/local for jar)
- OFF: disable ANTLR
- /path/to/antlr-*-complete.jar: path to specific ANTLR jar file
set(USE_ANTLR OFF)
Whether use Relay debug mode
set(USE_RELAY_DEBUG OFF)
Whether to build fast VTA simulator driver
set(USE_VTA_FSIM OFF)
Whether to build cycle-accurate VTA simulator driver
set(USE_VTA_TSIM OFF)
Whether to build VTA FPGA driver (device side only)
set(USE_VTA_FPGA OFF)
Whether use Thrust
set(USE_THRUST OFF)
Whether to build the TensorFlow TVMDSOOp module
set(USE_TF_TVMDSOOP OFF)
Whether to use STL's std::unordered_map or TVM's POD compatible Map
set(USE_FALLBACK_STL_MAP OFF)
Whether to use hexagon device
set(USE_HEXAGON_DEVICE OFF)
set(USE_HEXAGON_SDK /path/to/sdk)
Whether to use ONNX codegen
set(USE_TARGET_ONNX OFF)
Whether enable BNNS runtime
set(USE_BNNS OFF)
Whether to use libbacktrace
Libbacktrace provides line and column information on stack traces from errors.
It is only supported on linux and macOS.
Possible values:
- AUTO: auto set according to system information and feasibility
- ON: enable libbacktrace
- OFF: disable libbacktrace
set(USE_LIBBACKTRACE AUTO)

return to this commit:
c976a07fa

@tkonolige @tqchen   ↑ is the message, and my config.cmake

@xiebaiyuan Thanks for the extra information. It looks like the compiler is different between libbacktrace and the rest of the cmake project. Can you try this branch: https://github.com/tkonolige/incubator-tvm/tree/fix_libbacktrace_macos and see if that fixes it? (Please make sure you set USE_LIBBACKTRACE=On).

@tkonolige
https://github.com/tkonolige/incubator-tvm/tree/fix_libbacktrace_macos
USE_LIBBACKTRACE=On
➜  build git:(fix_libbacktrace_macos) cmake ..
-- The C compiler identification is AppleClang <IP_ADDRESS>00032
-- The CXX compiler identification is AppleClang <IP_ADDRESS>00032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build with RPC support...
-- Build with Graph runtime support...
-- Build with profiler...
-- VTA build with VTA_HW_PATH=/Users/xiebaiyuan/Downloads/incubator-tvm/3rdparty/vta-hw
-- Build VTA runtime with target: sim
-- Build with contrib.random
-- Build with contrib.sort
-- Build with contrib.hybriddump
-- Git found: /usr/local/bin/git
-- Found TVM_GIT_COMMIT_HASH=42213e3b74cfc58107c806a372b29a4cd38e8438
-- Performing Test SUPPORT_CXX14
-- Performing Test SUPPORT_CXX14 - Success
-- Building with libbacktrace...
-- Building with TVM Map...
-- Build with thread support...
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/xiebaiyuan/Downloads/incubator-tvm/build
========>
build git:(fix_libbacktrace_macos) make -j4
Scanning dependencies of target project_libbacktrace
Scanning dependencies of target tvm_objs
[  0%] Creating directories for 'project_libbacktrace'
[  1%] No download step for 'project_libbacktrace'
[  1%] No update step for 'project_libbacktrace'
[  1%] No checkout step for 'project_libbacktrace'
[  1%] No patch step for 'project_libbacktrace'
[  1%] Performing configure step for 'project_libbacktrace'
checking build system type... x86_64-apple-darwin20.3.0
checking host system type... x86_64-apple-darwin20.3.0
checking target system type... x86_64-apple-darwin20.3.0
checking for gcc... /Library/Developer/CommandLineTools/usr/bin/cc
checking whether the C compiler works... no
configure: error: in /Users/xiebaiyuan/Downloads/incubator-tvm/build/libbacktrace': configure: error: C compiler cannot create executables See config.log' for more details
make[2]: *** [libbacktrace/src/project_libbacktrace-stamp/project_libbacktrace-configure] Error 77
make[1]: *** [CMakeFiles/project_libbacktrace.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  1%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/canonical_simplify.cc.o
[  1%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/const_int_bound.cc.o
[  1%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/analyzer.cc.o
[  2%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/bound_deducer.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/detect_linear_equation.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/domain_touched.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/int_constraints.cc.o
[  3%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/int_set.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/ir_mutator_with_analyzer.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/iter_affine_map.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/modular_set.cc.o
[  4%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/rewrite_simplify.cc.o
[  5%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/solve_linear_equation.cc.o
[  5%] Building CXX object CMakeFiles/tvm_objs.dir/src/arith/solve_linear_inequality.cc.o
[  5%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/auto_schedule.cc.o
[  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/compute_dag.cc.o
[  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/cost_model.cc.o
[  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/feature.cc.o
[  6%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/loop_state.cc.o
[  7%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/measure.cc.o
[  7%] Building CXX object CMakeFiles/tvm_objs.dir/src/auto_scheduler/measure_record.cc.o

config.log
====>
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by package-unused configure version-unused, which was
generated by GNU Autoconf 2.69.  Invocation command line was
$ /Users/xiebaiyuan/Downloads/incubator-tvm/cmake/libs/../../3rdparty/libbacktrace/configure --prefix=/Users/xiebaiyuan/Downloads/incubator-tvm/build/libbacktrace --with-pic CPP=/Library/Developer/CommandLineTools/usr/bin/cc -E CC=/Library/Developer/CommandLineTools/usr/bin/cc AR= RANLIB= NM=/Library/Developer/CommandLineTools/usr/bin/nm STRIP=/Library/Developer/CommandLineTools/usr/bin/strip CFLAGS=-O2 -Wall -fPIC  CPPFLAGS=-O2 -Wall -fPIC  LDFLAGS=
---------
Platform.
---------
hostname = xiebaiyuandeMBP
uname -m = x86_64
uname -r = 20.3.0
uname -s = Darwin
uname -v = Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64
/usr/bin/uname -p = i386
/bin/uname -X     = unknown
/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64
Kernel configured for up to 12 processors.
6 processors are physically available.
12 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3 4 5 6 7 8 9 10 11
Primary memory available: 32.00 gigabytes
Default processor set: 740 tasks, 3346 threads, 12 processors
Load average: 2.17, Mach factor: 9.82
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown
PATH: /usr/local/opt/openjdk@8/bin
PATH: /opt/anaconda3/bin
PATH: /opt/anaconda3/condabin
PATH: /Users/xiebaiyuan/android-ndk-r16b
PATH: /Users/xiebaiyuan/.oh-my-zsh/custom/plugins/git-open
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /Library/Apple/usr/bin
PATH: /Library/Frameworks/Mono.framework/Versions/Current/Commands
PATH: /Users/xiebaiyuan/baidu/searchbox/mgit
PATH: /Users/xiebaiyuan/Library/Android/sdk/tools
PATH: /Users/xiebaiyuan/Library/Android/sdk/platform-tools
PATH: /Users/xiebaiyuan/android-ndk-r16b
PATH: /Library/Java/JavaVirtualMachines/openjdk-8.jdk/Contents/Home
-----------
Core tests.
-----------
configure:2379: checking build system type
configure:2393: result: x86_64-apple-darwin20.3.0
configure:2413: checking host system type
configure:2426: result: x86_64-apple-darwin20.3.0
configure:2446: checking target system type
configure:2459: result: x86_64-apple-darwin20.3.0
configure:2539: checking for gcc
configure:2566: result: /Library/Developer/CommandLineTools/usr/bin/cc
configure:2795: checking for C compiler version
configure:2804: /Library/Developer/CommandLineTools/usr/bin/cc --version >&5
Apple clang version 12.0.0 (clang-1<IP_ADDRESS>)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
configure:2815: $? = 0
configure:2804: /Library/Developer/CommandLineTools/usr/bin/cc -v >&5
Apple clang version 12.0.0 (clang-1<IP_ADDRESS>)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
configure:2815: $? = 0
configure:2804: /Library/Developer/CommandLineTools/usr/bin/cc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:2815: $? = 1
configure:2804: /Library/Developer/CommandLineTools/usr/bin/cc -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:2815: $? = 1
configure:2835: checking whether the C compiler works
configure:2857: /Library/Developer/CommandLineTools/usr/bin/cc -O2 -Wall -fPIC  -O2 -Wall -fPIC   conftest.c  >&5
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:2861: $? = 1
configure:2899: result: no
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME "package-unused"
| #define PACKAGE_TARNAME "libbacktrace"
| #define PACKAGE_VERSION "version-unused"
| #define PACKAGE_STRING "package-unused version-unused"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| / end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2904: error: in /Users/xiebaiyuan/Downloads/incubator-tvm/build/libbacktrace': configure:2906: error: C compiler cannot create executables See config.log' for more details
----------------
Cache variables.
----------------
ac_cv_build=x86_64-apple-darwin20.3.0
ac_cv_env_CC_set=set
ac_cv_env_CC_value=/Library/Developer/CommandLineTools/usr/bin/cc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-O2 -Wall -fPIC '
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-O2 -Wall -fPIC '
ac_cv_env_CPP_set=set
ac_cv_env_CPP_value='/Library/Developer/CommandLineTools/usr/bin/cc -E'
ac_cv_env_DSYMUTIL_set=
ac_cv_env_DSYMUTIL_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_NM_set=set
ac_cv_env_NM_value=/Library/Developer/CommandLineTools/usr/bin/nm
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-apple-darwin20.3.0
ac_cv_prog_ac_ct_CC=/Library/Developer/CommandLineTools/usr/bin/cc
ac_cv_target=x86_64-apple-darwin20.3.0
-----------------
Output variables.
 Could you try again?
The issue was that cmake resolves /usr/bin/cc to a specific compiler + flags on macOS, but does not give you any way to access these flags.

I recommend to test cmake / make runtime for arm cross compilation toolchain.
cmake .. \
-DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \
-DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++

make VERBOSE=1 runtime

make sure libbacktrace is built using arm gcc (not x86_64)

I've pushed a change on my branch. Could you try again?
The issue was that cmake resolves /usr/bin/cc to a specific compiler + flags on macOS, but does not give you any way to access these flags.

@tqchen  it works fine for me with libbackstrace on

@xiebaiyuan could you post the full build log?

@apivovarov Supporting cross compilation with libbacktrace is going to be a little more involved. I'm not sure I'll have time to work on it.

@tkonolige
build git:(fix_libbacktrace_macos) make -j1
[  2%] Built target project_libbacktrace
[ 13%] Built target tvm_runtime_objs
[ 13%] Linking CXX shared library libtvm_runtime.dylib
ld: warning: ignoring file libbacktrace/lib/libbacktrace.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
"_backtrace_create_state", referenced from:
__GLOBAL__sub_I_logging.cc in logging.cc.o
"_backtrace_full", referenced from:
tvm::runtime::Backtrace() in logging.cc.o
"_backtrace_syminfo", referenced from:
tvm::runtime::(anonymous namespace)::BacktraceFullCallback(void*, unsigned long, char const*, int, char const*) in logging.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libtvm_runtime.dylib] Error 1
make[1]: *** [CMakeFiles/tvm_runtime.dir/all] Error 2
make: *** [all] Error 2

➜  build git:(fix_libbacktrace_macos) cat config.cmake
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
#--------------------------------------------------------------------
Template custom cmake configuration for compiling

This file is used to override the build options in build.
If you want to change the configuration, please use the following
steps. Assume you are on the root directory. First copy the this
file so that any local changes will be ignored by git

$ mkdir build
$ cp cmake/config.cmake build

Next modify the according entries, and then compile by

$ cd build
$ cmake ..

Then build in parallel with 8 threads

$ make -j8
#--------------------------------------------------------------------
#---------------------------------------------
Backend runtimes.
#---------------------------------------------
Whether enable CUDA during compile,

Possible values:
- ON: enable CUDA with cmake's auto search
- OFF: disable CUDA
- /path/to/cuda: use specific path to cuda toolkit
set(USE_CUDA OFF)
Whether enable ROCM runtime

Possible values:
- ON: enable ROCM with cmake's auto search
- OFF: disable ROCM
- /path/to/rocm: use specific path to rocm
set(USE_ROCM OFF)
Whether enable SDAccel runtime
set(USE_SDACCEL OFF)
Whether enable Intel FPGA SDK for OpenCL (AOCL) runtime
set(USE_AOCL OFF)
Whether enable OpenCL runtime

Possible values:
- ON: enable OpenCL with cmake's auto search
- OFF: disable OpenCL
- /path/to/opencl-sdk: use specific path to opencl-sdk
set(USE_OPENCL OFF)
Whether enable Metal runtime
set(USE_METAL OFF)
Whether enable Vulkan runtime

Possible values:
- ON: enable Vulkan with cmake's auto search
- OFF: disable vulkan
- /path/to/vulkan-sdk: use specific path to vulkan-sdk
set(USE_VULKAN OFF)
Whether enable OpenGL runtime
set(USE_OPENGL OFF)
Whether enable MicroTVM runtime
set(USE_MICRO OFF)
Whether enable RPC runtime
set(USE_RPC ON)
Whether to build the C++ RPC server binary
set(USE_CPP_RPC OFF)
Whether embed stackvm into the runtime
set(USE_STACKVM_RUNTIME OFF)
Whether enable tiny embedded graph runtime.
set(USE_GRAPH_RUNTIME ON)
Whether enable tiny graph runtime with CUDA Graph
set(USE_GRAPH_RUNTIME_CUDA_GRAPH OFF)
Whether to enable the profiler for the graph runtime and vm
set(USE_PROFILER ON)
Whether enable uTVM standalone runtime
set(USE_MICRO_STANDALONE_RUNTIME OFF)
Whether build with LLVM support
Requires LLVM version >= 4.0

Possible values:
- ON: enable llvm with cmake's find search
- OFF: disable llvm, note this will disable CPU codegen
which is needed for most cases
- /path/to/llvm-config: enable specific LLVM when multiple llvm-dev is available.
set(USE_LLVM OFF)
#---------------------------------------------
Contrib libraries
#---------------------------------------------
Whether to build with BYODT software emulated posit custom datatype

Possible values:
- ON: enable BYODT posit, requires setting UNIVERSAL_PATH
- OFF: disable BYODT posit

set(UNIVERSAL_PATH /path/to/stillwater-universal) for ON
set(USE_BYODT_POSIT OFF)
Whether use BLAS, choices: openblas, atlas, apple
set(USE_BLAS none)
Whether to use MKL
Possible values:
- ON: Enable MKL
- /path/to/mkl: mkl root path
- OFF: Disable MKL
set(USE_MKL /opt/intel/mkl) for UNIX
set(USE_MKL ../IntelSWTools/compilers_and_libraries_2018/windows/mkl) for WIN32
set(USE_MKL ) if using pip install mkl
set(USE_MKL OFF)
Whether use MKLDNN library, choices: ON, OFF, path to mkldnn library
set(USE_MKLDNN OFF)
Whether use OpenMP thread pool, choices: gnu, intel
Note: "gnu" uses gomp library, "intel" uses iomp5 library
set(USE_OPENMP none)
Whether use contrib.random in runtime
set(USE_RANDOM ON)
Whether use NNPack
set(USE_NNPACK OFF)
Possible values:
- ON: enable tflite with cmake's find search
- OFF: disable tflite
- /path/to/libtensorflow-lite.a: use specific path to tensorflow lite library
set(USE_TFLITE OFF)
/path/to/tensorflow: tensorflow root path when use tflite library
set(USE_TENSORFLOW_PATH none)
Required for full builds with TFLite. Not needed for runtime with TFLite.
/path/to/flatbuffers: flatbuffers root path when using tflite library
set(USE_FLATBUFFERS_PATH none)
Possible values:
- OFF: disable tflite support for edgetpu
- /path/to/edgetpu: use specific path to edgetpu library
set(USE_EDGETPU OFF)
Possible values:
- ON: enable cuDNN with cmake's auto search in CUDA directory
- OFF: disable cuDNN
- /path/to/cudnn: use specific path to cuDNN path
set(USE_CUDNN OFF)
Whether use cuBLAS
set(USE_CUBLAS OFF)
Whether use MIOpen
set(USE_MIOPEN OFF)
Whether use MPS
set(USE_MPS OFF)
Whether use rocBlas
set(USE_ROCBLAS OFF)
Whether use contrib sort
set(USE_SORT ON)
Whether use MKL-DNN (DNNL) codegen
set(USE_DNNL_CODEGEN OFF)
Whether to use Arm Compute Library (ACL) codegen
We provide 2 separate flags since we cannot build the ACL runtime on x86.
This is useful for cases where you want to cross-compile a relay graph
on x86 then run on AArch.

An example of how to use this can be found here: docs/deploy/arm_compute_lib.rst.

USE_ARM_COMPUTE_LIB - Support for compiling a relay graph offloading supported
operators to Arm Compute Library. OFF/ON
USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME - Run Arm Compute Library annotated functions via the ACL
runtime. OFF/ON/"path/to/ACL"
set(USE_ARM_COMPUTE_LIB OFF)
set(USE_ARM_COMPUTE_LIB_GRAPH_RUNTIME OFF)
Whether to build with Arm Ethos-N support
Possible values:
- OFF: disable Arm Ethos-N support
- path/to/arm-ethos-N-stack: use a specific version of the
Ethos-N driver stack
set(USE_ETHOSN OFF)
If USE_ETHOSN is enabled, use ETHOSN_HW (ON) if Ethos-N hardware is available on this machine
otherwise use ETHOSN_HW (OFF) to use the software test infrastructure
set(USE_ETHOSN_HW OFF)
Whether to build with TensorRT codegen or runtime
Examples are available here: docs/deploy/tensorrt.rst.

USE_TENSORRT_CODEGEN - Support for compiling a relay graph where supported operators are
offloaded to TensorRT. OFF/ON
USE_TENSORRT_RUNTIME - Support for running TensorRT compiled modules, requires presense of
TensorRT library. OFF/ON/"path/to/TensorRT"
set(USE_TENSORRT_CODEGEN OFF)
set(USE_TENSORRT_RUNTIME OFF)
Whether use VITIS-AI codegen
set(USE_VITIS_AI OFF)
Build Verilator codegen and runtime
set(USE_VERILATOR OFF)
Build ANTLR parser for Relay text format
Possible values:
- ON: enable ANTLR by searching default locations (cmake find_program for antlr4 and /usr/local for jar)
- OFF: disable ANTLR
- /path/to/antlr-*-complete.jar: path to specific ANTLR jar file
set(USE_ANTLR OFF)
Whether use Relay debug mode
set(USE_RELAY_DEBUG OFF)
Whether to build fast VTA simulator driver
set(USE_VTA_FSIM OFF)
Whether to build cycle-accurate VTA simulator driver
set(USE_VTA_TSIM OFF)
Whether to build VTA FPGA driver (device side only)
set(USE_VTA_FPGA OFF)
Whether use Thrust
set(USE_THRUST OFF)
Whether to build the TensorFlow TVMDSOOp module
set(USE_TF_TVMDSOOP OFF)
Whether to use STL's std::unordered_map or TVM's POD compatible Map
set(USE_FALLBACK_STL_MAP OFF)
Whether to use hexagon device
set(USE_HEXAGON_DEVICE OFF)
set(USE_HEXAGON_SDK /path/to/sdk)
Whether to use ONNX codegen
set(USE_TARGET_ONNX OFF)
Whether enable BNNS runtime
set(USE_BNNS OFF)
Whether to use libbacktrace
Libbacktrace provides line and column information on stack traces from errors.
It is only supported on linux and macOS.
Possible values:
- AUTO: auto set according to system information and feasibility
- ON: enable libbacktrace
- OFF: disable libbacktrace
set(USE_LIBBACKTRACE ON)

only change USE_LIBBACKTRACE === > ON

@xiebaiyuan Can you do a make clean && make? Can also provide your CMakeCache.txt?
I'm having trouble reproducing this. I wonder if its related to which compiler you are using.

➜  build git:(c976a07fa) ✗ make clean && make
[  0%] Creating directories for 'project_libbacktrace'
[  1%] No download step for 'project_libbacktrace'
[  1%] No checkout step for 'project_libbacktrace'
[  1%] No update step for 'project_libbacktrace'
[  1%] No patch step for 'project_libbacktrace'
[  1%] Performing configure step for 'project_libbacktrace'
checking build system type... x86_64-apple-darwin20.3.0
checking host system type... x86_64-apple-darwin20.3.0
checking target system type... x86_64-apple-darwin20.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/local/bin/ggrep
checking for egrep... /usr/local/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
/Users/xiebaiyuan/workspace/tvm/3rdparty/libbacktrace/missing: Unknown --is-lightweight' option Try /Users/xiebaiyuan/workspace/tvm/3rdparty/libbacktrace/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking for dwz... no
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for fgrep... /usr/local/bin/ggrep -F
checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface...  -I/Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -c /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/state.c  -fno-common -DPIC -o state.o
libtool: link: rm -fr  .libs/libbacktrace.a .libs/libbacktrace.la .libs/libbacktrace.lai
libtool: link: ar cru .libs/libbacktrace.a  atomic.o dwarf.o fileline.o posix.o print.o sort.o state.o backtrace.o simple.o macho.o mmapio.o mmap.o
ar: u' modifier ignored since D' is the default (see `U')
libtool: link: ranlib .libs/libbacktrace.a
libtool: link: ( cd ".libs" && rm -f "libbacktrace.la" && ln -s "../libbacktrace.la" "libbacktrace.la" )
[  2%] Performing install step for 'project_libbacktrace'
/usr/local/bin/gmkdir -p '/Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib'
/bin/sh ./libtool   --mode=install /usr/local/bin/ginstall -c   libbacktrace.la '/Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib'
libtool: install: /usr/local/bin/ginstall -c .libs/libbacktrace.lai /Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib/libbacktrace.la
libtool: install: /usr/local/bin/ginstall -c .libs/libbacktrace.a /Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib/libbacktrace.a
libtool: install: chmod 644 /Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib/libbacktrace.a
libtool: install: ranlib /Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib/libbacktrace.a
Libraries have been installed in:
/Users/xiebaiyuan/workspace/tvm/build/libbacktrace/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:

add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
/usr/local/bin/gmkdir -p '/Users/xiebaiyuan/workspace/tvm/build/libbacktrace/include'
/usr/local/bin/ginstall -c -m 644 /Users/xiebaiyuan/workspace/tvm/cmake/modules/../../3rdparty/libbacktrace/backtrace.h backtrace-supported.h '/Users/xiebaiyuan/workspace/tvm/build/libbacktrace/include'
[  2%] Completed 'project_libbacktrace'
[  2%] Built target project_libbacktrace
Scanning dependencies of target tvm_runtime_objs
[  2%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/builtin_fp16.cc.o
[  3%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/c_runtime_api.cc.o
[  3%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/container.cc.o
[  3%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/cpu_device_api.cc.o
[  4%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/dso_library.cc.o
[  4%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/file_utils.cc.o
[  4%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/library_module.cc.o
[  4%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/logging.cc.o
[  5%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/metadata_module.cc.o
[  5%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/module.cc.o
[  5%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/ndarray.cc.o
[  5%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/object.cc.o
[  6%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/profiling.cc.o
[  6%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/registry.cc.o
[  6%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/system_library.cc.o
[  7%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/thread_pool.cc.o
[  7%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/threading_backend.cc.o
[  7%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/bytecode.cc.o
[  7%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/executable.cc.o
[  8%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/memory_manager.cc.o
[  8%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/vm.cc.o
[  8%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/workspace_pool.cc.o
[  8%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_channel.cc.o
[  9%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_device_api.cc.o
[  9%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_endpoint.cc.o
[  9%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_event_impl.cc.o
[ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_local_session.cc.o
[ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_module.cc.o
[ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_pipe_impl.cc.o
[ 10%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_server_env.cc.o
[ 11%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_session.cc.o
[ 11%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/rpc/rpc_socket_impl.cc.o
[ 11%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph/graph_runtime.cc.o
[ 11%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph/graph_runtime_factory.cc.o
[ 12%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/graph/debug/graph_runtime_debug.cc.o
[ 12%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/vm/profiler/vm.cc.o
[ 12%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/random/random.cc.o
[ 13%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/contrib/sort/sort.cc.o
[ 13%] Built target tvm_runtime_objs
[ 13%] Linking CXX shared library libtvm_runtime.dylib
ld: warning: ignoring file libbacktrace/lib/libbacktrace.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
"_backtrace_create_state", referenced from:
__GLOBAL__sub_I_logging.cc in logging.cc.o
"_backtrace_full", referenced from:
tvm::runtime::Backtrace() in logging.cc.o
"_backtrace_syminfo", referenced from:
tvm::runtime::(anonymous namespace)::BacktraceFullCallback(void*, unsigned long, char const*, int, char const*) in logging.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libtvm_runtime.dylib] Error 1
make[1]: *** [CMakeFiles/tvm_runtime.dir/all] Error 2
make: *** [all] Error 2

➜  build git:(c976a07fa) ✗ cat CMakeCache.txt
This is the CMakeCache file.
For build in directory: /Users/xiebaiyuan/workspace/tvm/build
It was generated by CMake: /usr/local/Cellar/cmake/3.19.1/bin/cmake
You can edit this file to change values found and used by cmake.
If you do not want to change any of the values, simply exit the editor.
If you do want to change a value, simply edit, save, and exit the editor.
The syntax for the file is as follows:
KEY:TYPE=VALUE
KEY is the name of a variable in the cache.
TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
VALUE is the current value for the KEY.
########################
EXTERNAL cache entries
########################
//Path to a program.
CMAKE_ADDR2LINE:FILEPATH=/usr/local/bin/addr2line
//Path to a program.
CMAKE_AR:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ar
//Choose the type of build, options are: None Debug Release RelWithDebInfo
// MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//CXX compiler
CMAKE_CXX_COMPILER:STRING=/Library/Developer/CommandLineTools/usr/bin/c++
//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the CXX compiler during DEBUG builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
//Flags used by the CXX compiler during MINSIZEREL builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the CXX compiler during RELEASE builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//C compiler
CMAKE_C_COMPILER:STRING=/Library/Developer/CommandLineTools/usr/bin/cc
//Flags used by the C compiler during all build types.
CMAKE_C_FLAGS:STRING=
//Flags used by the C compiler during DEBUG builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g
//Flags used by the C compiler during MINSIZEREL builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the C compiler during RELEASE builds.
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the C compiler during RELWITHDEBINFO builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Path to a program.
CMAKE_DLLTOOL:FILEPATH=/usr/local/bin/dlltool
//Executable file format
CMAKE_EXECUTABLE_FORMAT:STRING=MACHO
//Flags used by the linker during all build types.
CMAKE_EXE_LINKER_FLAGS:STRING=
//Flags used by the linker during DEBUG builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during MINSIZEREL builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during RELEASE builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during RELWITHDEBINFO builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
//Path to a program.
CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Path to a program.
CMAKE_LINKER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ld
//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/local/bin/gmake
//Flags used by the linker during the creation of modules during
// all build types.
CMAKE_MODULE_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of modules during
// DEBUG builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of modules during
// MINSIZEREL builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of modules during
// RELEASE builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of modules during
// RELWITHDEBINFO builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_NM:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/local/bin/objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/objdump
//Build architectures for OSX
CMAKE_OSX_ARCHITECTURES:STRING=
//Minimum OS X version to target for deployment (at runtime); newer
// APIs weak linked. Set to empty string for default value.
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=
//The product will be built against the headers and libraries located
// inside the indicated SDK.
CMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=tvm
//Path to a program.
CMAKE_RANLIB:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ranlib
//Path to a program.
CMAKE_READELF:FILEPATH=/usr/local/bin/readelf
//Flags used by the linker during the creation of shared libraries
// during all build types.
CMAKE_SHARED_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of shared libraries
// during DEBUG builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of shared libraries
// during MINSIZEREL builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELEASE builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of shared libraries
// during RELWITHDEBINFO builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Flags used by the linker during the creation of static libraries
// during all build types.
CMAKE_STATIC_LINKER_FLAGS:STRING=
//Flags used by the linker during the creation of static libraries
// during DEBUG builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during the creation of static libraries
// during MINSIZEREL builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during the creation of static libraries
// during RELEASE builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during the creation of static libraries
// during RELWITHDEBINFO builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_STRIP:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/strip
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make.  This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//Path to COMPILER-RT
COMPILER_RT_PATH:STRING=3rdparty/compiler-rt
//Path to DLPACK
DLPACK_PATH:STRING=3rdparty/dlpack/include
//Path to DMLC
DMLC_PATH:STRING=3rdparty/dmlc-core/include
//Git command line client
GIT_EXECUTABLE:FILEPATH=/usr/local/bin/git
//Path to a file.
GTEST_INCLUDE_DIR:PATH=GTEST_INCLUDE_DIR-NOTFOUND
//Path to a library.
GTEST_LIB:FILEPATH=GTEST_LIB-NOTFOUND
//Compile with -fvisibility=hidden.
HIDE_PRIVATE_SYMBOLS:STRING=OFF
//Defaults the index datatype to int64
INDEX_DEFAULT_I64:STRING=ON
//Install compiler infrastructure
INSTALL_DEV:STRING=OFF
//Path to PicoJSON
PICOJSON_PATH:STRING=3rdparty/picojson
//Path to a program.
PYTHON:FILEPATH=/opt/anaconda3/bin/python
//Path to RANG
RANG_PATH:STRING=3rdparty/rang/include
//The path to rocm
ROCM_PATH:STRING=/opt/rocm
//Build with coreml support
USE_COREML:STRING=OFF
//Build with MT
USE_MSVC_MT:STRING=OFF
//Build with RTTI
USE_RTTI:STRING=ON
//Build with Rust based compiler extensions, STATIC, DYNAMIC, or
// OFF
USE_RUST_EXT:STRING=OFF
//Build with thread support
USE_THREADS:STRING=ON
//Value Computed by CMake
tvm_BINARY_DIR:STATIC=/Users/xiebaiyuan/workspace/tvm/build
//Dependencies for the target
tvm_LIB_DEPENDS:STATIC=general;libbacktrace;
//Value Computed by CMake
tvm_SOURCE_DIR:STATIC=/Users/xiebaiyuan/workspace/tvm
//Dependencies for the target
tvm_runtime_LIB_DEPENDS:STATIC=general;libbacktrace;
########################
INTERNAL cache entries
########################
//Result of TRY_COMPILE
BUILD_FOR_ANDROID:INTERNAL=FALSE
//Result of TRY_COMPILE
BUILD_FOR_HEXAGON:INTERNAL=FALSE
//ADVANCED property for variable: CMAKE_ADDR2LINE
CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/Users/xiebaiyuan/workspace/tvm/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=19
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=1
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/ctest
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_DLLTOOL
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
//Path to cache edit program executable.
CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.19.1/bin/ccmake
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Test CMAKE_HAVE_LIBC_PTHREAD
CMAKE_HAVE_LIBC_PTHREAD:INTERNAL=1
//Have include pthread.h
CMAKE_HAVE_PTHREAD_H:INTERNAL=1
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/Users/xiebaiyuan/workspace/tvm
//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL
CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_READELF
CMAKE_READELF-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.19.1/share/cmake
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//Details about finding Threads
FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()]
//ADVANCED property for variable: GIT_EXECUTABLE
GIT_EXECUTABLE-ADVANCED:INTERNAL=1
//Test SUPPORT_CXX14
SUPPORT_CXX14:INTERNAL=1

Close due to inactive status, https://github.com/apache/tvm/pull/7917 might have fixed the setup, if not, we can als use the option to disable the libbacktrace

I fixed the same issue by the soution offered by this comment.
Basically, remove the binutils package, make clean and then rerun make:
brew uninstall binutils
make clean
make -j8


Feature request: Improved testing

Add more testing scenarios. Currently working on client creation testing

https://github.com/ephemeraHQ/message-kit/pull/108

@fabriguespe will this fix skills.ts not loading during runtime tests? MessageKit currently looks for a js file in dist/

Changed to vitest and worked.
One remaining issue
Error: Failed to load native binding
 ❯ Object.<anonymous> ../../node_modules/@xmtp/node-bindings/dist/index.js:359:11
 ❯ Module._compile node:internal/modules/cjs/loader:1358:14
 ❯ Object.Module._extensions..js node:internal/modules/cjs/loader:1[41](https://github.com/ephemeraHQ/message-kit/actions/runs/11774666506/job/32793645096?pr=108#step:6:42)6:10
 ❯ Module.load node:internal/modules/cjs/loader:1208:32
 ❯ Function.Module._load node:internal/modules/cjs/loader:1024:12
 ❯ cjsLoader node:internal/modules/esm/translators:348:17
 ❯ ModuleWrap.<anonymous> node:internal/modules/esm/translators:297:7
 ❯ ModuleJob.run node:internal/modules/esm/module_job:222:25
 ❯ ModuleLoader.import node:internal/modules/esm/loader:316:24
 ❯ VitestExecutor.interopedImport ../../node_modules/vitest/node_modules/vite-node/dist/client.mjs:[42](https://github.com/ephemeraHQ/message-kit/actions/runs/11774666506/job/32793645096?pr=108#step:6:43)1:28

Fixed https://github.com/ephemeraHQ/message-kit/pull/123
added:
warp-ubuntu-latest-x64-16x


Change type of private_cidr to list

Current type of var.private_cidr is a string. If I have multiple private subnets I'd like var.private_cidr to be a list

hey @antonbabenko would you mind taking a look at this PR?  it would be also useful to me; i'd be willing to co-maintain this repo if you'd like.

lgtm

@hakamadare you should be able to maintain it now. Thanks!


keep correct Level for pkg deps of scm deps

This is a fix for https://github.com/rebar/rebar3/issues/674
The issue was that all the "collected" package deps, whether from parsing rebar.config at the top level or parsing the rebar.config of a git dep would end up being considered at level 0. This patch stores the actual Level with the package deps so the lock file is correct.

Would be good to have a test for it but right now it doesn't seem like anything is ready to be reused rapidly. I can take a look soon-ish, or we can just track it for later.
+1 otherwise.

Hm, yea, I mean, I found just the current tests passing as a pretty good indication it worked -- I had broke them at first when fixing this -- but if we don't have a test that mixes scm and pkg deps like this that would be good to have. I don't think the current dep generation code makes that simple to do :(


PyPi description is messed up.

If you do a search for xgboost, you get a big one ugly mess where you should get  short description:
$ pip search xgboost
pandas_ml     - pandas, scikit-learn and xgboost integration
xgboost       - XGBoost Python Package ======================  |PyPI version| |PyPI downloads|  Installation ------------  We are on `PyPI
                <https://pypi.python.org/pypi/xgboost>`__ now. For stable version, please install using pip:  -  ``pip install xgboost`` -  Note
                for windows users: this pip installation may not work on some    windows environment, and it may cause unexpected errors. pip
                installation on windows is currently disabled for further    invesigation, please install from github.  For up-to-date version,
                please install from github.  -  To make the python module, type ``./build.sh`` in the root directory    of project -  Make sure
                you have    `setuptools <https://pypi.python.org/pypi/setuptools>`__ -  Install with ``python setup.py install`` from this
                directory. -  For windows users, please use the Visual Studio project file under    `windows folder <../windows/>`__. See also
                the `installation    tutorial <https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13043/run-xgboost-
                from-windows-and-python>`__    from Kaggle Otto Forum.  Examples --------  -  Refer also to the walk through example in `demo
                folder <../demo/guide-python>`__ -  See also the `example scripts <../demo/kaggle-higgs>`__ for Kaggle    Higgs Challenge,
                including `speedtest    script <../demo/kaggle-higgs/speedtest.py>`__ on this dataset.  Note ----  -  If you want to build
                xgboost on Mac OS X with multiprocessing support    where clang in XCode by default doesn't support, please install gcc    4.9 or
                higher using `homebrew <http://brew.sh/>`__    ``brew tap homebrew/versions; brew install gcc49`` -  If you want to run XGBoost
                process in parallel using the fork backend    for joblib/multiprocessing, you must build XGBoost without support    for OpenMP by
                ``make no_omp=1``. Otherwise, use the forkserver (in    Python 3.4) or spawn backend. See the    `sklearn\_parallel.py <../demo
                /guide-python/sklearn_parallel.py>`__    demo.  .. |PyPI version| image:: https://badge.fury.io/py/xgboost.svg    :target:
                http://badge.fury.io/py/xgboost .. |PyPI downloads| image:: https://img.shields.io/pypi/dm/xgboost.svg    :target:
                https://pypi.python.org/pypi/xgboost/

if you go to the web interace to PyPi , you get the same mess.
This has persisted for a number of releases, It would be good to clean that up.

It is the historical problem because I used the original README.rst but PyPI doesn't follow the paging format. I will prepare for a cleaner PyPI.

It also looks like you are getting the long description where the short description should be...
But I'm sure you'll figure it out :-)

Nice finding! I will update the PyPI (as well as the latest refactor-ed code) later. Thanks.

I just did a PR for this:


A11y manual testing for Ergonomic Assessment Request form

Link to form in staging: https://forms-staging.cdssandbox.xyz/id/77
Dev accessibility Test Scope

[ ] Entire pages and templates(designs)
[ ] Page content and Widgets

A basic testing routine

[ ] Run an Automated check (using Axe DevTools or Wave)
[ ] Screen Reader Resources (voiceOver, Narrator)

###Keyboard Accessibility

[ ] Enabling Keyboard Access (On Mac | Windows)
[ ] Test tab focusability and tab order
[ ] Check keyboard functionality
[ ] Check Visual Focus Indicator
[ ] Test Keyboard Functionality with Screen Reader On
[ ] Test effective Focus Management (Form Validation)

Test for Touch Device Accessibility ( if applicable)

[ ] Touch Functionality
[ ] Touch Target Size
[ ] Touch Functionality with Screen Reader On

Common tests

[ ] Test link text quality
[ ] Test Alt text quality
[ ] Test if Form Labels and Instructions are clear
[ ] Test if the form validation works or not
[ ] Test If the labels are correctly written and placed or not.
[ ] Test If the audio/video content is properly audible/visible or not.
[ ] Test If the colour contrast ratio is maintained or not with a Colour Contrast Analyser (CCA).
[ ] Test If the short keys are provided for the menu then you need to check if all of those are working fine.
[ ] Test if the navigation between tabs is an easy task.
[ ] Test If the heading is unique and conveying the meaning & structure or not.
[ ] Test If the link text is written with content description instead of creating ambiguity.
[ ] Test If the instructions are clearly given or not.
[ ] Test If the content is clear, concise and understandable or not.

Finally

[ ] Test If a page has followed all the principles and guidelines above.
[ ] Create or update the related task with ATR card in the New Issues column
[ ] Tag issues with a11y tag, and provide a triage rating

Triage methodology

@falila @craigzour Hey team! Can you please add your planning poker estimates with ZenHub


[WIP] Fully connected, higher order grad

Description
Add backward for fully connected backward.
This is not strictly correct if X or W depend on each other. After discussing with the community this a valid assumption that we can make (that the weights don't depend on the inputs). In this case the second order gradient is 0.
https://github.com/apache/incubator-mxnet/issues/10002
https://github.com/apache/incubator-mxnet/issues/14619
Resolves #14991
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.

[x] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
[ ] Changes are complete (i.e. I finished coding on this PR)
[x] All changes have test coverage:
Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
[x] Code is well-documented:
For user-facing API changes, API doc string has been updated.
For new C++ functions in header files, their functionalities and arguments are documented.
For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
[x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@mxnet-label-bot add [Autograd, Backend, pr-work-in-progress, pr-awaiting-review]

Can you add unit test?

@larroy Thanks for the contribution. Could you please add unit test and change the title if it's ready for review?

Why are there changes in submodules?

Ignore submodules, I guess I was out of date. I will sync them on the next commits.

@apeforest @kshitij12345

@mxnet-label-bot remove [pr-work-in-progress]

Working on fixing this, added the differential calculus developments for review and reference:

@apeforest @kshitij12345 is this good to merge?

Don't merge yet. I need to validate the result I have some doubts now.

@larroy Could you please paste your PyTorch script (and result) here for comparison purpose?

@kshitij12345 We initially thought the second order gradient for FullyConnected (which is a simple linear transformation in MXNet) is constant zeros because X and W are usually independant tensors. Is this correct? Please suggest. Thanks.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Description"""

__author__ = 'Pedro Larroy'
__version__ = '0.1'

import os
import sys
import subprocess

def main():
    import torch
    import torch.autograd as ag
    model = torch.nn.Sequential(
        torch.nn.Linear(3, 1))
    params = [x for x in model.parameters()]
    params[0].data = torch.FloatTensor([[1,2,3]])
    #x = torch.rand(5, 3)
    x = torch.FloatTensor([[0.2131, 0.5449, 0.9910],
       [0.1600, 0.1665, 0.1387],
       [0.6242, 0.0409, 0.0663],
       [0.6590, 0.9822, 0.3108],
       [0.8566, 0.3848, 0.8385]])
    x.requires_grad_(True)
    y=torch.sum(model(x))

    #w = torch.FloatTensor([1,2,3])
    #w.requires_grad_(True)
    #with torch.no_grad():
    #    model[0].weight.copy_(w)
    w=list(model.parameters())[0]
    b=list(model.parameters())[1]
    print(f"x: {x}")
    print(f"w: {w}")
    print(f"b: {b}")
    w_grad = ag.grad(y, w, create_graph=True, retain_graph=True)[0]
    w_grad_grad = ag.grad(torch.sum(w_grad), w, allow_unused=True)
    print(f"w_grad_grad {w_grad_grad}")

    params = [p for p in model.parameters()]
    params_grad = ag.grad(y, params, create_graph=True, retain_graph=True)
    print(f"params_grad {params_grad}")

    reduced_params_grad = torch.sum(torch.stack([torch.sum(p) for p in params_grad]))
    print(reduced_params_grad)
    # ? need scalar input
    params_grad_grad = ag.grad(reduced_params_grad, params, allow_unused=True)
    print(f"params_grad_grad {params_grad_grad}")
    return 0

    params_grad_flat = torch.cat([x.view(-1) for x in params_grad]).unsqueeze(0).requires_grad_(True)
    params_grad_flat_norm2 = params_grad_flat @ params_grad_flat.t()
    params_grad_grad = ag.grad(params_grad_flat_norm2, params, allow_unused=True)
    #params_grad_grad = ag.grad(params_grad_flat_norm2, params)
    w_grad = ag.grad(y, w, create_graph=True, retain_graph=True)[0].squeeze(0)
    xsum = torch.sum(x,0)
    print(f"torch.sum(x,0): {xsum}")
    print(f"w_grad: {w_grad}")
    w_grad_sum = torch.sum(w_grad, 0)
    print(f"sum(w_grad, 0) {w_grad_sum}")
    assert torch.all(torch.eq(w_grad, xsum))
    x_grad_w_grad = ag.grad(w_grad[1], x, grad_outputs=torch.FloatTensor([1,2,3]), allow_unused=True)[0]
    print(f"x_grad_w_grad: {x_grad_w_grad}")
    x_grad = ag.grad(y, x, create_graph=True, retain_graph=True)[0]
    print(f"x_grad: {x_grad}")
    x_grad_w_grad = ag.grad(x_grad[0], w, grad_outputs=torch.FloatTensor([1,2,1]), allow_unused=True)
    #x_grad_w_grad = ag.grad(x_grad[0][0], w, grad_outputs=torch.FloatTensor(1), allow_unused=True)
    print(f"x_grad_w_grad: {x_grad_w_grad}")
    w_grad_grad = ag.grad(torch.sum(w), w, allow_unused=True)
    print(f"w_grad_grad {w_grad_grad}")
    x_grad_grad = ag.grad(torch.sum(x), )

    return 0

if __name__ == '__main__':
    sys.exit(main())

second order gradient in torch seems to be zeros as well. Need to verify the same in this PR.

I think this is good to go @apeforest

Even I believe it should be zeros of X and W.
This is the computation that leads me to believe it.

@larroy Please update your PR description.

@apeforest @kshitij12345 @sxjscience thanks for the review. Is this good to go?

@larroy You may also refer to Line-7 of Algorithm 1 in https://arxiv.org/pdf/1704.00028.pdf . When implementing the gradient penalty, we should compute something like:

Thanks a lot for your help @sxjscience. I will refine this PR in light of your feedback.

Adding development for review:

The development is only for flattened inputs.

Let me know if you have questions about notation or the development or see some mistakes.

From my side is just missing the bias term, please help review the approach.

@sxjscience @kshitij12345 please help review.

Thanks for the comments about the whitespace. Is the calculation correct? Let's focus on the important stuff first, then do a round of beautification once we know the implementation is correct and the testing strategy is sound.

Thanks for the review. Is the approach correct in your opinion?


[Sub project] Response disappears if to update user message in chat history

EPAM AI DIAL chat version
0.6.0
What happened?

Open sub-project -> Open DIAL
Click on +circle or + New conversation
Send several messages
Edit message in the middle -> Save & Submit
Note that previous response disappears -> bug

Note: the same issue of to update in main DIAL app the chat created from sub-project. Also this is reproduced for delete message case
Confidential information

[X] I confirm that do not share any confidential information

Verified on sub-project-staging successfully


Key duplication in configMaps causing errors on some deployment tools

In these two files I found that there is a key duplication in the configMap:
https://github.com/datastax/pulsar-helm-chart/blob/master/helm-chart-sources/pulsar/templates/broker-deployment/broker-configmap.yaml#L222
https://github.com/datastax/pulsar-helm-chart/blob/master/helm-chart-sources/pulsar/templates/zookeeper/zookeeper-configmap.yaml#L40
For example, if I run helm template . and view zookeeper's configMap output:
apiVersion: v1
kind: ConfigMap
metadata:
  name: "pulsar-broker"
  namespace: nuri-test
  labels:
    app: pulsar
    chart: pulsar-2.0.9
    release: RELEASE-NAME
    heritage: Helm
    component: broker
    cluster: pulsar
data:
  zookeeperServers:
    pulsar-zookeeper-ca:2181
  configurationStoreServers:
    pulsar-zookeeper-ca:2181
  clusterName: pulsar
  allowAutoTopicCreationType: "non-partitioned"
  PULSAR_EXTRA_OPTS: -Dpulsar.log.root.level=info
  PULSAR_GC: -XX:+UseG1GC
  PULSAR_LOG_LEVEL: info
  PULSAR_LOG_ROOT_LEVEL: info
  PULSAR_MEM: -Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled
    -Dio.netty.recycler.linkCapacity=1024 -XX:+ExitOnOutOfMemoryError
  backlogQuotaDefaultRetentionPolicy: producer_exception
  brokerDeduplicationEnabled: "false"
  exposeConsumerLevelMetricsInPrometheus: "false"
  exposeTopicLevelMetricsInPrometheus: "true"
  # Workaround for double-quoted values in old values files
  PULSAR_MEM: -Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.linkCapacity=1024 -XX:+ExitOnOutOfMemoryError
  PULSAR_GC: -XX:+UseG1GC

The last 2 (PULSAR_MEM and PULSAR_GC) appear twice. This isn't a problem for Helm to handle.
However, for deployment automation tools such as kustomize and FluxCD this presents a problem as they depend on kyaml.
This is a known issue: https://github.com/kubernetes-sigs/kustomize/issues/3480
There's even the chance the error will eventually end up in Helm's newer versions.
I haven't noticed this duplication/workaround on apache's pulsar chart.
Would it be possible to remove the duplication or handle it in a way that will not produce double keys in the configMap?
There might be other instances of the duplication in other configMaps, I haven't gone through all of them.
Thank you.

@nuriel77 - thank you for this detailed issue. It should definitely be cleaned up. I should be able to fix this and deploy an updated chart early next week.

@nuriel77 - #107 resolves this issue. It is technically a breaking change for users that have old values, so we are not going to merge/release this fix until 3.0.0. We plan to release 3.0.0 in the first half of January.

@michaeljmarshall Hi! Thanks.
Do I understand correctly that these might be the types of values the workaround was trying to fix: https://github.com/datastax/pulsar-helm-chart/pull/107/files#diff-3be28e7b230396d61d2bc7bd74e5e00070fbfa2c507caa36269a18bfe502df52L37
If that is the case, did you consider trying the following approach that might just work for all cases:
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: "cm-pulsar-broker"
  labels:
    app: pulsar
data:
{{- range $key, $val := $.Values.broker.configData }}
  {{ $key }}: {{ $val | replace "\"" "" | quote }}
{{- end }}

Tested with the following values:
broker:
  configData:
    managedLedgerDefaultWriteQuorum: "2"
    zookeeperServers: "cm-pulsar-zookeeper-from-values-file:2181"
    PULSAR_MEM: "\"-Xms312m -Xmx312m -XX:MaxDirectMemorySize=200m -XX:+ExitOnOutOfMemoryError\""
    PULSAR_GC: "-XX:+UseG1GC"
    PULSAR_TEST: some test values

Result:
apiVersion: v1
kind: ConfigMap
metadata:
  name: "cm-pulsar-broker"
  labels:
    app: pulsar
data:
  PULSAR_GC: "-XX:+UseG1GC"
  PULSAR_MEM: "-Xms312m -Xmx312m -XX:MaxDirectMemorySize=200m -XX:+ExitOnOutOfMemoryError"
  PULSAR_TEST: "some test values"
  managedLedgerDefaultWriteQuorum: "2"
  zookeeperServers: "cm-pulsar-zookeeper-from-values-file:2181"

Do I understand correctly that these might be the types of values the workaround was trying to fix: https://github.com/datastax/pulsar-helm-chart/pull/107/files#diff-3be28e7b230396d61d2bc7bd74e5e00070fbfa2c507caa36269a18bfe502df52L37
(as I've notice those would result in getting wrapped by single quotes when using toYaml)

@nuriel77 - yes, those are exactly the the values the fix was working around. This looks like a good solution that to prevent breaking changes. Are you interested in creating a PR with this fix? If not, I should be able to contribute this fix tomorrow.

Are you interested in creating a PR with this fix?

Sure. I will be able to do it tomorrow morning (around European timezone) 👍

This was fixed by #110. Thanks for your contribution @nuriel77. I'll run a 2.0.11 release later today that will include this fix.


loads incorrect file

Calling await importModule("./MY_FILE.ts") loads<EMAIL_ADDRESS>instead of local file MY_FILE.ts. Native dynamic import works fine. How can i fix this? (Deno 1.29.4 on Arch linux)

Seeing this as well on Deno 1.29.1 on macOS.

Ups that was a dumb mistake and should be fixed now. There a a few other thing I want to do before releasing so for now you can import this URL: https://rawcdn.githack.com/ayoreis/import/commit/766677582408979ccb856eb94b8bc1b36f42c0fd

only works with force set to true for me

Weird could you share more about your setup?

app.js
import { importModule } from "https://raw.githubusercontent.com/ayoreis/import/main/mod.ts";

console.log(await importModule("./export.js", { force: true }));
// { default: "hello" }

console.log(await importModule("./export.js", { force: false }));
/*
error: Uncaught (in promise) TypeError: Module not found "https://raw.githubusercontent.com/ayoreis/import/main/export.js".
		return await import(moduleName)
		       ^
    at async importModule (https://raw.githubusercontent.com/ayoreis/import/main/mod.ts:182:10)
    at async file:///xxx/app.js:5:13
*/

export.js
export default "hello";


Question on usage

Hi there may I know if it is possible to give examples on basic ROS publisher and subscriber, that would able to communicate with the ROS Wiki basic python publisher and subscriber? I have found the code in example folder, is it possible to give it in README as well? So users may not need to go deep to the code for usage.
Also, I would like to ask about some details of usage.  For the code in example folder, there is List args passing into it.  I have investigated into it and found it is about ROS ip, hostname etc.  Can you please provide the example of input, as well as the format of the input in the documentation as well?
Thank you so much

The implementation is based off of rosnodejs. I can add in more documentation, but it really is quite similar to other ROS implementations, so it should be easy to pick up. The list of args passed into it is the same as you would have for any ROS node such as in C++. Feel free to create a pull request with anything you learn or find missing in the documentation. I'm happy to accept external contributions, since I don't have a ton of free time to work on this myself.

Ok I will take a look to that. Thank you so much for your information as I am actually new to ROS, that's help me a lot where to take reference to.  I lack experiences in ROS, and looking for some ROS Flutter communication library, so it is a bit difficult to understand the code.  However I really appreciate your work.
And I have notice one issue is that the dartgen message have pubspec.yaml conflicts with the library.  Is the dart gen yours as well?
Also I am not able to find these (sensor_msgs, rosgraph_msgs, geometry_msgs, actionlib_msgs) libraries in pub dev.  Are they published or not yet?
Thank you so much for your effort, and your time.

Glad to know there are people interested in flutter + ros. dartgen is also my package, but should not generate message with pubspec.yaml conflicts, make sure you are using the nullsafety branch of that repository if you are using the null-safe version of dartros. As far as the standard messages (sensor_msgs, rosgraph_msgs, geometry_msgs, actionlib_msgs), they are published to pub.dev, but are hidden from the results (unlisted). So you should be able to use them in your pubspec.yaml. Since they are just message definitions, they do not have much in the way of documentation, and really the focus should be on dartros for documentation / pub.dev results, so I opted to remove them from the results of pub.dev, let me know if you think I should do otherwise.


User is sent to the user home screen even if the close the app (if user is logged in)

whenever the user opens and closes the app the user should be checked if loggedin and sent to the right page

[x]  if user is loggedIn it is pointed to the right navigation which is userHome.
[x] if user is not loggedIn it is pointed to login register screen
[x] loggedIn user should not be able to navigate to login and register screens

@Rebal67 or @theblockstalk to finish this. See @HaseebUllahAbbasi existing PR first


auth

how to do basic auth with headless chrome?

thanks for answer

can we together find a way to solve this problem?

@ph1ex0n You could pass it through the URI:
http://user:password@domain/path

https://en.wikipedia.org/wiki/Basic_access_authentication#URL_encoding


Use nll_loss_backward decomposition for jvp transform

Before anyone asks: this is a pretty big hack. Ideally we would register the decomposition with PyTorch's forward-mode AD and since functorch leverages the PyTorch forward-mode AD implementation and rules for its jvp transform, then we would get them for free.
Since this was relatively easy to do and I want to do some initial testing for this approach, I added this hack, but in parallel we should make progress toward being able to use decompositions with the PyTorch forward-mode AD subsystem.


May I ask what tool you use to draw the model architecture figure in readme?

thanks a lot

That was done in lua with https://github.com/szagoruyko/iterm.torch
pytorch can visualize model graphs with tensorboard or with https://github.com/szagoruyko/pytorchviz


Add support for installation using PIP

TODO

Thank you for the contribution @KonstantinSchubert  I ran into a bit of an issue when uploading it to PyPi. Twine reports the following error:
Uploading distributions to https://pypi.python.org/pypi
TypeError: expected string or bytes-like object

Google does not produce any relevant results. Any suggestions @KonstantinSchubert ?

Figure it out. It did not like the wheel type distribution, but the following worked:
python setup.py sdist
twine upload dist/*

with the following PyPi config file ~/.pypirc:
[pypi]
username =
password =
repository:https://upload.pypi.org/legacy/

I will have to work some on the readme and also upload a new more stable version when I resolve #53 though :)


error JSON

HI Just logging in to the browser localhost:3000 gives the error
Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Just making sure, do you have all of the necessary env vars setup locally?