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

Morphuntion won't compile/link on Ubuntu 22 #38

Open
nciric opened this issue Dec 16, 2024 · 5 comments
Open

Morphuntion won't compile/link on Ubuntu 22 #38

nciric opened this issue Dec 16, 2024 · 5 comments
Assignees

Comments

@nciric
Copy link
Contributor

nciric commented Dec 16, 2024

Command:

make -j 8 check

Error message:

In file included from /home/cira/code/inflection/morphuntion/src/morphuntion/dictionary/PhraseProperties.cpp:11:
In file included from /home/cira/code/inflection/morphuntion/src/morphuntion/util/UnicodeSetUtils.hpp:8:
/home/cira/code/inflection/morphuntion/src/icu4cxx/UnicodeSet.hpp:163:12: error: use of undeclared identifier 'uset_hasStrings'
    return uset_hasStrings(wrappee_);
           ^
/home/cira/code/inflection/morphuntion/src/icu4cxx/UnicodeSet.hpp:184:12: error: use of undeclared identifier 'uset_getRangeCount'
    return uset_getRangeCount(wrappee_);
           ^
2 errors generated.
make[3]: *** [src/CMakeFiles/morphuntion_tool_objs.dir/build.make:188: src/CMakeFiles/morphuntion_tool_objs.dir/morphuntion/dictionary/PhraseProperties.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:773: src/CMakeFiles/morphuntion_tool_objs.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:944: test/CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:456: check] Error 2

Steps:

  • ICU was compiled from sources and installed into /usr/local/lib/icu
  • ICU version was either 76.1 (official), or 77.0.1 (live)
  • CMake 3.25.1 or 3.31 installed
  • Clang 14.0.6 with details below
Debian clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64

This same error shows up on ChromeBook Linux and clean Hyper-V VM of Ubuntu 22.
It's interesting that other uses of the same header in the code base don't show up as errors.

@nciric
Copy link
Contributor Author

nciric commented Dec 16, 2024

Cmake output with -DICU_DEBUG=ON:

CC=clang CXX=clang++ cmake -DICU_ROOT=/usr/local/lib/icu -DICU_DEBUG=ON ..
-- Found the following ICU libraries:
--   uc (required): /usr/local/lib/libicuuc.so
--   i18n (required): /usr/local/lib/libicui18n.so
-- --------FindICU.cmake search debug--------
-- ICU binary path search order: /usr/local/lib/icu
-- ICU include path search order: /usr/local/lib/icu
-- ICU library path search order: /usr/local/lib/icu
-- ----------------
-- --------FindICU.cmake results debug--------
-- ICU found: TRUE
-- ICU_VERSION number: 77.0.1
-- ICU_ROOT directory: /usr/local/lib/icu
-- ICU_INCLUDE_DIR directory: /usr/local/include
-- ICU_LIBRARIES: /usr/local/lib/libicuuc.so;/usr/local/lib/libicui18n.so
-- gencnval program: ICU_GENCNVAL_EXECUTABLE=/home/cira/miniconda3/bin/gencnval
-- icuinfo program: ICU_ICUINFO_EXECUTABLE=/home/cira/miniconda3/bin/icuinfo
-- genbrk program: ICU_GENBRK_EXECUTABLE=/home/cira/miniconda3/bin/genbrk
-- icu-config program: ICU_ICU-CONFIG_EXECUTABLE=/home/cira/miniconda3/bin/icu-config
-- genrb program: ICU_GENRB_EXECUTABLE=/home/cira/miniconda3/bin/genrb
-- gendict program: ICU_GENDICT_EXECUTABLE=/home/cira/miniconda3/bin/gendict
-- derb program: ICU_DERB_EXECUTABLE=/home/cira/miniconda3/bin/derb
-- pkgdata program: ICU_PKGDATA_EXECUTABLE=/home/cira/miniconda3/bin/pkgdata
-- uconv program: ICU_UCONV_EXECUTABLE=/usr/local/bin/uconv
-- gencfu program: ICU_GENCFU_EXECUTABLE=/home/cira/miniconda3/bin/gencfu
-- makeconv program: ICU_MAKECONV_EXECUTABLE=/home/cira/miniconda3/bin/makeconv
-- gennorm2 program: ICU_GENNORM2_EXECUTABLE=/usr/local/sbin/gennorm2
-- genccode program: ICU_GENCCODE_EXECUTABLE=/usr/local/sbin/genccode
-- gensprep program: ICU_GENSPREP_EXECUTABLE=/usr/local/sbin/gensprep
-- icupkg program: ICU_ICUPKG_EXECUTABLE=/usr/local/sbin/icupkg
-- gencmn program: ICU_GENCMN_EXECUTABLE=/usr/local/sbin/gencmn
-- Makefile.inc data: ICU_MAKEFILE_INC=/usr/local/lib/icu/Makefile.inc
-- pkgdata.inc data: ICU_PKGDATA_INC=/usr/local/lib/icu/pkgdata.inc
-- uc library found: ICU_UC_FOUND=ON
-- uc library found (compat name): UC_FOUND=ON
-- uc library: ICU_UC_LIBRARIES=/usr/local/lib/libicuuc.so
-- i18n library found: ICU_I18N_FOUND=ON
-- i18n library found (compat name): I18N_FOUND=ON
-- i18n library: ICU_I18N_LIBRARIES=/usr/local/lib/libicui18n.so
-- ----------------
Configured with copy of Marisa in: /home/cira/code/inflection/morphuntion/build/ext/lib/Marisa/marisa-trie/include
CMAKE_SYSTEM_PROCESSOR: x86_64. Using x86 dependency for core-foundation
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cira/code/inflection/morphuntion/build

VERBOSE=1 output:

[ 44%] Building CXX object src/CMakeFiles/morphuntion_tool_objs.dir/morphuntion/util/VersionUtils.cpp.o
cd /home/cira/code/inflection/morphuntion/build/src && /usr/bin/clang++ -DENABLE_ALL_FEATURES=1 -DMORPHUNTION_DATA_ROOT_DIR=\"/usr/local/share\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -I/home/cira/code/inflection/morphuntion/src -I/home/cira/code/inflection/morphuntion/build/resources -I/home/cira/code/inflection/morphuntion/build/ext/lib/Marisa/marisa-trie/include -isystem /home/cira/code/inflection/morphuntion/build/ext/lib/CoreFoundation/Source/CoreFoundation_dev/lib/swift -isystem /home/cira/code/inflection/morphuntion/build/ext/lib/CoreFoundation/Source/CoreFoundation_dev/include -fPIC -fvisibility=hidden -stdlib=libc++ -Wall -Weffc++ -Wextra -Wglobal-constructors -Wexit-time-destructors -Wweak-vtables -Wvla-extension -Werror=format-security -fstack-protector-strong -std=c++20 -MD -MT src/CMakeFiles/morphuntion_tool_objs.dir/morphuntion/util/VersionUtils.cpp.o -MF CMakeFiles/morphuntion_tool_objs.dir/morphuntion/util/VersionUtils.cpp.o.d -o CMakeFiles/morphuntion_tool_objs.dir/morphuntion/util/VersionUtils.cpp.o -c /home/cira/code/inflection/morphuntion/src/morphuntion/util/VersionUtils.cpp

@grhoten
Copy link
Member

grhoten commented Dec 16, 2024

Your setup seems to be finding multiple copies of ICU, and I think that your ICU_ROOT is the wrong value.

Can you please try this instead? I think the lib/icu is too deep.

CC=clang CXX=clang++ cmake -DICU_ROOT=/usr/local/ ..

Is it also possible to remove /home/cira/miniconda3/bin from your path for now? I don't think that you want that icu-config in your path.

@nciric
Copy link
Contributor Author

nciric commented Dec 17, 2024

Tried with a shorter ICU_ROOT path and removed miniconda3 from setup. Still exactly the same message.
I did a quick review of cmake files but didn't find anything wrong so far.

Do you have a handy Ubuntu/Linux so you can try it locally to confirm the problem?

@nciric
Copy link
Contributor Author

nciric commented Dec 18, 2024

I looked at the CMakeList file for generated code and printed values of the ICU_INCLUDE path (points to /use/local/include)

What I can't find in the compiler output is the -I/usr/local/include:

[ 42%] Building CXX object src/CMakeFiles/morphuntion_tool_objs.dir/morphuntion/dictionary/metadata/CharsetConverter.cpp.o
cd /home/cira/code/inflection/morphuntion/build/src && /usr/bin/clang++ -DENABLE_ALL_FEATURES=1 -DMORPHUNTION_DATA_ROOT_DIR=\"/usr/local/share\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -I/home/cira/code/inflection/morphuntion/src -I/home/cira/code/inflection/morphuntion/build/resources -I/home/cira/code/inflection/morphuntion/build/ext/lib/Marisa/marisa-trie/include -isystem /home/cira/code/inflection/morphuntion/build/ext/lib/CoreFoundation/Source/CoreFoundation_dev/lib/swift -isystem /home/cira/code/inflection/morphuntion/build/ext/lib/CoreFoundation/Source/CoreFoundation_dev/include -std=c++20 -fPIC -fvisibility=hidden -stdlib=libc++ -Wall -Weffc++ -Wextra -Wglobal-constructors -Wexit-time-destructors -Wweak-vtables -Wvla-extension -Werror=format-security -fstack-protector-strong -MD -MT src/CMakeFiles/morphuntion_tool_objs.dir/morphuntion/dictionary/metadata/CharsetConverter.cpp.o -MF CMakeFiles/morphuntion_tool_objs.dir/morphuntion/dictionary/metadata/CharsetConverter.cpp.o.d -o CMakeFiles/morphuntion_tool_objs.dir/morphuntion/dictionary/metadata/CharsetConverter.cpp.o -c /home/cira/code/inflection/morphuntion/src/morphuntion/dictionary/metadata/CharsetConverter.cpp
In file included from /home/cira/code/inflection/morphuntion/src/morphuntion/dictionary/PhraseProperties.cpp:11:
In file included from /home/cira/code/inflection/morphuntion/src/morphuntion/util/UnicodeSetUtils.hpp:8:
/home/cira/code/inflection/morphuntion/src/icu4cxx/UnicodeSet.hpp:163:12: error: use of undeclared identifier 'uset_hasStrings'
    return uset_hasStrings(wrappee_);
           ^
/home/cira/code/inflection/morphuntion/src/icu4cxx/UnicodeSet.hpp:184:12: error: use of undeclared identifier 'uset_getRangeCount'
    return uset_getRangeCount(wrappee_);
           ^
2 errors generated.

BTW, I looked at the morphuntion_tool_objs, and once it's setup its includes are /home/cira/code/inflection/morphuntion/src and /usr/local/include which looks ok.

The same for the morphuntion target.

@nciric
Copy link
Contributor Author

nciric commented Dec 24, 2024

I nuked my Ubuntu install, and got a fresh install of clang, cmake and ICU 76.1

The same errors show up as before. I then made minimal progress by:

  • Temporarily removing offending functions from the generated code (they are not called from the rest of the code).
  • The functions in question are: unum_hasAttribute, uset_getRangeCount and uset_hasStrings (and their wrappers)

A linked error shows up related to uloc_getCountry_69_swift after compilation stage is done:

gmake[3]: Entering directory '/home/cira/code/inflection/morphuntion/build'
cd /home/cira/code/inflection/morphuntion/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/cira/code/inflection/morphuntion /home/cira/code/inflection/morphuntion/src /home/cira/code/inflection/morphuntion/build /home/cira/code/inflection/morphuntion/build/src /home/cira/code/inflection/morphuntion/build/src/CMakeFiles/morphuntion.dir/DependInfo.cmake "--color="
gmake[3]: Leaving directory '/home/cira/code/inflection/morphuntion/build'
/usr/bin/gmake  -f src/CMakeFiles/morphuntion.dir/build.make src/CMakeFiles/morphuntion.dir/build
/usr/bin/ld: warning: libicuuc.so.72, needed by /lib/x86_64-linux-gnu/libxml2.so, may conflict with libicuuc.so.76
/usr/bin/ld: ../../src/CMakeFiles/morphuntion_tool_objs.dir/morphuntion/util/ULocale.cpp.o: undefined reference to symbol 'uloc_getCountry_69_swift'
/usr/bin/ld: /home/cira/code/inflection/morphuntion/build/ext/lib/CoreFoundation/Source/CoreFoundation_dev/lib/swift/linux/libicuucswift.so.69: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: Entering directory '/home/cira/code/inflection/morphuntion/build'
gmake[3]: Nothing to be done for 'src/CMakeFiles/morphuntion.dir/build'.
gmake[3]: Leaving directory '/home/cira/code/inflection/morphuntion/build'
[ 83%] Built target morphuntion
gmake[3]: *** [tools/buildDictionary/CMakeFiles/buildDictionary.dir/build.make:342: tools/buildDictionary/buildDictionary] Error 1
gmake[3]: Leaving directory '/home/cira/code/inflection/morphuntion/build'
gmake[2]: *** [CMakeFiles/Makefile2:717: tools/buildDictionary/CMakeFiles/buildDictionary.dir/all] Error 2
gmake[2]: Leaving directory '/home/cira/code/inflection/morphuntion/build'
gmake[1]: *** [CMakeFiles/Makefile2:1156: test/CMakeFiles/check.dir/rule] Error 2
gmake[1]: Leaving directory '/home/cira/code/inflection/morphuntion/build'
gmake: *** [Makefile:456: check] Error 2

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