MPI-IS / mesh

MPI-IS Mesh Processing Library
Other
643 stars 147 forks source link

C++ errors when installing on MacOs #6

Closed cvignac closed 4 years ago

cvignac commented 5 years ago

Hello, I'd like to install the library to play with the COMA project. However, I ran into some errors, and I don't manage to debug them all:

anuragranj commented 5 years ago

If you are in a virtual environment, make should call python2, and not python3. Could you alias python="python2.7" and see if it resolves. We are in the process of porting it to python3. But if you need it soon, you should check: https://stackoverflow.com/a/28306354

cvignac commented 5 years ago

Thank you for your answer. I tried, but it does not make any difference. As I said before, when I type python from within the virtual environment, it already opens a python2 console.

I don’t understand how it is possible that the script uses python3. Do you have an idea?

On 7 Mar 2019, at 15:40, Anurag Ranjan notifications@github.com wrote:

If you are in a virtual environment, make should call python2, and not python3. Could you `alias python="python2.7" and see if it resolves.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MPI-IS/mesh/issues/6#issuecomment-470551209, or mute the thread https://github.com/notifications/unsubscribe-auth/ARLnTjVdB5sWD8g4ehwewqSuB1Fdqytzks5vUST2gaJpZM4bizkH.

raffienficiaud commented 5 years ago

It would be good if you can paste all the steps you are doing, and print also your environment (type env). Maybe you have something in your .bashrc that is preferring python3. The c++ errors you are having seem to be pretty much related to that.

cvignac commented 5 years ago

Thank you for this advice, I actually had a line in my bash_profile that would choose python3 for python path.

Unfortunately, I now have another problem:

/Users/clementvignac/venv/directed_filters/mesh/build/temp.macosx-10.14-x86_64-2.7/CGAL-4.7/include/CGAL/config.h:85:10: fatal error: 'boost/config.hpp' file not found

include <boost/config.hpp>

I tried reinstalling boost from another source (macports instead of brew), but then I got the same error message…

Thanks!

On 7 Mar 2019, at 22:34, Raffi Enficiaud notifications@github.com wrote:

It would be good if you can paste all the steps you are doing, and print also your environment (type env). Maybe you have something in your .bashrc that is preferring python3. The c++ errors you are having seem to be pretty much related to that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

skunkwerk commented 5 years ago

Same problem here - can't get it to use python2.7 even inside a python2.7 venv on Mac. My bash_profile is clean, and I've aliased python to 'python2.7'

Yet it continues to use Python3.7

qianyunw commented 4 years ago

I edit the Makefile with "virtualenv venv --python=python2.7", it worked! I hope it works for you!

qianyunw commented 4 years ago

Sorry, I made a mistake, it should be the input command line to create a virtual environment for python2.7.

eaglex-sh commented 4 years ago

Sorry, I made a mistake, it should be the input command line to create a virtual environment for python2.7.

I tried, but it failed with the same errors. It used python3.7 by default.

kevinlin311tw commented 4 years ago

I made it works. I did the following modifications.

First step

In Makefile, modify line 55

    @virtualenv --system-site-packages $(venv_dir)

to

    @virtualenv --python=python2.7 --system-site-package $(venv_dir)

Second step

In setup.py, modify line 117

    ext.include_dirs = filter(None, ext.include_dirs)

to

    filtered = []  
    for x in filter(None, ext.include_dirs):  
        filtered.append(x)  
    ext.include_dirs = filtered
jcpassy commented 4 years ago

Hi @cvignac @kevinlin311tw @guodewen , this is an old ticket so I will close it. FYI, the package now supports only Python3 and the installation process does not create a new virtual environment - which is much safer. The user must now create one and activate it before executing the Makefile. This is explained in the README.

Cheers!