Bugfixes and compatibility updates - #52
Conversation
Added license text and reformatted the source code
Reformatted the C++ source code using the auto file formatting feature in vscode.
Included the source code of Approximate Novelty Search
New documentation and update auto-doc build process. The install
- Removed Automatic Sphinx documentation generation as it is incompatible with python >=3.11. - Included source code of Boost, Catch2 and Fast-Downward. Earlier, these were being downloaded over HTTPS. - Added anytime-fd option, which calls a fast-downward solver configuration
Cmake policies are version dependent; cannot be set on older versions and are necessary for newer releases.
Because of changes to standard library interface on windows, Python 3.7 and 3.8 cause error with Boost headers. Python 3.7 and 3.8 headers redefine sprintf as _sprintf. When Boost attempts to use sprintf, it is redirected to _sprintf, which was reimplemented as sprintf and does not exist. See boostorg/system#32. Resolution: we are deprecating the support for Python 3.7 and 3.8 on Windows as the error cannot be resolved without making changes to the Python headers.
Added Python 3.11 and 3.12 to the GitHub build workflow.
Once a static variable has been initialized, further initializations have no effect. Hence. static std::vector<int> var_count = std::vector<int>(prob.fluents().size(), 0), will not resize the vector if the count of fluents increases.
Shortening "approximate" novelty search
Include ctest cases based on Never Winter Night Game; these problems were designed by Miguel.
setuptools package was removed from Python 3.12 standard modules
Planenr setup method must be called before solve.
The destructor deletes the match tree; however, it is not guaranteed that the match tree will be created. A pointer must be initialized before it is deleted. So, we initialize the match tree pointer to nullptr when a match tree object is created.
- Ubuntu 18 image was removed from GitHub actions which we use to compile and publish the lapkt pypi package. - Fixed the path to pytest python files - Ubuntu 22.04 and 24.04 added to build_test workflow
Python 3.7 is unavailable for Ubuntu 24.04. So, we must deprecate it for Ubuntu 24.04 and later.
- Updated comments to reflect the most recent code. - Removed Sphinx auto doc generation routine entirely; the html it generated looked nice, but it was cumbersome to update the build routines for newer Python and Ubuntu version.
On windows static python wrappers are generated which we cannot link to from cpp_unit_test
to publish version lapkt 0.2.0 for glibc 2.35 and 2.39 and python 3.11 and 3.12.
|
@anubhav-cs , I'm trying to build in my mac (I know this may lead us to a headache we can solve later on). But, just in case. The error happens when I try to run cmake --build builds/build -j4 for which I get the error: -- CMAKE_INSTALL_NAME_DIR @loader_path
CMake Error at CMakeLists.txt:343 (set_target_properties):
set_target_properties Can not find target to add properties to: wrapper
CMake Error at CMakeLists.txt:348 (target_link_libraries):
Cannot specify link libraries for target "wrapper" which is not built by
this project.
-- Configuring incomplete, errors occurred!
make[2]: *** [cmake/SuperBuildLinux/external_lapkt-prefix/src/external_lapkt-stamp/external_lapkt-configure] Error 1
make[1]: *** [cmake/SuperBuildLinux/CMakeFiles/external_lapkt.dir/all] Error 2
make: *** [all] Error 2When I look at the cmakelist.txt file at line 348, you have this comment in it (# CHECK THIS FOR MACOS): #---- Python extensions ----#
#---- CXX Wrappers over LAPKT lib ----#
if(WINDOWS_BUILD)
pybind11_add_module(wrapper SHARED)
elseif(LINUX_BUILD)
add_library(wrapper SHARED)
target_link_libraries(wrapper PUBLIC
pybind11::pybind11
)
endif()
set_target_properties(wrapper PROPERTIES
PREFIX ""
INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:$ORIGIN" # CHECK THIS FOR MACOS
)Any clue which target path is the compiler looking for? |
Declaring python wrapper libraries using the same construct as Linux for macos. This may not work!
We replace it with the next available version macos-13
|
@nirlipo I did some changes to the cmake config. Can you try build the package again? On the GitHub's macos-13 image, it is failing to install the PyPi ruamel.yaml package; the compiler fails to find Also, Apple, MS, and Linux have their own ecosystem of libraries, binary formats and system paths; different things breaks in different ways, for each OS, whenever LAPKT dependencies get updated. One needs to know every aspect of the OS to configure the build properly. I can own this for Linux and Windows, but not for macos; I do not have sufficient knowledge of macos ecosystem. I suggest that someone who owns a mac be in-charge of the build steps for macos. |
|
The error on macos-13 |
…lic into pr/anubhav-cs/52
|
Hi @anubhav-cs , I added a couple of lines, to get my wrapper compiling, but now it fails to link due to some issues with pybind. https://gist.github.com/nirlipo/20bf85d3b198f920afb142ec70f416cd I tried with python 3.9 and 3.13, same issues. The gist above shares the command I used and the error message. We could accept this PR and open another issue to solve the MAC compilation errors. What do you think? Strangely enough, I have no issues installing realme in my local mac as it shows in the failed buildingtest BuildTest / build-macos-13 (3.10) (pull_request) |
|
Yes, we should move ahead with the PR. That way, I can push a new release on PyPi which Andrew can use for the tutorials. I think resolving issues with macos will take time. Could you please comment-out the lines 380 to 469 in The errors: stem from Python library not having certain symbols. May be it is linking to the wrong version of Python. I searched on Google and a Reddit note: https://www.reddit.com/r/cpp_questions/comments/ulyaii/pybind11_error_compatibility_andor_linker_issue/ pointed me to the pybind11 build instructions page: https://pybind11.readthedocs.io/en/stable/compiling.html#building-manually. We may need to add after line 151 in |
|
Great! with your suggested flag, I managed to compile and build in my local MAC using python 3.13! I created a special pip_requirements_mac.txt file for MAC where I fixed the version for realme.yaml. Hopefully this fixes the issue with the automatic build, and changed the superbuild cmake file to use it only for MAC OS builds. |
|
@anubhav-cs I managed to push the dial with the MAC OS built. I think we are close now, it still fails to build ruamel.yaml but it compiles, and fails only in the pytest section. Something to do whith python not finding the location of the library. see https://github.com/LAPKT-dev/LAPKT-public/actions/runs/14099081875/job/39491830134?pr=52 Ok, I comment out the build for mac and will accept the PR, and create another issue for MAC. |
|
see issue #53 wrt MAC build |
Important Changes:
v0.2.0
Others:
Known Issue:
Jupyter notebooks using Python 3.12 crash when the planner is called. However, the conversion of the notebooks to Python scripts works as expected. This is a very weird bug, and Jupyter does not give any helpful information even at the debug verbosity level. Python 3.9, 3.10, and 3.11 were tested with Jupyter notebooks and worked as expected.