Open naveedkakal opened 1 year ago
The error output if i try with MANUAL_BUILD=true
07:54:14 ✘ ~/dev/conductor main ✘ ✹
$ MANUAL_BUILD=true mix compile
==> opex62541
-- MANUAL_BUILD
-- Debugs CMAKE_C_FAGS=; BASE_C_FLAGS=-g -Wall -Wextra -lpthread; MBEDTLS_FOLDER_LIBRARY= MBEDTLS_FOLDER_INCLUDE=
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/naveedkakal/dev/conductor/_build/dev/cmake/Opex62541
could not compile dependency :opex62541, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile opex62541", update it with "mix deps.update opex62541" or clean it with "mix deps.clean opex62541"
==> conductor
** (Mix) Failure running 'make' (status: 2).
[ 4%] Performing update step for 'open62541'
[ 8%] Performing patch step for 'open62541'
[ 12%] No configure step for 'open62541'
[ 16%] Performing build step for 'open62541'
-- open62541 Version: 1.0.0-dirty
-- Architectures included in amalgamation: posix
-- The selected architecture is: posix
-- ENTRE
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (MBEDTLS)
does not match the name of the calling package (MbedTLS). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
tools/cmake/FindMbedTLS.cmake:33 (find_package_handle_standard_args)
CMakeLists.txt:380 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find LATEX (missing: LATEX_COMPILER)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/naveedkakal/dev/conductor/_build/dev/cmake/Opex62541/open62541-build
[ 13%] Built target open62541-generator-types
[ 17%] Built target open62541-generator-transport
[ 17%] Built target open62541-generator-statuscode
[ 21%] Built target open62541-generator-namespace
[ 39%] Built target open62541-amalgamation-header
[ 60%] Built target open62541-amalgamation-source
[ 65%] Building C object CMakeFiles/open62541-object.dir/open62541.c.o
/Users/naveedkakal/dev/conductor/_build/dev/cmake/Opex62541/open62541-build/open62541.c:14677:9: warning: No native IEEE 754 format detected. Use slow generic encoding. [-W#pragma-messages]
#pragma message "No native IEEE 754 format detected. Use slow generic encoding."
^
/Users/naveedkakal/dev/conductor/_build/dev/cmake/Opex62541/open62541-build/open62541.c:178201:27: error: no member named 'key_usage' in 'struct mbedtls_x509_crt'
if((remoteCertificate.key_usage & MBEDTLS_X509_KU_KEY_CERT_SIGN) &&
~~~~~~~~~~~~~~~~~ ^
/Users/naveedkakal/dev/conductor/_build/dev/cmake/Opex62541/open62541-build/open62541.c:178202:27: error: no member named 'key_usage' in 'struct mbedtls_x509_crt'
(remoteCertificate.key_usage & MBEDTLS_X509_KU_CRL_SIGN)) {
~~~~~~~~~~~~~~~~~ ^
/Users/naveedkakal/dev/conductor/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179677:10: fatal error: 'mbedtls/entropy_poll.h' file not found
#include <mbedtls/entropy_poll.h>
^~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 3 errors generated.
make[5]: *** [CMakeFiles/open62541-object.dir/open62541.c.o] Error 1
make[4]: *** [CMakeFiles/open62541-object.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [open62541-prefix/src/open62541-stamp/open62541-build] Error 2
make[1]: *** [CMakeFiles/open62541.dir/all] Error 2
make: *** [all] Error 2
We don't have an artifact (precompiled version) for your architecture therefore you can't use the DOWNLOAD_BUILD.
For the MANUAL_BUILD, it seems that cmake is not able to find the mbedtls package, are you sure you have it installed?
I installed it via homebrew
12:34:39 ~/dev/conductor main ✘ ✹ ✭
$ brew info mbedtls
==> mbedtls: stable 3.2.1 (bottled), HEAD
Cryptographic & SSL/TLS library
https://tls.mbed.org/
/opt/homebrew/Cellar/mbedtls/3.2.1 (156 files, 11.3MB) *
Poured from bottle on 2022-11-17 at 10:55:20
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/mbedtls.rb
License: Apache-2.0
==> Dependencies
Build: cmake ✔, python@3.10 ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 83,355 (30 days), 275,000 (90 days), 1,169,202 (365 days)
install-on-request: 599 (30 days), 1,992 (90 days), 9,736 (365 days)
build-error: 10 (30 days)
Following up on this, entropy_poll.h seems to be missing from the brew version of mbedtls@3, I ran two tests from here:
export C_INCLUDE_PATH=/opt/local/include/mbedtls
export PATH="/opt/local/bin/:$PATH"
export LDFLAGS="-L/opt/local/lib"
export CPPFLAGS="-I/opt/local/include"
In either case, running MANUAL_BUILD=true mix deps.compile
[ 4%] Performing update step for 'open62541'
[ 8%] Performing patch step for 'open62541'
[ 12%] No configure step for 'open62541'
[ 16%] Performing build step for 'open62541'
-- open62541 Version: 1.0.0-dirty
-- Architectures included in amalgamation: posix
-- The selected architecture is: posix
-- ENTRE
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.24.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (MBEDTLS)
does not match the name of the calling package (MbedTLS). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
tools/cmake/FindMbedTLS.cmake:33 (find_package_handle_standard_args)
CMakeLists.txt:380 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE)
-- Could NOT find LATEX (missing: LATEX_COMPILER)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build
[ 13%] Built target open62541-generator-types
[ 13%] Built target open62541-generator-transport
[ 17%] Built target open62541-generator-statuscode
[ 21%] Built target open62541-generator-namespace
[ 47%] Built target open62541-amalgamation-header
[ 60%] Built target open62541-amalgamation-source
Consolidate compiler generated dependencies of target open62541-object
[ 65%] Building C object CMakeFiles/open62541-object.dir/open62541.c.o
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:14677:9: warning: No native IEEE 754 format detected. Use slow generic encoding. [-W#pragma-messages]
#pragma message "No native IEEE 754 format detected. Use slow generic encoding."
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:178201:27: error: no member named 'key_usage' in 'struct mbedtls_x509_crt'
if((remoteCertificate.key_usage & MBEDTLS_X509_KU_KEY_CERT_SIGN) &&
~~~~~~~~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:178202:27: error: no member named 'key_usage' in 'struct mbedtls_x509_crt'
(remoteCertificate.key_usage & MBEDTLS_X509_KU_CRL_SIGN)) {
~~~~~~~~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179703:59: error: no member named 'md_info' in 'struct mbedtls_md_context_t'
size_t hashLen = (size_t)mbedtls_md_get_size(context->md_info);
~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179776:5: error: implicit declaration of function 'mbedtls_sha1_ret' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
mbedtls_sha1_ret(message->data, message->length, hash);
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179776:5: note: did you mean 'mbedtls_sha1_free'?
/opt/homebrew/include/mbedtls/sha1.h:95:6: note: 'mbedtls_sha1_free' declared here
void mbedtls_sha1_free( mbedtls_sha1_context *ctx );
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179803:5: error: implicit declaration of function 'mbedtls_sha1_ret' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
mbedtls_sha1_ret(message->data, message->length, hash);
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179814:71: error: too few arguments to function call, expected 9, have 8
mbedtls_ctr_drbg_random, drbgContext);
^
/opt/homebrew/include/mbedtls/pk.h:539:5: note: 'mbedtls_pk_sign' declared here
int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179831:5: error: implicit declaration of function 'mbedtls_sha1_ret' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
mbedtls_sha1_ret(certificate->data, certificate->length, thumbprint->data);
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179848:88: error: no member named 'len' in 'struct mbedtls_rsa_context'
UA_StatusCode retval = UA_ByteString_allocBuffer(&encrypted, max_blocks * context->len);
~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179858:67: error: use of undeclared identifier 'MBEDTLS_RSA_PUBLIC'
drbgContext, MBEDTLS_RSA_PUBLIC,
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179867:28: error: no member named 'len' in 'struct mbedtls_rsa_context'
offset += context->len;
~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179883:35: error: no member named 'len' in 'struct mbedtls_rsa_context'
if(data->length % rsaContext->len != 0)
~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179893:67: error: use of undeclared identifier 'MBEDTLS_RSA_PRIVATE'
drbgContext, MBEDTLS_RSA_PRIVATE,
^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:179901:33: error: no member named 'len' in 'struct mbedtls_rsa_context'
inOffset += rsaContext->len;
~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:180009:64: error: no member named 'len' in 'struct mbedtls_rsa_context'
return mbedtls_pk_rsa(cc->policyContext->localPrivateKey)->len;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:180018:54: error: no member named 'len' in 'struct mbedtls_rsa_context'
return mbedtls_pk_rsa(cc->remoteCertificate.pk)->len;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:180082:35: error: no member named 'len' in 'struct mbedtls_rsa_context'
if(data->length % rsaContext->len != 0)
~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:180092:77: error: no member named 'len' in 'struct mbedtls_rsa_context'
data->data + inOffset, rsaContext->len,
~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:180098:33: error: no member named 'len' in 'struct mbedtls_rsa_context'
inOffset += rsaContext->len;
~~~~~~~~~~ ^
/Users/gmorell/IdeaProjects/project/project/_build/dev/cmake/Opex62541/open62541-build/open62541.c:180116:24: error: no member named 'len' in 'struct mbedtls_rsa_context'
return rsaContext->len;
~~~~~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
Hi! Did anyone solve the compilation problems? I'm running into the same errors.
mac OS / M2 Pro / mbedtls installed via homebrew
if U disable the encryption with -DUA_ENABLE_ENCRYPTION=NO the build runs a bit longer but then fails with errors like
/Users/tom/Desktop/opex62541/src/opc_ua_server.c:843:16: error: no member named 'discovery' in 'struct UA_ServerConfig'
if(config->discovery.mdns.mdnsServerName.data)
~~~~~~ ^
/Users/tom/Desktop/opex62541/src/opc_ua_server.c:844:34: error: no member named 'discovery' in 'struct UA_ServerConfig'
UA_String_clear(&config->discovery.mdns.mdnsServerName);
~~~~~~ ^
/Users/tom/Desktop/opex62541/src/opc_ua_server.c:846:13: error: no member named 'discovery' in 'struct UA_ServerConfig'
config->discovery.mdns.mdnsServerName = server_name;
~~~~~~ ^
/Users/tom/Desktop/opex62541/src/opc_ua_server.c:862:45: warning: passing 'long *' to parameter of type 'unsigned long *' converts between pointers to integer types with different sign [-Wpointer-sign]
if (ei_decode_ulong(req, req_index, &timeout) < 0) {
^~~~~~~~
/Users/tom/.local/share/rtx/installs/erlang/26.2.1/usr/include/ei.h:566:65: note: passing argument to parameter 'p' here
int ei_decode_ulong(const char *buf, int *index, unsigned long *p);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
17 warnings and 20 errors generated.
Elapsed time (seconds): 0.220924
make[2]: *** [CMakeFiles/opc_ua_server.dir/opc_ua_server.c.o] Error 1
make[1]: *** [CMakeFiles/opc_ua_server.dir/all] Error 2
make: *** [all] Error 2
Hello, I have been having some issues trying to get the package to build on my Apple silicon mac.
I was wondering if you had any suggestions, was getting a bit lost in trying to understand the CMake steps and errors.
Thanks