Undefined symbol ___ctzdi2 - makefile

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

Related

Unable to compile library, symbol not found when running make

I am trying to compile a library, MultiNest. I am on Mac OS Catalina, 10.15.6. The instructions to do so are
git clone https://github.com/JohannesBuchner/MultiNest
cd MultiNest/build
cmake ..
make
I get this error when running make:
Undefined symbols for architecture x86_64:
"___nested_MOD_nestrun", referenced from:
_run in eggbox.c.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/eggboxC] Error 1
make[1]: *** [src/example_eggbox_C/CMakeFiles/eggboxC.dir/all] Error 2
make: *** [all] Error 2

qt compile mac os undefined symbols AVFMediaPlayerService AVFVideoRendererControl

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.

VLC Compilation Mac OS

I'm trying to compile VLC by myself as described here and the build.sh throw this error
make all-am
CCLD libvlccore.la
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
__nl_find_msg in libintl.a(dcigettext.o)
(maybe you meant: _vlc_iconv_open, _vlc_iconv , _vlc_iconv_close )
"_iconv_open", referenced from:
__nl_find_msg in libintl.a(dcigettext.o)
(maybe you meant: _vlc_iconv_open)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libvlccore.la] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
And I have not the single clue of what I should do. I'm running Mac OS 10.8.4 and Xcode 4.6.2
You might need to remove references to existing package managers like fink or macports in your environment.
For this, use these commands before doing anything else:
https://wiki.videolan.org/OSXCompile#3rd_party_packagers_and_PATH

When trying to link an OpenMP program on OS X ld returns an error

I am currently working on an OpenMP program running both on Linux (openSUSE 12.2) and OS X (10.8.1), both x86_64. Linking is no problem on Linux, on OS X however I get the following error:
Undefined symbols for architecture x86_64:
"_gomp_tls_key", referenced from:
_GOMP_barrier in libgomp.a(barrier.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [src/resolma_t] Error 1
make[1]: *** [src/CMakeFiles/resolma_t.dir/all] Error 2
make: *** [all] Error 2
How do I fix this? g++ is invoked with -fopenmp so this obviously can't be the reason. My gcc version is i686-apple-darwin11-llvm-gcc-4.2, other OpenMP programs link and work perfectly on the same machine.

Open MPI compilation error

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.

Resources