jchibane / if-net

Implicit Feature Network (IF-Net) - Codebase
305 stars 59 forks source link

libmesh setup error #26

Closed kfarivar closed 3 years ago

kfarivar commented 3 years ago

Hello

I get this when I runpython setup.py build_ext --inplace

Compiling triangle_hash.pyx because it changed.
[1/1] Cythonizing triangle_hash.pyx
/home/logi/anaconda3/envs/if-net/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/logi/Desktop/ifnet/if-net/data_processing/libmesh/triangle_hash.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
running build_ext
building 'triangle_hash' extension
creating build
creating build/temp.linux-x86_64-3.7
gcc -pthread -B /home/logi/anaconda3/envs/if-net/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/logi/anaconda3/envs/if-net/include/python3.7m -c triangle_hash.cpp -o build/temp.linux-x86_64-3.7/triangle_hash.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
triangle_hash.cpp:626:10: fatal error: numpy/arrayobject.h: No such file or directory
  626 | #include "numpy/arrayobject.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

any help appreciated.

kfarivar commented 3 years ago

so I tried sudo apt-get install python-numpy and now it works .

GentleDell commented 3 years ago

numpy can not be installed on my ubuntu (18.04) for some dependency issues. So I follow the solution here and modified the setup.py of libmesh a bit. Now I can install the libmesh.

Here is the modified setup.py of the libmesh.

from setuptools import setup
from Cython.Build import cythonize
import numpy

setup(name = 'libmesh',
      ext_modules = cythonize("*.pyx"),
      include_dirs=[numpy.get_include()]
)