"Cannot assign type 'char *' to 'string'" while compiling material_library

22 views
Skip to first unread message

Jonathon McKay

unread,
Nov 25, 2021, 6:15:56 PM11/25/21
to PyNE
Good afternoon
I've never posted here before, so you'll need to forgive me if I mess something up.

I look after a small HPC cluster where I work, and have been tasked with installing Pyne on it. Through various reasons, I can't simply install it with Anaconda, so I'm forced to download the source, and compile with the python setup.py script.

Here is the issue I'm having:
During the compile (make) phase of the setup.py script, it fails with what looks like a source code problem:

[ 68%] Compiling Cython CXX source for material_library...

Error compiling Cython file:
------------------------------------------------------------
...

"""
cdef char * c_filename
filename_bytes = filename.encode('UTF-8')
c_filename = filename_bytes
self._inst.from_json(c_filename)
                              ^
------------------------------------------------------------

/[redacted]/source/pyne-0.7.5/pyne/material_library.pyx:207:39: Cannot assign type 'char *' to 'string'
make[2]: *** [pyne/material_library.cxx] Error 1
make[2]: *** Deleting file `pyne/material_library.cxx'
make[1]: *** [pyne/CMakeFiles/material_library.dir/all] Error 2
make: *** [all] Error 2

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


Any ideas what's going on? While I am also a programmer, I don't personally know Cython, so I'm at a loss to the cause.

Some more details:
OS: CentOS 7.5
GCC 4.9.4
Python 3.6.1 (as "python3")
Cython 0.25.2
PyNE 0.7.5 (Downloaded tar from github just today)

Any help would be greatly appreciated.
Thank you

Andrew Davis

unread,
Nov 26, 2021, 10:34:43 AM11/26/21
to pyne-dev
That gcc version looks suspect, we're on gcc 11.2 right now, could you install a newer version?

--

---
You received this message because you are subscribed to the Google Groups "PyNE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyne-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-dev/2e77c692-66da-4da5-8f63-e6fac2f1019cn%40googlegroups.com.

Paul Wilson

unread,
Nov 26, 2021, 11:14:15 AM11/26/21
to pyne...@googlegroups.com

Hi all,

 

I can’t guarantee that this is the problem, but it is true that this is an unsupported, 5-year-old version of GCC: https://gcc.gnu.org/gcc-4.9/

 

Paul

 

-- 
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul P.H. Wilson (he/him/his)
Grainger Professor of Nuclear Engineering
Chair, Department of Engineering Physics
o: 608-263-0807, c: 608-469-9615
paul....@wisc.edu
153 Engineering Research Bldg
1500 Engineering Dr, Madison, WI 53706
Zoom Meeting Room: https://uwmadison.zoom.us/j/6082630807
Zoom Phone Access: +1-929-205-6099, Access code: 6082630807

Computational Nuclear Engineering Research Group

Jonathon McKay

unread,
Nov 26, 2021, 1:32:40 PM11/26/21
to PyNE
I can certainly try a newer version (maybe not quite 11.2). 
I was trying with an older GCC, as that sometimes gets rid of ... other problems.
I'll give it a shot, and report back.

Thanks

Paul Wilson

unread,
Nov 26, 2021, 2:26:03 PM11/26/21
to Jonathon McKay, PyNE

Hi again Jonathan,

 

It appears that Cython 0.25 is also a little on the stale side - ~5 yrs old.  Updating cython can maybe precipitate a long list of other updates/dependencies??

 

That said, it would be great to understand your use case (or your user’s use case?).  While it should be possible to install PyNE on an HPC system, I recognize that they are often configured conservatively to help ensure stability.

 

PyNE offers both python and C++ interfaces, with the latter being more common for integration into applications on HPC resources.  I wonder if there are other ways to “slice” this?

 

Paul

-- 
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul P.H. Wilson (he/him/his)
Grainger Professor of Nuclear Engineering
Chair, Department of Engineering Physics
o: 608-263-0807, c: 608-469-9615
paul....@wisc.edu
153 Engineering Research Bldg
1500 Engineering Dr, Madison, WI 53706
Zoom Meeting Room: https://uwmadison.zoom.us/j/6082630807
Zoom Phone Access: +1-929-205-6099, Access code: 6082630807

Computational Nuclear Engineering Research Group

 

 

From: Jonathon McKay <mckay...@gmail.com>
Date: Friday, November 26, 2021 at 1:12 PM
To: PyNE <pyne...@googlegroups.com>
Subject: Re: [PyNE] "Cannot assign type 'char *' to 'string'" while compiling material_library

 

I have attempted to use GCC 10.1.0.

Unfortunately, it didn't help. It failed in exactly the same place, in exactly the same way.

I have noticed, however, it is Cython that is producing the error message.

  (Verified by running the Cython command that failed by hand, giving me the same error message)

Jonathon McKay

unread,
Nov 26, 2021, 2:26:32 PM11/26/21
to PyNE
I have attempted to use GCC 10.1.0.
Unfortunately, it didn't help. It failed in exactly the same place, in exactly the same way.
I have noticed, however, it is Cython that is producing the error message.
  (Verified by running the Cython command that failed by hand, giving me the same error message)

On Friday, November 26, 2021 at 1:32:40 PM UTC-5 Jonathon McKay wrote:

mckayj.aecl

unread,
Dec 3, 2021, 2:47:32 PM12/3/21
to PyNE
Hey again

I've (finally) gotten around to trying out a new version of Cython.
And it worked!

The version I've got now is 0.29.24, which is the current available through PyPI (pip).
Could the dependency list be updated?

Thank you both for all your help.
Reply all
Reply to author
Forward
0 new messages