souffle-lang / souffle

Soufflé is a variant of Datalog for tool designers crafting analyses in Horn clauses. Soufflé synthesizes a native parallel C++ program from a logic specification.
http://souffle-lang.github.io/
Universal Permissive License v1.0
913 stars 206 forks source link

`jni.h` not found when running with `-s java` in Ubuntu #2496

Open DIvanov503 opened 3 months ago

DIvanov503 commented 3 months ago

When trying to generate SWIG binding to datalog file I'm getting the following error:

SwigInterface_wrap.cxx:178:10: fatal error: jni.h: No such file or directory
  178 | #include <jni.h>
      |          ^~~~~~~
compilation terminated.
Traceback (most recent call last):
  File "/usr/bin/souffle-compile.py", line 171, in <module>
    launch_command(cmd, "Compilation of SWIG C++", verbose=args.verbose)
  File "/usr/bin/souffle-compile.py", line 73, in launch_command
    raise RuntimeError("Error: {}. Command: {}".format(descr, cmd))
RuntimeError: Error: Compilation of SWIG C++. Command: "/usr/bin/c++" -fPIC -c -D__EMBEDDED_SOUFFLE__ SwigInterface_wrap.cxx /home/dmitry/datalog/acycle.cpp -DRAM_DOMAIN_SIZE=64 -DUSE_NCURSES -DUSE_LIBZ -DUSE_SQLITE  -I/souffle/src/include -I/usr/include -std=c++17  -fopenmp -O3  -I -I
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 76, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0]))
FileNotFoundError: [Errno 2] No such file or directory

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/souffle-compile.py", line 171, in <module>
    launch_command(cmd, "Compilation of SWIG C++", verbose=args.verbose)
  File "/usr/bin/souffle-compile.py", line 73, in launch_command
    raise RuntimeError("Error: {}. Command: {}".format(descr, cmd))
RuntimeError: Error: Compilation of SWIG C++. Command: "/usr/bin/c++" -fPIC -c -D__EMBEDDED_SOUFFLE__ SwigInterface_wrap.cxx /home/dmitry/datalog/acycle.cpp -DRAM_DOMAIN_SIZE=64 -DUSE_NCURSES -DUSE_LIBZ -DUSE_SQLITE  -I/souffle/src/include -I/usr/include -std=c++17  -fopenmp -O3  -I -I
failed to compile C++ sources

I installed Soufflé with apt, hence I believe the prebuilt version doesn't use my JAVA_HOME to generate an include path.