Alejandro, Kip,
"Hart, Kenneth A" <khart(a)gatech.edu> writes:
> I get the same error and I think this has to do with my setup.py hack
> to get MeshPy to install on the mac. I added a line that forces the
> Mac to use a C++ compiler instead of a C compiler because the compile
> line has a combination of C compiler and C++ flags. I figured
> switching the compiler to C++ would solve the problem. Now it installs
> but throws that realarray error.
>
> I want to try removing the C++ flags for C-compiled code, but I'm not
> experienced enough with distutils to attempt that. Perhaps Andreas
> could take a look?
Try current master.
Andreas
Hi Kip,
Thanks for your swift reply. It wasn’t easy to install MeshPy in the first place. I figured the C++ flags also called for clang++ instead, so I ended up doing something similar to your hack, but on the command line:
$ CC=clang++ CPPFLAGS=-I/Users/aaragon/Local/pybind11/include python setup.py install
also because pybind’s installation didn’t put the header files in known header file paths.
Best,
— Alejandro
> On Oct 10, 2018, at 18:49, Hart, Kenneth A <khart(a)gatech.edu> wrote:
>
> Hi Alejandro,
>
> I get the same error and I think this has to do with my setup.py hack to get MeshPy to install on the mac. I added a line that forces the Mac to use a C++ compiler instead of a C compiler because the compile line has a combination of C compiler and C++ flags. I figured switching the compiler to C++ would solve the problem. Now it installs but throws that realarray error.
>
> I want to try removing the C++ flags for C-compiled code, but I'm not experienced enough with distutils to attempt that. Perhaps Andreas could take a look?
>
> Best,
> Kip
> From: MeshPy <meshpy-bounces(a)tiker.net> on behalf of Alejandro Marcos Aragón <alejandro.aragon(a)gmail.com>
> Sent: Wednesday, October 10, 2018 12:24:16 PM
> To: MeshPy(a)tiker.net
> Subject: [MeshPy] problems when loading both tet and triangle
>
> Dear all,
>
> In the application I’m working on, I need to use both triangle and tetgen in the same function. I try to import both of them in a module as follows:
>
> import meshpy.triangle as triangle
> import meshpy.tet as tet
>
> but then I get the error:
>
> $ python test.py
> Traceback (most recent call last):
> File "test.py", line 6, in <module>
> import meshpy.tet as tet
> File "/Users/aaragon/.virtualenvs/pydev/lib/python3.7/site-packages/MeshPy-2018.2-py3.7-macosx-10.9-x86_64.egg/meshpy/tet.py", line 4, in <module>
> import meshpy._tetgen as internals
> ImportError: generic_type: type "RealArray" is already registered!
>
> If I invert the order the error happens then when I try to load triangle. Is there a way to fix this problem?
> On Mac OS, I’m using Python 3.7 and the latest version of MeshPy that uses PyBind (this was quite difficult to install).
>
> Best,
>
> — Alejandro M. Aragón, Ph.D.
>
Dear all,
In the application I’m working on, I need to use both triangle and tetgen in the same function. I try to import both of them in a module as follows:
import meshpy.triangle as triangle
import meshpy.tet as tet
but then I get the error:
$ python test.py
Traceback (most recent call last):
File "test.py", line 6, in <module>
import meshpy.tet as tet
File "/Users/aaragon/.virtualenvs/pydev/lib/python3.7/site-packages/MeshPy-2018.2-py3.7-macosx-10.9-x86_64.egg/meshpy/tet.py", line 4, in <module>
import meshpy._tetgen as internals
ImportError: generic_type: type "RealArray" is already registered!
If I invert the order the error happens then when I try to load triangle. Is there a way to fix this problem?
On Mac OS, I’m using Python 3.7 and the latest version of MeshPy that uses PyBind (this was quite difficult to install).
Best,
— Alejandro M. Aragón, Ph.D.
Hi Andreas,
I recently tried to install MeshPy on a new Mac and received the error message below. It looks like my computer is trying to compile Triangle with a C compiler and C++ flags. To fix this, I downloaded the git repository and edited the setup.py file:
88: if sys.platform == 'darwin':
89: c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
90: import os
91: os.environ['CC'] = 'clang++’
I’m unfamiliar with distutils, so there may be a better solution. I didn’t get this error on Linux and have not tried re-installing on Windows.
Best,
Kip
Error message:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -fwrapv -Wall -O1 -DNDEBUG -DEXTERNAL_TEST=1 -DANSI_DECLARATORS=1 -DTRILIBRARY=1 -I/Users/khart31/Documents/venv/include/site/python3.7 -I/Users/khart31/Documents/venv/include/site/python3.7 -Isrc/cpp -I/Users/khart31/Documents/venv/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/cpp/triangle.c -o build/temp.macosx-10.9-x86_64-3.7/src/cpp/triangle.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="2018.2" -std=c++14 -fvisibility=hidden
error: invalid argument '-std=c++14' not allowed with 'C'
error: command 'gcc' failed with exit status 1