Hey @dimitarvp. I tried building the erlang h3 version here by downloading it, going in the folder and running “make” but I got the same error as the Hex H3 (likely the same build then):
./rebar3 compile
===> Verifying dependencies...
-- Building for: Visual Studio 17 2022
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.38.33130.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at cmake/ASan.cmake:8 (set_property):
set_property could not find CACHE variable CMAKE_BUILD_TYPE. Perhaps it
has not yet been created.
Call Stack (most recent call first):
CMakeLists.txt:10 (include)
-- Found Erlang: c:/Program Files/Erlang OTP/erts-13.1.2/include
-- Found Git: C:/Program Files/Git/mingw64/bin/git.exe (found version "2.38.1.windows.1")
fatal: not a git repository (or any of the parent directories): .git
CMake Warning at cmake/FindH3.cmake:21 (message):
could not get erlang-h3 tag, falling back on hard-coded version
Call Stack (most recent call first):
CMakeLists.txt:92 (find_package)
-- Using upstream h3 tag v3.6.4 based on local tag v3.6.4
-- Configuring incomplete, errors occurred!
===> Hook for compile failed!
make: *** [Makefile:6: compile] Error 1
In terms of the problems, to break this down, it seems only #2 is a true error but to review it all:
1) Deprecation warning
This comes from the line in CMakeLists.txt:
cmake_minimum_required(VERSION 3.3)
Presumably, I can just increase this to 3.5. I did that and the deprecation warning resolved without new issues.
2) Asan.cmake Error
This file Asan.cmake contains only the following, with line 8 being the last one that is throwing the error that seems to be breaking the build:
# This file provides a custom build type, `CMAKE_BUILD_TYPE_ASAN`
set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fsanitize=address -fno-omit-frame-pointer -fno-common" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_ASAN "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsanitize=address -fno-omit-frame-pointer -fno-common" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_ASAN "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -fsanitize=address" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_ASAN "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} -fsanitize=address" CACHE STRING "" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "ASan")
There is obviously a problem with this set_property
line. Any idea what it is or how to fix it?
CMakeLists.txt line 10 is the last here:
cmake_minimum_required(VERSION 3.5)
project(ErlangH3 C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_STANDARD 99)
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake)
include(ASan)
3) .git Message
I am not sure if this is meaningful? I am not sure what it is trying to say.
4) Could not get erlang-h3 tag
This derives from FindH3.cmake:
# Use this repo's semantic version as the tag to fetch from up
# upstream uber/h3
find_package(Git REQUIRED)
execute_process(COMMAND
${GIT_EXECUTABLE} describe --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUCCESS
OUTPUT_VARIABLE ERLANG_H3_TAG
)
if(NOT GIT_SUCCESS EQUAL "0")
message(WARNING "could not get erlang-h3 tag, falling back on hard-coded version")
set(ERLANG_H3_TAG "v3.6.4")
endif()
string(REGEX REPLACE "\n$" "" ERLANG_H3_TAG "${ERLANG_H3_TAG}")
string(REGEX MATCH "^v[0-9]+\.[0-9]+\.[0-9]+" UPSTREAM_H3_GIT_TAG "${ERLANG_H3_TAG}")
message(STATUS "Using upstream h3 tag ${UPSTREAM_H3_GIT_TAG} based on local tag ${ERLANG_H3_TAG}")
Again is there any likely significance to this?
Any thoughts or ideas on how to solve #2 in particular which is what seems to be breaking it? Thanks.