Project

General

Profile

Actions

Bug #1042

closed

Error during make on a clean system

Added by Ricardo Nabinger Sanchez over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
Start date:
07/08/2016
Due date:
% Done:

100%

Estimated time:

Description

After successfully installing lttng-modules and userspace-rcu, I followed the instructions for installing lttng-ust. Both ./bootstrap and ./configure ran OK, but this error happened during make:

-- Could NOT find LTTngUST (missing:  LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS)
-- Configuring done
(...)
-- Generating done
-- Build files have been written to: /home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build
make[4]: Entering directory '/home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build'
make[5]: Entering directory '/home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Leaving directory '/home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build'
[ 10%] Building CXX object CMakeFiles/tracepoint-provider.dir/tracepoint-provider.cpp.o
In file included from /home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp:26:0:
/home/rnsanchez/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h:32:30: fatal error: lttng/tracepoint.h: No such file or directory
compilation terminated.
CMakeFiles/tracepoint-provider.dir/build.make:62: recipe for target 'CMakeFiles/tracepoint-provider.dir/tracepoint-provider.cpp.o' failed

I should mention that this is a clean-system install, i.e., it is a brand-new LTTng installation on a recently installed machine. Linux distribution is Slackware64-14.2, no extraneous software. Hardware is Dell R720, 2x Intel E5-2620 v3, 320 GB RAM. Linux kernel 4.6.3, config is based on Slackware's default plus many tweaks to enable all sorts of tracing stuff.

Git suggests this is a 2.9.0-pre version. Hash is 723f78e383087aebe4975305d8fd3ca5a0c9097b.

To confirm that the failed example expects the (self-)dependencies to be already installed, I ran make install as root. The pre-requisites got installed while make install started, and eventually the compilation of the examples succeeded. By doing this, the package was successfully installed.

Actions #2

Updated by Sébastien Boisvert over 8 years ago

The fix could be implemented 100% in FindLTTngUST.cmake such that it looks in the lttng-ust source distribution for the header file and for the shared library.

I don't think that we would really want that.

Actions #3

Updated by Sébastien Boisvert over 8 years ago

So...

The 3 solutions that I can see are:

1. The patch that I provided (or a variant thereof).

2. Implement a solution strictly in FindLTTngUST.cmake.

3. Don't build this example if if LTTngUST is not found on the system.

Actions #4

Updated by Ricardo Nabinger Sanchez over 8 years ago

On another machine (without LTTng), using the repository/branch mentioned by Sébastien, the build completed without errors:

(...)
make[4]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/gen-tp'
if [ x"cmake-multiple-shared-libraries" != x"" ]; then \
    for subdir in cmake-multiple-shared-libraries; do \
        (cd cmake-multiple-shared-libraries && mkdir -p build && cd build && cmake .. && make && cd ..) || exit 1; \
    done; \
fi;
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find LTTngUST (missing:  LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build
make[4]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[5]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
Scanning dependencies of target tracepoint-provider
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 10%] Building CXX object CMakeFiles/tracepoint-provider.dir/tracepoint-provider.cpp.o
[ 20%] Linking CXX shared library libtracepoint-provider.so
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 20%] Built target tracepoint-provider
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
Scanning dependencies of target aligner-lib
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 30%] Building CXX object CMakeFiles/aligner-lib.dir/aligner-lib.cpp.o
[ 40%] Linking CXX shared library libaligner-lib.so
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 40%] Built target aligner-lib
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
Scanning dependencies of target tester-lib
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 50%] Building CXX object CMakeFiles/tester-lib.dir/tester-lib.cpp.o
[ 60%] Linking CXX shared library libtester-lib.so
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 60%] Built target tester-lib
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
Scanning dependencies of target tester
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 70%] Building CXX object CMakeFiles/tester.dir/tester.cpp.o
[ 80%] Linking CXX executable tester
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 80%] Built target tester
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
Scanning dependencies of target aligner
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[6]: Entering directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[ 90%] Building CXX object CMakeFiles/aligner.dir/aligner.cpp.o
[100%] Linking CXX executable aligner
make[6]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
[100%] Built target aligner
make[5]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[4]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples/cmake-multiple-shared-libraries/build'
make[3]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc/examples'
make[2]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml/doc'
make[1]: Leaving directory '/home/rnsanchez/apps/lttng/lttng-ust-sebhtml'

Actions #5

Updated by Mathieu Desnoyers over 8 years ago

I would think that there might be a way to FindLTTngUST.cmake to look in additional spots ?

So it would itself not have to know whether it is invoked from src tree or not, but would rather receive environment variables telling it where to look.

Solution (1) looks weird because there appears to be an error in the configure output (cannot find...), but then it succeeds afterward.

Actions #6

Updated by Philippe Proulx over 8 years ago

find_path() and find_library() need to know where to find the include and library files beyond the system directories.

One of the many ways to achieve this is by using the standard CMake definitions CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH.

This is fixed in this GH pull request.

Actions #7

Updated by Philippe Proulx over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset ust|commit:0363661e12053e578f5cae7e29108c7029ed74ae.

Actions #8

Updated by Ricardo Nabinger Sanchez over 8 years ago

Confirmed:

(...)
-- Found LTTngUST: /home/rnsanchez/apps/lttng/lttng-ust/liblttng-ust/.libs/liblttng-ust.so;dl (found version "2.9.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rnsanchez/apps/lttng/lttng-ust/doc/examples/cmake-multiple-shared-libraries/build
(...)

Actions

Also available in: Atom PDF