test.c
#include <stdio.h>
#include <mm_malloc.h>
int main(int argc, const char * argv[]) {
float *floatBuffer = _mm_malloc(256*sizeof(float), 16);
_mm_free(floatBuffer);
printf("%s\n", "Done!");
}
Compiling test.c
with Macports clang
:
christian ~/ [master*] /opt/local/bin/clang -g -Wall -DNDEBUG -o test test.c
christian ~/ [master*] ./test
Done!
Setting Macports clang
in .emscripten
:
LLVM_ROOT = os.path.expanduser('/opt/local/bin') # directory
Compiling with Emscripten emcc
:
christian ~/ [master*] emcc -g -Wall -DNDEBUG -o test.js test.c
clang: warning: argument unused during compilation: '-nostdinc++'
test.c:2:10: fatal error: 'mm_malloc.h' file not found
#include <mm_malloc.h>
^
1 error generated.
ERROR emcc: compiler frontend failed to generate LLVM bitcode, halting