Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

I'm trying to build from source and getting an error. I've included the error log first, and then the results of cmake in case that's useful.

Error log:

cat /home/nathan/cadabra2/build/CMakeFiles/CMakeError.log Determining if the pthread_create exist failed with the following output: Change Dir: /home/nathan/cadabra2/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_6a5d8/fast" /usr/bin/make -f CMakeFiles/cmTC_6a5d8.dir/build.make CMakeFiles/cmTC_6a5d8.dir/build make[1]: Entering directory '/home/nathan/cadabra2/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_6a5d8.dir/CheckSymbolExists.c.o /usr/bin/cc -o CMakeFiles/cmTC_6a5d8.dir/CheckSymbolExists.c.o -c /home/nathan/cadabra2/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c Linking C executable cmTC_6a5d8 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6a5d8.dir/link.txt --verbose=1 /usr/bin/cc -rdynamic CMakeFiles/cmTC_6a5d8.dir/CheckSymbolExists.c.o -o cmTC_6a5d8 CMakeFiles/cmTC_6a5d8.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x1b): undefined reference topthread_create' collect2: error: ld returned 1 exit status CMakeFiles/cmTC_6a5d8.dir/build.make:97: recipe for target 'cmTC_6a5d8' failed make[1]: [cmTC_6a5d8] Error 1 make[1]: Leaving directory '/home/nathan/cadabra2/build/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_6a5d8/fast' failed make: [cmTC_6a5d8/fast] Error 2

File /home/nathan/cadabra2/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include <pthread.h>

int main(int argc, char** argv) { (void)argv;

ifndef pthread_create

return ((int*)(&pthread_create))[argc];

else

(void)argc; return 0;

endif

}

Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/nathan/cadabra2/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_40720/fast" /usr/bin/make -f CMakeFiles/cmTC_40720.dir/build.make CMakeFiles/cmTC_40720.dir/build make[1]: Entering directory '/home/nathan/cadabra2/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_40720.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_40720.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.10/Modules/CheckFunctionExists.c Linking C executable cmTC_40720 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_40720.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_40720.dir/CheckFunctionExists.c.o -o cmTC_40720 -lpthreads /usr/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status CMakeFiles/cmTC_40720.dir/build.make:97: recipe for target 'cmTC_40720' failed make[1]: [cmTC_40720] Error 1 make[1]: Leaving directory '/home/nathan/cadabra2/build/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_40720/fast' failed make: [cmTC_40720/fast] Error 2

Cmake:

cmake .. -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.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 -- Git found: /usr/bin/git


Building Cadabra version 2.3.6.5 (64-bit)

-- Build id '2690.508b5e9f8b' dated 2021-01-23 -- Build mode is set to '' -- Install directory set to /usr/local -- This is an Ubuntu 18.04 system -- Building tweak version -- Building in user mode -- Building tests


Configuring Mathematica

CMake Error at CMakeLists.txt:225 (cmake_policy): Policy "CMP0077" is not known to this version of CMake.

-- Could NOT find Mathematica_WSTP (missing: Mathematica_WSTP_LIBRARY Mathematica_WSTP_INCLUDE_DIR) (found version "") -- Could NOT find Mathematica (missing: Mathematica_ROOT_DIR Mathematica_KERNEL_EXECUTABLE Mathematica_FRONTEND_EXECUTABLE Mathematica_WSTP_LIBRARY Mathematica_WSTP_INCLUDE_DIR) (found version "")


Configuring Python

-- Building for use with Python 3 (good!) -- pybind11 v2.6.1 dev1 -- Found PythonInterp: /usr/bin/python3.6 (found version "3.6.9") -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Found python /usr/lib/x86_64-linux-gnu/libpython3.6m.so -- Python version is 3.6. -- Installing Python module in /usr/local/lib/python3.6/site-packages -- Python abi name cpython-36m-x86_64-linux-gnu


Configuring Jupyter kernel

-- Building the default Jupyter kernel


Configuring client-server

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'glibmm-2.4' -- Found glibmm-2.4, version 2.56.0 -- Found glibmm; include path /usr/include/glibmm-2.4;/usr/lib/x86_64-linux-gnu/glibmm-2.4/include;/usr/include/glib-2.0;/usr/lib/x86_64-linux-gnu/glib-2.0/include;/usr/include/sigc++-2.0;/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -- Found glibmm; lib glibmm-2.4;gobject-2.0;glib-2.0;sigc-2.0 -- Checking for module 'sqlite3' -- Found sqlite3, version 3.22.0 -- Found sqlite3 library path sqlite3 -- Found sqlite3 include path -- Found SQLITE3: sqlite3 -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- program_options -- date_time -- filesystem -- Not building Xeus Jupyter kernel


Configuring core

-- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- Found glibmm; include path /usr/include/glibmm-2.4;/usr/lib/x86_64-linux-gnu/glibmm-2.4/include;/usr/include/glib-2.0;/usr/lib/x86_64-linux-gnu/glib-2.0/include;/usr/include/sigc++-2.0;/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -- Found glibmm; lib glibmm-2.4;gobject-2.0;glib-2.0;sigc-2.0 -- Found gmp header at /usr/include/x86_64-linux-gnu -- Found gmp library at /usr/lib/x86_64-linux-gnu/libgmp.so -- Found gmp -- Found gmpxx -- Building without Mathematica support


Configuring packages

-- Packages built in /home/nathan/cadabra2/build/core/packages/cdb -- gauge_theory_init -- gauge_theory_instantons


Configuring native notebook frontend

-- Checking for module 'gtkmm-3.0' -- Found gtkmm-3.0, version 3.22.2 -- Found gtkmm -- Using GTKMM frontend -- Found sqlite3 library path sqlite3 -- Found sqlite3 include path -- Found glibmm; include path /usr/include/glibmm-2.4;/usr/lib/x86_64-linux-gnu/glibmm-2.4/include;/usr/include/glib-2.0;/usr/lib/x86_64-linux-gnu/glib-2.0/include;/usr/include/sigc++-2.0;/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -- Found glibmm; lib glibmm-2.4;gobject-2.0;glib-2.0;sigc-2.0 -- Found gtkmm -- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- Installing LaTeX style files in /usr/local/share/cadabra2/latex


Configuring tests

-- Set PYTHONPATH for testing to :/home/nathan/cadabra2/libs/appdirs:/home/nathan/cadabra2/core/packages:/home/nathan/cadabra2/core:/home/nathan/cadabra2/build/core/packages:/home/nathan/cadabra2/build/core/:/home/nathan/cadabra2/build/core/:/home/nathan/cadabra2/tests


Configuring documentation

-- Book will be created in /home/nathan/cadabra2/build/book


All scripts completed

-- Configuring incomplete, errors occurred! See also "/home/nathan/cadabra2/build/CMakeFiles/CMakeOutput.log". See also "/home/nathan/cadabra2/build/CMakeFiles/CMakeError.log".

in Installation trouble by (200 points)

FYI, I tried it on Ubuntu 20 and it works fine. Maybe just a quirk of my system....

1 Answer

+1 vote

Configure with

 cmake -DENABLE_MATHEMATICA=OFF ..

For some reason the script which tries to locate Mathematica messes up other parts of the CMake procedure.

by (83.1k points)
...