openJDK build on solaris 10: Format error: shdr table truncated - java

I am trying to build openJDK8 in Solaris 10.
Solaris:
uname -a
o/p: SunOS xxxx 5.10 Generic_148889-05 i86pc i386 i86pc
I followed the steps mentioned in https://hg.openjdk.java.net/jdk8u/jdk8u/raw-file/tip/README-builds.html#solaris
Installed necessary packages to build openJDK such as Mercurial, gmake, freetype, cups and xRender from openCSW.
I've downloaded jdk8 from Mercurials and got source.
bash ./configure is success. After that when i run gmake all getting below error.
Making libjvm_db.so
Opening 'libjvm_db.so' for update
No SHF_ALLOC flags needed to be cleared.
Done with 'libjvm_db.so'
Computing CRC for 'libjvm_db.debuginfo'
Opening 'libjvm_db.so' for update
Adding ELF data for new section name
Adding ELF data for debug_info_path value
Saving updates to 'libjvm_db.so'
Done updating 'libjvm_db.so'
/usr/ccs/bin/nm: g1CollectedHeap.o: Format error: shdr table truncated
ld: warning: symbol '__JvmOffsets' has differing types:
(file JvmOffsets.o type=OBJT; file dtrace.o type=FUNC);
ld: warning: symbol 'CodeCache::_heap' has differing types:
(file codeCache.o type=OBJT; file dtrace.o type=FUNC);
ld: warning: symbol 'BufferBlob::__vtbl' has differing types:
(file codeBlob.o type=OBJT; file dtrace.o type=FUNC);
ld: fatal: file g1CollectedHeap.o: Format error: shdr table truncated
ld: fatal: file processing errors. No output written to libjvm.so
gmake[6]: *** [libjvm.so] Error 2
gmake[5]: *** [the_vm] Error 2
gmake[4]: *** [product] Error 2
gmake[3]: *** [generic_build2] Error 2
gmake[2]: *** [product] Error 2
gmake[1]: *** [/export/home/openjdk/build/solaris-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2
gmake: *** [hotspot-only] Error 2
Can anyone point out how to resolve this error.

Related

Compile dlib for Android on Ubuntu

I'm trying to compile dlib for Android. My SO is Ubuntu 20.04. I followed this tutorial from https://github.com/tzutalin/dlib-android
I downloaded Android-NDK version r14b and unzipped it at /opt. When I run python3 build.py command, I get this error:
/bin/sh: 1: /opt/android-ndk-r14b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
/bin/sh: 1: /opt/android-ndk-r14b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
make: *** [/opt/android-ndk-r14b/build/core/build-binary.mk:530: obj/local/armeabi-v7a/objs/android_dlib/jni_imageutils.o] Error 127
make: *** Waiting for unfinished jobs....
/bin/sh: 1: /opt/android-ndk-r14b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
make: *** [/opt/android-ndk-r14b/build/core/build-binary.mk:530: obj/local/armeabi-v7a/objs/android_dlib/jni_pedestrian_det.o] Error 127
make: *** [/opt/android-ndk-r14b/build/core/build-binary.mk:530: obj/local/armeabi-v7a/objs/android_dlib/jni_face_det.o] Error 127
Build Error
Inspecting /opt/android-ndk-r14b, there is no linux-x86_64 under prebuild folder. The only directory there is darwin-x86_64.
I also tried with android-ndk-r21d, but I got another error:
/opt/android-ndk-r21d/build/core/add-application.mk:178: *** Android NDK: APP_STL gnustl_static is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. . Stop.
Build Error
Can you help me?
You can look into this, https://github.com/Luca96/dlib-for-android/blob/master/setup.sh. I did not try on linux but if there are problems the link below could give some hints.
I used the powershell script with some modifications from the repo above and used dlib master from github to compile on windows. It copies files to given Android Studio folder when done. Latest modified script here, https://github.com/quickgrid/Setup-Guide/blob/master/dlib-android-setup.ps1.

Having trouble loading rJava and xlsx on R studio keep getting same error message

Hello I am attempting to export some R files that were edited in R to excel. I am trying to install the package xlsx and rjava as they both are needed.
I have already tried to download Java into the file pathway but it will not let me since the folder already has files in it. So I did the next best thing and created a folder in hopes this would work but I keep getting the same error. I also have Rtools installed.
> install.packages("rJava")
Installing package into ‘C:/Users/Austin/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/rJava_0.9-11.zip'
Content type 'application/zip' length 832080 bytes (812 KB)
downloaded 812 KB
package ‘rJava’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Austin\AppData\Local\Temp\RtmpcHsZaF\downloaded_packages
> library("rJava")
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/Austin/Documents/R/win-library/3.6/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.
Being able to export R files to excel

Build OpenJDK 9 in CentOS5

I was trying to build OpenJDK 9 in Centos 5. I used
sh ./configure --disable-warnings-as-errors
make all
I am getting the following error.
Building target 'all' in configuration 'linux-x86_64-normal-server-release'
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
/usr/bin/objcopy: '/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so': No such file
gmake[3]: *** [/root/jdk9/build/linux-x86_64-normal-server-
release/support/modules_libs/java.base/libjava.so] Error 1
gmake[2]: *** [java.base-libs] Error 2
ERROR: Build failed for target 'all' in configuration 'linux-x86_64-normal-
server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_java.base_libjava_BUILD_LIBJAVA_link:
/root/jdk9/build/linux-x86_64-normal-server-
release/support/native/java.base/libjava/io_util_md.o: In function
`handleSetLength':
/root/jdk9/jdk/src/java.base/unix/native/libjava/io_util_md.c:228:
undefined reference to `fallocate64'
collect2: ld returned 1 exit status
* All command lines available in /root/jdk9/build/linux-x86_64-normal-
server-release/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See common/doc/building.html#troubleshooting for assistance.
make[1]: *** [main] Error 2
make: *** [all] Error 2
I also tried other make targets such as make images and make install. But still getting the same error. My GCC version is gcc (GCC) 4.4.7 which I manually installed because Centos 5 by default has an older version.
Building JDK requires at least GCC 5.0 (see Building the JDK: CC).
This seems to be a problem in the glibc version (see redhat-issue, util-linux). So, updating your glibc to the latest version might solve it.
If you don't want to update your system's glibc, here is another alternative:
By looking at the man page of fallocate, we find that the description mentions that posix_fallocate(3) is a portable, POSIX.1-specified version of it, in case the mode parameter has the default value (0). The same applies to fallocate64.
Since all the occurrences of the aforementioned error already use the default mode value, you can replace them with posix_fallocate64() (instead of commenting them out as you mentioned in another comment).
The denoted man page says that:
This default behavior [of fallocate with mode=0] closely resembles the
behavior of the posix_fallocate(3) library function, and is intended
as a method of optimally implementing that function.

XLConnect not installing on 32 bit architecture

I have 32 bit R, Java, and Excel, yet XLConnect is still not installing. Here is the error info:
* installing *source* package 'XLConnectJars' ...
** package 'XLConnectJars' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-
installing Java and make sure R and Java have matching architectures.
Error: loading failed
Execution halted
ERROR: loading failed for 'x64'
* removing 'C:/'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/i386/R" CMD INSTALL -l
"C:\"
C:.../XLConnectJars_0.2-13.tar.gz' had status 1
Warning in install.packages :
installation of package ‘XLConnectJars’ had non-zero exit status
ERROR: dependency 'XLConnectJars' is not available for package 'XLConnect'
* removing 'C:/...3.2/XLConnect'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.3/bin/i386/R" CMD INSTALL -l
"C:\"
C:\.../XLConnect_0.2-13.tar.gz' had status 1
Warning in install.packages :
installation of package ‘XLConnect’ had non-zero exit status
I'm not sure what else could be causing this problem since everything is 32 bit

Compiling OpenCV on Ubuntu

When I try to build OpenCV for java on Ubuntu I got the following error:
[ 61%] Built target opencv_test_objdetect
Generating opencl_kernels.cpp, opencl_kernels.hpp
CMake Error at /home/dinhvantan/opencv/opencv/cmake/cl2cpp.cmake:50 (string):
string does not recognize sub-command MD5
make[2]: *** [modules/ocl/opencl_kernels.cpp] Error 1
make[1]: *** [modules/ocl/CMakeFiles/opencv_ocl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 70%] Built target opencv_legacy
make: *** [all] Error 2
Could anyone tell me what I need to do resolve this problem?
This link suggests you need to upgrade to a newer CMake version.
You could either upgrade to a new Ubuntu release, or use a PPA, or build CMake from source.

Categories

Resources