FFTW Error "Symbol not found: _ompi_mpi_char" when running executable - c++

I'm on macOS Catalina (10.15.7) and I have FFTW installed using brew install fftw. Up until today, I was able to run an executable which required FFTW. I have no idea why it just stopped working today and gave me the following error.
dyld: Symbol not found: _ompi_mpi_char
Referenced from: /usr/local/opt/fftw/lib/libfftw3_mpi.3.dylib
Expected in: flat namespace
in /usr/local/opt/fftw/lib/libfftw3_mpi.3.dylib
zsh: abort ./cartogram -h
I've tried everything from uninstalling and reinstalling all my brew packages and git cloning a fresh repo from GitHub but it doesn't work despite it working for my friend when he freshly clones the repo from GitHub. My suspicion is that it has something to do with my "macOS Catalina 10.15.7 Update" 2 days ago, which is 1 day after I last successfully ran my executable.
Any help is appreciated, thank you.

I think it might be due to the formula's flag --enable-openmp. I have tried to compile FFTW 3.3.10 myself using the following command to configure:
./configure --enable-threads --enable-shared --disable-debug --disable-dependency-tracking --enable-avx2
and then
make && make install

Related

Boost MPI flags can't be found when installing Repast HPC

Using M1 Mac, I've followed the manual install procedures to install Repast HPC.
I'm trying to run ./install.sh rhpc and the following error persists:
configure: error: cannot not find the flags to link with Boost mpi
The suggested solution says to add the compiler wrappers with the following commands:
export PATH=$BASE_DIR/MPICH/bin:$PATH
MPI_COMPILER_INVOCATION=$BASE_DIR/MPICH/bin/mpicxx
which didn't work as the command mpicxx still couldn't be invoked.
So I tried installing mpich through homebrew, where mpicxx now works outside of the install. However, the error persists.
So I tried installing boost through homebrew and directing the install to the homebrew directory, but the error persists.
So I tried installing open-mpi through homebrew, and mpicxx still works, but the error persists.
Any suggestions? I'm running out of online resources to solve the issue.

otool is referencing an old version of libffi

I'm trying to compile an R package (which compiles in Linux) on Mac OS 10.15.7.
I'm getting a weird problem right at the end of the installation, related to llvm-objdump-mp-7.0 referencing /opt/local/bin/libffi.7.dylib.
The problem seems to be with my Xcode/homebrew toolsets somehow being out of sync.
I can generate the problem with
$otool --version
llvm-otool(1): Apple Inc. version cctools-921
dyld: Library not loaded: /opt/local/lib/libffi.7.dylib
Referenced from: /opt/local/libexec/llvm-7.0/lib/libLLVM.dylib
Reason: image not found
fatal error: otool: fatal error in /opt/local/bin/llvm-objdump-mp-7.0
However,
$ ls /opt/local/lib/libffi*
/opt/local/lib/libffi.8.dylib /opt/local/lib/libffi.dylib
/opt/local/lib/libffi.a
I've run brew update followed by brew upgrade and brew reinstall libffi and brew reinstall llvm
I've upgraded my Xcode to 12.4, as well as installing the command line tools.
What am I missing?
I must have previously installed an older version of llvm which put its commands in /usr/local/bin, which then masked the system version of /usr/bin/otool.
The current llvm formula puts the updated tools in /usr/local/opt/llvm/bin so as to not mask the Xcode versions. However, the older versions were still living in /usr/local/bin.
The following commands seemed to fix me.
sudo rm /opt/local/bin/otool
sudo rm /opt/local/bin/llvm-otool
sudo rm /opt/local/bin/*-mp-7.0
otools is now properly finding the Xcode version, so I'm up and running again.

Do anyone know why I build boost on macOS but there's no boost::fiber lib created?

I am working on writing some code with boost::fiber as coroutine. The code works well on windows, but when I clone it (via git) to macOS, I found cmake couldn't find boost::fiber.
On both windows and macOS, I built and installed boost by myself like ./boostrap.sh --with-libraries=all and (sudo) ./b2 install -a, besides that I also built on Ubuntu 20.04 for testing, on linux & windows, there's libfiber.a or .so generated in the installed folder. But on macOS, there's not.
my macbook air has been fully reinstalled for only one week. I think the macOS version and the clang version should be very very closed to the latest.
May I know if anyone has been there and figured out how to make the boost::fiber to be built on macOS?
Thank you.
I think I found the reason: The boost::fiber needs some new features of c++17.
With the following commands, I can make the boost::fiber to be built and installed on my mac(OS: 10.15.5, gcc: Apple clang version 11.0.3):
./bootstrap.sh --with-libraries=all
sudo ./b2 cxxflags=-std=c++17 install -a > out.txt 2>&1
Just remark the commands here. May be somebody else will run into the same issue...

brew install gdb with python 3 does not build

I am unable to build gdb 8.2 in mac osx mojave 10.14.3 (with gcc 8.2) using python3.7.
python3 was installed using brew install python3 and is in the PATH.
Using brew edit gdb,
I have changed --with-python=/usr to /path/to/python3
Also, added ENV['CFLAGS']='-I/path/to/python3/include', ENV['CC']='gcc', ENV['CXX']='g++'.
I keep getting missing < Python.h > and < frameobject.h > related error even after including CFLAGS.
How can I fix this? Thanks for any help.
I know this is an old question. But I just ran into the same Problem and couldn't find a solution.
Have a look at the homebrew-core repository on GitHub. The commit bb8b6616e51672c8011435000476b24fa242a066 removed the --with-python option for some reason.
Revert that commit, change gdb version and all works fine.

Mac OS X Yosemite C++ Eclipse error: "Error while launching command: gdb --version"

I am following a C++ Eclipse tutorial and learning how to debug. I filled in the sections of the Debug Configurations window as it said in the tutorial and clicked 'Debug'.
I get the error "Error while launching command: gdb --version". I found a similar post here: Mac C++/eclipse cannot debug: Error while launching command: gdb --version
and there the user said he already had GDB installed. I tried to install it using the instructions at this link: http://www.patosai.com/blog/post/installing-gdb-on-mac-os-x-yosemite
and when I entered the first command "brew install gdb" I got the following in my terminal:
Error: No available formula for gdb
==> Searching formulae...
cgdb gdbm pgdbf
==> Searching taps...
homebrew/dupes/gdb Caskroom/cask/macgdbp
I think there may have been a problem there because when I entered the final command of the "Installing GDB on Mac OS X Yosemite" tutorial above: "codesign -s gdb-cert /usr/local/bin/gdb" it said "no such file or directory.
Can anyone see where I've made an error please? Thanks :)
Seems like brew was unable to find gdb in its default search location.
The line 'Searching Taps...' means that brew is searching other git repositories for the software you are trying to install.
In this case it found two repositories that contain something useful.
homebrew/dupes/gdb and Caskroom/cask/macgdbp
homebrew/dupes/gdb would be the one you need as this is the gdb version apple used for xcode before it switched to other tools.
This site has a really good tutorial for installing gdb using either brew or macports http://ntraft.com/installing-gdb-on-os-x-mavericks/
I used this command to try to install gdb.
brew install homebrew/dupes/gdb
this should produce the following output
Installing gdb from homebrew/homebrew-dupes
Downloading http://ftpmirror.gnu.org/gdb/gdb-7.9.1.tar.xz
./configure --prefix=/usr/local/Cellar/gdb/7.9.1 --with-system-readline --with-lzma --with-python=/usr
make
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating config.h
config.status: executing default commands**strong text**
make: *** [all] Error 2
The installation process failed on my macbook. This was most likely due to me using the os x 10.11 beta. But it might also be because the gdb version on brew does not work well with yosemite and higher. If this is the case you could try the macports install using the above tutorial.
I can't currently use macports because my os x version. but if you are using yosemite it should be fine.