I am trying to compile open MPI (release 1.5.4) from the source code on a Macbook Pro (OS X Lion) with Xcode 4.1 installed. I configure the openmpi with the following options;
../configure CFLAGS=-m64 CXXFLAGS=-m64 FFLAGS=-m64 FCFLAGS=-m64 --with-wrapper-cflags=-m64 --with-wrapper-cxxflags=-m64
in a new/clean directory. When I try make it gives me the following error;
Making all in otfprofile
CXX otfprofile-otfprofile.o
CXX otfprofile-CSVParse.o
CXX otfprofile-DataStructure.o
CXX otfprofile-Handler.o
CXX otfprofile-Prodtex.o
CXX otfprofile-Summary.o
CXXLD otfprofile
Undefined symbols for architecture x86_64:
"___builtin_expect", referenced from:
_main.omp_fn.0 in otfprofile-otfprofile.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[9]: *** [otfprofile] Error 1
make[8]: *** [all-recursive] Error 1
make[7]: *** [all-recursive] Error 1
make[6]: *** [all] Error 2
make[5]: *** [all-recursive] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
I have gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00), gfortran GNU Fortran (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
I heard that I can use MacPorts for an easy installation but I want to compile it myself from the source. Can someone suggest me if I need to set some extra flags or what is causing this error? Please let me know if you need any further information. Thanks.
__builtin_expect is a gcc extension. I'd guess the clang/LLVM move from Apple doesn't support that but thinks it's gcc still.
There's a macro in OpenMPI which is set conditionally, but most likely incorrectly here. Since __builtin_expect is just an optimisation to hint about branch prediction you can probably fix the build by forcing the macro OMPI_CXX_HAVE_BUILTIN_EXPECT to be undefined during build.
Related
If I verify my gcc --version I get:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
And when I build with make after configure, I obtain the following error:
ld: warning: ignoring file /usr/local/Cellar/gcc/11.3.0_2/lib/gcc/11/libquadmath.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/usr/local/Cellar/gcc/11.3.0_2/lib/gcc/11/libquadmath.0.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
collect2: error: ld returned 1 exit status
make[8]: *** [libfgsl.la] Error 1
make[7]: *** [subdir-fgsl] Error 2
make[6]: *** [build-fgsl] Error 2
make[5]: *** [hd-std-all-subdirs] Error 2
make[4]: *** [all-subdirs] Error 2
make[3]: *** [hd-std-all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [heacore] Error 2
make: *** [all] Error 2
Following the similar question here, I verified that
% ranlib --version
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: unknown option character `-' in: --version
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib [-sactfqLT] [-] archive [...]
(base) user#user BUILD_DIR % ranlib -version
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: unknown option character `v' in: -version
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib [-sactfqLT] [-] archive [...]
and that echo $PATH returns:
% echo $PATH
/usr/bin:/Users/username/opt/anaconda3/bin:/Users/username/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin
I have followed similar questions and a) updated Cmake, b) attempted to edit CMAKE_OSX_ARCHITECTURES (but not found in cmake), and more.
Why is this happening and how to fix it?
EDIT: for env:
% env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/zsh
TERM=xterm-256color
TMPDIR=/var/folders/9x/gdg5j9sd4wx3q_v9f2pkrw6r0000gn/T/
TERM_PROGRAM_VERSION=445
TERM_SESSION_ID=C5417ED9-E4C8-411C-9CC3-18711A679E88
USER=username
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.nCSXSuYzna/Listeners
PATH=/usr/bin:/Users/username/opt/anaconda3/bin:/Users/username/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin
Im trying to compile Qt 5.9.x on my Mac OS High Sierra computer.
I configure with the following options:
./configure --prefix=/Users/myuserid/opt/qt593 \
-opensource \
-release -gui -widgets -no-opengl -confirm-license \
-shared -no-dbus -nomake examples
After configuring I compile and after a while it stops with the
following undefined symbols:
Undefined symbols for architecture x86_64:
"AVFVideoRendererControl::staticMetaObject", referenced from:
AVFMediaPlayerService::releaseControl(QMediaControl*) in avfmediaplayerservice.o
"AVFVideoRendererControl::AVFVideoRendererControl(QObject*)", referenced from:
AVFMediaPlayerService::requestControl(char const*) in avfmediaplayerservice.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [../../../../plugins/mediaservice/libqavfmediaplayer.dylib] Error 1
make[4]: *** [sub-mediaplayer-make_first] Error 2
make[3]: *** [sub-avfoundation-make_first] Error 2
make[2]: *** [sub-plugins-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtmultimedia-make_first] Error 2
How do I fix or get past this error? I haven't seen an AVMediaPlayer package to download for Mac OS? I really don't need it anyhow since
Im not planning on doing any Sound or Video?
Anyone see this error and know how to fix it?
Thanks
I'm currently compiling Qt 5.9.3 on osx. I get the same error when I use the '--no-opengl' switch, without it, the compilation is successful. I don't know if this is an option for you, though.
I am trying to install a debugger called Valgrind on OSX 10.11.2.
While running make, I get the following error
Undefined symbols for architecture i386:
"___ctzdi2", referenced from:
_doRegisterAllocation in libvex-x86-darwin.a(libvex_x86_darwin_a-host_generic_reg_alloc2.o)
ld: symbol(s) not found for architecture i386
make[3]: *** [memcheck-x86-darwin] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Do you know how to fix this?
This may or may not work for you, as I am operating in the following environment:
OS X 10.11.2,
Xcode 7.3.1
Custom built GCC 6.2.0 from source (which I am using instead of Xcode's clang compiler)
The following patch file applied to valgrind-3.12.0:
https://gist.github.com/milljm/22e40e723fb9faf201b83197fc23b4a1
I received the same error as OP, until I used the following extra configure argument:
./configure --enable-only64bit
I try to make gunplot 5.0.0 under osx yosemite(10.10.4), and it comes with errors:
$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in config
make[2]: Nothing to be done for `all'.
Making all in m4
make[2]: Nothing to be done for `all'.
Making all in term
make[2]: Nothing to be done for `all'.
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in wxterminal
make[4]: Nothing to be done for `all'.
Making all in qtterminal
make[4]: Nothing to be done for `all'.
c++ -g -O2 -o gnuplot alloc.o axis.o breaders.o boundary.o color.o command.o contour.o datablock.o datafile.o dynarray.o eval.o external.o fit.o gadgets.o getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o interpol.o libcerf.o matrix.o misc.o mouse.o multiplot.o parse.o plot.o plot2d.o plot3d.o pm3d.o readline.o save.o scanner.o set.o show.o specfun.o standard.o stats.o stdfn.o tables.o tabulate.o term.o time.o unset.o util.o util3d.o variable.o version.o -lreadline -lncurses -lz -llua -liconv
Undefined symbols for architecture x86_64:
"_luaL_checkint", referenced from:
_LUA_GP_int_error in term.o
_LUA_GP_int_warn in term.o
(maybe you meant: _luaL_checkinteger)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [gnuplot] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Seems like something related to lua. This is my lua env:
$ lua -v
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
I don't understand the make's output, please help!
It appears that the module/application you are compiling is not Lua 5.3-compatible. It uses luaL_checkint, but Lua 5.3 is using luaL_checkinteger. You need to update the module or use the compatibility switch LUA_COMPAT_APIINTCASTS (LUA_COMPAT_5_2 should work as well as it includes LUA_COMPAT_APIINTCASTS).
I had the same issue when using macports and trying to compile gnuplot (as a dependency for latex2rtf). In the end the fix was relatively straightforward...
In the version of gnuplot I needed (gnuplot-5.0.1), there are two references to luaL_checkint in the lua.trm file found in the term folder:
./term/lua.trm: t_num = luaL_checkint(L, 1);
./term/lua.trm: t_num = luaL_checkint(L, 1);
./term/lua.trm: token_cnt = luaL_checkinteger(L, 1);
Changing luaL_checkint to luaL_checkinteger did the trick. See Paul Kulchenko answer for the reason behind this compatibility issue.
I'm new to Mac and trying to build pkg-config-0.28 on OS X 10.8. I was able to configure successfully using:
./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E" --with-internal-glib
I tried the "--with-internal-glib" after getting an error saying glib not found.
But now I'm getting the following error when I entered:
$ make -j8
Error message:
> CC gvarianttype.lo
CC gversion.lo
CC gwakeup.lo
CC gprintf.lo
CC glib-unix.lo
CC gthread-posix.lo
CC giounix.lo
gutils.c: In function 'find_folder':
gutils.c:1423: warning: 'FSFindFolder' is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h:290)
CC gspawn.lo
echo > glib-public-headers.txt.tmp && mv glib-public-headers.txt.tmp glib-public-headers.txt
lipo: can't figure out the architecture type of: /var/folders/wn/zc31626x5mz7w57dq6cf8f7w0000gn/T//cczwFoWN.out
make[6]: *** [gvariant.lo] Error
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [all-recursive] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Before that, I installed pkg-config-0.26 from a .pkg file but the problem is, it shows install successful but when I enter "pkg-config" in the terminal it says command not found. For this reason I thought of building from the latest release.
I really need this for building/compiling an opencv project. Now how I can get pkg-config to work? Please help.