CrossCompile jrxtx with yocto - java

I'm trying to crosscompile jrxtx library (https://github.com/openmuc/jrxtx) using a yocto toolchain but it fails.
first
source /opt/poky/environment-setup-cortexa8t2hf-vfp-neon-poky-linux-gnueabi
then
cd /home/peppe/projects/rxtx/jrxtx/native && ./BUILD.sh
I had to hand modify config.status to remove some errors on mv and rm, nevertheless i get
/bin/bash /home/peppe/projects/rxtx/jrxtx/native/libtool --mode=link arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/opt/poky/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi -O2 -pipe -g -feliminate-unused-debug-types -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lpthread -release 2.2pre1 -o librxtxSerial.la -rpath /usr/lib/jvm/java-11-openjdk-amd64/jre/lib/amd64 /home/peppe/projects/rxtx/jrxtx/native/x86_64-unknown-linux-gnu/SerialImp.lo; \
fi; \
)
/bin/bash: line 2: cd: x86_64-unknown-linux-gnu: No such file or directory
/bin/bash: /home/peppe/projects/rxtx/jrxtx/native/libtool: No such file or directory
/bin/bash: /home/peppe/projects/rxtx/jrxtx/native/libtool: No such file or directory
/bin/bash: /home/peppe/projects/rxtx/jrxtx/native/libtool: No such file or directory
make: *** [Makefile:756: x86_64-unknown-linux-gnu/librxtxSerial.la] Error 127
Even it it seems to launch the correct compiler arm-poky-linux-gnueabi-gcc it tries to cd into x86_64-unknown-linux-gnu and obviously things gets mad...

Related

Error building openJDK 11 with devkit: Unknown base OS Fedora

I need to build the following openJDK
git clone --depth 1 --branch jdk-11+28 https://github.com/openjdk/jdk.git
For that I run:
cd make/devkit
make TARGETS="aarch64-linux-gnu" BASE_OS=Fedora BASE_OS_VERSION=21 &>build.log
And got following error
Building on platform x86_64-unknown-linux-gnu
host_platforms x86_64-unknown-linux-gnu
target_platforms x86_64-unknown-linux-gnu
find: ‘/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit/result/x86_64-unknown-linux-gnu’: No such file or directory
Building compilers for x86_64-unknown-linux-gnu
Targets: x86_64-unknown-linux-gnu
for p in x86_64-unknown-linux-gnu ; do \
make -f Tools.gmk download-rpms HOST=x86_64-unknown-linux-gnu BUILD=x86_64-unknown-linux-gnu RESULT=/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit/result PREFIX=/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit/result/x86_64-unknown-linux-gnu OUTPUT_ROOT=/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit TARGET=$p && \
make -f Tools.gmk all HOST=x86_64-unknown-linux-gnu BUILD=x86_64-unknown-linux-gnu RESULT=/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit/result PREFIX=/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit/result/x86_64-unknown-linux-gnu OUTPUT_ROOT=/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/build/devkit \
TARGET=$p || exit 1 ; \
done
make[1]: Entering directory '/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/make/devkit'
TARGET=x86_64-unknown-linux-gnu
HOST=x86_64-unknown-linux-gnu
BUILD=x86_64-unknown-linux-gnu
ARCH=x86_64
Tools.gmk:66: *** Unknown base OS Fedora. Stop.
make[1]: Leaving directory '/media/katya/e947f05e-bd8f-4647-bbdd-0df608faa788/openjdk11/jdk/make/devkit'
Makefile:86: recipe for target 'x86_64-unknown-linux-gnu' failed
make: *** [x86_64-unknown-linux-gnu] Error 1
Host OS is Ubuntu 16.04.7 LTS (Xenial Xerus). Please tell me what am I doing wrong?
Where can I submit a bug report about openjdk11, or discuss this issue?

OpenJDK cross compilation: failed unable to make target

I need to cross-compile this fork of openJDK https://gitlab.com/gosjava/11/openjdk/-/tree/master/ on host system Kali Linux 2021.3 for target "aarch64-linux-gnu"
As described here https://gitlab.com/gosjava/11/openjdk/-/blob/master/doc/building.md#cross-compiling-the-easy-way-with-openjdk-devkits
And it fails with error:
┌──(katya㉿kali)-[~/work/prostor/openjdk]
└─$ cd make/devkit
┌──(katya㉿kali)-[~/…/prostor/openjdk/make/devkit]
└─$ make TARGETS="aarch64-linux-gnu"
Building on platform unknown-linux-gnu
host_platforms unknown-linux-gnu
target_platforms aarch64-linux-gnu
find: ‘/home/katya/work/prostor/openjdk/build/devkit/result/unknown-linux-gnu-to-aarch64-linux-gnu’: No such file or directory
Building compilers for unknown-linux-gnu
Targets: aarch64-linux-gnu
for p in aarch64-linux-gnu; do \
make -f Tools.gmk download-rpms HOST=unknown-linux-gnu BUILD=unknown-linux-gnu RESULT=/home/katya/work/prostor/openjdk/build/devkit/result OUTPUT_ROOT=/home/katya/work/prostor/openjdk/build/devkit \
TARGET=$p PREFIX=/home/katya/work/prostor/openjdk/build/devkit/result/unknown-linux-gnu-to-$p && \
make -f Tools.gmk all HOST=unknown-linux-gnu BUILD=unknown-linux-gnu RESULT=/home/katya/work/prostor/openjdk/build/devkit/result OUTPUT_ROOT=/home/katya/work/prostor/openjdk/build/devkit \
TARGET=$p PREFIX=/home/katya/work/prostor/openjdk/build/devkit/result/unknown-linux-gnu-to-$p && \
make -f Tools.gmk ccache HOST=unknown-linux-gnu BUILD=unknown-linux-gnu RESULT=/home/katya/work/prostor/openjdk/build/devkit/result OUTPUT_ROOT=/home/katya/work/prostor/openjdk/build/devkit \
TARGET=unknown-linux-gnu PREFIX=/home/katya/work/prostor/openjdk/build/devkit/result/unknown-linux-gnu-to-$p BUILDDIR=/home/katya/work/prostor/openjdk/build/devkit/unknown-linux-gnu/$p || exit 1 ; \
done
make[1]: Entering directory '/home/katya/work/prostor/openjdk/make/devkit'
TARGET=aarch64-linux-gnu
HOST=unknown-linux-gnu
BUILD=unknown-linux-gnu
ARCH=aarch64
Tools.gmk:75: *** Unknown base OS . Stop.
make[1]: Leaving directory '/home/katya/work/prostor/openjdk/make/devkit'
make: *** [Makefile:90: unknown-linux-gnu] Error 1
Why? The command make TARGETS="aarch64-linux-gnu" BASE_OS=OLE6 also fails
Tools.gmk:75: *** Unknown base OS OLE6. Stop.
make[1]: Leaving directory '/home/katya/work/prostor/openjdk/make/devkit'
make: *** [Makefile:90: unknown-linux-gnu] Error 1
What is wrong? I follow documentation, but ...

Error building jpy `gcc: error: : No such file or directory`

I am trying to build jpy for using the SNAP API of the european space agency in my ubuntu 16.04 with anaconda. After setting all my java, jdk and jvm paths correctly, I executed
python setup.py build
and got the following error:
src/main/c/jni/org_jpy_PyLib.c:254:26: warning: unused variable ‘state’ [-Wunused-variable]
PyGILState_STATE state = PyGILState_Ensure();
^~~~~ gcc -pthread -shared -B /home/delgado/local/anaconda3/compiler_compat
-L/home/delgado/local/anaconda3/lib -Wl,-rpath=/home/delgado/local/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/src/main/c/jpy_module.o build/temp.linux-x86_64-3.6/src/main/c/jpy_diag.o build/temp.linux-x86_64-3.6/src/main/c/jpy_conv.o build/temp.linux-x86_64-3.6/src/main/c/jpy_compat.o build/temp.linux-x86_64-3.6/src/main/c/jpy_jtype.o build/temp.linux-x86_64-3.6/src/main/c/jpy_jarray.o build/temp.linux-x86_64-3.6/src/main/c/jpy_jobj.o build/temp.linux-x86_64-3.6/src/main/c/jpy_jmethod.o build/temp.linux-x86_64-3.6/src/main/c/jpy_jfield.o build/temp.linux-x86_64-3.6/src/main/c/jni/org_jpy_PyLib.o -L
-L/home/delgado/local/anaconda3/lib -ljvm -ldl -lpython3.6m -o build/lib.linux-x86_64-3.6/jpy.cpython-36m-x86_64-linux-gnu.so
-Xlinker -rpath gcc: error: : No such file or directory error: command 'gcc' failed with exit status 1
I do not know precisely which file is missing and why it is missing.
Using a built version of jpy in conda solved the issue. I suggest eg: conda install -c terradue jpy
hope this still helps somebody

Autoreconf failing when installing (py)COMPSs in a clusters

I tried to install pyCOMPSs (v1.4) on a Cluster system using the
installation script for Supercomputers.
The script terminates with the following error:
libtool: link: ranlib .libs/libcbindings.a
libtool: link: ( cd ".libs" && rm -f "libcbindings.la" && ln -s
"../libcbindings.la" "libcbindings.la" )
make[1]: Entering directory
`/home/xxx/repos/pycompss/COMPSs/Bindings/c/src/bindinglib'
/usr/bin/mkdir -p
'/home/cramonco/svn/compss/framework/trunk/builders/specs/deb/compss-c-binding/tmp/opt/COMPSs/Bindings/c/lib'
/usr/bin/mkdir: cannot create directory ‘/home/cramonco’: Permission denied
make[1]: *** [install-libLTLIBRARIES] Error 1
make[1]: Leaving directory
`/home/xxx/xxx/repos/pycompss/COMPSs/Bindings/c/src/bindinglib'
make: *** [install-am] Error 2
BindingLib Installation failed, please check errors above!
Seems the error is due to the package includes a previous configuration
and in your case the autoreconf is not overwritting the Makefile and
other files produced by autotools. try with
running
cd /home/xxx/repos/pycompss/COMPSs/Bindings/c/src/bindinglib
make maintainer-clean
After this run again the install command

GnuPG for Java library ant build issue/bug

I'm working GnuPG Java API to encrypt/decrypt files.
Googled and found a Java Wrapper GnuPG for Java, Java wrapper for GPGME(GnuPG Made Easy,C language library).
Official website also referring this as the Java wrapper.
So followed the instructions, set up ant and tried to run ant clean release
it is throwing errors.
But maven build working and jar file also generated.
Following error occured while running ant.
C:\Users\user\Desktop\MFT\gnupg-for-java-master>ant clean release
Buildfile: C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml
clean-native:
[exec] rm -f GnuPGContext.o GnuPGData.o GnuPGGenkeyResult.o GnuPGKey.o GnuPGSignature.o gpgmeutils.o *~
[exec] rm -f C:\Users\user\Desktop\MFT\gnupg-for-java-master\build/gnupg-for-java.dll
[exec] rm -f com_freiheit_gnupg_GnuPGContext.h com_freiheit_gnupg_GnuPGData.h com_freiheit_gnupg_GnuPGGenkeyResult.h com_freiheit_gnupg_GnuPG
Key.h com_freiheit_gnupg_GnuPGSignature.h
clean:
[delete] Deleting directory C:\Users\user\Desktop\MFT\gnupg-for-java-master\build\classes
prepare:
compile-java:
[mkdir] Created dir: C:\Users\user\Desktop\MFT\gnupg-for-java-master\build\classes
[javac] C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml:21: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=l
ast; set to false for repeatable builds
[javac] Compiling 8 source files to C:\Users\user\Desktop\MFT\gnupg-for-java-master\build\classes
gen-jni-headers:
prepare:
compile-java:
[javac] C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml:21: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=l
ast; set to false for repeatable builds
generate-jni-headers:
[exec] C:\Program Files (x86)/Java/jdk1.7.0_51/bin/javah -classpath C:\Users\user\Desktop\MFT\gnupg-for-java-master\build\classes -jni com.freih
eit.gnupg.GnuPGContext com.freiheit.gnupg.GnuPGData com.freiheit.gnupg.GnuPGGenkeyResult com.freiheit.gnupg.GnuPGKey com.freiheit.gnupg.GnuPGSigna
ture
[exec] /bin/sh: -c: line 0: syntax error near unexpected token `('
[exec] /bin/sh: -c: line 0: `C:\Program Files (x86)/Java/jdk1.7.0_51/bin/javah -classpath C:\Users\user\Desktop\MFT\gnupg-for-java-master\build\c
lasses -jni com.freiheit.gnupg.GnuPGContext com.freiheit.gnupg.GnuPGData com.freiheit.gnupg.GnuPGGenkeyResult com.freiheit.gnupg.GnuPGKey com.fre
iheit.gnupg.GnuPGSignature'
[exec] make: *** [com_freiheit_gnupg_GnuPGContext.h] Error 2
BUILD FAILED
C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml:71: The following error occurred while executing this line:
C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml:63: exec returned: 2
Total time: 4 seconds
Update
I changed the Java home in GNUmakefile, Now it is throwing different error. Seems c library not found and this API is written for Unix system seems by reading the error message. What C library missing ?
generate-jni-headers:
[exec] C:\Java\jdk1.7.0_75/bin/javah -classpath C:\Users\user\Desktop\MFT\gnupg-for-java-master\build\classes -jni com.freiheit.gnupg.GnuPGConte
xt com.freiheit.gnupg.GnuPGData com.freiheit.gnupg.GnuPGGenkeyResult com.freiheit.gnupg.GnuPGKey com.freiheit.gnupg.GnuPGSignature
gen-jni-library:
recompile-c-code:
[exec] mingw32-gcc -g -Werror -Wall -Wno-deprecated-declarations -fPIC -mms-bitfields -Wl,--add-stdcall-alias -D_REENTRANT -D_THREAD_SAFE -D_FIL
E_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1 -I"C:\Java\jdk1.7.0_75/include" -I"C:\Java\jdk1.7.0_75/include/win32" -I"C:\Program Files (x86)/GNU/GnuPG/includ
e" -c GnuPGContext.c
[exec] /bin/sh: mingw32-gcc: command not found
[exec] make: *** [GnuPGContext.o] Error 127
BUILD FAILED
C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml:82: The following error occurred while executing this line:
C:\Users\user\Desktop\MFT\gnupg-for-java-master\build.xml:75: exec returned: 2
Total time: 7 seconds
Can anyone help me to solve this issue ?
Where I'm making mistake ?
I rewrote my answer because I wanted to create a complete guide.
Install GnuPG and MinGW-Get to a directory without spaces.
After you installed MinGW with !!!GUI!!!, open mingw-get, install these components:
mingw32-gcc (check all)
mingw32-libz (the dll is the most important)
Download and install MSYS, that is a command line toolkit for running commands like make.
Then put c:\msys\1.0\bin\ (or wherever you installed it) on the beginning of the PATH variable. Restart eclipse or open a new cmd, and it should work.
In the build.xml:
line 21:
classpath="lib/junit-4.4.jar" added.(and the junit is in the lib dir)
In the GNUmakefile:
line 9 :
ALL_CFLAGS := -Wall -Wno-deprecated-declarations -fPIC
line 10:
ALL_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1 \
-I"c:/WORK/x/gnu/jdk/jdk1.8.0_25/include" -I"c:/WORK/x/gnu/jdk/jdk1.8.0_25/include/win32"
line 21-27:
JAVA_HOME := c:/WORK/x/gnu/jdk/jdk1.8.0_25
ALL_CFLAGS += -mms-bitfields -Wl,--add-stdcall-alias
ALL_CPPFLAGS += -I"c:/WORK/x/gnu/jdk/jdk1.8.0_25/include/win32" -I"c:/WORK/x/gnu/jdk/jdk1.8.0_25/include" -I"c:/GNU/GnuPG/include"
ALL_LDFLAGS := -s -shared -Wl,--enable-auto-import
ALL_LIBS := -L"c:/GNU/GnuPG" -lgpgme-11
GNUPG_LIB := $(BUILD_DIR)/gnupg-for-java.dll
line 63:
$(CC) $(DEBUG) $(ALL_CFLAGS) $(ALL_LDFLAGS) $^ -o "$(BUILD_DIR)/gnupg-for-java.dll" $(ALL_LIBS)
Summary: This is working for me and outputs the jar and dll file to the build directory. My work directory was c:/WORK/x so replace the paths where it is different. Don't use "Program Files" anywhere, as you can see I had to copy everything from there.
The error message is telling that it cannot find mingw32-gcc in /bin/sh.
You should install mingw at first and add it to your path. Check that mingw32-gcc can be launched from the command line.
Are you running the ant script from cygwin? It's a bit strange that it is referring /bin/sh. Maybe you should try to run it from cygwin. Or check the build.xml file to see how mingw32-gcc is called. It must be recompile-c-code target.

Categories

Resources