From snazarkin at azul.com Mon Jul 2 10:25:41 2018 From: snazarkin at azul.com (Sergey Nazarkin) Date: Mon, 2 Jul 2018 10:25:41 +0000 Subject: RFR: better support for cross compilation In-Reply-To: References: Message-ID: <8D485CFB-3D72-457E-B226-1BB3AB2FAF00@azul.com> So far I?ve got the only single response with the proposal to remove redundant PI_TOOLS variable. I?ve accepted it and new changeset would be diff -r 1b3d9720d724 Makefile --- a/Makefile Tue Jun 19 19:15:30 2018 +0300 +++ b/Makefile Mon Jul 02 13:20:46 2018 +0300 @@ -40,14 +40,19 @@ ########################################################### # check for required env vars + ifeq ($(CROSS_TOOL),) - $(error "CROSS_TOOL is not defined. Please set CROSS_TOOL to point to the location of the raspberry pi GNU toolchain") + $(error "CROSS_TOOL is not defined. Please set CROSS_TOOL to point to the location of the cross compilation GNU toolchain") endif ifeq ($(JAVA_HOME),) $(error "JAVA_HOME is not defined. Please set JAVA_HOME to point to the location of the JDK8 installation") endif +# Target device JDK build, required for cross compilation, should contain "include /jni.h" and "inlude/linux/jni_md.h" +# Default value points to host JDK +TARGET_JDK_PATH ?= $(JAVA_HOME) + BUILD_DEVICEACCESS := true DIO_JAVA_API_DIRS := \ @@ -79,10 +84,10 @@ BUILD_NUMBER ?= dev ifneq ($(BUILD_NUMBER),dev) - # only include 'b' when you have an actual build number + # only include 'b' when you have an actual build number B := b endif - + ifeq ($(TARGET_CPU_LEGACY_LIB),arm) OSGI_ARCH := arm @@ -165,15 +170,15 @@ ####################################################################################################### # tool and flag setup for arm (rasp pi) build -TARGET_TOOLCHAIN := $(CROSS_TOOL) -TARGET_CC := $(TARGET_TOOLCHAIN)gcc -TARGET_CXX := $(TARGET_TOOLCHAIN)g++ -TARGET_LD := $(TARGET_TOOLCHAIN)gcc +TARGET_CC := $(CROSS_TOOL)gcc +TARGET_CXX := $(CROSS_TOOL)g++ +TARGET_LD := $(CROSS_TOOL)gcc + JAVAC := $(JAVA_HOME)/bin/javac JAR := $(JAVA_HOME)/bin/jar MKDIR := mkdir -p TARGET_C_FLAGS = $(USER_C_FLAGS) -fPIC -Wno-psabi -DJAVACALL_REPORT_LEVEL=0 -DENABLE_DEVICEACCESS -c -MMD -MF $(NATIVE_OUT_DIR)/$(@).d -TARGET_INCLUDES = $(foreach d,$(DIO_INCLUDE_DIRS),-I$(d)) -I$(JAVA_TARGET_HOME)/include -I$(JAVA_TARGET_HOME)/include/linux +TARGET_INCLUDES = $(foreach d,$(DIO_INCLUDE_DIRS),-I$(d)) -I$(TARGET_JDK_PATH)/include -I$(TARGET_JDK_PATH)/include/linux TARGET_CXX_FLAGS = $(USER_CXX_FLAGS) -fPIC -Wno-psabi -DJAVACALL_REPORT_LEVEL=4 -DENABLE_DEVICEACCESS -c TARGET_LD_FLAGS= $(USER_LD_FLAGS) -Xlinker -z -Xlinker defs -Xlinker -O1 \ -shared \ From allen at aemyers.com Thu Jul 5 21:07:32 2018 From: allen at aemyers.com (Allen Myers) Date: Thu, 5 Jul 2018 14:07:32 -0700 Subject: Ubuntu 16.04 Build Message-ID: I'd like to try and get this library working for a Ubuntu server that is connected to an Arduino Zero. I'm having trouble finding documentation/examples on how to build the library. Are there binaries available somewhere? Is there any document/guide that might walk a first time user through the process to use this library? From snazarkin at azul.com Fri Jul 6 10:25:58 2018 From: snazarkin at azul.com (Sergey Nazarkin) Date: Fri, 6 Jul 2018 10:25:58 +0000 Subject: Ubuntu 16.04 Build In-Reply-To: References: Message-ID: <1A2F0E61-D37E-46D3-A8D1-0B78A08199C3@azul.com> Hi Allan, you can start from official page http://openjdk.java.net/projects/dio/. The build is rather simple: just set JAVA_HOME= and launch make. Sergey Nazarkin > On 6 Jul 2018, at 00:07, Allen Myers wrote: > > I'd like to try and get this library working for a Ubuntu server that is > connected to an Arduino Zero. > > I'm having trouble finding documentation/examples on how to build the > library. Are there binaries available somewhere? > > Is there any document/guide that might walk a first time user through the > process to use this library? From snazarkin at azul.com Fri Jul 13 19:31:47 2018 From: snazarkin at azul.com (snazarkin at azul.com) Date: Fri, 13 Jul 2018 19:31:47 +0000 Subject: hg: dio/dev: DIO-27: Better support of cross-compilation Message-ID: <201807131931.w6DJVl7a000384@aojmv0008.oracle.com> Changeset: e9febb974bec Author: snazarki Date: 2018-07-13 22:30 +0300 URL: http://hg.openjdk.java.net/dio/dev/rev/e9febb974bec DIO-27: Better support of cross-compilation ! Makefile From snazarkin at azul.com Fri Jul 13 19:38:37 2018 From: snazarkin at azul.com (Sergey Nazarkin) Date: Fri, 13 Jul 2018 19:38:37 +0000 Subject: RFR: better support for cross compilation In-Reply-To: <8D485CFB-3D72-457E-B226-1BB3AB2FAF00@azul.com> References: <8D485CFB-3D72-457E-B226-1BB3AB2FAF00@azul.com> Message-ID: <6FBDB9F3-1DEA-4A28-8CCC-8A02FCFFCD86@azul.com> Hi! Since there was no objection, I?ve committed the last version of Makefile changes. WBR, Sergey Nazarkin > On 2 Jul 2018, at 13:25, Sergey Nazarkin wrote: > > So far I?ve got the only single response with the proposal to remove redundant PI_TOOLS variable. I?ve accepted it and new changeset would be > > diff -r 1b3d9720d724 Makefile > --- a/Makefile Tue Jun 19 19:15:30 2018 +0300 > +++ b/Makefile Mon Jul 02 13:20:46 2018 +0300 > @@ -40,14 +40,19 @@ > > ########################################################### > # check for required env vars > + > ifeq ($(CROSS_TOOL),) > - $(error "CROSS_TOOL is not defined. Please set CROSS_TOOL to point to the location of the raspberry pi GNU toolchain") > + $(error "CROSS_TOOL is not defined. Please set CROSS_TOOL to point to the location of the cross compilation GNU toolchain") > endif > > ifeq ($(JAVA_HOME),) > $(error "JAVA_HOME is not defined. Please set JAVA_HOME to point to the location of the JDK8 installation") > endif > > +# Target device JDK build, required for cross compilation, should contain "include /jni.h" and "inlude/linux/jni_md.h" > +# Default value points to host JDK > +TARGET_JDK_PATH ?= $(JAVA_HOME) > + > BUILD_DEVICEACCESS := true > > DIO_JAVA_API_DIRS := \ > @@ -79,10 +84,10 @@ > BUILD_NUMBER ?= dev > > ifneq ($(BUILD_NUMBER),dev) > - # only include 'b' when you have an actual build number > + # only include 'b' when you have an actual build number > B := b > endif > - > + > > ifeq ($(TARGET_CPU_LEGACY_LIB),arm) > OSGI_ARCH := arm > @@ -165,15 +170,15 @@ > > ####################################################################################################### > # tool and flag setup for arm (rasp pi) build > -TARGET_TOOLCHAIN := $(CROSS_TOOL) > -TARGET_CC := $(TARGET_TOOLCHAIN)gcc > -TARGET_CXX := $(TARGET_TOOLCHAIN)g++ > -TARGET_LD := $(TARGET_TOOLCHAIN)gcc > +TARGET_CC := $(CROSS_TOOL)gcc > +TARGET_CXX := $(CROSS_TOOL)g++ > +TARGET_LD := $(CROSS_TOOL)gcc > + > JAVAC := $(JAVA_HOME)/bin/javac > JAR := $(JAVA_HOME)/bin/jar > MKDIR := mkdir -p > TARGET_C_FLAGS = $(USER_C_FLAGS) -fPIC -Wno-psabi -DJAVACALL_REPORT_LEVEL=0 -DENABLE_DEVICEACCESS -c -MMD -MF $(NATIVE_OUT_DIR)/$(@).d > -TARGET_INCLUDES = $(foreach d,$(DIO_INCLUDE_DIRS),-I$(d)) -I$(JAVA_TARGET_HOME)/include -I$(JAVA_TARGET_HOME)/include/linux > +TARGET_INCLUDES = $(foreach d,$(DIO_INCLUDE_DIRS),-I$(d)) -I$(TARGET_JDK_PATH)/include -I$(TARGET_JDK_PATH)/include/linux > TARGET_CXX_FLAGS = $(USER_CXX_FLAGS) -fPIC -Wno-psabi -DJAVACALL_REPORT_LEVEL=4 -DENABLE_DEVICEACCESS -c > TARGET_LD_FLAGS= $(USER_LD_FLAGS) -Xlinker -z -Xlinker defs -Xlinker -O1 \ > -shared \ > From allen at aemyers.com Tue Jul 17 23:10:37 2018 From: allen at aemyers.com (Allen Myers) Date: Tue, 17 Jul 2018 16:10:37 -0700 Subject: Ubuntu 16.04 Build In-Reply-To: <1A2F0E61-D37E-46D3-A8D1-0B78A08199C3@azul.com> References: <1A2F0E61-D37E-46D3-A8D1-0B78A08199C3@azul.com> Message-ID: Thank you, Sergey. I still have a problem if I don't define a CROSS_TOOL value. If I comment out line 45: http://hg.openjdk.java.net/dio/dev/file/e9febb974bec/Makefile#l45 Will the build still produce as expected? Where does the libdio.so file need to exist? Classpath? On Fri, Jul 6, 2018 at 3:25 AM, Sergey Nazarkin wrote: > > Hi Allan, > > you can start from official page http://openjdk.java.net/projects/dio/. > The build is rather simple: just set JAVA_HOME= and launch > make. > > > Sergey Nazarkin > > > > > > On 6 Jul 2018, at 00:07, Allen Myers wrote: > > > > I'd like to try and get this library working for a Ubuntu server that is > > connected to an Arduino Zero. > > > > I'm having trouble finding documentation/examples on how to build the > > library. Are there binaries available somewhere? > > > > Is there any document/guide that might walk a first time user through the > > process to use this library? > > From snazarkin at azul.com Wed Jul 18 09:30:11 2018 From: snazarkin at azul.com (Sergey Nazarkin) Date: Wed, 18 Jul 2018 09:30:11 +0000 Subject: Ubuntu 16.04 Build In-Reply-To: References: <1A2F0E61-D37E-46D3-A8D1-0B78A08199C3@azul.com> Message-ID: <5CCA6458-CC90-49C8-90C4-302EE0AFDC23@azul.com> > On 18 Jul 2018, at 02:10, Allen Myers wrote: > > Thank you, Sergey. I still have a problem if I don't define a CROSS_TOOL value. > > If I comment out line 45: http://hg.openjdk.java.net/dio/dev/file/e9febb974bec/Makefile#l45 > > Will the build still produce as expected? It depends on what are expecting to get. Without CROSS_TOOL the library is built with host GCC, so that x86 linux will produce library for the intel cpu. > > Where does the libdio.so file need to exist? Classpath? The path to the native library should be provided with -Djava.library.path= > > On Fri, Jul 6, 2018 at 3:25 AM, Sergey Nazarkin wrote: > > Hi Allan, > > you can start from official page http://openjdk.java.net/projects/dio/. The build is rather simple: just set JAVA_HOME= and launch make. > > > Sergey Nazarkin > > > > > > On 6 Jul 2018, at 00:07, Allen Myers wrote: > > > > I'd like to try and get this library working for a Ubuntu server that is > > connected to an Arduino Zero. > > > > I'm having trouble finding documentation/examples on how to build the > > library. Are there binaries available somewhere? > > > > Is there any document/guide that might walk a first time user through the > > process to use this library? > > From allen at aemyers.com Wed Jul 18 15:05:47 2018 From: allen at aemyers.com (Allen Myers) Date: Wed, 18 Jul 2018 08:05:47 -0700 Subject: Ubuntu 16.04 Build In-Reply-To: <5CCA6458-CC90-49C8-90C4-302EE0AFDC23@azul.com> References: <1A2F0E61-D37E-46D3-A8D1-0B78A08199C3@azul.com> <5CCA6458-CC90-49C8-90C4-302EE0AFDC23@azul.com> Message-ID: Sergey: Thank you again. So as I look deeper into this library, I'm starting to realize maybe it is not what I need. I'm running a Java application from an x86 Ubuntu computer that connects to an Arduino Zero via the USB port. Is it possible to use this library for that USB connection? On Wed, Jul 18, 2018 at 2:30 AM, Sergey Nazarkin wrote: > > > On 18 Jul 2018, at 02:10, Allen Myers wrote: > > > > Thank you, Sergey. I still have a problem if I don't define a CROSS_TOOL > value. > > > > If I comment out line 45: http://hg.openjdk.java.net/ > dio/dev/file/e9febb974bec/Makefile#l45 > > > > Will the build still produce as expected? > > It depends on what are expecting to get. Without CROSS_TOOL the library is > built with host GCC, so that x86 linux will produce library for the intel > cpu. > > > > > Where does the libdio.so file need to exist? Classpath? > > The path to the native library should be provided with > -Djava.library.path= > > > > > On Fri, Jul 6, 2018 at 3:25 AM, Sergey Nazarkin > wrote: > > > > Hi Allan, > > > > you can start from official page http://openjdk.java.net/projects/dio/. > The build is rather simple: just set JAVA_HOME= and launch > make. > > > > > > Sergey Nazarkin > > > > > > > > > > > On 6 Jul 2018, at 00:07, Allen Myers wrote: > > > > > > I'd like to try and get this library working for a Ubuntu server that > is > > > connected to an Arduino Zero. > > > > > > I'm having trouble finding documentation/examples on how to build the > > > library. Are there binaries available somewhere? > > > > > > Is there any document/guide that might walk a first time user through > the > > > process to use this library? > > > > > > From snazarkin at azul.com Wed Jul 18 15:51:05 2018 From: snazarkin at azul.com (Sergey Nazarkin) Date: Wed, 18 Jul 2018 15:51:05 +0000 Subject: Ubuntu 16.04 Build In-Reply-To: References: <1A2F0E61-D37E-46D3-A8D1-0B78A08199C3@azul.com> <5CCA6458-CC90-49C8-90C4-302EE0AFDC23@azul.com> Message-ID: <7FD5E014-23FA-49A8-80DF-0AFE44478988@azul.com> Allen, DIO dio doesn?t support USB since there are special libraries for this. Sergey Nazarkin > On 18 Jul 2018, at 18:05, Allen Myers wrote: > > Sergey: Thank you again. > > So as I look deeper into this library, I'm starting to realize maybe it is not what I need. I'm running a Java application from an x86 Ubuntu computer that connects to an Arduino Zero via the USB port. > > Is it possible to use this library for that USB connection? > > > On Wed, Jul 18, 2018 at 2:30 AM, Sergey Nazarkin wrote: > > > On 18 Jul 2018, at 02:10, Allen Myers wrote: > > > > Thank you, Sergey. I still have a problem if I don't define a CROSS_TOOL value. > > > > If I comment out line 45: http://hg.openjdk.java.net/dio/dev/file/e9febb974bec/Makefile#l45 > > > > Will the build still produce as expected? > > It depends on what are expecting to get. Without CROSS_TOOL the library is built with host GCC, so that x86 linux will produce library for the intel cpu. > > > > > Where does the libdio.so file need to exist? Classpath? > > The path to the native library should be provided with -Djava.library.path= > > > > > On Fri, Jul 6, 2018 at 3:25 AM, Sergey Nazarkin wrote: > > > > Hi Allan, > > > > you can start from official page http://openjdk.java.net/projects/dio/. The build is rather simple: just set JAVA_HOME= and launch make. > > > > > > Sergey Nazarkin > > > > > > > > > > > On 6 Jul 2018, at 00:07, Allen Myers wrote: > > > > > > I'd like to try and get this library working for a Ubuntu server that is > > > connected to an Arduino Zero. > > > > > > I'm having trouble finding documentation/examples on how to build the > > > library. Are there binaries available somewhere? > > > > > > Is there any document/guide that might walk a first time user through the > > > process to use this library? > > > > > >