Commit b845cce6 authored by hanzo's avatar hanzo
Browse files

update config

parent cfb99d9b
libs/
*.pstats
external/
bin/
......
......@@ -111,7 +111,7 @@ First you need to clone Luddi and JPY repositories, then download C++ build and
If everything worked, you should have a build directory. Copy the content of the lib directory into the Ludii directory in a folder called **/LudiiPythonAI/libs/**. The Ludii jar file should also be moved to the libs directory. Finaly, you can build the jar file thanks to ant and the xml file, then export it in Ludii.
You also have to specify some paths in the configuration files such as **jpyconfig.py** and **jpyconfig.properties**.
You might also have to specify some paths in the configuration files such as **jpyconfig.py** and **jpyconfig.properties**. You might aswell modify **build.xml** file in order to set the correct classpath for the JPY snapshot.
There is an **alphazero_env.yml** file which can be used to create a conda environnement from scratch with all the required librairies with the command `conda env create -f alphazero_env.yml`.
......
......@@ -11,6 +11,7 @@
<pathelement location="libs/Ludii-1.3.4.jar"/>
<pathelement location="LudiiPythonAI.jar"/>
<pathelement location="libs/jpy-0.10.0-SNAPSHOT.jar"/>
<!-- <pathelement location="libs/jpy-0.12.0-SNAPSHOT.jar"/> -->
</path>
<target name="init">
......
# Created by 'jpyutil.py' tool on 2022-06-08 12:15:29.436031
# Created by 'jpyutil.py' tool on 2022-07-08 22:58:49.843149
# This file is read by the jpy Java API (org.jpy.PyLib class) in order to find shared libraries
# For LIP6 home
jpy.jpyLib = /home/durande/Bureau/AlphaZeroICGA/src/main/libs/jpy.cpython-39-x86_64-linux-gnu.so
jpy.jdlLib = /home/durande/Bureau/AlphaZeroICGA/src/main/libs/jdl.cpython-39-x86_64-linux-gnu.so
#jpy.jpyLib = /home/durande/Bureau/AlphaZeroICGA/src/main/libs/jpy.cpython-39-x86_64-linux-gnu.so
#jpy.jdlLib = /home/durande/Bureau/AlphaZeroICGA/src/main/libs/jdl.cpython-39-x86_64-linux-gnu.so
# For SCAI cluster
#jpy.jpyLib = /home/vittaut/AlphaZeroICGA/src/main/libs/jpy.cpython-39-x86_64-linux-gnu.so
#jpy.jdlLib = /home/vittaut/AlphaZeroICGA/src/main/libs/jdl.cpython-39-x86_64-linux-gnu.so
jpy.pythonLib = /usr/lib/x86_64-linux-gnu/libpython3.9.so
jpy.pythonPrefix = /usr
jpy.pythonExecutable = /usr/bin/python3
#jpy.pythonLib = /usr/lib/x86_64-linux-gnu/libpython3.9.so
#jpy.pythonPrefix = /usr
#jpy.pythonExecutable = /usr/bin/python3
# For personal computer
jpy.jpyLib = /home/hanzopgp/project/AlphaZeroICGA/src/main/libs/jpy.cpython-39-x86_64-linux-gnu.so
jpy.jdlLib = /home/hanzopgp/project/AlphaZeroICGA/src/main/libs/jdl.cpython-39-x86_64-linux-gnu.so
jpy.pythonLib = /home/hanzopgp/miniconda3/lib/libpython3.9.so
jpy.pythonPrefix = /home/hanzopgp/miniconda3
jpy.pythonExecutable = /home/hanzopgp/miniconda3/bin/python
\ No newline at end of file
# Created by 'jpyutil.py' tool on 2022-06-08 12:15:29.436031
# This file is read by the jpy Java API (org.jpy.PyLib class) in order to find shared libraries
jpy.jpyLib = /home/durande/Bureau/AlphaZeroICGA/src/main/libs/jpy.cpython-39-x86_64-linux-gnu.so
py.jdlLib = /home/durande/Bureau/AlphaZeroICGA/src/main/libs/jdl.cpython-39-x86_64-linux-gnu.so
jpy.pythonLib = /usr/lib/x86_64-linux-gnu/libpython3.9.so
jpy.pythonPrefix = /usr
jpy.pythonExecutable = /usr/bin/python3
# Created by 'jpyutil.py' tool on 2022-06-08 12:15:29.434869
# Created by 'jpyutil.py' tool on 2022-07-08 21:36:19.198104
# This file is read by the 'jpyutil' module in order to load and configure the JVM from Python
#java_home = '/usr/lib/jvm/java-11-openjdk-amd64/'
java_home = '/home/durande/binaries/jdk-18.0.1.1'
#jvm_dll = '/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so'
jvm_dll = '/home/durande/binaries/jdk-18.0.1.1/lib/server/libjvm.so'
java_home = 'C:\\Program Files\\Java\\jdk-18.0.1.1'
jvm_dll = 'C:\\Program Files\\Java\\jdk-18.0.1.1\\bin\\server\\jvm.dll'
jvm_maxmem = None
jvm_classpath = []
jvm_properties = {}
......
......@@ -36,7 +36,7 @@ import subprocess
__author__ = "Norman Fomferra (Brockmann Consult GmbH) and contributors"
__copyright__ = "Copyright 2015-2018 Brockmann Consult GmbH and contributors"
__license__ = "Apache 2.0"
__version__ = "0.10.0.dev1"
__version__ = "0.12.0.dev0"
# Setup a dedicated logger for jpyutil.
......@@ -444,13 +444,17 @@ def init_jvm(java_home=None,
config=config)
logger.debug('Creating JVM with options %s' % repr(jvm_options))
jpy.create_jvm(options=jvm_options)
py_lib_initializer = jpy.get_type('org.jpy.PyLibInitializer')
py_lib_initializer.initPyLib(
_find_python_dll_file(fail=True),
_get_module_path('jpy', fail=True),
_get_module_path('jdl', fail=True)
)
try:
py_lib_initializer = jpy.get_type('org.jpy.PyLibInitializer')
py_lib_initializer.initPyLib(
_find_python_dll_file(fail=True),
_get_module_path('jpy', fail=True),
_get_module_path('jdl', fail=True)
)
except ValueError:
# It's valid to not have jpy.jar on the classpath if you don't expect java to call into python
logger.debug("Unable to find org.jpy.PyLibInitializer on classpath")
pass
else:
jvm_options = None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment