Skip to content
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

Bugs related to the compiler #2

Open
keflavich opened this issue Nov 8, 2013 · 4 comments
Open

Bugs related to the compiler #2

keflavich opened this issue Nov 8, 2013 · 4 comments

Comments

@keflavich
Copy link
Owner

I've been attempting a series of different compilations.

If I use gfortran-4.2.3 with no -arch flags:

/usr/local/bin/gfortran -Wall -undefined dynamic_lookup -lpython2.7 -bundle

I get the error:

ImportError: dlopen(pyradex/radex/radex.so, 2): no suitable image found.  Did find:
    pyradex/radex/radex.so: mach-o, but wrong architecture

If I try:

LDFLAGS='-arch i686 -arch x86_64 -undefined dynamic_lookup -lpython2.7 -bundle' python setup.py install_radex

there's a different error:

ImportError: dlopen(pyradex/radex/radex.so, 2): Symbol not found: _backrad_
  Referenced from: /Users/adam/repos/pyradex/pyradex/radex/radex.so
  Expected in: dynamic lookup

In fact, the only way I got it working with the regular, vanilla GCC-4.2.3 is:

FFLAGS='-arch i686 -arch x86_64 -fPIC' CFLAGS='-fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2' LDFLAGS='-arch i686 -arch x86_64 -undefined dynamic_lookup -bundle' python setup.py install_radex

Or, in other words, thoroughly ridiculous.

@keflavich
Copy link
Owner Author

For the hpc compiler, remarkably, this worked?

PATH=/Users/adam/repos/hpc/bin/:/usr/bin:~/virtual-python/bin/:/bin FFLAGS='-m64 -fPIC' CFLAGS='-fno-strict-aliasing -fno-common -dynamic -m64 -g -O2' LDFLAGS='-m64 -undefined dynamic_lookup -bundle' python -c "import install_radex; install_radex.compile_radex(f77exec='/Users/adam/repos/hpc/bin/gfortran')"

@keflavich
Copy link
Owner Author

Actually, the above didn't use the hpc compiler, but this did:

CC=/Users/adam/repos/hpc/bin/gcc PATH=/Users/adam/repos/hpc/bin/:~/virtual-python/bin/:/bin:/usr/bin FFLAGS='-m64 -fPIC' CFLAGS='-fno-strict-aliasing -fno-common -dynamic -m64 -g -O2' LDFLAGS='-m64 -undefined dynamic_lookup -bundle' python setup.py install_radex

which can be applied more generically as:

CC=gcc FFLAGS='-m64 -fPIC' CFLAGS='-fno-strict-aliasing -fno-common -dynamic -m64 -g -O2' LDFLAGS='-m64 -undefined dynamic_lookup -bundle' python setup.py install_radex

@RankkaApina
Copy link

I'm trying to use pip install for pyradex, but it doesn't find the readme file and thus refuses to install. And when I go to the source where it takes the package from the readme file is missing. Maybe this could be added?

@keflavich
Copy link
Owner Author

Thanks @RankkaApina - that should be raised as a different issue. It is probably a problem with the MANIFEST.in file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants