Opened 13 years ago

Closed 12 years ago

#32080 closed defect (worksforme)

cmake build error on OSX 10.6.8: use of undeclared identifier 'DT_SONAME'

Reported by: anotherperson2011@… Owned by: cssdev
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc:
Port: cmake

Description

CMake fails to build on a OSX 10.6.8 system with all Apple updates:

sudo port install cmake

--->  Computing dependencies for cmake
--->  Building cmake
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for cmake is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_cmake/cmake/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

It does not make any difference if the following are tried:

* sudo port selfupdate
* sudo port clean cmake
* sudo port install cmake configure.compiler=llvm-gcc-4.2
* sudo port upgrade outdated
* sudo port uninstall cmake

log is attached. Thanks for looking into this.

Attachments (4)

main.log (184.5 KB) - added by anotherperson2011@… 13 years ago.
main.2.log (22.8 KB) - added by anotherperson2011@… 13 years ago.
Update of OSX 10.7.3 run
terminal.txt (10.1 KB) - added by anotherperson2011@… 13 years ago.
Terminal Log when running erring command manually
CMakeCache.txt (55.0 KB) - added by anotherperson2011@… 13 years ago.
Attached CMakeCache.txt from failed build, as requested.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: CMake DT_SONAME removed
Owner: changed from macports-tickets@… to css@…
Port: cmake added; CMake removed
Summary: CMake build error on OSX 10.6.8cmake build error on OSX 10.6.8: use of undeclared identifier 'DT_SONAME'

Please attach a main.log that was generated by a clean build, i.e. after running "sudo port clean cmake".

What version of Xcode are you using?

Changed 13 years ago by anotherperson2011@…

Attachment: main.log added

comment:2 in reply to:  1 Changed 13 years ago by anotherperson2011@…

Replying to ryandesign@…:

Please attach a main.log that was generated by a clean build, i.e. after running "sudo port clean cmake".

'main.log' updated as requested.

What version of Xcode are you using?

Xcode 4.2 (build 4C199).

thanks

Changed 13 years ago by anotherperson2011@…

Attachment: main.2.log added

Update of OSX 10.7.3 run

comment:3 Changed 13 years ago by anotherperson2011@…

Issue still exists with OSX 10.7.3, Xcode 4.3 (build 4E71d). Please see updated log ('main.2.log')

comment:4 Changed 13 years ago by cssdev

I'm trying a build of 2.8.7 right now, although I don't have Lion or XCode 4.2+ yet. See #33388

Changed 13 years ago by anotherperson2011@…

Attachment: terminal.txt added

Terminal Log when running erring command manually

comment:5 Changed 13 years ago by anotherperson2011@…

Tried suggestions from ticket #33388 but no change observed in erroneous behavior, believe it's a different issue. Tried manually running (as sudo) the command which appears to fail in the log, results are in the attached file 'terminal.txt'. It seems to be a failure of being able to open 'cmELF.cxx.o' and other '*.cxx.o' files.

comment:6 Changed 13 years ago by cssdev

The current 2.8.7 port seems to build and run fine for me. Can you run selfupdate and try again?

comment:7 Changed 13 years ago by anotherperson2011@…

Similar errors with 2.8.7, though this time cmExprParser.cxx.o is not being created due to the same missing symbols.

The issue appears to be with lines in 'cm*.cxx' that state :

#include <elf.h>

'elf.h' does not appear to be part of the cmake distribution. I have 55 versions of elf.h on my machine, in various source distributions, but the above code finds the only one in the common system paths at /usr/include/elf.h, which on this Mac system is a one line file consisting of:

#define CONFIG_BINFMT_ELF 1

Hence the build issue. Perhaps you could include 'elf.h' in the cmake build, or explicitly point to one elsewhere within MacPorts so that the expected one is used?

comment:8 Changed 13 years ago by anotherperson2011@…

I can confirm that the lack of inclusion of a suitable 'elf.h' file is the source of the issue. Replacing the existing elf.h with a copy of elf.h from an Ubuntu distribution into /usr/include allowed cmake to build within 'sudo port upgrade outdated'.

comment:9 Changed 13 years ago by anotherperson2011@…

Googling 'macports elf.h' reveals that some other macports and apps seems to have encountered the same issue and have some suggested workarounds:

e.g. http://plattanimattan.blogspot.com/2010/04/cross-compiling-linux-on-mac-osx.html

comment:10 in reply to:  8 Changed 13 years ago by anotherperson2011@…

Replying to anotherperson2011@…: Just to clarify - with this workaround, macports cmake 2.8.7 builds cleanly on OSX 10.7.3 with Xcode 4.3 (build 4E71d).

comment:11 Changed 13 years ago by cssdev

I think something else is the issue. It's not that it can't find elf.h, but rather that it shouldn't be looking for it in the first place. This seems similar to #20871.

comment:12 Changed 13 years ago by cssdev

Status: newassigned

Could someone please attach a failed build's CMakeCache.txt?

Changed 13 years ago by anotherperson2011@…

Attachment: CMakeCache.txt added

Attached CMakeCache.txt from failed build, as requested.

comment:13 Changed 12 years ago by cssdev

It looks like files are getting picked up from /usr/local. Do you have another package tool of some type installed that could interfere with MacPorts?

comment:14 in reply to:  13 ; Changed 12 years ago by anotherperson2011@…

Replying to css@…:

It looks like files are getting picked up from /usr/local.

Can you clarify - which files? I can then take a look. The only ones from /usr/local I see being referenced within CMakeCache.txt are a few from /usr/local/bin Path on the machine is fairly ordinary:

PATH=/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

Do you have another package tool of some type installed that could interfere with MacPorts?

'Pallet' is installed but rarely used.

comment:15 in reply to:  14 ; Changed 12 years ago by pixilla (Bradley Giesbrecht)

Replying to anotherperson2011@…:

Replying to css@…:

It looks like files are getting picked up from /usr/local.

The only ones from /usr/local I see being referenced within CMakeCache.txt are a few from /usr/local/bin

See FAQ /usr/local

Try:

sudo mv /usr/local /usr/local_tmp
sudo port clean cmake
sudo port install cmake

comment:16 in reply to:  15 Changed 12 years ago by anotherperson2011@…

Replying to pixilla@…:

Replying to anotherperson2011@…:

Replying to css@…:

It looks like files are getting picked up from /usr/local.

The only ones from /usr/local I see being referenced within CMakeCache.txt are a few from /usr/local/bin

See FAQ /usr/local

Try:

sudo mv /usr/local /usr/local_tmp
sudo port clean cmake
sudo port install cmake

System is now OSX 10.7.4 Lion with Xcode Version 4.3.2 (4E2002) I tried:

rm /usr/include/elf.h (which was the workaround which had been working)
sudo port uninstall cmake
sudo port install cmake

and it built with no problems. I don't know if it was a change to MacPort, CMake, OSX or Xcode which fixed things, but you may close the ticket. Thanks for looking at this.

comment:17 Changed 12 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.