Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Issues with PCP installation during make? #29

Closed
dianadkle opened this Issue Jun 24, 2015 · 5 comments

Comments

Projects
None yet
3 participants

I'm following the latest instructions to building PCP on OS X Yosemite.

$ git clone git://git.pcp.io/pcp
$ cd pcp
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ make install 

But when I go to "make" the files, I get this error after some time:

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [pmwebd] Error 1
make[1]: *** [default_pcp] Error 2
make: *** [default_pcp] Error 2

I'm sure I've installed all the necessary tools and libraries for the file to install properly. What should I do?

Contributor

natoscott commented Jun 24, 2015

ld: symbol(s) not found for architecture i386

The issue here is with the libmicrohttpd library that the PCP code is being linked with, not with PCP itself. It is likely that ibrary has been built x86_64-only, instead of as a Universal binary supporting both i386 and x86_64 (which the rest of the PCP build needs, due to it needing to link with other platform libraries).

There's some additional notes on Mac OS X builds here which should help:
http://www.pcp.io/pipermail/pcp/2015-May/007353.html

cheers.

@natoscott natoscott closed this Jun 24, 2015

Thanks natoscott. I've downloaded the libmicrohttpd library as suggested in the Cairo link you provided, but I'm still getting the same error. For reference, here's the output after getting the universal binary:

$ sudo port install libmicrohttpd +universal
--->  Computing dependencies for libmicrohttpd
--->  Deactivating libmicrohttpd @0.9.42_0
--->  Cleaning libmicrohttpd
--->  Activating libmicrohttpd @0.9.42_0+universal
--->  Cleaning libmicrohttpd
--->  Scanning binaries for linking errors
--->  No broken files found.
Contributor

natoscott commented Jun 25, 2015

"port install" isn't quite what that Cairo link is discussing - it describes building libraries directly (setting CC for universal libraries, etc). See the notes about half-way through, where the CC env variable is set such that it includes "-arch ppc -arch i386 -arch x86_64"... that's the sort of thing you'll need to do with a libmicrohttpd source build to get a successful link.

Have there been any resolution on this? running pcp with libmicrohttpd-0.9.46

 $ ./Makepkgs -v

== Cleaning build tree for packaging build
Wrote: code/pcp/build/tar/pcp-3.11.4.src.tar.gz

== Preparing fresh build tree for packaging build
Source File is: code/pcp/build/tar/pcp-3.11.4.src.tar.gz
TAR command is: /usr/bin/tar

== Configuring pcp, log is in code/pcp/Logs/pcp (--prefix=/usr/local --sysconfdir=/etc --localstatedir=/var  -v)

== Building pcp, log is in code/pcp/Logs/pcp
Make default_pcp failed, see log in code/pcp/Logs/pcp
      pmgraphite_respond_render_gfx(MHD_Connection*, http_params const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in pmgraphite.o
  "_cairo_surface_write_to_png_stream", referenced from:
      pmgraphite_respond_render_gfx(MHD_Connection*, http_params const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in pmgraphite.o
  "_cairo_text_extents", referenced from:
      pmgraphite_respond_render_gfx(MHD_Connection*, http_params const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in pmgraphite.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [pmwebd] Error 1
make[1]: *** [default_pcp] Error 2
make: *** [default_pcp] Error 2
Contributor

natoscott commented Jul 4, 2016

@shahsaifi this part of the error message is the part to read carefully:
"ld: symbol(s) not found for architecture i386"

It is telling you the problem - one of the libraries you are attempting to link with (outside of PCP) has not been built with i386 instructions (it is not a "universal" binary, IOW). Fix that - see earlier notes I posted - and the build will succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment