GithubHelp home page GithubHelp logo

Comments (19)

rmjarvis avatar rmjarvis commented on June 15, 2024

As you probably expected, the problem is in the otool output. It should include libstdc++:

$ otool -L _treecorr.so 
_treecorr.so:
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

Unfortunately, I wasn't able to reproduce your problem though. I have anaconda installed, but it's not my default python, so pip doesn't install into it. But when I did /anaconda/bin/python setup.py install it worked correctly.

So could you try downloading the TreeCorr tarball and installing it that way? If that still doesn't work, please send me the full output of the installation. Maybe I'll see some difference between what it does on your machine and what it does on mine that might give a clue.

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

Here is the full output from the install:

$ python setup.py install
Python version =  2.7
running install
running bdist_egg
running egg_info
creating TreeCorr.egg-info
writing requirements to TreeCorr.egg-info/requires.txt
writing TreeCorr.egg-info/PKG-INFO
writing top-level names to TreeCorr.egg-info/top_level.txt
writing dependency_links to TreeCorr.egg-info/dependency_links.txt
writing manifest file 'TreeCorr.egg-info/SOURCES.txt'
reading manifest file 'TreeCorr.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'TreeCorr.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.5-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.5-x86_64-2.7
creating build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/binnedcorr2.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/catalog.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/celestial.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/config.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/corr2.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/field.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/ggcorrelation.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/kgcorrelation.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/kkcorrelation.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/ngcorrelation.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/nkcorrelation.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
copying treecorr/nncorrelation.py -> build/lib.macosx-10.5-x86_64-2.7/treecorr
running build_ext
Using compiler cc, which is clang
building 'treecorr._treecorr' extension
creating build/temp.macosx-10.5-x86_64-2.7
creating build/temp.macosx-10.5-x86_64-2.7/src
gcc -fno-strict-aliasing -I/Users/daniel/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Iinclude -I/Users/daniel/anaconda/include/python2.7 -c src/BinnedCorr2.cpp -o build/temp.macosx-10.5-x86_64-2.7/src/BinnedCorr2.o -O3 -ffast-math
gcc -fno-strict-aliasing -I/Users/daniel/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Iinclude -I/Users/daniel/anaconda/include/python2.7 -c src/Cell.cpp -o build/temp.macosx-10.5-x86_64-2.7/src/Cell.o -O3 -ffast-math
gcc -fno-strict-aliasing -I/Users/daniel/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Iinclude -I/Users/daniel/anaconda/include/python2.7 -c src/Field.cpp -o build/temp.macosx-10.5-x86_64-2.7/src/Field.o -O3 -ffast-math
gcc -bundle -undefined dynamic_lookup -L/Users/daniel/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/BinnedCorr2.o build/temp.macosx-10.5-x86_64-2.7/src/Cell.o build/temp.macosx-10.5-x86_64-2.7/src/Field.o -L/Users/daniel/anaconda/lib -o build/lib.macosx-10.5-x86_64-2.7/treecorr/_treecorr.so
creating build/bdist.macosx-10.5-x86_64
creating build/bdist.macosx-10.5-x86_64/egg
creating build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/__init__.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/_treecorr.so -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/binnedcorr2.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/catalog.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/celestial.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/config.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/corr2.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/field.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/ggcorrelation.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/kgcorrelation.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/kkcorrelation.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/ngcorrelation.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/nkcorrelation.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
copying build/lib.macosx-10.5-x86_64-2.7/treecorr/nncorrelation.py -> build/bdist.macosx-10.5-x86_64/egg/treecorr
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/binnedcorr2.py to binnedcorr2.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/catalog.py to catalog.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/celestial.py to celestial.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/config.py to config.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/corr2.py to corr2.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/field.py to field.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/ggcorrelation.py to ggcorrelation.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/kgcorrelation.py to kgcorrelation.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/kkcorrelation.py to kkcorrelation.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/ngcorrelation.py to ngcorrelation.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/nkcorrelation.py to nkcorrelation.pyc
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/nncorrelation.py to nncorrelation.pyc
creating stub loader for treecorr/_treecorr.so
byte-compiling build/bdist.macosx-10.5-x86_64/egg/treecorr/_treecorr.py to _treecorr.pyc
creating build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
installing scripts to build/bdist.macosx-10.5-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
copying and adjusting scripts/corr2 -> build/scripts-2.7
changing mode of build/scripts-2.7/corr2 from 644 to 755
creating build/bdist.macosx-10.5-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/corr2 -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.macosx-10.5-x86_64/egg/EGG-INFO/scripts/corr2 to 755
copying TreeCorr.egg-info/PKG-INFO -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying TreeCorr.egg-info/SOURCES.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying TreeCorr.egg-info/dependency_links.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying TreeCorr.egg-info/requires.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
copying TreeCorr.egg-info/top_level.txt -> build/bdist.macosx-10.5-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.5-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
treecorr.config: module references __file__
treecorr.field: module references __file__
treecorr.ggcorrelation: module references __file__
treecorr.kgcorrelation: module references __file__
treecorr.kkcorrelation: module references __file__
treecorr.ngcorrelation: module references __file__
treecorr.nkcorrelation: module references __file__
treecorr.nncorrelation: module references __file__
creating dist
creating 'dist/TreeCorr-3.1.0-py2.7-macosx-10.5-x86_64.egg' and adding 'build/bdist.macosx-10.5-x86_64/egg' to it
removing 'build/bdist.macosx-10.5-x86_64/egg' (and everything under it)
Processing TreeCorr-3.1.0-py2.7-macosx-10.5-x86_64.egg
creating /Users/daniel/anaconda/lib/python2.7/site-packages/TreeCorr-3.1.0-py2.7-macosx-10.5-x86_64.egg
Extracting TreeCorr-3.1.0-py2.7-macosx-10.5-x86_64.egg to /Users/daniel/anaconda/lib/python2.7/site-packages
Adding TreeCorr 3.1.0 to easy-install.pth file
Installing corr2 script to /Users/daniel/anaconda/bin

Installed /Users/daniel/anaconda/lib/python2.7/site-packages/TreeCorr-3.1.0-py2.7-macosx-10.5-x86_64.egg
Processing dependencies for TreeCorr==3.1.0
Searching for pandas==0.15.1
Best match: pandas 0.15.1
Adding pandas 0.15.1 to easy-install.pth file

Using /Users/daniel/anaconda/lib/python2.7/site-packages
Searching for numpy==1.9.1
Best match: numpy 1.9.1
Adding numpy 1.9.1 to easy-install.pth file

Using /Users/daniel/anaconda/lib/python2.7/site-packages
Searching for pytz==2014.9
Best match: pytz 2014.9
Adding pytz 2014.9 to easy-install.pth file

Using /Users/daniel/anaconda/lib/python2.7/site-packages
Searching for python-dateutil==2.2
Best match: python-dateutil 2.2
Adding python-dateutil 2.2 to easy-install.pth file

Using /Users/daniel/anaconda/lib/python2.7/site-packages
Searching for six==1.8.0
Best match: six 1.8.0
Adding six 1.8.0 to easy-install.pth file

Using /Users/daniel/anaconda/lib/python2.7/site-packages
Finished processing dependencies for TreeCorr==3.1.0

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024
gcc -bundle -undefined dynamic_lookup -L/Users/daniel/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/BinnedCorr2.o build/temp.macosx-10.5-x86_64-2.7/src/Cell.o build/temp.macosx-10.5-x86_64-2.7/src/Field.o -L/Users/daniel/anaconda/lib -o build/lib.macosx-10.5-x86_64-2.7/treecorr/_treecorr.so

This is the line that is wrong. It is supposed to be using g++ to do the linking. It does on all of my machines. Maybe the version of setuptools is relevant. Could you check what:

python -c "import setuptools; print setuptools.__version__"

outputs for you? I have version 7.0.

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

Hmmm...

$ python -c "import setuptools; print setuptools.__version__"
5.8

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

OK, that's progress. See if you can upgrade that to a more recent version. I think you can just use

pip install setuptools --upgrade

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

Okay, I upgraded setuptools to 7.0 and tried rebuilding but it looks like gcc is still being used.

gcc -bundle -undefined dynamic_lookup -L/Users/daniel/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/BinnedCorr2.o build/temp.macosx-10.5-x86_64-2.7/src/Cell.o build/temp.macosx-10.5-x86_64-2.7/src/Field.o -L/Users/daniel/anaconda/lib -o build/lib.macosx-10.5-x86_64-2.7/treecorr/_treecorr.so

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

Darn. I thought that was going to work. I don't have another idea at the moment, and I haven't been able to find anything by Googling yet. I'll keep looking though.

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

Thanks for the help. I have access to a system where it does work so I can use that for now.

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

Could you try doing

/usr/bin/python setup.py build -f

to see if that does the right thing? That might distinguish between a problem with your anaconda python vs something else on your system causing the trouble.

from treecorr.

dmargala avatar dmargala commented on June 15, 2024
$ /usr/bin/python setup.py build -f
Python version =  2.7
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/__init__.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/binnedcorr2.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/catalog.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/celestial.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/config.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/corr2.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/field.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/ggcorrelation.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/kgcorrelation.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/kkcorrelation.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/ngcorrelation.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/nkcorrelation.py -> build/lib.macosx-10.9-intel-2.7/treecorr
copying treecorr/nncorrelation.py -> build/lib.macosx-10.9-intel-2.7/treecorr
running build_ext
Using compiler cc, which is clang
building 'treecorr._treecorr' extension
creating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Iinclude -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/BinnedCorr2.cpp -o build/temp.macosx-10.9-intel-2.7/src/BinnedCorr2.o -O3 -ffast-math
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Iinclude -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/Cell.cpp -o build/temp.macosx-10.9-intel-2.7/src/Cell.o -O3 -ffast-math
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Iinclude -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/Field.cpp -o build/temp.macosx-10.9-intel-2.7/src/Field.o -O3 -ffast-math
c++ -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/BinnedCorr2.o build/temp.macosx-10.9-intel-2.7/src/Cell.o build/temp.macosx-10.9-intel-2.7/src/Field.o -o build/lib.macosx-10.9-intel-2.7/treecorr/_treecorr.so
running build_scripts
creating build/scripts-2.7
copying and adjusting scripts/corr2 -> build/scripts-2.7
changing mode of build/scripts-2.7/corr2 from 644 to 755
$ ./build/scripts-2.7/corr2 
Traceback (most recent call last):
  File "./build/scripts-2.7/corr2", line 17, in <module>
    import treecorr
  File "/Users/daniel/source/TreeCorr-3.1.0/treecorr/__init__.py", line 18, in <module>
    from .config import read_config, set_omp_threads
  File "/Users/daniel/source/TreeCorr-3.1.0/treecorr/config.py", line 344, in <module>
    _treecorr = numpy.ctypeslib.load_library('_treecorr',os.path.dirname(__file__))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/ctypeslib.py", line 131, in load_library
    raise exc
OSError: dlopen(/Users/daniel/source/TreeCorr-3.1.0/treecorr/_treecorr.so, 6): image not found
$ otool -L build/lib.macosx-10.9-intel-2.7/treecorr/_treecorr.so 
build/lib.macosx-10.9-intel-2.7/treecorr/_treecorr.so:
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

oh I guess that second block is not really a good test. Do you have a better suggestion for a test?

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

build -f doesn't complete the installation, so I think it's probably not surprising that corr2 didn't work yet. But it did use c++ to do the linking, which is correct. (c++ and g++ are the same thing. Both are actually aliases for clang++ on recent Macs.)

If you want, you can finish the installation with the system python, and I think that will give you a working corr2 executable. However, it still wouldn't give you a working treecorr module in your anaconda python, so I won't call this a complete victory.

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

Another thought. I wonder if there might be something wrong with your g++ executable. You could try which g++ and then ls -l it to see if it is corrupted in some way.

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

Well here is the output from trying that but I'm not sure what to expect.

$ which g++
/usr/bin/g++
$ ls -l /usr/bin/g++
-rwxr-xr-x  1 root  wheel  14224 Jul 10 09:53 /usr/bin/g++

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

Well here is the output from trying that but I'm not sure what to expect.

Looks fine. I had a machine that used to randomly corrupt symlinks, so I thought maybe if that happened to g++, it might explain why python wasn't using it. But that doesn't seem to be the case here.

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

OK, here's another idea. You might have CXX=gcc in your environment. I was able to override the compiler used to link C++ files by setting CXX on the command line. So try:

CXX=g++ python setup.py install

I think that might work. If this is right, you probably also want to get rid of that environment setting, since it could mess up other things as well.

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

Daniel, Is this still an issue for you? Did you give up on this, or did you eventually figure out a way to get the right compiler to be used for the C++ linking?

Just wondering if I should leave this issue open or close it...

from treecorr.

dmargala avatar dmargala commented on June 15, 2024

I think I gave up on this but it appears that I can run corr2 without getting that error now. I also ran the unit tests and no problems there either.

from treecorr.

rmjarvis avatar rmjarvis commented on June 15, 2024

Cool. Ok. Feel free to reopen if it recurs in some environment.

from treecorr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.