Unable to build SciPy on OS X 10.5.7 - macos

I am trying to install SciPy following these instructions: http://www.scipy.org/Download
And constantly getting error to build them for OS X Lepeord 10.5.7:
dyld: lazy symbol binding failed: Symbol not found: _iconv_open
Referenced from: /usr/lib/libaprutil-1.0.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
dyld: Symbol not found: _iconv_open
Referenced from: /usr/lib/libaprutil-1.0.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
Traceback (most recent call last):
File "setup.py", line 82, in
FULLVERSION += svn_version()
File "setup.py", line 74, in svn_version
raise ValueError("Error while parsing svn version ?")
ValueError: Error while parsing svn version ?

Is it absolutely necessary for you to build SciPy from source? It seems like it would be much easier to install SciPy on Mac OS X Leopard by using the SciPy Superpack Installer (which is mentioned on the SciPy download page). That is how I installed SciPy, and I've never had any problems with it.

The reason it's failing is that you have things installed in your /opt/local which are interfering with the system libraries. libiconv is installed in /usr/lib
MacPorts has a habit of messing up things. Unsetting the DYLD_LIBRARY_PATH when you run (and when you use) libraries like this would fix it.

Related

Symbol not found in flat namespace '_MQBACK' (Python3.9 - MacOS 12.1 Silicon)

Installing pymqi in a MacOS M1 Pro 12.1 Monterey, Python 3.9.9 in a virtualenv and the usual suspect appeared again:
Traceback (most recent call last):
File "/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/__init__.py", line 132, in <module>
from . import pymqe # type: ignore
ImportError: dlopen(/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/pymqe.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_MQBACK'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/__init__.py", line 134, in <module>
import pymqe # type: ignore # Backward compatibility
ModuleNotFoundError: No module named 'pymqe'
All paths are in place /opt/mqm/bin:/opt/mqm/samp/bin and Python sees the env variable os.environ['DYLD_LIBRARY_PATH']=='/opt/mqm/lib64'
After reinstalling pymqi with --verbose flag, this warning showed up:
ld: warning: ignoring file /opt/mqm/lib64/libmqic_r.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Might be the root cause of the exception symbol not found in flat namespace '_MQBACK' in M1 Pro Silicon platforms ?
It says that ibmqic_r.dylib is ignored.
Would a new release of MacOS Toolkit build for macOS-arm64 solve the issue?
Another option - theoretically speaking - could be to run the build for macOS-x86_64 with Rosetta 2 as suggested in this post, I don't know how to do it..
Any help will be mostly appreciated.

pg 0.14.1: dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb

Running postgresql 9.4.5 and pg 0.14.1 on El Capitan, and experiencing the following error followed by an exit from the Rails console when performing the first query:
dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb
Referenced from: /Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle
Expected in: flat namespace
dyld: Symbol not found: _PQconnectdb
Referenced from: /Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle
Expected in: flat namespace
Trace/BPT trap: 5
Any ideas?
This means that the libpq library the gem was compiled against is missing or is no longer loadable for some reason. Oftentimes you'll need to reinstall PostgreSQL after an OS upgrade, or after installing a new version of the XCode command line tools.
You can look at the library the gem is trying to load like this (on OSX anyway):
file $(otool -L /Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle | grep libpq | cut -f1 -d' ')
It should look something like this:
/usr/local/lib/libpq.5.dylib: Mach-O 64-bit dynamically linked shared library x86_64
My PostgreSQL is installed via Homebrew, so your path might be different, but it should at least show a shared library. If it looks okay, post what it says in a comment and I'll try to help further.

Trying to compile GnuPG-2.1.1 on OS X Yosemite 10.10.1

While trying to build the latest GnuPG (2.1.1 modern), my build fails when trying to link t-stringhelp. make outputs:
ld: warning: ignoring file libcommon.a, file was built for archive which is not the architecture being linked (x86_64): libcommon.a
Undefined symbols for architecture x86_64:
"_compare_filenames", referenced from:
_main in t-stringhelp.o
"_make_absfilename_try", referenced from:
_main in t-stringhelp.o
"_make_filename_try", referenced from:
_main in t-stringhelp.o
"_percent_escape", referenced from:
_main in t-stringhelp.o
"_strconcat", referenced from:
_main in t-stringhelp.o
"_xstrconcat", referenced from:
_main in t-stringhelp.o
I don't know how to fix this as libcommon is part of the source, so it should build fine. When building with CFLAGS="-m64" (-arch x86_64 does nothing), I get this:
ld: warning: ignoring file ../common/libgpgrl.a, file was built for archive which is not the architecture being linked (x86_64): ../common/libgpgrl.a
Undefined symbols for architecture x86_64:
"_gnupg_rl_initialize", referenced from:
_main in gpg.o
I've also rebuilt all the depandancies (as I built them on Mavericks), except pinentry, as it can't find libiconv which is also installed. My configure outputs that its target is Darwin (x86_64-apple-darwin14.0.0), so this should work. I have also got all the latest prerequisites, tried to install everything in its own directory (--prefix=/usr/local/gnupg-2.1.1), build all the dependancies and GnuPG as 32 bits (again, fails on same error), created a separate build folder and tried to build in there, but only one thing so far has solved the error: looking at how libgpgrl.a is being built - it's only component is common/gpgrlhelp.c - so I cd'ed into g10 and tried to build gpg2, replacing ../common/libgpgrl.a with ../common/gpgrlhelp.o, the lib common.a with all of its object files, for all the libraries that didn't work. Then some programs weren't linking to libksba libgcrypt and libassuan, so I changed the Makefiles, so that they could link. I can now compile all the code well, I installed everything, but I get a new error, when I try to run gpg2:
dyld: lazy symbol binding failed: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
dyld: Symbol not found: __gcry_mpi_init
Referenced from: /usr/local/gnupg-2.1.1/lib/libgcrypt.20.dylib
Expected in: flat namespace
I have everything in my path, which is:
/usr/local/gnupg-2.1.1/bin:/usr/local/gnupg-2.1.1/lib:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
I could compile GnuPG-2.0.22 on Mavericks, but no version of GnuPG builds on Yosemite.
Please help, I'm really confused.
I’ve been running GnuPG 2.1 on Yosemite 10.10.2 (the latest public beta of as of this writing) for about a week and it’s been fine.
You can follow these directions for using brew tap or you can use the raw URL: brew install https://github.com/mtigas/homebrew-gpg21/raw/master/Formula/gnupg2.rb.
Note this formula installs GnuPG 2.1; not GnuPG 2.1.1, the version originally asked about. I can confirm this bug where gpg2 --refresh-keys fails with some keyservers using 2.1 (apparently fixed in 2.1.1) but it’ll get you 90% there.
It shouldn’t be hard to update the formula to install 2.1.1.
Update
Someone submitted a pull request for GNuPG 2.1.1 support—I just tried it and it worked great. Short answer: brew install https://raw.githubusercontent.com/calebthompson/homebrew-gpg21/2.1.1/Formula/gnupg2.rb.
Personally, I would install homebrew, which is a one-liner pasted from their website (http://brew.sh) then do
brew install gnupg
If therw are any problems, run
brew doctor
and heed the good doctor's advice.
Turns out I had a ranlib in /usr/local/bin/ranlib. It was broken, I don't know how it got there (I did try to build gcc at some point, it doesn't support make uninstall, so that's probably why). I just ran:
sudo mv /usr/local/ranlib /usr/local/ranlib_old
Then I just rebuilt all the dependancies, and it worked!

How can I fix this PDL installation?

I have installed PDL on a Mac OS X (10.7.3) machine. Evidently the SciPDL installer places PDL.pm in /Library/Perl/5.12/darwin-thread-multi-2level, so I added
use lib '/Library/Perl/5.12/darwin-thread-multi-2level';
at the top of my test script. I now get these errors:
dyld: lazy symbol binding failed: Symbol not found: _Perl_Gthr_key_ptr
Referenced from: /Library/Perl/5.12/darwin-thread-multi-2level/auto/PDL/Core/Core.bundle
Expected in: flat namespace
dyld: Symbol not found: _Perl_Gthr_key_ptr
Referenced from: /Library/Perl/5.12/darwin-thread-multi-2level/auto/PDL/Core/Core.bundle
Expected in: flat namespace
Unfortunately these errors don't mean much to me. What do they mean? And what's the solution?
Use cpanm to install modules instead of the SciPDL installer. Install cpanm:
either bootstrap from the Web:
curl -L http://cpanmin.us | perl - --self-upgrade
or with the CPAN client that ships with Perl:
cpan App::cpanminus
Install PDL:
cpanm PDL
This compiles PDL for your specific platform, making sure all the paths are set properly.

Problems with libftdi and libusb

I'm running on a Macbook, OS X 10.6.4. I've installed the latest version of libusb 1.x and also libusb-compat. The example applications in libusb compile and run, no problems there so I am assuming that it's installed correctly. Libftdi also appears to install correctly, but it seems to be having trouble with libusb. I tried one of the example apps and I get this error message:
$ ./simple
dyld: lazy symbol binding failed: Symbol not found: _usb_init
Referenced from: /Users/Me/Downloads/libftdi-0.19/src/.libs/libftdi.1.dylib
Expected in: flat namespace
dyld: Symbol not found: _usb_init
Referenced from: /Users/Me/Downloads/libftdi-0.19/src/.libs/libftdi.1.dylib
Expected in: flat namespace
Trace/BPT trap
The assumption that libusb is to blame is because _usb_init is a libusb function, I found a post here that was along the same lines http://www.jedi.be/blog/2009/11/11/ruby-usb-libusb/ but for Ruby.
Trying to get things going with Pylibftdi,
Traceback (most recent call last):
File "blah/list_devices.py", line 4, in <module>
for device in Driver().list_devices():
File "/Library/Python/2.6/site-packages/pylibftdi/driver.py", line 61, in __init__
fdll = CDLL(ftdi_lib)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 345, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/libftdi.dylib, 6): Symbol not found: _usb_bulk_read
Referenced from: /usr/local/lib/libftdi.dylib
Expected in: flat namespace
in /usr/local/lib/libftdi.dylib
Note that to get anything to even run using Pyftdi I had to install libftdi for i386 rather than x86_64 as default (throws up mach-o errors) - however, even installing libftdi 'normally' gives the OSErrors above. Any suggestions would be greatly appreciated.
I believe with libftdi 0.19 you're supposed to use libusb 0.1 (atleast according to thier web page. http://www.intra2net.com/en/developer/libftdi/download.php). There's a port of libftdi out there to use libusb 1.0 if you want. I've been using it for SYNC and ASYNC Fifos and its been working great.
http://developer.intra2net.com/git/?p=libftdi-1.0
git://developer.intra2net.com/libftdi-1.0
Good luck

Resources