Hi Bruno, I'm hesitant to propose a change, as doing so may break the build process for other people using different Python binding configurations. I'm also by no means a CMake expert :-) However, if it's a safe assumption that anyone using the bindings is using Python3, sure.
As for what type of bindings, I was planing on writing some for the mesh-refinement indicators and executing mesh refinement. Most of the bindings I'm planning to write would be specific to solvers I've developed on top of deal ii, but some of the functionality might be useful to the community. The idea is to drive the adaptive refinement of a solver with a Python code that has access to machine learning libraries such as PyTorch. Corbin On Wednesday, April 20, 2022 at 8:15:57 AM UTC-4 [email protected] wrote: > Corbin, > > That's great. Let us know if you encounter any other problems. What kind > of bindings do you want to write? BTW, do you want to open a PR with the > FindPython3 change? > > Best, > > Bruno > > Le mer. 20 avr. 2022 à 06:56, Corbin Foucart <[email protected]> a > écrit : > >> It looks like in the python-bindings CMakeLists.txt file here: >> https://github.com/dealii/dealii/blob/master/contrib/python-bindings/CMakeLists.txt >> >> There's a call to >> > INCLUDE(FindPythonInterp) >> on line 24. >> >> It seems that for cmake versions > 3.12, FindPythonInterp has been >> deprecated, with FindPython3 replacing it... modifying that line of the >> file manually, as well as manually setting the Boost version and python >> versions in the same CMakeLists.txt file to 1.71 and 3.8, respectively, I >> am able to get past the cmake errors. If the build process succeeds, I'll >> try writing some bindings. >> >> Corbin >> >> On Wednesday, April 20, 2022 at 6:06:21 AM UTC-4 Corbin Foucart wrote: >> >>> Hi Bruno, >>> >>> Thanks for the advice. >>> >>> It's my understanding that compiling boost.python code outputs a shared >>> object file (in this case, I'm guessing something like PyDealII/Debug.so) >>> which can be loaded as a module by a python interpreter (in this case by >>> adding the shared object location to the PYTHONPATH). Running 'find' in my >>> build directory, I was unable to find the shared object file. >>> >>> Digging deeper, I found that the actual flag is >>> -DDEAL_II_COMPONENT_PYTHON_BINDING*S*=ON, so I hadn't built the library >>> with the correct configuration. Attempting to build the python bindings, >>> the build of deal.ii fails, with the following error >>> >>> ``` >>> -- Setting up python bindings >>> -- Found PythonInterp: /usr/bin/python (found version "2.7.18") >>> -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found >>> version "2.7.18") >>> CMake Error at >>> /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 >>> (message): >>> Could NOT find Boost (missing: python27) (found suitable version >>> "1.71.0", >>> minimum required is "1.67") >>> Call Stack (most recent call first): >>> /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 >>> (_FPHSA_FAILURE_MESSAGE) >>> /usr/share/cmake-3.16/Modules/FindBoost.cmake:2179 >>> (find_package_handle_standard_args) >>> contrib/python-bindings/CMakeLists.txt:46 (_FIND_PACKAGE) >>> ``` >>> >>> I'm confused by this--I've installed boost and the build process finds >>> it, but I don't know why it's looking for Python 2.7, I have more recent >>> system versions (namely, 3.8) in the same directory. I imagine this might >>> be causing the issue with Boost, and I wouldn't be developing bindings for >>> python 2 anyway, as it's not supported. I'm using an Ubuntu 18.04 machine >>> and attempting to install deal.ii-9.3.3. Am I building this the wrong way? >>> >>> Thank you, >>> Corbin >>> >>> On Tuesday, April 19, 2022 at 4:37:11 PM UTC-4 [email protected] >>> wrote: >>> >>>> Corbin, >>>> >>>> On Tuesday, April 19, 2022 at 3:04:39 PM UTC-4 [email protected] >>>> wrote: >>>> >>>>> I've built deal.ii version 9.3.0 with the >>>>> -DDEAL_II_COMPONENT_PYTHON_BINDING=ON configuration, yet when I run the >>>>> notebook, the Jupyter kernel is unable to locate the PyDealII module, >>>>> that >>>>> is, the notebook cell >>>>> >>>>> > import PyDealII.Release as dealii >>>>> >>>>> fails with an import error. >>>>> >>>> I havent' use the python binding in a while but you probably need to >>>> set the PYTHONPATH to where pydealii is located. You may also need to add >>>> the path to libdealii.so to LD_LIBRARY_PATH >>>> >>>> Where is this library located, and how should I go about setting up a >>>>> (conda) environment to be able to use PyDealII? Are there dependencies? >>>>> >>>> The library should be located in the same directory where you installed >>>> deal.II. Look somewhere in /path/to/install/lib . I don't use conda so I >>>> can't help you with that. What kind of dependencies are you talking about? >>>> PyDealII only depends on deal.II and Boost.Python, nothing else >>>> >>>> Best, >>>> >>>> Bruno >>>> >>> -- >> The deal.II project is located at http://www.dealii.org/ >> For mailing list/forum options, see >> https://groups.google.com/d/forum/dealii?hl=en >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "deal.II User Group" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/dealii/XlPFOictshI/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/dealii/deac2b5e-0449-40f6-aeaf-ff83e536e614n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/dealii/deac2b5e-0449-40f6-aeaf-ff83e536e614n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/ffdaa408-093c-454a-87af-22f0a4a92cc0n%40googlegroups.com.
