OpenLightingProject / ola

The Open Lighting Architecture - The Travel Adaptor for the Lighting Industry
https://www.openlighting.org/ola/
Other
644 stars 204 forks source link

C++ compiler cannot create executables #1570

Open Lockstrafe opened 5 years ago

Lockstrafe commented 5 years ago

I've been having a lot of issues with compiling. I've followed the steps on the install page (https://www.openlighting.org/ola/mac-install/) and I get errors at the autoreconf -istep, and the ./configure step. I'm not too sure where exactly the issue is. At first autoreconf -i was returning 'command not found'. After installing a few libraries such as autoconfand automake through MacPorts I got to the point where it would return this instead.

autoreconf -i
Makefile.am:196: warning: .PHONY was already defined in condition DX_COND_doc, which is included in condition TRUE ...
aminclude.am:161: ... '.PHONY' previously defined here
Makefile.am:15:   'aminclude.am' included from here

I'm not sure if that worked or not. Nothing is mentioned on the install page about what it should return

The next issue is at ./configure --enable-rdm-tests I've been trying to sort this out for a number of hours now so I can't remember exactly what was going on originally, but now it looks like it can't compile it. After executing ./configure --enable-rdm-tests it returns

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/users/lachlancareedy/ola':
configure: error: C++ compiler cannot create executables
See `config.log' for more details

Here is the config.log config.log From what I can see the issue is around here

checking whether the C++ compiler works
configure:4002: g++  -I/opt/local/include -L/opt/local/lib conftest.cpp  >&5
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
1 warning generated.
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've looked around a whole bunch and it looks like this issue happens for any number of reasons. I saw that maybe it's a bug in Xcode? This is as far as I've gotten. Here's a bunch of info that may or may not be useful Xcode version 10.2.1 Python version 2.7.1 Xcode command-line tools are installed All of the mentioned libraries are up to date, as well as anything else mentioned (I think. I fresh installed and updated just about everything) I don't know what I'm doing, so I tried the tarball and the git. Both have the same issue. I'm running this from an 11 inch 2014 MacBook air running macOS Mojave 10.14.5

I have absolutely no experience with most of this stuff, although I have some minor experience with coding, and I know the very basics of command line. I have always wanted to learn python though, so this has been a good intro for me. Xcode and all of the libraries are all fresh installs as I have never used this stuff before. I also used brew for a few things, although I've lost track of what I actually used it for. I've been through that many internet rabbit holes trying to sort this out.

I hope someone can help me out with this. It would be greatly appreciated :)

peternewman commented 5 years ago

The command is autoreconf, rather than autoreconfig, explaining your earlier issues.

The autoreconf looks to have worked, they are just some warnings we should try and fix at some point.

We desperately need someone to rewrite all our user docs, try this guide instead: https://wiki.openlighting.org/index.php/OLA_Install_Using_MacPorts

Specifically try just running: sudo port install ola

Although my suspicion is it will also fail with a similar error as it feels like some compiler issue.

I've been trying to get our Travis build to work against xcode 10.2 with limited success, although not that specific error yet: https://github.com/OpenLightingProject/ola/pull/1445

Lockstrafe commented 5 years ago

The command is autoreconf, rather than autoreconfig, explaining your earlier issues.

The autoreconf looks to have worked, they are just some warnings we should try and fix at some point.

We desperately need someone to rewrite all our user docs, try this guide instead: https://wiki.openlighting.org/index.php/OLA_Install_Using_MacPorts

Specifically try just running: sudo port install ola

Although my suspicion is it will also fail with a similar error as it feels like some compiler issue.

I've been trying to get our Travis build to work against xcode 10.2 with limited success, although not that specific error yet:

1445

Sorry that was just a typo in the post. I was actually using autoreconf -i when executing those commands.

I tried sudo port install olaand that gave me this

 Computing dependencies for ola
Error: Can't install protobuf3-cpp because conflicting ports are active: protobuf-cpp
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port ola failed

I tried uninstalling protobuf-cpp and installed protobuf3-cpp, but got the same error

Should I maybe try and install an older version of Xcode that worked previously?

peternewman commented 5 years ago

Ah great @lockstrafe .

I'm surprised that having switched you still got the same error. It might be worth trying port installed when you've done that.

An older Xcode would also be worth a go.

Lockstrafe commented 5 years ago

Ah great @Lockstrafe .

I'm surprised that having switched you still got the same error. It might be worth trying port installed when you've done that.

An older Xcode would also be worth a go.

Here's what Port installed returned

$ port installed
The following ports are currently installed:
  autoconf @2.69_5 (active)
  automake @1.16.1_1 (active)
  bzip2 @1.0.8_0 (active)
  cppunit @1.14.0_0 (active)
  curl @7.65.1_0+ssl (active)
  curl-ca-bundle @7.65.1_0 (active)
  db48 @4.8.30_4 (active)
  expat @2.2.7_0 (active)
  gdbm @1.18.1_1 (active)
  gettext @0.19.8.1_2 (active)
  git @2.22.0_0+credential_osxkeychain+diff_highlight+doc+pcre+perl5_28 (active)
  glib2 @2.58.3_0+x11 (active)
  gmp @6.1.2_1 (active)
  gnutls @3.6.8_1+doc (active)
  icu @58.2_2 (active)
  kerberos5 @1.17_0 (active)
  libcomerr @1.45.2_0 (active)
  libedit @20190324-3.1_0 (active)
  libffi @3.2.1_0 (active)
  libgcrypt @1.8.4_0 (active)
  libgpg-error @1.36_1 (active)
  libiconv @1.16_0 (active)
  libidn @1.35_0 (active)
  libidn2 @2.2.0_0 (active)
  libmicrohttpd @0.9.65_0 (active)
  libpsl @0.21.0-20190419_0 (active)
  libtasn1 @4.13_0 (active)
  libtool @2.4.6_6 (active)
  libunistring @0.9.10_0 (active)
  libusb @1.0.22_0 (active)
  libxml2 @2.9.9_1 (active)
  libxslt @1.1.33_1 (active)
  ncurses @6.1_0 (active)
  nettle @3.5.1_0 (active)
  openssl @1.0.2s_0 (active)
  p5.28-authen-sasl @2.160.0_0 (active)
  p5.28-cgi @4.440.0_0 (active)
  p5.28-digest-hmac @1.30.0_0 (active)
  p5.28-digest-sha1 @2.130.0_4 (active)
  p5.28-error @0.170.270_0 (active)
  p5.28-gssapi @0.280.0_3 (active)
  p5.28-html-parser @3.720.0_0 (active)
  p5.28-html-tagset @3.200.0_4 (active)
  p5.28-io-socket-ssl @2.66.0_0 (active)
  p5.28-net-libidn @0.120.0_5 (active)
  p5.28-net-smtp-ssl @1.40.0_0 (active)
  p5.28-net-ssleay @1.880.0_0 (active)
  p5.28-term-readkey @2.380.0_0 (active)
  p11-kit @0.23.16.1_0 (active)
  pcre @8.43_0 (active)
  pcre2 @10.33_0 (active)
  perl5.28 @5.28.2_0 (active)
  pkgconfig @0.29.2_0 (active)
  popt @1.16_0 (active)
  protobuf3-cpp @3.8.0_0 (active)
  py27-protobuf @2.6.1_2 (active)
  py27-setuptools @41.0.1_0 (active)
  python2_select @0.0_3 (active)
  python27 @2.7.16_1 (active)
  python_select @0.3_8 (active)
  readline @8.0.000_0 (active)
  rsync @3.1.3_0 (active)
  sqlite3 @3.29.0_0 (active)
  xz @5.2.4_0 (active)
  zlib @1.2.11_0 (active)

Is there a particular version of Xcode you would suggest I try?

peternewman commented 5 years ago

Try uninstalling py27-protobuf too and then file a bug with MacPorts about a confusing error message if that does the trick!

Otherwise we're successfully building with Xcode 9.3.

Lockstrafe commented 5 years ago

@peternewman That looked like it was going to work, but looks like yet another error. After uninstalling py27-protobuf it went through and installed the rest of the required dependencies and started building ola, but failed here

--->  Extracting ola
--->  Applying patches to ola
--->  Configuring ola
--->  Building ola
Error: Failed to build ola: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_ola/ola/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port ola failed

Here is the log file main.log The issue seems to be here

:info:build Exit code: 2
:error:build Failed to build ola: command execution failed
:debug:build Error code: CHILDSTATUS 9921 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"

I'm guessing this is a macports issue and not an ola issue. Should I file a bug with them? I'll install Xcode 9.3 and see if that helps anything as well

peternewman commented 5 years ago

If you look up a bit in the log it's actually erroring on: ''' :info:build protoc/StrUtil.cpp:256:3: error: use of undeclared identifier 'GOOGLE_CHECK' :info:build GOOGLE_CHECK(i >= 0) :info:build ^ :info:build protoc/StrUtil.cpp:436:3: error: use of undeclared identifier 'GOOGLE_DCHECK_LT' :info:build GOOGLE_DCHECK_LT(digits, 100); :info:build ^ :info:build 2 errors generated. '''

Which is another instance of https://github.com/OpenLightingProject/ola/issues/1550 .

There's a fix in here you can try: https://github.com/OpenLightingProject/ola/pull/1558

As MacPorts released a new protobuf here: https://github.com/macports/macports-ports/commit/e62be99b8c7c625ad8f9bdf7bf6720ccad214a03#diff-8be66e9da4e76d2300e6352949a338c7

playztag commented 4 years ago

Hi there, I'm getting a very similar error: ---> Building ola Error: Failed to build ola: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_ola/ola/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port ola failed

I'm unsure how to generate a log file to see exactly where this is failing. I am running MacOS Catalina 10.15.5 I can't install the older Xcode as it's incompatible with my MacOS.

@peternewman do you have any ideas on how I can get past this part?

EDIT: I did uninstall earlier versions of protobuf as it was conflicting with the install process.