Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build telega server on m1 mac #384

Closed
xingmungwa opened this issue Nov 19, 2022 · 3 comments
Closed

Unable to build telega server on m1 mac #384

xingmungwa opened this issue Nov 19, 2022 · 3 comments

Comments

@xingmungwa
Copy link

xingmungwa commented Nov 19, 2022

Telega Setup

OS: Darwin Kernel Version 22.1.0
Emacs: GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-09-12
Telega: telega-20221105.1528

Installed through MELPA

Current Behavior

Unable to build the telega server. Getting the following logs

opt/homebrew/bin/gmake -C server clean

gmake[1]: Entering directory '/Users//.emacs.d/elpa/telega-20221105.1528/server'

gmake[1]: Leaving directory '/Users//.emacs.d/elpa/telega-20221105.1528/server'

/opt/homebrew/bin/gmake -C server install

gmake[1]: Entering directory '/Users//.emacs.d/elpa/telega-20221105.1528/server'

cc -I/opt/homebrew//include -Wall -g -pthread -o telega-server telega-server.c telega-dat.c telega-pngext.c -
L/opt/homebrew//lib -Wl,-rpath,/opt/homebrew//lib -ltdjson

ld: warning: ignoring file /opt/homebrew//lib/libtdjson.dylib, building for macOS-x86_64 but attempting to link with file built 
for macOS-arm64

Undefined symbols for architecture x86_64:

  "_td_json_client_create", referenced from:

      _main in telega-server-40786b.o

  "_td_json_client_destroy", referenced from:

      _main in telega-server-40786b.o

  "_td_json_client_execute", referenced from:

      _telega_set_verbosity in telega-server-40786b.o

      _telega_set_logfile in telega-server-40786b.o

  "_td_json_client_receive", referenced from:

      _tdlib_loop in telega-server-40786b.o

  "_td_json_client_send", referenced from:

      _main in telega-server-40786b.o

      _stdin_loop in telega-server-40786b.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

gmake[1]: *** [Makefile:35: telega-server] Error 1

gmake[1]: Leaving directory '/Users//.emacs.d/elpa/telega-20221105.1528/server'

gmake: *** [Makefile:12: server-reinstall] Error 2

Steps to Reproduce

  1. Try to start the telega server

I have already changed the make version on mac to that of arm architecture but it did not help.

@paskn
Copy link

paskn commented Jan 15, 2023

I have the same issue on M2. I see that the issue is marked as closed, though.

I have tried using docker: works fine. But I would prefer to the compiled version.

@xingmungwa , do you have any suggestions how to solve it?

@chuxubank
Copy link

@paskn Just use docker pull zevlg/telega-server:latest --platform linux/amd64 as mentioned in #404

@Cianidos
Copy link

Cianidos commented Dec 14, 2024

If you encounter this issue, check if your brew is set to arm64. It’s quite surprising, but after this problem, I discovered that I had been using the x86_64 brew as the default for an unknown period.

You can verify this by running the following command:

type -a brew

This will reveal that /usr/local/bin/brew is set to x86_64, while /opt/homebrew/bin/brew is set to arm64.

I’m not sure why this happened, but I resolved it by adding the correct brew path to the end of my ~/.zshrc file:

export PATH=“/opt/homebrew/bin:$PATH

Be cautious, as there’s a

(defcustom telega-server-libs-prefix “/usr/local”)

On m1 Mac with tdlib installed via brew, it should be manually set to /opt/homebrew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants