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

undefined reference to `libiconv' #403

Open
senisioi opened this issue Feb 5, 2023 · 1 comment
Open

undefined reference to `libiconv' #403

senisioi opened this issue Feb 5, 2023 · 1 comment
Labels

Comments

@senisioi
Copy link

senisioi commented Feb 5, 2023

Bug description

I have been trying to compile marianMT on a docker container with this nvcr image nvcr.io/nvidia/pytorch:21.12-py3
and it seems the 3rd party pathie library is making all marian executables fail to link because of the following error:

/usr/bin/ld: ../libmarian.a(pathie.cpp.o): in function `Pathie::convert_encodings(char const*, char const*, std::__cxx11::basic_string<char,
 std::char_traits<char>, std::allocator<char> > const&)':
/marian/src/3rd_party/pathie-cpp/src/pathie.cpp:121: undefined reference to `libiconv_open'
/usr/bin/ld: /marian/src/3rd_party/pathie-cpp/src/pathie.cpp:152: undefined reference to `libiconv'
/usr/bin/ld: /marian/src/3rd_party/pathie-cpp/src/pathie.cpp:161: undefined reference to `libiconv_close'

How to reproduce

Pull the nvcr image nvcr.io/nvidia/pytorch:21.12-py3 and install all dependencies.

git clone --depth 1 --branch 1.11.0 https://github.com/marian-nmt/marian /marian
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_SENTENCEPIECE=ON -DUSE_MPI=ON -DCOMPILE_CPU=on -DCOMPILE_SERVER=on  && make -j8 

Context

  • Marian version: 1.11.0
  • CMake command: Type the cmake command you used and attach the output of --build-info all
  • Log file: Attach your training/decoding logs

The dependency install for docker is based strongly on this repo

@senisioi senisioi added the bug label Feb 5, 2023
@senisioi
Copy link
Author

senisioi commented Feb 5, 2023

I found a fix by commenting the if statement at this line to always

set(EXT_LIBS ${EXT_LIBS} iconv)

Is that condition really necessary only for APPLE?

A working example is available in my branch

Update: it seems this only works if I compile libiconv in the image. Now the comment at line 168 makes perfect sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant