Hello,
I am trying to build an application with dealii in which i need to interface with a Python file. However, i am facing a segmentation fault when the following condition is true:
Condition: the Python file imports numpy AND a dealii object (say a Tensor<1,3>) is called.
I don't face such an issue if either of the conditions is altered.
I am also not facing such an issue when I have another library's (say Eigen) object called.
The segmentation fault appears only when "Condition" is true. I have tried to create a reproducible example which has the following files:
1. cpp_to_python.h - Declares the function python_interface_function() in class cpp_to_python
2. cpp_to_python.cpp - Defines the function python_interface_function() in class cpp_to_python
3. main.cpp - creates an object of type cpp_to_python and calls the function python_interface_function()
4. python_test.py - a simple python file that is called inside python_interface_function() to test the interface between cpp and python
5. CMakeLists.txt - contains all the packages that are needed for this example
Note regarding the reproducible example:
1. When one runs the executable, one will get the segmentation fault error. However, there will be no error if one comments out the line in which dealii object is called i.e. line 19 in main.cpp file - this shows that the issue is somehow with dealii and python coupling
2. Place the python_test.py in the build folder for it to be recognized.
Python version - 3.8
dealii version - 9.4
Can someone please help me with this issue? Let me know if there's any issue with running the reproducible example.