New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile against anaconda #6

Open
michiexile opened this Issue Mar 12, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@michiexile

michiexile commented Mar 12, 2017

I tried installing and using diamorse, and got the following result from my first attempt in creating the python bindings:

[m.johansson@penzias diamorse]$ make python
make -C src/python
make[1]: Entering directory `/scratch/m.johansson/diamorse/src/python'
cython --cplus MorseAnalysis.pyx
g++ -std=c++11 -g -O3 -Wno-cpp -I /share/usr/compilers/python/anaconda/4.3.0_1/include/python2.7 -I /share/usr/compilers/python/anaconda/4.3.0_1/lib/python2.7/site-packages/numpy/core/include -I ../lib --shared -fPIC MorseAnalysis.cpp -o ../../bin/MorseAnalysis.so -lpython2.7
/usr/bin/ld: cannot find -lpython2.7
collect2: error: ld returned 1 exit status
make[1]: *** [../../bin/MorseAnalysis.so] Error 1
rm MorseAnalysis.cpp
make[1]: Leaving directory `/scratch/m.johansson/diamorse/src/python'
make: *** [python] Error 2

I tried changing diamorse/src/python/Makefile from

LDFLAGS     = -lpython${PYTHON_VERSION}

to

LDFLAGS     = -L ${PYTHON_PREFIX}/lib -lpython${PYTHON_VERSION}

After this change, the build went through, but persistence.py still doesn't work:

[m.johansson@penzias ~]$ PYTHONPATH=$PYTHONPATH:/scratch/m.johansson/diamorse/python/ time diamorse/python/persistence.py tomo_floatfoo_IMP.nc -r > foo.txt
Traceback (most recent call last):
  File "diamorse/python/persistence.py", line 4, in <module>
    from MorseAnalysis import VolumeImage, VectorField
ImportError: /scratch/m.johansson/diamorse/python/MorseAnalysis.so: undefined symbol: _ZSt24__throw_out_of_range_fmtPKcz
0.01user 0.01system 0:00.05elapsed 55%CPU (0avgtext+0avgdata 5456maxresident)k
0inputs+0outputs (0major+1864minor)pagefaults 0swaps
@odf

This comment has been minimized.

Show comment
Hide comment
@odf

odf Mar 12, 2017

Collaborator

Unfortunately, I have no experience with Anaconda, at all. Google results for "throw_out_of_range" seem to indicate that their might be a version mismatch between your g++ compiler and your python executable (specifically, I think, which versions of the standard libraries they link to).

Thanks for reporting this, and let use know if you can figure it out, especially if it looks like an issue other Anaconda users are likely to come across.

Collaborator

odf commented Mar 12, 2017

Unfortunately, I have no experience with Anaconda, at all. Google results for "throw_out_of_range" seem to indicate that their might be a version mismatch between your g++ compiler and your python executable (specifically, I think, which versions of the standard libraries they link to).

Thanks for reporting this, and let use know if you can figure it out, especially if it looks like an issue other Anaconda users are likely to come across.

@chulmoon

This comment has been minimized.

Show comment
Hide comment
@chulmoon

chulmoon Jun 15, 2017

I am not sure it is because of Anaconda, but I had the same issue and solved by installing the package:

For Fedora/RHEL
yum install python-devel

For Ubuntu
apt-get install python-dev

chulmoon commented Jun 15, 2017

I am not sure it is because of Anaconda, but I had the same issue and solved by installing the package:

For Fedora/RHEL
yum install python-devel

For Ubuntu
apt-get install python-dev

@odf

This comment has been minimized.

Show comment
Hide comment
@odf

odf Jun 16, 2017

Collaborator

@chulmoon Thanks for that!

Collaborator

odf commented Jun 16, 2017

@chulmoon Thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment