Comments (9)
malloc.h is non-standard linux-specific header.
malloc() function always exists in stdlib.h - it's guaranteed by standard.
So, stdlib.h is much better than malloc.h
Original comment by [email protected]
on 2 Dec 2014 at 11:05
from word2vec.
Dirty solution, but it works:
In OSx Lion, Mountain Lion, Maveriks, Yosemite, the lib malloc.h is in the
directory /usr/include/malloc
So, do:
cd /usr/include/malloc
sudo cp malloc.h ..
and then go to your word2vec folder and compile with make.
Original comment by [email protected]
on 13 Jan 2015 at 1:38
from word2vec.
Dirty solution did not work for me:
distance.c:18:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
^
1 error generated.
make: *** [distance] Error 1
$cp /usr/include/malloc/malloc.h .
$make
gcc distance.c -o distance -lm -pthread -O3 -march=native -Wall -funroll-loops
-Wno-unused-result
distance.c:18:10: error: 'malloc.h' file not found with <angled> include; use
"quotes" instead
#include <malloc.h>
^~~~~~~~~~
"malloc.h"
distance.c:46:19: warning: implicitly declaring library function 'malloc' with
type 'void *(unsigned long)'
vocab = (char *)malloc((long long)words * max_w * sizeof(char));
^
distance.c:46:19: note: please include the header <stdlib.h> or explicitly
provide a declaration for 'malloc'
distance.c:31:8: warning: unused variable 'ch' [-Wunused-variable]
char ch;
^
2 warnings and 1 error generated.
make: *** [distance] Error 1
Original comment by [email protected]
on 30 Jan 2015 at 8:08
from word2vec.
You have to change <malloc.h> to "malloc.h" in all of the c files. Then it will
compiles on osx.
Original comment by [email protected]
on 10 Feb 2015 at 7:00
from word2vec.
"malloc.h" must be removed from anywhere as a non-standatd header.
"stdlib.h" must be used instead.
See here
http://stackoverflow.com/questions/12973311/difference-between-stdlib-h-and-mall
oc-h
Original comment by [email protected]
on 10 Feb 2015 at 8:55
from word2vec.
Yup, replacing "malloc.h" with "stdlib.h" in three c files got it working on my
MacBook.
Original comment by [email protected]
on 8 Apr 2015 at 9:32
from word2vec.
because "stdlib.h" already exist in files, just delete "malloc.h".
it works on my mac
Original comment by [email protected]
on 22 Apr 2015 at 3:19
from word2vec.
Hello,guys! I have the same problem. I could not find both of "malloc.h" and
"stdlib.h" , how could I replace them or delete them? Did I forget to download
something? I am trying to install htk. Please give me a suggestion. Thank you!!!
Original comment by [email protected]
on 4 May 2015 at 8:11
from word2vec.
Hey, they should already be on your system. Just replace the references in
the downloaded code.
-- Peter
Original comment by [email protected]
on 4 May 2015 at 8:15
from word2vec.
Related Issues (20)
- How can I get the coordinates of all words?
- Charset encoding HOT 1
- Patch for /trunk/demo-train-big-model-v1.sh HOT 4
- Fix build errors and warnings
- cnnot check out ?
- slightly optimized word2vec
- expTable array initialization
- Missing first letters in precompiled word vectors file: GoogleNews-vectors-negative300.bin HOT 2
- Keeping indexing URIs in plain text models
- Cluster output malformed
- The definition of sentences? HOT 1
- Patch for /trunk/word2vec.c
- Patch for /trunk/README.txt
- Create vectors for classification HOT 1
- Patch for distance.c: minor off-by-one error
- word2phrase: AddWord2Vocab strcpy's full length of strings longer than MAX_STRING HOT 1
- distance.c - fread'ing all vector floats at once boosts loading speed by ~3x...
- Updating global variables without locking
- word2vec.c: Minor tweak to reduce CPU pipeline stalls (3% gain) HOT 1
- Make fails on Windows + Cygwin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from word2vec.