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

Can't finish ./build.sh on arm Mac #1555

Closed
sapoepsilon opened this issue Jun 2, 2021 · 4 comments
Closed

Can't finish ./build.sh on arm Mac #1555

sapoepsilon opened this issue Jun 2, 2021 · 4 comments

Comments

@sapoepsilon
Copy link

After installing all the dependencies and building OpenSSL for iOS, watchOS, tvOS, and macOS I am not able to build tdLIB. When I am running cd <path to TDLib sources>/example/ios ./build.sh

I am getting this error. Am I getting this error because I have an M1 MAC, or am I doing something incorrectly ?

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [benchmark/check_tls] Error 1
make[1]: *** [benchmark/CMakeFiles/check_tls.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 33%] Linking CXX executable rmdir
ld: warning: ignoring file ../../../third_party/openssl/macOS/lib/libcrypto.a, missing required architecture arm64 in file ../../../third_party/openssl/macOS/lib/libcrypto.a (1 slices)
[ 33%] Built target rmdir
[ 33%] Linking CXX static library libtdapi.a
[ 33%] Built target tdapi
make: *** [all] Error 2

@levlam
Copy link
Contributor

levlam commented Jun 2, 2021

Yes, this is a possible reason, but it should affect only building for macOS and not other operating systems.

To build TDLib for macOS you can use https://tdlib.github.io/td/build.html. This will generate some required source files and you would be able to use the same source tree to build TDLib for iOS, watchOS and tvOS. You will need to remove macOS from the list of platforms in build.sh and build-openssl.sh and should be able to continue building of the example/ios after that.

@sapoepsilon
Copy link
Author

sapoepsilon commented Jun 3, 2021

Looks like I haven't paid close attention while I was building everything. Cmake can't find OpenSSL, although OpenSSL is installed.

After cloning the library, I am creating native-build directory. And then when I am entering cmake .. I am getting this error:

machinegun@Ismatullas-MacBook-Air native-build % cmake ..
-- Could NOT find ccache (this is NOT an error)
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY)
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/libz.tbd
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY)
CMake Warning at CMakeLists.txt:167 (message):
Can't find OpenSSL: stop TDLib building

@levlam
Copy link
Contributor

levlam commented Jun 3, 2021

OpenSSL isn't needed for source code generation. Now you can run native build with cmake --build . and continue to build TDLib for iOS/watchOS/tvOS.

@sapoepsilon
Copy link
Author

I don't know man... I could not build it. Nevertheless, thank you for your help.

@Kylmakalle Kylmakalle mentioned this issue Jul 19, 2021
7 tasks
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

2 participants