mikejm

mikejm

I have been able to add a number of packages to my testserver project with no issues. I would like to also add the H3 package here:

However, when I add that to my dependencies and run iex -S mix phx.server or mix deps.compile h3 I get:

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.19044.
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)


-- Configuring incomplete, errors occurred!
===> Hook for compile failed!

** (Mix) Could not compile dependency :h3, "escript.exe "c:/Users/Mike/.mix/elixir/1-14/rebar3" bare compile --paths h:/filePath/testserver/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile h3", update it with "mix deps.update h3" or clean it with "mix deps.clean h3"

I have confirmed c:/Users/Mike/.mix/elixir/1-14/rebar3 does in fact exist.

Is there any obvious way to fix this? Or to figure out more precisely the issue? The package is from 2020, so maybe there is just something inside it I might need to update?

Thanks for any help.

Showing Posts 1 to 7

dimitarvp

dimitarvp

If the library hasn’t been updated in a while and it has native dependencies + even deprecation warnings then your chances are not good I am afraid.

What does h3 do? A quick glance didn’t give me an answer. It is an option to replace it I’d reckon.

mikejm

mikejm OP

@dimitarvp H3 is Uber’s hexagonal global spatialization library which they made open source:

https://www.uber.com/en-CA/blog/h3/

https://github.com/uber/h3

People have adapted it into many languages. There are easily available working C# versions I have tested and it was formally released with JavaScript support. At some point soon I will need a working Elixir implementation.

If you think I might have to do it myself, any pointers for someone who knows virtually nothing about coding Elixir? :joy: Maybe I will have to pay someone to fix it? I dunno.

Edit: I just looked again and there is another version here: GitHub - helium/erlang-h3: Erlang binding for Uber's H3 spatial coordinate library · GitHub I will try to build that from the instructions there. Thanks.

dimitarvp

dimitarvp

Hope you make the alternative work.

Looking at Bindings | H3, I’d just choose one of the Rust libraries and then use rustler to bind to it. Should be a much smoother ride with less surprises.

As for paying people, sure. Maybe there will be takers for a C/C++ project managed by cmake but again, I’d put my chips on Rust if I were you.

dimitarvp

dimitarvp

Oh, only one of them is actually a direct translation without the underlying C/C++ dependency: GitHub - HydroniumLabs/h3o: Rust implementation of the H3 geospatial indexing system. · GitHub

Then I’d start there.

mikejm

mikejm OP

I find it absolutely hilarious (in a good way) that this forum is the complete 100% antithesis of StackOverflow. :joy::clinking_beer_mugs:

I am so used to just not asking programming questions of any kind and suffering in silence to figure things out because there is no point even asking anything on StackOverflow these days. GitHub discussion pages are usually dead. Rarely, if you can find a Discord server for a particular niche that can be good.

Anyway, thanks for being nice and helpful. Even small answers like, “It’s probably going to be a mess trying to fix that thing,” can save a person a lot of wasted time.

mikejm

mikejm OP

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.

dimitarvp

dimitarvp

It has been a very long time since I last dealt with C/C++ and CMake so I can’t help you, I am afraid. Even if I wanted to, it would take time, time that I don’t have much of.

I’d again advise you to just go with the Rust dependency, it’s much easier and transparent to work with Rust + the Elixir<=>Rust bridge called rustler.

I and others can help you with it, but if you really want help with the C/++ and CMake problems then I am not your guy. :zipper_mouth_face:

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews