Skip to content

Commit b6809b4

Browse files
authored
Merge pull request #54 from lemire/dlemire/adding_actions
Adding github actions.
2 parents b3e1f4f + 25840b4 commit b6809b4

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

.github/workflows/basic.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Java CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
java: [ 11, 16 ]
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up JDK
15+
uses: actions/[email protected]
16+
with:
17+
java-version: ${{ matrix.java }}
18+
distribution: 'adopt'
19+
- name: Build and test with Maven
20+
run: mvn package
21+
- name: Build example
22+
run: javac -cp target/classes/:. example.java
23+
- name: Run example
24+
run: java -cp target/classes/:. example

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ Most others do not.
7070
The Java Team at Intel (R) introduced the vector implementation for FastPFOR
7171
based on the Java Vector API that showed significant gains over the
7272
non-vectorized implementation. For an example usage, see
73-
examples/vector/Example.java. The feature requires JDK 19+.
73+
examples/vector/Example.java. The feature requires JDK 19+ and is currently for
74+
advanced users.
7475

7576
Maven central repository
7677
------------------------
@@ -166,21 +167,22 @@ Speed is always reported in millions of integers per second.
166167
For Maven users
167168
---------------
168169

169-
If you are running JDK 19+
170+
The current development versions assume JDK 11 or better.
170171

171172
```
172173
mvn compile
174+
mvn exec:java
173175
```
174176

175-
If you are running earlier versions of JDK
177+
You may run our examples as follows:
176178

179+
````
180+
mvn package
181+
javac -cp target/classes/:. example.java
182+
java -cp target/classes/:. example
177183
```
178-
mvn compiler:compile@default-compile
179-
```
180-
181-
mvn exec:java
182184
183-
For ant users
185+
For ant users (legacy, currently untested)
184186
-------------
185187
186188
If you use Apache ant, please try this:

example.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ public static void basicExample() {
8888
/**
8989
* Like the basicExample, but we store the input array size manually.
9090
*/
91-
@Test
92-
public void basicExampleHeadless() {
91+
public static void basicExampleHeadless() {
9392
int[] data = new int[2342351];
9493
System.out.println("Compressing " + data.length + " integers in one go using the headless approach");
9594
// data should be sorted for best

pom.xml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
<groupId>org.apache.maven.plugins</groupId>
6565
<artifactId>maven-compiler-plugin</artifactId>
6666
<version>3.8.0</version>
67+
<configuration>
68+
<source>11</source>
69+
<target>11</target>
70+
</configuration>
6771
<executions>
6872
<execution>
6973
<id>default-compile</id>
@@ -76,18 +80,19 @@
7680
<exclude>me/lemire/integercompression/vector/*</exclude>
7781
<exclude>module-info.java</exclude>
7882
</excludes>
79-
</configuration>
80-
</execution>
81-
<execution>
83+
</configuration>
84+
</execution>
85+
<!-- The vector module will be enabled when JDK19+ is LTE, currently only for advanced users. -->
86+
<!--<execution>
8287
<id>vector-fastpfor</id>
8388
<phase>compile</phase>
8489
<goals>
8590
<goal>compile</goal>
8691
</goals>
87-
<configuration>
92+
<configuration>
8893
<release>19</release>
89-
</configuration>
90-
</execution>
94+
</configuration>
95+
</execution> -->
9196
</executions>
9297
</plugin>
9398
<plugin>
@@ -127,9 +132,9 @@
127132
<plugin>
128133
<groupId>org.apache.maven.plugins</groupId>
129134
<artifactId>maven-javadoc-plugin</artifactId>
130-
<version>3.0.0</version>
135+
<version>3.4.1</version>
131136
<configuration>
132-
<excludePackageNames>com.kamikaze.pfordelta:me.lemire.integercompression.benchmarktools</excludePackageNames>
137+
<excludePackageNames>me.lemire.integercompression.vector;com.kamikaze.pfordelta:me.lemire.integercompression.benchmarktools</excludePackageNames>
133138
</configuration>
134139
<executions>
135140
<execution>

src/main/java/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
// SPDX-License-Identifier: Apache-2.0
44
module me.lemire.integercompression {
5-
requires jdk.incubator.vector;
5+
// This is currently only for advanced users:
6+
// requires jdk.incubator.vector;
67
exports me.lemire.integercompression;
78
exports me.lemire.integercompression.vector;
89
}

0 commit comments

Comments
 (0)