[SRILM User List] installation on mac lion error on negram class
mohsen jadidi
mohsen.jadidi at gmail.com
Wed Mar 13 08:03:20 PDT 2013
I managed to run my program after installing the srilm
with NO_ICONV=anything . Otherwise it keeps giving me this error:
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
File::fgetsUTF8(char*, int)in libmisc.a(File.o)
"_iconv_close", referenced from:
File::reopen(char const*)in libmisc.a(File.o)
File::reopen(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >&, int)in libmisc.a(File.o)
File::reopen(char const*, unsigned long, int)in libmisc.a(File.o)
File::reopen(char const*, char const*)in libmisc.a(File.o)
File::~File() in libmisc.a(File.o)
File::~File() in libmisc.a(File.o)
"_iconv_open", referenced from:
File::fgetsUTF8(char*, int)in libmisc.a(File.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
I read some pages and they suggested problem comes from the different
version of iconv,(The Mac default library and Macport installation). I
couldn't realize how to fix the problem. I tried to set ADDITIONAL_CFLAGS
= /usr/lib/libiconv.2.dylib but didnt work.
These are some information you might find useful :
For default version in /usr/lib I have :
ls -ll libiconv*
lrwxr-xr-x 1 root wheel 16 Oct 8 2011 libiconv.2.4.0.dylib ->
libiconv.2.dylib
-r-xr-xr-x 1 root wheel 2105216 Oct 8 2011 libiconv.2.dylib
lrwxr-xr-x 1 root wheel 20 Oct 8 2011 libiconv.dylib ->
libiconv.2.4.0.dylib
none of them have (*) to indicate which one my compiler use?! Also,
nm libiconv.2.dylib | grep iconv
00000000000f1af0 S ___iconv_2VersionNumber
00000000000f1b90 S ___iconv_2VersionString
00000000000f60f0 D __libiconv_version
000000000000a1e1 T _iconv
000000000000a5a0 T _iconv_canonicalize
0000000000013164 T _iconv_close
0000000000013171 T _iconv_open
000000000000a72c T _iconvctl
000000000000a20f T _iconvlist
0000000000014dbd T _libiconv_relocate
0000000000014cff T _libiconv_set_relocation_prefix
For Macport version I have :
-rw-r--r-- 1 root admin 1072264 Apr 4 2012 libiconv.2.dylib
-rw-r--r-- 1 root admin 1098856 Apr 4 2012 libiconv.a
lrwxr-xr-x 1 root admin 16 Apr 4 2012 libiconv.dylib ->
libiconv.2.dylib
-rw-r--r-- 1 root admin 914 Apr 4 2012 libiconv.la
and also:
nm libiconv.a | grep iconv
libiconv.a(iconv.o):
0000000000016780 D __libiconv_version
000000000000ac10 T _iconv_canonicalize
00000000000f9908 S _iconv_canonicalize.eh
000000000000a810 T _libiconv
00000000000f97d0 S _libiconv.eh
00000000000159f0 T _libiconv_close
00000000000fa6c0 S _libiconv_close.eh
0000000000015a00 T _libiconv_open
00000000000fa6f0 S _libiconv_open.eh
0000000000014950 T _libiconv_open_into
00000000000fa518 S _libiconv_open_into.eh
000000000000adc0 T _libiconvctl
00000000000f9940 S _libiconvctl.eh
000000000000a850 T _libiconvlist
00000000000f9830 S _libiconvlist.eh
libiconv.a(localcharset.o):
libiconv.a(relocatable.o):
00000000000000c0 T _libiconv_relocate
00000000000001d0 S _libiconv_relocate.eh
0000000000000000 T _libiconv_set_relocation_prefix
0000000000000198 S _libiconv_set_relocation_prefix.eh
Do you have any suggestion ?
On Tue, Mar 12, 2013 at 10:53 PM, Charles Wooters <wooters at icsi.berkeley.edu
> wrote:
> That is weird! So, I'm running 10.8.2 with Xcode 4.6, is that what you
> have too? And did you try a fresh install?
>
> If the answer to those two questions are "yes" and "yes", then could you
> send me a small example program or command line that causes the problem?
> Maybe my install is faulty too and I just haven't run into it yet...
>
> ---
> Chuck Wooters
> International Computer Science Institute
> http://www.icsi.berkeley.edu
>
>
> On Tue, Mar 12, 2013 at 2:41 PM, mohsen jadidi <mohsen.jadidi at gmail.com>wrote:
>
>> c++ gives me the same error!
>>
>>
>> On Mon, Mar 11, 2013 at 5:49 PM, Charles Wooters <
>> wooters at icsi.berkeley.edu> wrote:
>>
>>> Hi Mohsen,
>>>
>>> I'm not sure what is happening. I have only ever compiled successfully
>>> using the LLVM-based compiler - 'c++'. I have never tried with 'g++'. I
>>> suspect that there is some missing or mismatched library at runtime. Have
>>> you tried using 'c++' yet?
>>>
>>> -Chuck
>>>
>>>
>>> ---
>>> Chuck Wooters
>>> International Computer Science Institute
>>> http://www.icsi.berkeley.edu
>>>
>>>
>>> On Sun, Mar 10, 2013 at 2:47 PM, mohsen jadidi <mohsen.jadidi at gmail.com>wrote:
>>>
>>>> I compile and link like this:
>>>>
>>>> g++ -c -o lm.o LanguageModel.cpp
>>>> -I/Users/mohsenjadidi/Documents/srilm/include #it is ok
>>>> g++ -o lm lm.o -L/Users/mohsenjadidi/Documents/srilm/lib/macosx-m64
>>>> #(ERROR)
>>>>
>>>>
>>>>
>>>>
>>>> On Sun, Mar 10, 2013 at 10:45 PM, mohsen jadidi <
>>>> mohsen.jadidi at gmail.com> wrote:
>>>>
>>>>> Hello Charles,
>>>>>
>>>>> I stil have problem with this library. When ever instantiate Vocab or
>>>>> Ngam class ( vocal_srilm = new Vocab) I am getting this error :
>>>>>
>>>>> Undefined symbols for architecture x86_64:
>>>>> "Ngram::Ngram(Vocab&, unsigned int)", referenced from:
>>>>> _main in lm.o
>>>>> ld: symbol(s) not found for architecture x86_64
>>>>> collect2: ld returned 1 exit status
>>>>>
>>>>> Do you have any idea?
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Mar 6, 2013 at 6:29 PM, Charles Wooters <
>>>>> wooters at icsi.berkeley.edu> wrote:
>>>>>
>>>>>> Great!
>>>>>>
>>>>>> By the way, if you are interested in building maximum entropy models
>>>>>> using libLBFGS optimization library (as described in the 'INSTALL' file), I
>>>>>> have written up some instructions about how to compile libLBFGS on the Mac
>>>>>> and hook it into the SRILM Toolkit. You can find the instructions here:
>>>>>>
>>>>>> https://gist.github.com/wooters/5095712
>>>>>>
>>>>>> -Chuck
>>>>>>
>>>>>> ---
>>>>>> Chuck Wooters
>>>>>> International Computer Science Institute
>>>>>> http://www.icsi.berkeley.edu
>>>>>>
>>>>>>
>>>>>> On Wed, Mar 6, 2013 at 1:04 AM, mohsen jadidi <
>>>>>> mohsen.jadidi at gmail.com> wrote:
>>>>>>
>>>>>>> yay..worked.the problem was the gcc version. I set the default one
>>>>>>> and it worked.Thank you all
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Mar 6, 2013 at 12:11 AM, Charles Wooters <
>>>>>>> wooters at icsi.berkeley.edu> wrote:
>>>>>>>
>>>>>>>> I am just using the default compiler that comes with Xcode - I
>>>>>>>> never installed gcc through homebrew. So, maybe try that...
>>>>>>>>
>>>>>>>> ---
>>>>>>>> Chuck Wooters
>>>>>>>> International Computer Science Institute
>>>>>>>> http://www.icsi.berkeley.edu
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Mar 5, 2013 at 3:00 PM, mohsen jadidi <
>>>>>>>> mohsen.jadidi at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> the thing is I updated my gcc to 4.7 using homebrew and set it as
>>>>>>>>> my default. Is it a problem?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Mar 5, 2013 at 11:56 PM, Charles Wooters <
>>>>>>>>> wooters at icsi.berkeley.edu> wrote:
>>>>>>>>>
>>>>>>>>>> Hmmm. It looks like there may be some sort of compiler mismatch
>>>>>>>>>> here (see this article:
>>>>>>>>>> http://stackoverflow.com/questions/4035445/linker-error-undefined-reference-to-stdctypechar-m-widen-init
>>>>>>>>>> )
>>>>>>>>>>
>>>>>>>>>> If you haven't already, I suggest that you start over:
>>>>>>>>>> re-download the toolkit, untar it into a new directory, and then compile.
>>>>>>>>>> See if that fixes things.
>>>>>>>>>>
>>>>>>>>>> -Chuck
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---
>>>>>>>>>> Chuck Wooters
>>>>>>>>>> International Computer Science Institute
>>>>>>>>>> http://www.icsi.berkeley.edu
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Mar 5, 2013 at 2:47 PM, mohsen jadidi <
>>>>>>>>>> mohsen.jadidi at gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> I installed those libraries and update my xcode but didnt fix :
>>>>>>>>>>>
>>>>>>>>>>> or subdir in misc dstruct lm flm lattice utils; do \
>>>>>>>>>>> (cd $subdir/src; make SRILM=/Users/mohsenjadidi/Downloads/srilm
>>>>>>>>>>> MACHINE_TYPE=macosx-m64 OPTION= MAKE_PIC= release-libraries) || exit 1; \
>>>>>>>>>>> done
>>>>>>>>>>> make[2]: Nothing to be done for `release-libraries'.
>>>>>>>>>>> make[2]: Nothing to be done for `release-libraries'.
>>>>>>>>>>> make[2]: Nothing to be done for `release-libraries'.
>>>>>>>>>>> make[2]: Nothing to be done for `release-libraries'.
>>>>>>>>>>> make[2]: Nothing to be done for `release-libraries'.
>>>>>>>>>>> make[2]: Nothing to be done for `release-libraries'.
>>>>>>>>>>> make release-programs
>>>>>>>>>>> for subdir in misc dstruct lm flm lattice utils; do \
>>>>>>>>>>> (cd $subdir/src; make SRILM=/Users/mohsenjadidi/Downloads/srilm
>>>>>>>>>>> MACHINE_TYPE=macosx-m64 OPTION= MAKE_PIC= release-programs) || exit 1; \
>>>>>>>>>>> done
>>>>>>>>>>> make[2]: Nothing to be done for `release-programs'.
>>>>>>>>>>> make[2]: Nothing to be done for `release-programs'.
>>>>>>>>>>> c++ -Wreturn-type -Wimplicit -m64 -DINSTANTIATE_TEMPLATES
>>>>>>>>>>> -I/usr/include -I. -I../../include -DHAVE_ZOPEN -u _matherr
>>>>>>>>>>> -L../../lib/macosx-m64 -g -O2 -fno-common -o ../bin/macosx-m64/ngram
>>>>>>>>>>> ../obj/macosx-m64/ngram.o ../obj/macosx-m64/liboolm.a
>>>>>>>>>>> ../../lib/macosx-m64/libflm.a ../../lib/macosx-m64/libdstruct.a
>>>>>>>>>>> ../../lib/macosx-m64/libmisc.a -L/usr/lib -ltcl -lm 2>&1 | c++filt
>>>>>>>>>>> Undefined symbols for architecture x86_64:
>>>>>>>>>>> "std::ctype<char>::_M_widen_init() const", referenced from:
>>>>>>>>>>> makeLoglinearMixLM(Array<char const*>, Vocab&, SubVocab*,
>>>>>>>>>>> unsigned int, LM*, Array<double>) in ngram.o
>>>>>>>>>>> LHash<unsigned int, unsigned int*>::dump() const in
>>>>>>>>>>> liboolm.a(MultiwordVocab.o)
>>>>>>>>>>> LHash<char const*, unsigned int*>::dump() const in
>>>>>>>>>>> liboolm.a(RefList.o)
>>>>>>>>>>> ClassNgram::prefixProb(unsigned int, unsigned int const*,
>>>>>>>>>>> float&, TextStats&) in liboolm.a(ClassNgram.o)
>>>>>>>>>>> ClassNgram::expand(unsigned int, unsigned int) in
>>>>>>>>>>> liboolm.a(ClassNgram.o)
>>>>>>>>>>> NgramCounts<float>::readBinaryNode(Trie<unsigned int,
>>>>>>>>>>> float>&, unsigned int, unsigned int, File&, long long&, bool,
>>>>>>>>>>> Array<unsigned int>&) in liboolm.a(ClassNgram.o)
>>>>>>>>>>> NgramCounts<float>::readBinary(File&, unsigned int, bool)
>>>>>>>>>>> in liboolm.a(ClassNgram.o)
>>>>>>>>>>> ...
>>>>>>>>>>> ld: symbol(s) not found for architecture x86_64
>>>>>>>>>>> collect2: error: ld returned 1 exit status
>>>>>>>>>>> test -f ../bin/macosx-m64/ngram
>>>>>>>>>>> make[2]: *** [../bin/macosx-m64/ngram] Error 1
>>>>>>>>>>> make[1]: *** [release-programs] Error 1
>>>>>>>>>>> make: *** [World] Error 2
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Mar 5, 2013 at 5:52 PM, Charles Wooters <
>>>>>>>>>>> wooters at icsi.berkeley.edu> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> As for prerequisites, I installed these two using the homebrew
>>>>>>>>>>>> package manager (http://mxcl.github.com/homebrew/):
>>>>>>>>>>>>
>>>>>>>>>>>> - gawk (this also installed xz)
>>>>>>>>>>>> - gzip
>>>>>>>>>>>>
>>>>>>>>>>>> These were already installed on my machine (perhaps by Xcode or
>>>>>>>>>>>> Xcode command-line utilities):
>>>>>>>>>>>>
>>>>>>>>>>>> - make
>>>>>>>>>>>> - tcsh
>>>>>>>>>>>> - tcl
>>>>>>>>>>>> - bzip2
>>>>>>>>>>>>
>>>>>>>>>>>> This is the only one that I haven't installed (but I will now):
>>>>>>>>>>>>
>>>>>>>>>>>> - p7zip
>>>>>>>>>>>>
>>>>>>>>>>>> Hope that helps.
>>>>>>>>>>>>
>>>>>>>>>>>> -Chuck
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---
>>>>>>>>>>>> Chuck Wooters
>>>>>>>>>>>> International Computer Science Institute
>>>>>>>>>>>> http://www.icsi.berkeley.edu
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, Mar 4, 2013 at 10:46 PM, mohsen jadidi <
>>>>>>>>>>>> mohsen.jadidi at gmail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> did you install any of prerequisites libraries?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, Mar 5, 2013 at 12:26 AM, Charles Wooters <
>>>>>>>>>>>>> wooters at icsi.berkeley.edu> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> I was able to compile v1.7 on my macbook pro (2.6 GHz Intel
>>>>>>>>>>>>>> Core i7) running OSX 10.8.2 following these instructions:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> http://www1.icsi.berkeley.edu/~wooters/SRILM/index.html
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> -Chuck
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---
>>>>>>>>>>>>>> Chuck Wooters
>>>>>>>>>>>>>> International Computer Science Institute
>>>>>>>>>>>>>> http://www.icsi.berkeley.edu
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Mon, Mar 4, 2013 at 12:35 PM, mohsen jadidi <
>>>>>>>>>>>>>> mohsen.jadidi at gmail.com> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> this is mine:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> /usr/lib/libiconv.dylib: Mach-O universal binary with 2
>>>>>>>>>>>>>>> architectures
>>>>>>>>>>>>>>> /usr/lib/libiconv.dylib (for architecture x86_64): Mach-O
>>>>>>>>>>>>>>> 64-bit dynamically linked shared library x86_64
>>>>>>>>>>>>>>> /usr/lib/libiconv.dylib (for architecture i386): Mach-O
>>>>>>>>>>>>>>> dynamically linked shared library i386
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Mon, Mar 4, 2013 at 8:20 PM, Roman Kutlak <
>>>>>>>>>>>>>>> kutlak.roman at gmail.com> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You should check that you have libiconv in /usr/lib and
>>>>>>>>>>>>>>>> that you have the 64bit version using the following command:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> file /usr/lib/libiconv.dylib
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You should see something like the following:
>>>>>>>>>>>>>>>> /usr/lib/libiconv.dylib: Mach-O universal binary with 2
>>>>>>>>>>>>>>>> architectures
>>>>>>>>>>>>>>>> /usr/lib/libiconv.dylib (for architecture i386): Mach-O
>>>>>>>>>>>>>>>> dynamically linked shared library i386
>>>>>>>>>>>>>>>> /usr/lib/libiconv.dylib (for architecture x86_64): Mach-O
>>>>>>>>>>>>>>>> 64-bit dynamically linked shared library x86_64
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Roman
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 4 Mar 2013, at 18:40, mohsen jadidi <
>>>>>>>>>>>>>>>> mohsen.jadidi at gmail.com> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks but it didnt fixed the problem! Just removed the
>>>>>>>>>>>>>>>> warnings
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Mon, Mar 4, 2013 at 4:31 AM, Andreas Stolcke <
>>>>>>>>>>>>>>>> stolcke at icsi.berkeley.edu> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On 3/3/2013 1:46 PM, mohsen jadidi wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Hello everybody,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I am trying to install versiobn 1.7 on mac, but it keeps
>>>>>>>>>>>>>>>>>> giving me error:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> The cc1plus warning should disappear if you change
>>>>>>>>>>>>>>>>> common/Makefile.machine.macosx to have
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> GCC_FLAGS = -Wreturn-type
>>>>>>>>>>>>>>>>> CC = cc $(GCC_FLAGS) -Wimplicit -Wimplicit-int
>>>>>>>>>>>>>>>>> CXX = c++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> The link error seems to have something to do with the
>>>>>>>>>>>>>>>>> iconv library not being properly installed for 64bit builds.
>>>>>>>>>>>>>>>>> You might be able to work around this by building with
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> make NO_ICONV=1 ...
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I hope someone with MacOSX savvy can provide a way to make
>>>>>>>>>>>>>>>>> the linking with -liconv actually work.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Andreas
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>> Mohsen Jadidi
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> SRILM-User site list
>>>>>>>>>>>>>>>> SRILM-User at speech.sri.com
>>>>>>>>>>>>>>>> http://www.speech.sri.com/mailman/listinfo/srilm-user
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> SRILM-User site list
>>>>>>>>>>>>>>>> SRILM-User at speech.sri.com
>>>>>>>>>>>>>>>> http://www.speech.sri.com/mailman/listinfo/srilm-user
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> Mohsen Jadidi
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> SRILM-User site list
>>>>>>>>>>>>>>> SRILM-User at speech.sri.com
>>>>>>>>>>>>>>> http://www.speech.sri.com/mailman/listinfo/srilm-user
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Mohsen Jadidi
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Mohsen Jadidi
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Mohsen Jadidi
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Mohsen Jadidi
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mohsen Jadidi
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Mohsen Jadidi
>>>>
>>>
>>>
>>
>>
>> --
>> Mohsen Jadidi
>>
>
>
--
Mohsen Jadidi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.speech.sri.com/pipermail/srilm-user/attachments/20130313/31cd62a9/attachment.html>
More information about the SRILM-User
mailing list