-
Notifications
You must be signed in to change notification settings - Fork 258
CMake failure when building for arm platform #118
Comments
The error is caused by a missing include file uuid/uuid.h. It appears that the gateway SDK I would suggest this implementation for UniqueId_Generate(). It's much more portable and // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "azure_c_shared_utility/uniqueid.h"
#include "azure_c_shared_utility/xlogging.h"
DEFINE_ENUM_STRINGS(UNIQUEID_RESULT, UNIQUEID_RESULT_VALUES);
UNIQUEID_RESULT UniqueId_Generate(char* uid, size_t len)
{
UNIQUEID_RESULT result;
/* Codes_SRS_UNIQUEID_07_002: [If uid is NULL then UniqueId_Generate shall return UNIQUEID_INVALID_ARG] */
/* Codes_SRS_UNIQUEID_07_003: [If len is less then 37 then UniqueId_Generate shall return UNIQUEID_INVALID_ARG] */
if (uid == NULL || len < 37)
{
result = UNIQUEID_INVALID_ARG;
LogError("Buffer Size is Null. (result = %s)", ENUM_TO_STRING(UNIQUEID_RESULT, result));
}
else
{
int fd = open("/proc/sys/kernel/random/uuid",O_RDONLY);
if (fd < 0)
result = UNIQUEID_ERROR;
else
{
memset(uid, 0, len);
if (len-1 == read(fd,uid,len-1))
result = UNIQUEID_OK;
else
result = UNIQUEID_ERROR;
close(fd);
}
}
return result;
} |
@GrantEdwards How does your suggested code above fix the #include error? If you could attach two files from your build it would help us narrow down the problem: |
It doesn't include <uuid/uuid.h>. Nor does it need the uuid library at link time. [That requires a
As I mentioned above: the error is caused by a missing include file My platform doesn't have libuuid or uuid/uuid.h. The uuid library is |
In the azure-c-shared-utility repo, we already provide a CMake option called That said, the gateway SDK build system does not honor this option--we don't pass it down to azure-c-shared-utility when we build it for you. I'll use this issue as an opportunity to fix that. |
I added an option to CMake, now I need to expose it through our build script... |
Should be ready to go now... @GrantEdwards please give it a try! |
Fix is in the 2017-03-06 release. |
The first place to look would be in the It's unusual for ctest to fail to build - the usual problem is the submodule has not been initialized, but that should happen during the build if the CMake can detect the submodule is not present. It wouldn't hurt to do:
|
I'm trying to build the SDK on a Linux AMD64 host for an ARM9 target,
and I keep getting a configuration failure for azure_c_shared_utility,
and I'm unable to determine what's wrong
Looking at the CMake log files, I see:
CMakeError.log:
CMakeOutput.log:
The text was updated successfully, but these errors were encountered: