-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix build for macOS #1
Open
puddly
wants to merge
2
commits into
rhasspy:master
Choose a base branch
from
puddly:puddly/minimum-cpp-version
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Would it work without the patch if we just renamed the .c files to .cc? |
Converting them to C++ would require some patching: pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:69:7: error: assigning to 'int16_t *' (aka 'short *') from incompatible type 'void *'
69 | malloc(num_channels_plus_1 * sizeof(*state->channel_frequency_starts));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:71:7: error: assigning to 'int16_t *' (aka 'short *') from incompatible type 'void *'
71 | malloc(num_channels_plus_1 * sizeof(*state->channel_weight_starts));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:73:7: error: assigning to 'int16_t *' (aka 'short *') from incompatible type 'void *'
73 | malloc(num_channels_plus_1 * sizeof(*state->channel_widths));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:74:17: error: assigning to 'uint64_t *' (aka 'unsigned long long *') from incompatible type 'void *'
74 | state->work = malloc(num_channels_plus_1 * sizeof(*state->work));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:76:10: error: cannot initialize a variable of type 'float *' with an rvalue of type 'void *'
76 | float* center_mel_freqs =
| ^
77 | malloc(num_channels_plus_1 * sizeof(*center_mel_freqs));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:78:12: error: cannot initialize a variable of type 'int16_t *' (aka 'short *') with an rvalue of type 'void *'
78 | int16_t* actual_channel_starts =
| ^
79 | malloc(num_channels_plus_1 * sizeof(*actual_channel_starts));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:80:12: error: cannot initialize a variable of type 'int16_t *' (aka 'short *') with an rvalue of type 'void *'
80 | int16_t* actual_channel_widths =
| ^
81 | malloc(num_channels_plus_1 * sizeof(*actual_channel_widths));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:163:20: error: assigning to 'int16_t *' (aka 'short *') from incompatible type 'void *'
163 | state->weights = calloc(weight_index_start, sizeof(*state->weights));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pymicro-features/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.cc:164:22: error: assigning to 'int16_t *' (aka 'short *') from incompatible type 'void *'
164 | state->unweights = calloc(weight_index_start, sizeof(*state->unweights));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 errors generated.
error: command '/usr/bin/clang++' failed with exit code 1 |
This fixes the build for me on an Apple Silicon device running macOS 14.6.1 ✅ It'd be great to see either this or #2 merged soon :) |
domdomegg
approved these changes
Dec 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pybind11 doesn't like to compile mixed C/C++ codebases with Clang: C++17 features are used but setting
cxx_std=17
causes Clang to fail when compiling C source files, since-std=c++17
isn't valid when building C.I've worked around this problem by patching the distutils compiler at build time on macOS: