On running coffee.py in > out (ImportError: dynamic module does not define module export function)

64 views
Skip to first unread message

Brian Leininger

unread,
Mar 9, 2021, 2:42:45 PM3/9/21
to CoFFEE code forum
I'm trying to run the example for 4x4x4 C_vac (q=-2) found in:

CoFFEE_1.1/Examples/3D/Diamond/Model_Scaling/4x4x4

and am getting the attached import error.

Is the attached error indicative of a compiling issue for the .so files or is there another cause?

Any help is appreciated, thank you

Brian Leininger

CoFFEE_diamond_error.PNG

Mit Naik

unread,
Mar 9, 2021, 2:47:10 PM3/9/21
to CoFFEE code forum
Hi Brian,

Did you perform the setup: python setup.py build_ext -b PoissonSolver/? See the README.txt in the CoFFEE folder.

Best,
Mit

Brian Leininger

unread,
Mar 9, 2021, 2:50:09 PM3/9/21
to CoFFEE code forum
Mit,

Yes, I performed the setup and have the .so files in the PoissonSolver/ folder

Best,

Brian Leininger

Mit Naik

unread,
Mar 9, 2021, 2:54:06 PM3/9/21
to CoFFEE code forum
Do you have the file matvec1D.so in the PoissonSolver/ folder? Also, can you compile with python2 and try the example?

Brian Leininger

unread,
Mar 9, 2021, 3:04:57 PM3/9/21
to CoFFEE code forum
Mit,

Yes, they are currently inside the PoissonSolver/ folder.
ps3d.so
matvec2D.so
matvec1D.so

should they be in their respective PS_3D_cy, MV_2D_cy and MV_1D_cy folders?

This was done using Python2.7.

Brian Leininger

Mit Naik

unread,
Mar 9, 2021, 3:27:00 PM3/9/21
to CoFFEE code forum
They should be in the PoissonSolver/ folder. 

Not sure if this will solve the issue, but maybe you can try cythonizing the .pyx files from scratch. 
You will need Cython for this: pip install cython
Go to the folder: CoFFEE_1.1/PoissonSolver/MV_1D_cy/,  CoFFEE_1.1/PoissonSolver/MV_2D_cy/, CoFFEE_1.1/PoissonSolver/PS_3D_cy/ and follow the README instructions. Then copy the new .so files generated to CoFFEE_1.1/PoissonSolver/

Best,
Mit

Brian Leininger

unread,
Mar 9, 2021, 6:00:02 PM3/9/21
to CoFFEE code forum
Following the above instructions:

I received the same overall results when running coffee.py

When cythonizing the .pyx files from scratch, I received the attached warnings, but still produced a .so file.

Moved the .so files to the correct directory and re-ran the coffee.py. Same ImportError.

-----------------------------

Also, in the CoFFEE_1.1/README file, it's mentioned in the dependencies,"5. Cython, if you wish to make any changes to the Poisson solver". That said, w/o Cython, there are no .so files to be used, what exactly is the purpose of the .so files?

Thank you,

Brian Leininger
CoFFEE_warning_02.PNG
CoFFEE_warning_01.jpg
CoFFEE_warning_03.PNG

Brian Leininger

unread,
Mar 12, 2021, 12:18:14 PM3/12/21
to CoFFEE code forum
UPDATE:

I ended up starting from scratch in a conda Python2.7 environment.

Ran exactly each step in the User's Guide and everything has worked so far.

Thank for all the help.

Best,

Brian Leininger

On Tuesday, March 9, 2021 at 2:27:00 PM UTC-6 mit...@gmail.com wrote:

Mit Naik

unread,
Mar 12, 2021, 1:33:48 PM3/12/21
to CoFFEE code forum
That's great! Glad it worked out.

Let me know if you have any other trouble.

Best,
Mit
Reply all
Reply to author
Forward
0 new messages