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

[Bug][JAVA]: maven failed to build libgar-jni.so #260

Closed
1 task done
acezen opened this issue Oct 23, 2023 · 2 comments · Fixed by #261
Closed
1 task done

[Bug][JAVA]: maven failed to build libgar-jni.so #260

acezen opened this issue Oct 23, 2023 · 2 comments · Fixed by #261
Assignees

Comments

@acezen
Copy link
Contributor

acezen commented Oct 23, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

build the java sdk with maven got error:

[exec] /usr/lib/llvm-11/bin/clang++  -Dgar_jni_EXPORTS -I/home/john/GraphAr/java/src/main/native -I/home/j
ohn/GraphAr/java/src/test/native -isystem /home/john/GraphAr/java/target/native/graphar_ep-prefix/include -isystem /us
r/lib/jvm/java-8-openjdk-amd64/include -isystem /usr/lib/jvm/java-8-openjdk-amd64/include/linux  -flto -fforce-emit-vt
ables -O3 -g -std=c++17 -Wall -fPIC   -pthread -std=gnu++17 -o CMakeFiles/gar-jni.dir/target/generated-sources/annotat
ions/jni_com_alibaba_graphar_writers_builder_VerticesBuilder_cxx_0xd05edbb.cc.o -c /home/john/GraphAr/java/target/gene
rated-sources/annotations/jni_com_alibaba_graphar_writers_builder_VerticesBuilder_cxx_0xd05edbb.cc
[INFO]      [exec] make[2]: Leaving directory '/home/john/GraphAr/java/target/native'
[INFO]      [exec] make[1]: Leaving directory '/home/john/GraphAr/java/target/native'
[INFO]      [exec] make[2]: *** No rule to make target 'graphar_ep-prefix/lib/libgar.so', needed by 'libgar-jni.so'.  
Stop.
[ERROR] /home/john/GraphAr/java/build.xml:24: exec returned: 2
[ERROR] around Ant part ...<ant antfile="/home/john/GraphAr/java/build.xml">... @ 5:54 in /home/john/GraphAr/java/targ
et/antrun/build-main.xml

Expected Behavior

build successful without error.

Minimal Reproducible Example

maven clean test

Environment

  • Operating system: Ubuntu 20.04
  • CMake version: 3.16.3
  • GraphAr version: commit

Link to GraphAr Logs

No response

Further Information

No response

@acezen acezen self-assigned this Oct 23, 2023
@acezen
Copy link
Contributor Author

acezen commented Oct 23, 2023

This issue is reported by @Thespica

@acezen
Copy link
Contributor Author

acezen commented Oct 23, 2023

After digging into @Thespica 's building environment, seems that the generated MakeFile of java's CMakeList has the wrong building order:
Makefile2.txt

# The main recursive "all" target.
all: CMakeFiles/gar-jni.dir/all
all: CMakeFiles/graphar_ep.dir/all

.PHONY : all

# The main recursive "preinstall" target.
preinstall:

.PHONY : preinstall

# The main recursive "clean" target.
clean: CMakeFiles/gar-jni.dir/clean
clean: CMakeFiles/graphar_ep.dir/clean

gar-jni target depends on target graphar, but the building order is wrong.

After debugging, the code:
https://github.com/alibaba/GraphAr/blob/c3ced985b49a9c2be6aaff7acc287dc9a870cdec/java/CMakeLists.txt#L28
it links the graphar with a variable name, this could be empty if graphar not building yet.
Here should use the imported target name to enforce the graphar building before gar-jni.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant