curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Build process faild on openSuSE 42.3 #42

Closed EPeterR closed 6 years ago

EPeterR commented 6 years ago

Describe the bug A clear and concise description of what the bug is. This a build problem.

Build Log echo '#define CURV_VERSION "'git describe --tags --always --dirty'"' >,v if cmp -s ,v libcurv/version.h; then rm ,v; else mv ,v libcurv/version.h; fi rm -rf CMakeCache.txt CMakeFiles mkdir -p release cd release; cmake -DCMAKE_BUILD_TYPE=Release .. -- Boost version: 1.54.0 -- Found the following Boost libraries: -- iostreams -- system -- thread -- regex -- chrono -- date_time -- atomic -- Using X11 for window creation -- Configuring done -- Generating done -- Build files have been written to: /home/peter/Downloads/Apps/3D-CAD/curv/release cd release; make make[1]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release' make[2]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release' make[3]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release' Scanning dependencies of target replxx make[3]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release' make[3]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release' [ 0%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/conversion.cxx.o [ 0%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/replxx.cxx.o [ 2%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/util.cxx.o [ 2%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/prompt.cxx.o [ 2%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/inputbuffer.cxx.o [ 4%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/windows.cxx.o [ 4%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/history.cxx.o [ 4%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/io.cxx.o [ 6%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/escape.cxx.o [ 6%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/wcwidth.cpp.o [ 9%] Building CXX object CMakeFiles/replxx.dir/extern/replxx/src/ConvertUTF.cpp.o [ 9%] Linking CXX static library libreplxx.a make[3]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release' [ 9%] Built target replxx make[3]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release' Scanning dependencies of target libcurv make[3]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release' make[3]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release' [ 11%] Building CXX object CMakeFiles/libcurv.dir/libcurv/record.cc.o In file included from /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/list.h:8:0, from /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/record.h:8, from /home/peter/Downloads/Apps/3D-CAD/curv/libcurv/record.cc:5: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:105:49: warning: multi-character character constant [-Wmultichar] static constexpr uint64_t k_nanbits = 0x7FFF'0000'0000'0000; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:105:59: warning: missing terminating ' character [enabled by default] static constexpr uint64_t k_nanbits = 0x7FFF'0000'0000'0000; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:105:5: error: missing terminating ' character static constexpr uint64_t k_nanbits = 0x7FFF'0000'0000'0000; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:50: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] static constexpr uint64_t k_boolmask = 0xFFFF'FFFF'FFFF'FFFE; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:50: warning: multi-character character constant [-Wmultichar] /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:60: warning: missing terminating ' character [enabled by default] static constexpr uint64_t k_boolmask = 0xFFFF'FFFF'FFFF'FFFE; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:5: error: missing terminating ' character static constexpr uint64_t kboolmask = 0xFFFF'FFFF'FFFF'FFFE; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:120:42: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] bits = ((uint64_t)r & 0x0000'FFFF'FFFF'FFFF) | Value::knanbits; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:120:42: warning: multi-character character constant [-Wmultichar] /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:120:52: warning: missing terminating ' character [enabled by default] bits = ((uint64_t)r & 0x0000'FFFF'FFFF'FFFF) | Value::knanbits; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:120:13: error: missing terminating ' character bits = ((uint64_t)r & 0x0000'FFFF'FFFF'FFFF) | Value::k_nanbits; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:105:43: error: expected ‘;’ at end of member declaration static constexpr uint64_t k_nanbits = 0x7FFF'0000'0000'0000; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:105:49: error: expected unqualified-id before '\x30303030' static constexpr uint64_t k_nanbits = 0x7FFF'0000'0000'0000; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:44: error: expected ‘;’ at end of member declaration static constexpr uint64_t k_boolmask = 0xFFFF'FFFF'FFFF'FFFE; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:50: error: expected unqualified-id before '\x46464646' static constexpr uint64_t k_boolmask = 0xFFFF'FFFF'FFFF'FFFE; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:105:31: error: ‘curv::Value::k_nanbits’ may not be static because it is a member of a union static constexpr uint64_t k_nanbits = 0x7FFF'0000'0000'0000; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:112:31: error: ‘curv::Value::k_boolbits’ may not be static because it is a member of a union static constexpr uint64_t k_boolbits = k_nanbits|2; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:113:31: error: ‘curv::Value::k_boolmask’ may not be static because it is a member of a union static constexpr uint64_t k_boolmask = 0xFFFF'FFFF'FFFF'FFFE; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h: In constructor ‘constexpr curv::Value::Value()’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:134:47: error: ‘knullbits’ was not declared in this scope inline constexpr Value() noexcept : bits{k_nullbits} {} ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:134:57: error: cannot convert ‘’ to ‘uint64t {aka long unsigned int}’ in initialization inline constexpr Value() noexcept : bits{k_nullbits} {} ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h: In member function ‘bool curv::Value::is_null() const’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:139:25: error: ‘knullbits’ was not declared in this scope return bits == k_nullbits; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h: In constructor ‘curv::Value::Value(double)’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:172:21: error: ‘knullbits’ was not declared in this scope bits = k_nullbits; ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h: In constructor ‘curv::Value::Value(curv::Shared)’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:209:53: error: ‘struct curv::Shared’ has no member named ‘detach’ inline Value(Shared ptr) : Value(ptr.detach()) ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h: In constructor ‘curv::Value::Value(curv::Value&&)’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/value.h:313:21: error: ‘knullbits’ was not declared in this scope val.bits = k_nullbits; ^ In file included from /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/list.h:9:0, from /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/record.h:8, from /home/peter/Downloads/Apps/3D-CAD/curv/libcurv/record.cc:5: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h: In static member function ‘static std::unique_ptr<curv::Tail_Array > curv::Tail_Array::make(size_t, Rest&& ...)’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h:121:14: error: ‘is_trivially_default_constructible’ is not a member of ‘std’ if (!std::is_trivially_default_constructible<_value_type>::value) { ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h:121:65: error: expected primary-expression before ‘>’ token if (!std::is_trivially_default_constructible<_value_type>::value) { ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h:121:66: error: ‘::value’ has not been declared if (!std::is_trivially_default_constructible<_value_type>::value) { ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h: In static member function ‘static std::unique_ptr<curv::Tail_Array > curv::Tail_Array::make_copy(curv::Tail_Array::_value_type, size_t, Rest&& ...)’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h:193:13: error: ‘is_trivially_copy_constructible’ is not a member of ‘std’ if (std::is_trivially_copy_constructible<_value_type>::value) { ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h:193:61: error: expected primary-expression before ‘>’ token if (std::is_trivially_copy_constructible<_value_type>::value) { ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/tail_array.h:193:62: error: ‘::value’ has not been declared if (std::is_trivially_copy_constructible<_value_type>::value) { ^ In file included from /home/peter/Downloads/Apps/3D-CAD/curv/libcurv/record.cc:5:0: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/record.h: In member function ‘virtual std::unique_ptr curv::DRecord::iter() const’: /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/record.h:127:16: error: ‘make_unique’ is not a member of ‘std’ return std::make_unique(this); ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/record.h:127:37: error: expected primary-expression before ‘>’ token return std::make_unique(*this); ^ /home/peter/Downloads/Apps/3D-CAD/curv/./libcurv/record.h:128:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ CMakeFiles/libcurv.dir/build.make:62: recipe for target 'CMakeFiles/libcurv.dir/libcurv/record.cc.o' failed make[3]: [CMakeFiles/libcurv.dir/libcurv/record.cc.o] Error 1 make[3]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release' CMakeFiles/Makefile2:137: recipe for target 'CMakeFiles/libcurv.dir/all' failed make[2]: [CMakeFiles/libcurv.dir/all] Error 2 make[2]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release' Makefile:127: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release' Makefile:2: recipe for target 'release' failed make: [release] Error 2

CMakeError.log Determining if the pthread_create exist failed with the following output: Change Dir: /mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_94a60/fast" gmake[1]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp' /usr/bin/gmake -f CMakeFiles/cmTC_94a60.dir/build.make CMakeFiles/cmTC_94a60.dir/build gmake[2]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_94a60.dir/CheckSymbolExists.c.o /usr/bin/cc -o CMakeFiles/cmTC_94a60.dir/CheckSymbolExists.c.o -c /mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp/CheckSymbolExists.c Linking C executable cmTC_94a60 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_94a60.dir/link.txt --verbose=1 /usr/bin/cc CMakeFiles/cmTC_94a60.dir/CheckSymbolExists.c.o -o cmTC_94a60 -rdynamic CMakeFiles/cmTC_94a60.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference topthread_create' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ collect2: error: ld returned 1 exit status CMakeFiles/cmTC_94a60.dir/build.make:97: recipe for target 'cmTC_94a60' failed gmake[2]: [cmTC_94a60] Error 1 gmake[2]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_94a60/fast' failed gmake[1]: [cmTC_94a60/fast] Error 2 gmake[1]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp'

File /mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp/CheckSymbolExists.c: / /

include

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: /mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_f7fbd/fast" gmake[1]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp' /usr/bin/gmake -f CMakeFiles/cmTC_f7fbd.dir/build.make CMakeFiles/cmTC_f7fbd.dir/build gmake[2]: Entering directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_f7fbd.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_f7fbd.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c Linking C executable cmTC_f7fbd /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f7fbd.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_f7fbd.dir/CheckFunctionExists.c.o -o cmTC_f7fbd -rdynamic -lpthreads /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status CMakeFiles/cmTC_f7fbd.dir/build.make:97: recipe for target 'cmTC_f7fbd' failed gmake[2]: [cmTC_f7fbd] Error 1 gmake[2]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_f7fbd/fast' failed gmake[1]: [cmTC_f7fbd/fast] Error 2 gmake[1]: Leaving directory '/mnt/data2/Apps/3D-CAD/curv/release/CMakeFiles/CMakeTmp'

To Reproduce on openSuSE 42.3 user or root terminal Steps to reproduce the behavior:

  1. Go to 'cd /home/peter/Downloads/Apps/3D-CAD/curv' or 'cd /mnt/data2/Apps/3D-CAD/curv'
  2. Run '$ make'
  3. make failed (see buildlog above)
  4. See error 'CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'' in release/CMakeError.log above

Expected behavior Because library pthreads is installed I would expect a make/cmake build without stop on this error

I found following comment at stackoverflow In general, libraries should follow sources and objects on command line, and -lpthread is not an "option", it's a library specification. On a system with only libpthread.a installed,

Don't hesitate to ask for more infos, if needed. Kind regards Peter

doug-moen commented 6 years ago

Curv is written in the C++14 language. You are currently running gcc 4.8, but you need gcc 5.2 or later to compile C++14 programs. I recommend gcc 6.1 or later, because that is when C++14 support became solid, and the "experimental" tag was dropped.

According to suse.org, "Leap 42.3 has gcc 4.8.5 as the default compiler, but gcc 5.3.1, 6.2.1 and 7.1.1 are also available options for developers."

EPeterR commented 6 years ago

I got it! Now running gcc 7.3.1, but the successful build is based on installing of ALL devel packages that match the list in BUILD.md's 'Ubuntu Linux 16.04 build instructions' section. I missed two of them.