jiaxibei2008 / mitlm

Automatically exported from code.google.com/p/mitlm
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compiling on Mac OS X Lion fails #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. checkout revision 48
2. copy Makefile.example to Makefile
3. compile with "make -j"

What is the expected output? What do you see instead?

I expected a successful compilation. Instead I get a failed compilation with 
non-zero return code

What version of the product are you using? On what operating system?

I'm using a clean checkout of revision 48 of mitlm. I'm compiling it on Mac OS 
X Lion (10.7).

Please provide any additional information below.

I manage to solve the problem by performing the following steps:

1. Install Fortran with Homebrew: "brew install gfortran"
2. Add this setting to your Makefile after the FFLAGS line: "FC = gfortran"
3. Change the LDFLAGS line to "LDFLAGS  = -L. -lgfortran -lmitlm"
4. Create a symlink to your libgfortran library: "ln -s 
/usr/local/Cellar/gfortran/4.2.4-5666.3/lib/gcc/i686-apple-darwin11/4.2.1/x86_64
/libgfortran.a"

Once I did this, I was able to compile mitlm with no errors.

I haven't yet used the binaries for anything, but I noticed that running the 
estimate-ngram command without any input produces a segmentation fault:

$ ./interpolate-ngram 
Interpolating component LMs...
Tying parameters across n-gram order...
Segmentation fault: 11

Since I've never used it before, I'm not sure if this just me.

Original issue reported on code.google.com by tiago.he...@gmail.com on 25 Aug 2011 at 2:37

GoogleCodeExporter commented 8 years ago
I had the same problem on OS X 10.6 Snow Leopard, and was able to successfully 
build with the steps described above.

Original comment by robert.t...@gmail.com on 30 Jan 2012 at 4:59

GoogleCodeExporter commented 8 years ago
Hi, I am OS X 10.6 Snow Leopard. 
I followed the steps but the error that I get on make DEBUG=1 is: 

g++ -g -Wall -fPIC -fmessage-length=0 -Isrc -O0 -fno-inline   -c -o 
src/util/RefCounter.o src/util/RefCounter.cpp
g++ -g -Wall -fPIC -fmessage-length=0 -Isrc -O0 -fno-inline   -c -o 
src/util/Logger.o src/util/Logger.cpp
g++ -g -Wall -fPIC -fmessage-length=0 -Isrc -O0 -fno-inline   -c -o 
src/util/CommandOptions.o src/util/CommandOptions.cpp
g++ -g -Wall -fPIC -fmessage-length=0 -Isrc -O0 -fno-inline   -c -o src/Vocab.o 
src/Vocab.cpp
g++ -g -Wall -fPIC -fmessage-length=0 -Isrc -O0 -fno-inline   -c -o 
src/NgramVector.o src/NgramVector.cpp
g++ -g -Wall -fPIC -fmessage-length=0 -Isrc -O0 -fno-inline   -c -o 
src/NgramModel.o src/NgramModel.cpp
src/vector/Operations.h: In static member function ‘static T OpIsNan::Eval(T) 
[with T = double]’:
src/vector/VectorClosures.h:103:   instantiated from ‘typename 
TypeInfo<UnaryVectorClosure<Op, V> >::ElementType UnaryVectorClosure<Op, 
V>::ConstIterator::operator*() const [with Op = OpIsNan, V = 
DenseVector<double>]’
src/vector/VectorOps.h:77:   instantiated from ‘bool anyTrue(const 
Vector<I>&) [with V = UnaryVectorClosure<OpIsNan, DenseVector<double> >]’
src/NgramModel.cpp:388:   instantiated from here
src/vector/Operations.h:133: error: no matching function for call to 
‘isnan(double&)’
make: *** [src/NgramModel.o] Error 1

Any Ideas? Could this be a Boost issue. I have boost 1.45 installed, but not 
sure whether mitlm knows the path to it. 

Original comment by Joro.Dzh...@gmail.com on 28 Feb 2012 at 6:36

GoogleCodeExporter commented 8 years ago
The above tips were very helpful, thanks. I had a handfull of more troubles 
installing this in Lion, here are some pointers for others:

* Some functions were not found I had to go and edit the code to std::min and 
similar in some instances. (I believe this might be fixed in SVN).
* I didn't want to use brew, so I installed a gfortran precompiled version from 
here: http://gcc.gnu.org/wiki/GFortranBinaries
* The library that I needed to symlink was in a different directory: 
/usr/local/gfortran/lib/libgfortran.a
* I needed to link two more libraries: /usr/local/gfortran/lib/libquadmath.a 
/usr/local/gfortran/lib/gcc/x86_64-apple-darwin11/4.6.2/libgcc.a and 
/usr/local/gfortran/lib/gcc/x86_64-apple-darwin11/4.6.2/libgcc_eh.a
* I needed to add these to the makefile too -lquadmath -lgcc -lgcc_eh

Original comment by sand...@gmail.com on 19 May 2012 at 5:42

GoogleCodeExporter commented 8 years ago
Hi, can you please try mitlm 0.4.1 installation and report results?

Original comment by giuliop...@gmail.com on 27 Mar 2013 at 1:22