Bug 206546 - devel/cmake - Cmake 3.4.1 fails to build using "make install"
Summary: devel/cmake - Cmake 3.4.1 fails to build using "make install"
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Many People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-23 23:00 UTC by Byron Katz
Modified: 2016-01-27 09:55 UTC (History)
1 user (show)

See Also:
rakuco: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Byron Katz 2016-01-23 23:00:56 UTC
Discovered during build of Gnu Octave.  There are two problems I see happening.  
1)  the man page isn't being built when/where expected.
2) when Cmake tries to run install/strip, it fails and shows the error message "Signal 11".

My system:
==========

[root@laser /usr/ports/devel/cmake]# uname -v -a
FreeBSD laser 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r290228: Sun Nov  1 09:33:36 EST 2015     root@laser:/usr/obj/usr/local/share/head/sys/GENERIC  i386


port svn info
=============

[root@laser /usr/ports/devel/cmake]# svn info /usr/ports/devel/cmake
Path: .
Working Copy Root Path: /usr/ports
URL: https://svn.freebsd.org/ports/head/devel/cmake
Relative URL: ^/head/devel/cmake
Repository Root: https://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 407046
Node Kind: directory
Schedule: normal
Last Changed Author: rakuco
Last Changed Rev: 403079
Last Changed Date: 2015-12-05 16:16:19 -0500 (Sat, 05 Dec 2015)

running the build
=================

[root@laser /usr/ports/devel/cmake]# make install
===>  Staging for cmake-3.4.1
===>   cmake-3.4.1 depends on file: /usr/local/share/cmake/Modules/CMake.cmake - found
===>   cmake-3.4.1 depends on shared library: libcurl.so - found (/usr/local/lib/libcurl.so)
===>   cmake-3.4.1 depends on shared library: libexpat.so - found (/usr/local/lib/libexpat.so)
===>   cmake-3.4.1 depends on shared library: libjsoncpp.so - found (/usr/local/lib/libjsoncpp.so)
===>   cmake-3.4.1 depends on shared library: libarchive.so.13 - found (/usr/local/lib/libarchive.so.13)
===>   Generating temporary packing list
[  7%] Built target cmsys
[ 10%] Built target cmsys_c
[ 11%] Built target cmcompress
[ 62%] Built target CMakeLib
[ 70%] Built target CPackLib
[ 90%] Built target CTestLib
[ 96%] Built target ccmake
[ 97%] Built target cmake
[ 98%] Built target cpack
[ 99%] Built target ctest
[100%] sphinx-build man: see Utilities/Sphinx/build-man.log
/usr/ports/devel/cmake/work/cmake-3.4.1/Help/index.rst:16: WARNING: toctree contains reference to nonexisting document u'manual/cmake-gui.1'
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
None:None: WARNING: cmake:manual reference target not found: cmake-gui(1)
[100%] Built target documentation
Installing the project stripped...
*** Signal 11

Stop.
make[2]: stopped in /usr/ports/devel/cmake/work/cmake-3.4.1
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/cmake
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/cmake
[root@laser /usr/ports/devel/cmake]#



Looking into the Makefile in the work directory for info on install/strip 
=========================================================================

[root@laser /usr/ports/devel/cmake]# find . -type f -exec grep -InH "Installing the project stripped" {} \;
./work/cmake-3.4.1/Auxiliary/bash-completion/Makefile:95:       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Auxiliary/Makefile:95:       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Source/cmGlobalGenerator.cxx:2447:          install_strip, "Installing the project stripped...",
./work/cmake-3.4.1/Source/kwsys/Makefile:95:    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Source/Makefile:95:  @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Tests/Makefile:95:   @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Utilities/cmcompress/Makefile:95:    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Utilities/Doxygen/Makefile:95:       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Utilities/KWIML/Makefile:95: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Utilities/KWStyle/Makefile:95:       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Utilities/Sphinx/Makefile:95:        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Utilities/Makefile:95:       @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
./work/cmake-3.4.1/Makefile:95: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."



Looking for info on where the "Signal 11" error message came from
=================================================================

[root@laser /usr/ports/devel/cmake]# find . -type f -exec grep -InH "Signal %d" {} \;
./work/cmake-3.4.1/Source/kwsys/ProcessUNIX.c:2388:      sprintf(cp->ExitExceptionString, "Signal %d", sig);



Looking into that file
======================
[root@laser /usr/ports/devel/cmake]# sed -n '2250,2400p' ./work/cmake-3.4.1/Source/kwsys/ProcessUNIX.c
}

/*--------------------------------------------------------------------------*/
static kwsysProcessTime kwsysProcessTimeSubtract(kwsysProcessTime in1, kwsysProcessTime in2)
{
  kwsysProcessTime out;
  out.tv_sec = in1.tv_sec - in2.tv_sec;
  out.tv_usec = in1.tv_usec - in2.tv_usec;
  if(out.tv_usec < 0)
    {
    out.tv_usec += 1000000;
    out.tv_sec -= 1;
    }
  return out;
}

/*--------------------------------------------------------------------------*/
#define KWSYSPE_CASE(type, str) \
  cp->ExitException = kwsysProcess_Exception_##type; \
  strcpy(cp->ExitExceptionString, str)
static void kwsysProcessSetExitException(kwsysProcess* cp, int sig)
{
  switch (sig)
    {
#ifdef SIGSEGV
    case SIGSEGV: KWSYSPE_CASE(Fault, "Segmentation fault"); break;
#endif
#ifdef SIGBUS
# if !defined(SIGSEGV) || SIGBUS != SIGSEGV
    case SIGBUS: KWSYSPE_CASE(Fault, "Bus error"); break;
# endif
#endif
#ifdef SIGFPE
    case SIGFPE: KWSYSPE_CASE(Numerical, "Floating-point exception"); break;
#endif
#ifdef SIGILL
    case SIGILL: KWSYSPE_CASE(Illegal, "Illegal instruction"); break;
#endif
#ifdef SIGINT
    case SIGINT: KWSYSPE_CASE(Interrupt, "User interrupt"); break;
#endif
#ifdef SIGABRT
    case SIGABRT: KWSYSPE_CASE(Other, "Child aborted"); break;
#endif
#ifdef SIGKILL                                                                                                                                                           [53/1279]
    case SIGKILL: KWSYSPE_CASE(Other, "Child killed"); break;
#endif
#ifdef SIGTERM
    case SIGTERM: KWSYSPE_CASE(Other, "Child terminated"); break;
#endif
#ifdef SIGHUP
    case SIGHUP: KWSYSPE_CASE(Other, "SIGHUP"); break;
#endif
#ifdef SIGQUIT
    case SIGQUIT: KWSYSPE_CASE(Other, "SIGQUIT"); break;
#endif
#ifdef SIGTRAP
    case SIGTRAP: KWSYSPE_CASE(Other, "SIGTRAP"); break;
#endif
#ifdef SIGIOT
# if !defined(SIGABRT) || SIGIOT != SIGABRT
    case SIGIOT: KWSYSPE_CASE(Other, "SIGIOT"); break;
# endif
#endif
#ifdef SIGUSR1
    case SIGUSR1: KWSYSPE_CASE(Other, "SIGUSR1"); break;
#endif
#ifdef SIGUSR2
    case SIGUSR2: KWSYSPE_CASE(Other, "SIGUSR2"); break;
#endif
#ifdef SIGPIPE
    case SIGPIPE: KWSYSPE_CASE(Other, "SIGPIPE"); break;
#endif
#ifdef SIGALRM
    case SIGALRM: KWSYSPE_CASE(Other, "SIGALRM"); break;
#endif
#ifdef SIGSTKFLT
    case SIGSTKFLT: KWSYSPE_CASE(Other, "SIGSTKFLT"); break;
#endif
#ifdef SIGCHLD
    case SIGCHLD: KWSYSPE_CASE(Other, "SIGCHLD"); break;
#elif defined(SIGCLD)
    case SIGCLD: KWSYSPE_CASE(Other, "SIGCLD"); break;
#endif
#ifdef SIGCONT
    case SIGCONT: KWSYSPE_CASE(Other, "SIGCONT"); break;
#endif
#ifdef SIGSTOP
    case SIGSTOP: KWSYSPE_CASE(Other, "SIGSTOP"); break;
#endif
#ifdef SIGTSTP
    case SIGTSTP: KWSYSPE_CASE(Other, "SIGTSTP"); break;
#endif
#ifdef SIGTTIN
    case SIGTTIN: KWSYSPE_CASE(Other, "SIGTTIN"); break;
#endif
#ifdef SIGTTOU
    case SIGTTOU: KWSYSPE_CASE(Other, "SIGTTOU"); break;
#endif
#ifdef SIGURG
    case SIGURG: KWSYSPE_CASE(Other, "SIGURG"); break;
#endif
#ifdef SIGXCPU
    case SIGXCPU: KWSYSPE_CASE(Other, "SIGXCPU"); break;
#endif
#ifdef SIGXFSZ
    case SIGXFSZ: KWSYSPE_CASE(Other, "SIGXFSZ"); break;
#endif
#ifdef SIGVTALRM
    case SIGVTALRM: KWSYSPE_CASE(Other, "SIGVTALRM"); break;
#endif
#ifdef SIGPROF
    case SIGPROF: KWSYSPE_CASE(Other, "SIGPROF"); break;
#endif
#ifdef SIGWINCH
    case SIGWINCH: KWSYSPE_CASE(Other, "SIGWINCH"); break;
#endif
#ifdef SIGPOLL
    case SIGPOLL: KWSYSPE_CASE(Other, "SIGPOLL"); break;
#endif
#ifdef SIGIO
# if !defined(SIGPOLL) || SIGIO != SIGPOLL
    case SIGIO: KWSYSPE_CASE(Other, "SIGIO"); break;
# endif
#endif
#ifdef SIGPWR
    case SIGPWR: KWSYSPE_CASE(Other, "SIGPWR"); break;
#endif
#ifdef SIGSYS
    case SIGSYS: KWSYSPE_CASE(Other, "SIGSYS"); break;
#endif
#ifdef SIGUNUSED
# if !defined(SIGSYS) || SIGUNUSED != SIGSYS
    case SIGUNUSED: KWSYSPE_CASE(Other, "SIGUNUSED"); break;
# endif
#endif
    default:
      cp->ExitException = kwsysProcess_Exception_Other;
      sprintf(cp->ExitExceptionString, "Signal %d", sig);
      break;
    }
}
#undef KWSYSPE_CASE
Comment 1 w.schwarzenfeld 2016-01-24 01:36:15 UTC
Look at the port-Makefile:

# cmake-gui(1) is installed by devel/cmake-gui. Remove the man page's source to
# prevent it from being built/installed by devel/cmake.
        ${RM} ${WRKSRC}/Help/manual/cmake-gui.1.rst
Comment 2 Byron Katz 2016-01-24 01:47:25 UTC
Well, I should have mentioned, I cannot build cmake-gui, with the same error messages.
Comment 3 Byron Katz 2016-01-24 01:47:32 UTC
workaround: download cmake from its website, at https://cmake.org/download/ and follow the commands:

  configure
  gmake
Comment 4 w.schwarzenfeld 2016-01-24 02:21:27 UTC
Did you try comment out the line in the port Makefile?
Comment 5 Byron Katz 2016-01-24 02:52:45 UTC
(In reply to w.schwarzenfeld from comment #4)
No.  I didn't.  But it's not clear that is what I am supposed to do.

The line you reference is a command in a Makefile.  It's going to be run.  I don't see anything that a user is supposed to do differently, following typical conventions, to make this port build properly.  As far as I can tell, I'm going down the middle of the road and it's just not working.
Comment 6 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-24 18:56:50 UTC
> 1)  the man page isn't being built when/where expected.

Like comment #1 said, things are working as intended: the cmake-gui port installs the cmake-gui man page. It causes a warning to be output in devel/cmake's build, but it is harmless.

> 2) when Cmake tries to run install/strip, it fails and shows the error message "Signal 11".

The "signal 11" message did not come from CMake, it's something invoked during the build that crashed. Try building with CMAKE_VERBOSE=1 to see which command was invoked.
Comment 7 Byron Katz 2016-01-24 21:28:04 UTC
(In reply to Raphael Kubo da Costa from comment #6)
Nothing changes when I include that variable:

this was the command:
[root@laser /usr/ports/devel/cmake]# make -DCMAKE_VERBOSE=1

results were exactly the same, no changes at all.
Comment 8 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-24 22:24:27 UTC
It's a make variable, you should just use CMAKE_VERBOSE=1, without the "-D".
Comment 9 Byron Katz 2016-01-24 23:22:31 UTC
(In reply to Raphael Kubo da Costa from comment #8)
Nothing different.  Exact same print-out as before, tried this:

[root@laser /usr/ports/devel/cmake]# CMAKE_VERBOSE=1
[root@laser /usr/ports/devel/cmake]# make

and this:

[root@laser /usr/ports/devel/cmake]# make CMAKE_VERBOSE=1
Comment 10 Byron Katz 2016-01-24 23:26:47 UTC
(In reply to Raphael Kubo da Costa from comment #8)
I think you are referring to the "inner" makefile that is used by cmake, *not* the port makefile.  I'm not clear on how to pass thru this flag to the inner make.  Furthermore, I'm not sure any of this is worth it.  The port is not working for me, flat out.  Is it working for you?  If you go to /usr/ports/devel/cmake and type "make", does it build?  Note that you need to have the same version I have, which is revision 403079, dated  2015-12-05 16:16:19 -0500
Comment 11 Chris Hutchinson 2016-01-25 15:46:02 UTC
(In reply to Byron Katz from comment #10)
> (In reply to Raphael Kubo da Costa from comment #8)
> I think you are referring to the "inner" makefile that is used by cmake,
> *not* the port makefile.  I'm not clear on how to pass thru this flag to the
> inner make.  Furthermore, I'm not sure any of this is worth it.  The port is
> not working for me, flat out.  Is it working for you?  If you go to
> /usr/ports/devel/cmake and type "make", does it build?  Note that you need
> to have the same version I have, which is revision 403079, dated  2015-12-05
> 16:16:19 -0500

A couple of things jump out at me, that might [possibly] point to a cause;
Your kernel is a month out (earlier than) from the port tree [revision] -- was anything [significant] added to the kernel/base that might make the difference?

I see u'manual/cmake-gui.1' in the error output -- this would [likely] indicate a missing closing quote where I come from, is this just a [spoken] language difference that causes this?

Lastly; I /believe/ if invoked from the ports framework make; the correct syntax would be: make -DMAKE_VERBOSE -- note the omission of "=1"

As to "why should I jump through all these hoops, seems to me the port is broken" (paraphrasing); because (thus far) you appear to be the only person that has this issue, and this will help determine what it might be on /your/ system, or if it's /actually/ "ports" related. :)

All the best.

--Chris
Comment 12 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-25 18:30:32 UTC
(In reply to Byron Katz from comment #10)
> (In reply to Raphael Kubo da Costa from comment #8)
> I think you are referring to the "inner" makefile that is used by cmake,
> *not* the port makefile.  I'm not clear on how to pass thru this flag to the
> inner make.

Sorry, CMAKE_VERBOSE works with ports that use Uses/cmake.mk, not the cmake port itself. `make MAKE_ARGS=VERBOSE=1` should do the same thing, but I guess it won't make much difference in your case since the build part is supposedly working.

What you can do is the following:
% cd /usr/ports/devel/cmake
% make  # this will likely crash for you when staging
% cd `make -V WRKSRC`
% ./bin/cmake --trace-output -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake

this should provide you with more output, though it's possible that it's the generated cmake binary itself that's failing. If this is the case, you'll need to do some debugging to find out where it is crashing.

> Furthermore, I'm not sure any of this is worth it.  The port is
> not working for me, flat out.  Is it working for you?  If you go to
> /usr/ports/devel/cmake and type "make", does it build?  Note that you need
> to have the same version I have, which is revision 403079, dated  2015-12-05
> 16:16:19 -0500

Like Chris said in comment #11, it is basically working for everyone else including the official package builders. If none of this is worth it, how do you expect to be helped?
Comment 13 Byron Katz 2016-01-26 01:37:42 UTC
(In reply to Raphael Kubo da Costa from comment #12)
I was kind of hoping to not debug this myself - rather, I just wanted to let the maintainer know that for a certain combination of port version / kernel / machine that CMake doesn't build properly.

Anyway, here is the result of the recent suggestions:
[root@laser /usr/ports/devel/cmake]# cd `make -V WRKSRC`
[root@laser /usr/ports/devel/cmake/work/cmake-3.4.1]# ./bin/cmake --trace-output -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
Segmentation fault (core dumped)
[root@laser /usr/ports/devel/cmake/work/cmake-3.4.1]#


running the following line caused a ton of extra output, but nothing of obvious significance:
[root@laser /usr/ports/devel/cmake]# make MAKE_ARGS=VERBOSE=1
===>  Staging for cmake-3.4.1
===>   cmake-3.4.1 depends on file: /usr/local/share/cmake/Modules/CMake.cmake -
 found
===>   cmake-3.4.1 depends on shared library: libcurl.so - found (/usr/local/lib/libcurl.so)
...
... (lots of debug info)
...
[100%] Built target ctest
/usr/ports/devel/cmake/work/cmake-3.4.1/Bootstrap.cmk/cmake -E cmake_progress_start /usr/ports/devel/cmake/work/cmake-3.4.1/CMakeFiles 0
/usr/bin/make -f CMakeFiles/Makefile2 preinstall
Installing the project stripped...
bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
*** Signal 11

Stop.
make[2]: stopped in /usr/ports/devel/cmake/work/cmake-3.4.1
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/cmake
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/cmake
Comment 14 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-26 10:33:20 UTC
OK, so it's the generated cmake binary that's crashing. I'm afraid you'll need to do some digging to find out what's wrong:

- Build with WITH_DEBUG=1 (make clean build WITH_DEBUG=1)
- Run gdb710 (from the devel/gdb port) on the generated binary:
  % cd work/cmake-3.4.1
  % gdb710 --args ./bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake

And then get a backtrace.
Comment 15 Byron Katz 2016-01-26 16:33:15 UTC
Here it is:

[root@laser /usr/ports/devel/cmake/work/cmake-3.4.1]# gdb710 --args ./bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
GNU gdb (GDB) 7.10 [GDB v7.10 for FreeBSD]
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-portbld-freebsd11.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bin/cmake...done.
(gdb) run
Starting program: /usr/ports/devel/cmake/work/cmake-3.4.1/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
[New Thread 29812000 (LWP 100686)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 29812000 (LWP 100686)]
0x29086c45 in OPENSSL_ia32_cpuid () from /lib/libcrypto.so.8
(gdb) bt
#0  0x29086c45 in OPENSSL_ia32_cpuid () from /lib/libcrypto.so.8
#1  0x293198ab in OPENSSL_cpuid_setup () from /lib/libcrypto.so.7
#2  0x29213fbd in _init () from /lib/libcrypto.so.7
#3  0x28b0bb60 in ?? ()
#4  0x28aeecc9 in ?? () from /libexec/ld-elf.so.1
#5  0x28aed06e in ?? () from /libexec/ld-elf.so.1
(gdb)
Comment 16 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-26 16:35:57 UTC
This looks like an OpenSSL version mix-up on your system. You should only have /lib/libcrypto.so.8, not libcrypto.so.7. Did you run make delete-old-libs after installing a new kernel/world?
Comment 17 Byron Katz 2016-01-27 02:31:14 UTC
(In reply to Raphael Kubo da Costa from comment #16)
I didn't, actually.  After you mentioned it, I went ahead and ran it, and...now I cannot log in:
in try_dlopen(): /usr/lib/pam_opie.so.5: Shared object "libopie.so.8" not found
in openpam_load_module(): no pam_opie.so found
pam_start(): system error

heh.  Ah well.  I'm going to build 10.2 and go to that now.  Thanks for your help.
Comment 18 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-01-27 09:55:15 UTC
OK, I'm glad we got to the bottom of this. Closing the bug now.