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 init failed: U_FILE_ACCESS_ERROR on (open)SUSE #170

Closed
jeroen opened this issue Jun 23, 2015 · 27 comments
Closed

ICU init failed: U_FILE_ACCESS_ERROR on (open)SUSE #170

jeroen opened this issue Jun 23, 2015 · 27 comments
Assignees
Labels

Comments

@jeroen
Copy link
Contributor

jeroen commented Jun 23, 2015

I'm seeing these problems on some servers (e.g. opensuse):

[  142s] ** preparing package for lazy loading
[  143s] ** help
[  143s] *** installing help indices
[  144s] ** building package indices
[  145s] ** testing if installed package can be loaded
[  145s] Error in dyn.load(file, DLLpath = DLLpath, ...) :
[  145s]   ICU init failed: U_FILE_ACCESS_ERROR
[  145s] Error: loading failed

I think the problem is that you are overriding the location of icudt even when linked against system ICU. I think you should only be calling stri_set_icu_data_directory when the package has been built with the bundled ICU.

Perhaps something like

#ifdef UCONFIG_USE_LOCAL
   stri_set_icu_data_directory((char*)*(char**)(dll) /* dll->path */);
#endif
@jeroen jeroen changed the title U_FILE_ACCESS_ERROR ICU init failed: U_FILE_ACCESS_ERROR Jun 23, 2015
@gagolews
Copy link
Owner

Thanks, at least I'll have got stringi tested on many platforms. :)

I need full ./configure's output to diagnose that.

setDataDirectory shouldn't be the case here, as according to ICU manual, if a icudt.dat file is not found, bundled icudata (libicudata) is used.

I suspect that suse comes with incomplete icudata itself. Looking at libicu53 rpm, you can see that libicudata is of very small size (typically it should be ca. 20 MB). So first please check your libicu's size. If it is the case, either recompile icu or build stringi with --disable-pkg-config.

And now you see the price of using system icu :)

@jeroen
Copy link
Contributor Author

jeroen commented Jun 23, 2015

I don't have a suse machine available right now. Are these logs any help? x86 and x64.

@jeroen
Copy link
Contributor Author

jeroen commented Jun 23, 2015

Oops sorry these logs are for the build without system ICU (which also fails). Let me get you the build log for the one with icu.

@gagolews
Copy link
Owner

In the attached build logs you get a download error. Cannot do anything about that.

As for suse, funny, there's a separate libicu53_1-ledata-53.1-2.3.2 rpm. Make sure if it is indeed used. Also, strange, it is installed before libicu53_1-53.1-2.3.2 - maybe the second rpm overwrites libicudata? If so, this is not my fault - you have a misconfigured build envir...

@gagolews
Copy link
Owner

BTW, if you got a blocked network conn on some system, why not installing stringi directly from github? In such a case, icudt is included in the source bundle - it will be copied from this local repo on install.

@jeroen
Copy link
Contributor Author

jeroen commented Jun 23, 2015

I suspect that suse, like yourself, ships icudt.dat separately from libicu in the installation, but it can't find it because you are overriding stri_set_icu_data_directory.

@gagolews
Copy link
Owner

OK, I'll apply a patch soon (it is harmless anyway) and we'll see if it works.

@jeroen
Copy link
Contributor Author

jeroen commented Jun 23, 2015

So how do I build the source package with batteries included? I tried:

git clone https://github.com/Rexamine/stringi/
R CMD build stringi

But that gives me the same thing as the CRAN version?

@gagolews
Copy link
Owner

R CMD INSTALL stringi --configure.args='--disable-pkg-config'

@gagolews
Copy link
Owner

Ah, you mean building the package -- you should edit .Rinstignore manually and get rid of src/icu55/data entry

@jeroen
Copy link
Contributor Author

jeroen commented Jun 23, 2015

And that will automatically find it, and not download the files from the internet? So it can be compiled on a build server without internet access?

@gagolews
Copy link
Owner

Yes, install.libs.R first tries copying icudata from src/icu55/data.

@jeroen
Copy link
Contributor Author

jeroen commented Jun 23, 2015

OK that makes the source package 23m, that is pretty big indeed. I'll first try it with your patch.

@gagolews
Copy link
Owner

Commit 76d125a pushed - what about now?

gagolews added a commit that referenced this issue Jun 23, 2015
@gagolews gagolews changed the title ICU init failed: U_FILE_ACCESS_ERROR ICU init failed: U_FILE_ACCESS_ERROR pn (open)SUSE Jun 23, 2015
@gagolews gagolews changed the title ICU init failed: U_FILE_ACCESS_ERROR pn (open)SUSE ICU init failed: U_FILE_ACCESS_ERROR on (open)SUSE Jun 23, 2015
@gagolews gagolews self-assigned this Jun 23, 2015
@fungs
Copy link

fungs commented Jun 24, 2015

I'm also getting this when installing as a dependency of ggplot2 on openSUSE 13.2
When I pull the source from Github (c5fdde3) and install as suggested, I'm getting the same error and the following output. Note the unknown option warning at the beginning.

R CMD INSTALL stringi --configure.args='--disable-pkg-config'
Warning: unknown option ‘--configure.args=--disable-pkg-config’
* installing to library ‘/local/home/johdro/R/x86_64-suse-linux-gnu-library/3.1’
* installing *source* package ‘stringi’ ...
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /usr/lib64/R
checking for R... /usr/lib64/R/bin/R
checking for R >= 3.1.0... yes
checking for cat... /usr/bin/cat
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=c++11 accepts -g... yes
checking whether the C++ compiler supports the long long type... yes
checking whether the compiler implements namespaces... yes
checking whether the compiler supports Standard Template Library... yes
checking whether std::map is available... yes
checking for pkg-config... /usr/bin/pkg-config
checking with pkg-config for ICU4C installed... 53.1
checking for ICU4C >= 50... yes
checking for proper CPPFLAGS, LDFLAGS, and LIBS... done
checking whether we may build an ICU-based project... yes
checking for available ICU data library (ucnv, uloc, utrans)... yes
checking for available ICU data library (ucol)... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/uconfig_local.h
config.status: creating src/install.libs.R

*** stringi configure summary:
    ICU_FOUND=1
    ICUDT_DIR=icu55/data
    STRINGI_CXXSTD=CXX_STD=CXX11
    STRINGI_CFLAGS= 
    STRINGI_CPPFLAGS=-I.   -UDEBUG -DNDEBUG -DU_HAVE_ELF_H
    STRINGI_CXXFLAGS= 
    STRINGI_LDFLAGS=-L/usr/lib64  
    STRINGI_LIBS=-licui18n -licuuc -licudata  

*** compiler settings used:
    CC=gcc -std=gnu99
    CPP=g++ -E
    LD=g++
    CFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g 
    CPPFLAGS=-I/usr/local/include  -UDEBUG -DNDEBUG
    CXX=g++ -std=c++11
    CXXFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g 
    LDFLAGS= 
    LIBS= 
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  ICU init failed: U_FILE_ACCESS_ERROR

Installed packages are

Repository: OpenSUSE OSS
Name: libicu53_1
Version: 53.1-2.3.2
Arch: x86_64
Vendor: openSUSE

Repository: OpenSUSE OSS
Name: libicu53_1-ledata
Version: 53.1-2.3.2
Arch: noarch
Vendor: openSUSE

Repository: OpenSUSE OSS
Name: libicu53_1-bedata
Version: 53.1-2.3.2
Arch: noarch
Vendor: openSUSE

@gagolews
Copy link
Owner

R CMD INSTALL --help --> the option name is --configure-args.

OK, I will install opensuse on a VM and check it out.

@fungs
Copy link

fungs commented Jun 24, 2015

I reran it with the correct option syntax but it throws the same error (+ some compiler macro warnings about depricated syntax).

@fungs
Copy link

fungs commented Jun 24, 2015

OK, I will install opensuse on a VM and check it out.

Even faster with docker:

docker pull opensuse:13.2
docker run -t -i opensuse:13.2 /bin/bash

@gagolews
Copy link
Owner

self-note: icudt53l.dat is in /usr/share/icu/53.1/

icu-config --icudata-install-dir
pkg-config icu-uc --variable=pkglibdir # not valid

If the C preprocessor variable ICU_DATA_DIR was set at the time ICU was built, use its compiled-in value.

I have a solution, stay tuned.

gagolews added a commit that referenced this issue Jun 24, 2015
@gagolews
Copy link
Owner

Should be fixed now, please confirm.

Apparently, the suse icu pkg rpm builder hardcoded ICUDATA path during the lib build. @jeroenooms was right, I forced overriding this path, which lead to an error.

@fungs, BTW, re-compiling the package with changed --disable-pkg-config setting needs a make clean -- this can be done by passing --preclean to R CMD INSTALL.

@gagolews gagolews added the bug label Jun 24, 2015
@gagolews gagolews added this to the stringi-0.6 milestone Jun 24, 2015
@jeroen
Copy link
Contributor Author

jeroen commented Jun 24, 2015

Did you test it with the suse ICU or does it only work with --disable-pkg-config and bundled ICU? The Suse build servers do not allow internet access so it won't be able to download icudt.

@gagolews
Copy link
Owner

I tested it with system ICU.

--disable-pkg-config only causes problems if there is no internet access.

@jeroen
Copy link
Contributor Author

jeroen commented Jun 24, 2015

Okay great, thanks. I'll do another build of my stack soon, hopefully it works now.

@fungs
Copy link

fungs commented Jun 24, 2015

@gagolews: I can test on my machine next week, and I will report.

@jlehtoma
Copy link

Had the same problem with openSUSE 13.2 Tumbleweed. Cloning stringi 0.5-3 from GitHub and installing with

R CMD INSTALL stringi --configure.args='--disable-pkg-config'

worked for me.

@gagolews
Copy link
Owner

Added a Docker opensuse testbed in #173, works for me.

@fungs
Copy link

fungs commented Jul 2, 2015

I can also confirm that it works now. Thanks!

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

4 participants