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

icu-config deprecated #153

Closed
Greg57070 opened this issue Aug 28, 2019 · 10 comments
Closed

icu-config deprecated #153

Greg57070 opened this issue Aug 28, 2019 · 10 comments

Comments

@Greg57070
Copy link

Hello guy,

ltfs can't build on Debian 10 as icu-config has been removed from icu-devtools.

As found on this debian bugreport https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920900, and on icu-project howto use, icu-config is now deprecated.

It's now recommanded to use pkg-config to get cflags

Thanks for the good job, keep up with it !

BR,
Grégory

@piste-jp
Copy link
Member

Thank you for your report.

I confirmed the problem and I made a fix to handle ICU_UC package in configure.ac. It works fine but I have another problem on pkgdata program provided by ICU.

It looks the pkgdata uses icu-config internally. I believe Debian shall provide icu-config correctly.

$ pkgdata -p bin_mkltfs -m static packagelist.txt
sh: 1: icu-config: not found
sh: 1: icu-config: not found
pkgdata: icu-config: No icu-config found. (fix PATH or use -O option)
 required parameter is missing: -O is required for static and shared builds.
Run 'pkgdata --help' for help.

@jcadt
Copy link

jcadt commented Sep 1, 2019

Hello piste-jp-ibm, when i try to compile on Ubuntu 19.04 i get the same error, icu-config isn´t prensent in the system
Thanks
Juan Carlos

@piste-jp
Copy link
Member

piste-jp commented Sep 2, 2019

Hi @Greg57070,

I realized a comment is added to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920900, I believe you commented.

Thank you very much.

@bucovaina
Copy link

Just to let you know, I have the same problem. LTFS runs well on debian 8 and 9 but on debian 10 I'm getting probably the same errors due to icu no longer being supported.

I attached the Dockerfile I use to build a docker image (I run LTFS in a container but that should not matter I guess).

The build process works if I change the line
FROM debian:buster
in the attached Dockerfile to
FROM debian:stretch
ro
FROM debian:jessie

Dockerfile.txt

Hereby also attached the output of the full build process that fails in Debian Buster:
debian-buster-container-build-process.txt

@sgoudelis
Copy link

Has anybody figured out a way to compile this in Ubuntu 19 ?

@piste-jp
Copy link
Member

piste-jp commented Dec 24, 2019

I found a way to make it compilable. At this time, this is a quick patch but I can build LTFS on Ubuntu19.

The pkgdata command calls icu-config --incpkgdatafile and get a path of pkgdata.inc. So it is good to create a dummy script to return the path of pkgdata.inc file.

On Ubuntu19,

  1. Create /usr/bin/icu-config
  2. Write a code to return a path of pkgdata.inc in /usr/bin/icu-config
  3. Set executable bit of /usr/bin/icu-config

The sample script for Ubuntu19 is

#!/bin/sh

echo '/usr/lib/x86_64-linux-gnu/icu/pkgdata.inc'

May be you need to adjust the path on your machine.

@sgoudelis
Copy link

I am getting this:

make[3]: Entering directory '/home/name/projects/ltfs/src/libltfs'
/bin/bash ../../libtool  --tag=CC   --mode=link gcc -Wall -Wsign-compare -fsigned-char -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/uuid -I/usr/include/libxml2 /usr/lib/x86_64-linux-gnu/icu/current/pkgdata.inc -D ENABLE_SNMP -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/build/net-snmp-rzx9Z7/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -Wdate-time -I. -I/usr/include -fkeep-inline-functions -rdynamic -g -O2 -D_FORTIFY_SOURCE=0 -O0 -ggdb -Wl,--no-undefined,--as-needed -lfuse -pthread -luuid -lxml2 /usr/lib/x86_64-linux-gnu/icu/current/pkgdata.inc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmpmibs -lsensors -lpci -ldl -lnetsnmpagent -lwrap -Wl,-E -lnetsnmp -lcrypto -lm 2> /dev/null -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmp -lcrypto -lm -L../../messages -llibltfs_dat -linternal_error_dat -ltape_common_dat  -o libltfs.la -rpath /usr/local/lib libltfs_la-ltfs.lo libltfs_la-ltfs_internal.lo libltfs_la-ltfs_fsops.lo libltfs_la-ltfs_fsops_raw.lo libltfs_la-ltfssnmp.lo libltfs_la-fs.lo libltfs_la-xml_common.lo libltfs_la-xml_writer.lo libltfs_la-xml_reader.lo libltfs_la-xml_writer_libltfs.lo libltfs_la-xml_reader_libltfs.lo libltfs_la-label.lo libltfs_la-base64.lo libltfs_la-tape.lo libltfs_la-iosched.lo libltfs_la-dcache.lo libltfs_la-kmi.lo libltfs_la-pathname.lo libltfs_la-index_criteria.lo libltfs_la-xattr.lo libltfs_la-ltfslogging.lo libltfs_la-ltfstrace.lo libltfs_la-ltfs_thread.lo libltfs_la-config_file.lo libltfs_la-plugin.lo libltfs_la-periodic_sync.lo arch/libltfs_la-uuid_internal.lo arch/libltfs_la-filename_handling.lo arch/libltfs_la-time_internal.lo arch/libltfs_la-arch_info.lo arch/libltfs_la-errormap.lo  -lrt -lpthread 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/libltfs_la-ltfs.o .libs/libltfs_la-ltfs_internal.o .libs/libltfs_la-ltfs_fsops.o .libs/libltfs_la-ltfs_fsops_raw.o .libs/libltfs_la-ltfssnmp.o .libs/libltfs_la-fs.o .libs/libltfs_la-xml_common.o .libs/libltfs_la-xml_writer.o .libs/libltfs_la-xml_reader.o .libs/libltfs_la-xml_writer_libltfs.o .libs/libltfs_la-xml_reader_libltfs.o .libs/libltfs_la-label.o .libs/libltfs_la-base64.o .libs/libltfs_la-tape.o .libs/libltfs_la-iosched.o .libs/libltfs_la-dcache.o .libs/libltfs_la-kmi.o .libs/libltfs_la-pathname.o .libs/libltfs_la-index_criteria.o .libs/libltfs_la-xattr.o .libs/libltfs_la-ltfslogging.o .libs/libltfs_la-ltfstrace.o .libs/libltfs_la-ltfs_thread.o .libs/libltfs_la-config_file.o .libs/libltfs_la-plugin.o .libs/libltfs_la-periodic_sync.o arch/.libs/libltfs_la-uuid_internal.o arch/.libs/libltfs_la-filename_handling.o arch/.libs/libltfs_la-time_internal.o arch/.libs/libltfs_la-arch_info.o arch/.libs/libltfs_la-errormap.o   -lfuse -luuid -lxml2 -L/usr/lib/x86_64-linux-gnu -lnetsnmpmibs -lsensors -lpci -ldl -lnetsnmpagent -lwrap -lnetsnmp -lcrypto -lm -L../../messages -llibltfs_dat -linternal_error_dat -ltape_common_dat -lrt -lpthread  -g -O2 -fstack-protector-strong -g -O2 -O0 -ggdb -Wl,--no-undefined -Wl,--as-needed -pthread -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-E -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,now   -pthread -Wl,-soname -Wl,libltfs.so.0 -o .libs/libltfs.so.0.0.0
make[3]: *** [Makefile:553: libltfs.la] Error 1
make[3]: Leaving directory '/home/name/projects/ltfs/src/libltfs'
make[2]: *** [Makefile:696: all-recursive] Error 1
make[2]: Leaving directory '/home/name/projects/ltfs/src'
make[1]: *** [Makefile:521: all-recursive] Error 1
make[1]: Leaving directory '/home/name/projects/ltfs'
make: *** [Makefile:427: all] Error 2

is this related to this issue ?

@piste-jp
Copy link
Member

piste-jp commented Dec 25, 2019

No, I don't think it is related directly. But I might miss something to write in the previous comment...

My build step is little bit tricky at this time. I will try to enhance this later if no one post a PR about this.

Step1 : Edit configure.ac

diff --git a/configure.ac b/configure.ac
index 95c3958..6f56907 100644
--- a/configure.ac
+++ b/configure.ac
@@ -342,7 +342,7 @@ ICU_MODULE_CFLAGS="`icu-config --cppflags 2> /dev/null`";
 ICU_MODULE_LIBS="`icu-config --ldflags 2> /dev/null`";
 if test -z "$ICU_MODULE_LIBS"
 then
-    PKG_CHECK_MODULES([ICU_MODULE], [icu >= 0.21])
+    PKG_CHECK_MODULES([ICU_MODULE], [icu-uc >= 0.21])
 fi

 AC_MSG_CHECKING([use latest ICU])

Step2 : Run configuration

$ ./autogen.sh
$ ./configure

Step3 : Create icu-config

  1. Create /usr/bin/icu-config
  2. Write a code to return a path of pkgdata.inc in /usr/bin/icu-config
  3. Set executable bit of /usr/bin/icu-config

The sample script for Ubuntu19 is

#!/bin/sh

echo '/usr/lib/x86_64-linux-gnu/icu/pkgdata.inc'

Step4 : make

$ ./make

@piste-jp
Copy link
Member

I wrote a minimal script to support ltfs build on Debian10 and Ubuntu19.10. And also I made build environemts on GitHub Actions.

#!/bin/sh

opts=$1

case $opts in
  '--cppflags')
    echo '' ;;
  '--ldflags')
    echo '-licuuc -licudata' ;;
  *)
    echo '/usr/lib/x86_64-linux-gnu/icu/pkgdata.inc' ;;
esac

See also

@bert-willekens
Copy link

bert-willekens commented Mar 25, 2021

Hi. In my Ubuntu 20.04 environment I had to add -ldl to to the flags for errors related to 'dlopen'

$ cat /etc/issue
Ubuntu 20.04.2 LTS \n \l
$ uname -a
Linux xx 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ cat /usr/bin/icu-config
#!/bin/sh

opts=$1

case $opts in
  '--cppflags')
    echo '' ;;
  '--ldflags')
    echo '-licuuc -licudata -ldl' ;;
  *)
    echo '/usr/lib/x86_64-linux-gnu/icu/pkgdata.inc' ;;
esac

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

6 participants