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

There's no <malloc.h> on OSX #32

Open
nrnrnr opened this issue Feb 28, 2015 · 3 comments
Open

There's no <malloc.h> on OSX #32

nrnrnr opened this issue Feb 28, 2015 · 3 comments
Assignees

Comments

@nrnrnr
Copy link

nrnrnr commented Feb 28, 2015

I'm trying to build mosml on OSX. But there's no <malloc.h> file on my system.

There is a <malloc/malloc.h> and a <sys/malloc.h>.

@kfl
Copy link
Owner

kfl commented Mar 3, 2015

That sound strange. My main platform for developing Moscow ML these days are OSX, but maybe I have polluted/enhanced my local setup.

Can you give me a bit more information about your setup? Are you using gcc or clang to compile the runtime, for instance? (I always use gcc as it makes Moscow ML 5-15% faster for some reason.)

Also, where do you get the compile error? Because we really shouldn't include malloc.h anywhere

@kfl kfl self-assigned this Mar 3, 2015
@nrnrnr
Copy link
Author

nrnrnr commented Mar 3, 2015

That sound strange. My main platform for developing Moscow ML these days
are OSX, but maybe I have polluted/enhanced my local setup.

Can you give me a bit more information about your setup? Are you using gcc
or clang to compile the runtime, for instance? (I always use gcc as it
makes Moscow ML 5-15% faster for some reason.)

I'm using someone else's Mac, about which I know almost nothing.

I'm using something called /usr/bin/gcc but it's clearly an alias for
clang.

I found malloc.h in /usr/include/malloc/malloc.h, but I ran into
enough other issues that I stopped filing them. Including no access
to mallopt().

Also, where do you get the compile error? Because we really shouldn't
include malloc.h anywhere

Maybe the best thing for me to do is to send you the diffs between
what I pulled from github and what eventually compiled? And the joker
in the system is that all of this is on top of my own changes (which
are limited to things like the version string and converting some
warnings to errors).

Norman

@kfl
Copy link
Owner

kfl commented Mar 4, 2015

It sound like you have a modified version of src/runtime/gc_ctrl.c (*), please check that you are using the gc_ctrl.c from github

(*) At one point we had a hard to track down bug on 64 bit Linux, that triggered when malloc() switched to using mmap(). Thus, the advice back then was use mallopt(), but this advice (and bug) is/was glibc specific and is no longer needed.

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