compile old qt version - c++

I'm working on a project with Qt. I have download and compile my Qt 4.8.7 version without problems on Ubuntu 14.04 and Ubuntu 16.04.
I have followed the next steps:
Install cross compilation tools and package dependencies
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install g++-multilib
sudo apt-get build-dep qt4-x11
Download Qt
mkdir -p ~/dmi/dep/qt && cd ~/dmi/dep/qt
wget http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
tar xvzf qt-everywhere-opensource-src-4.8.7.tar.gz
cd qt-everywhere-opensource-src-4.8.7
Configure, compile and install Qt for the host system
./configure -prefix $HOME/dmi/dep/install/amd64 -embedded -static \
-nomake docs -nomake examples -nomake demos -no-openssl \
-no-qt3support -no-phonon -no-phonon-backend -no-webkit \
-no-javascript-jit -no-script -no-scripttools -no-cups -qvfb \
-qt-gfx-linuxfb -qt-gfx-qvfb -opensource -confirm-license
make -j 5
make install
As I said... This is working perfectly with qt 4.8.7. Now I'm trying to the the same with an old Qt version 4.6.4. But It doesn't work. This is the ./configure output:
Build ............... libs tools translations
Configuration ....... release static embedded largefile precompile_header mmx 3dnow sse sse2 exceptions_off minimal-config small-config medium-config large-config full-config accessibility embedded reduce_exports ipv6 clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify system-jpeg jpeg mng system-png png gif system-tiff tiff system-freetype system-zlib nis glib dbus multimedia audio-backend svg release
Debug ............... no
Qt 3 compatibility .. no
QtDBus module ....... yes (run-time)
QtConcurrent code.... yes
QtScript module ..... no
QtScriptTools module no
QtXmlPatterns module no
Phonon module ....... no
Multimedia module ... yes
SVG module .......... yes
WebKit module ....... no
Declarative module .. no
STL support ......... no
PCH support ......... yes
MMX/3DNOW/SSE/SSE2.. yes/yes/yes/yes
IPv6 support ........ yes
IPv6 ifname support . yes
getaddrinfo support . yes
getifaddrs support .. yes
Accessibility ....... yes
NIS support ......... yes
CUPS support ........ no
Iconv support ....... no
Glib support ........ yes
GStreamer support ... auto
Large File support .. yes
GIF support ......... yes
TIFF support ........ yes (system)
JPEG support ........ yes (system)
PNG support ......... yes (system)
MNG support ......... yes (qt)
zlib support ........ system
Session management .. no
Embedded support .... x86_64
Freetype2 support ... auto (system)
Graphics (qt) ....... linuxfb multiscreen qvfb linuxfb qvfb
Graphics (plugin) ...
Decorations (qt) .... styled windows default
Decorations (plugin)
Keyboard driver (qt). tty qvfb
Keyboard driver (plugin)
Mouse driver (qt) ... pc linuxtp qvfb
Mouse driver (plugin)
OpenGL support ...... no
OpenVG support ...... no
MySQL support ....... plugin
PostgreSQL support .. plugin
ODBC support ........ plugin
TDS support ......... plugin
SQLite support ...... plugin (qt)
OpenSSL support ..... no
Alsa support ........ no
WARNING: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.
Finding project files. Please wait...
Reading /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/src/tools/bootstrap/bootstrap.pro
...
Reading /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/translations/translations.pro
790 projects found.
Creating makefiles. Please wait...
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/tools/qtestlib/wince/remotelib/remotelib.pro
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/tools/designer/src/components/lib/lib.pro
potential duplicate alias detected: 'widget.png'
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/tools/assistant/lib/lib.pro
...
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/src/plugins/phonon/gstreamer/gstreamer.pro
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/src/plugins/phonon/mmf/mmf.pro
Error: Symbian SDK registry key not found
Error: failed to find epoc root
Either
1. Set EPOCROOT environment variable to a valid value
or 2. Ensure that the HKEY_LOCAL_MACHINE\Software\Symbian\EPOC SDKs\CommonPath registry key is set, and then
a. Set EPOCDEVICE environment variable to a valid device
or b. Specify a default device in the devices.xml file.
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/src/plugins/phonon/waveout/waveout.pro
...
for /home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /home/xabi/dmi/dep/install/amd64
To reconfigure, run 'make confclean' and 'configure'.
And the make fails:
64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-x86_64-g++ -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include -I../../include/QtGui -I.rcc/release-static-emb-x86_64 -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-static-emb-x86_64 -I.uic/release-static-emb-x86_64 -o .obj/release-static-emb-x86_64/qheaderview.o itemviews/qheaderview.cpp
itemviews/qabstractitemview.cpp: In member function ‘virtual void QAbstractItemView::keyPressEvent(QKeyEvent*)’:
itemviews/qabstractitemview.cpp:2311:10: error: ‘Key_BackSpace’ is not a member of ‘Qt’
case Qt::Key_BackSpace:
^
g++ -c -include .pch/release-static-emb-x86_64/QtGui -pipe -m64 -fno-exceptions -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_NO_FONTCONFIG -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_GTK -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-x86_64-g++ -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include -I../../include/QtGui -I.rcc/release-static-emb-x86_64 -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-static-emb-x86_64 -I.uic/release-static-emb-x86_64 -o .obj/release-static-emb-x86_64/qlistview.o itemviews/qlistview.cpp
Makefile:126493: recipe for target '.obj/release-static-emb-x86_64/qabstractitemview.o' failed
make[1]: *** [.obj/release-static-emb-x86_64/qabstractitemview.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/xabi/dmi/dep/qt/qt-everywhere-opensource-src-4.6.4/src/gui'
Makefile:306: recipe for target 'sub-gui-make_default-ordered' failed
make: *** [sub-gui-make_default-ordered] Error 2
What's the problem? Any idea?

Related

Graphics Installation in Opam

I am trying to install graphics using opam install graphics, but I get the following error
message:
$ opam install graphics
The following actions will be performed:
∗ install graphics 5.1.1
↻ recompile ocamlfind 1.9.1 [uses graphics]
↻ recompile base-bytes base [uses ocamlfind]
↻ recompile ounit2 2.2.4 [uses base-bytes]
↻ recompile ANSITerminal 0.8.2 [uses base-bytes]
===== ∗ 1 ↻ 4 =====
Do you want to continue? [Y/n] y
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ANSITerminal.0.8.2] found in cache
[graphics.5.1.1] found in cache
[ocamlfind.1.9.1] found in cache
[ounit2.2.2.4] found in cache
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] The compilation of graphics failed at "/Users/traviszhang/.opam/opam-init/hooks/sandbox.sh build dune
build -p graphics -j 3 #install".
#=== ERROR while compiling graphics.5.1.1 =====================================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.11.1 | https://opam.ocaml.org#7e6a6dcc
# path ~/.opam/cs3110-2021sp/.opam-switch/build/graphics.5.1.1
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p graphics -j 3 #install
# exit-code 1
# env-file ~/.opam/log/graphics-9364-8b8a2d.env
# output-file ~/.opam/log/graphics-9364-8b8a2d.out
### output ###
# [...]
# In file included from src/unix/subwindow.c:16:
# src/unix/libgraph.h:17:10: fatal error: 'X11/Xlib.h' file not found
# #include <X11/Xlib.h>
# ^~~~~~~~~~~~
# 1 error generated.
# cc src/text.o (exit 1)
# (cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -D_FILE_OFFSET_BITS=64 -D_REENTRANT -g -I /Users/traviszhang/.opam/cs3110-2021sp/lib/ocaml -o text.o -c text.c)
# In file included from src/unix/text.c:16:
# src/unix/libgraph.h:17:10: fatal error: 'X11/Xlib.h' file not found
# #include <X11/Xlib.h>
# ^~~~~~~~~~~~
# 1 error generated.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build graphics 5.1.1
└─
╶─ No changes have been performed
I have tried the following solutions, but none of them seem to work:
https://github.com/ocaml/graphics/issues/16 (running export LIBRARY_PATH=/opt/X11/lib)
Also adding export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig" to my .zshrc file (this is mentioned in the same thread as 1.
When I run pkg-config --list-all | grep x11 the x11 libraries pop up, but for some reason spam can't seem to find it when trying to install graphics. Any suggestions would be helpful!
Here is my current computer configuration:
macOS BigSur Version 11.2.1
Ocaml Compiler 4.11.1
Update:
This issue has been brought up in the following thread (https://github.com/ocaml/graphics/pull/36#issuecomment-846827032), and will be updated in the new graphics release.
The easiest path to get the graphics package working on macOS is to install and properly setup homebrew, after that you can just do
opam depext --install graphics
and it should install the system dependencies via homebrew (xquartz and xorgproto) and install the OCaml library.

Missing file "tensorflow/core/framework/types.pb.h" when building TensorFlow r1.14 C++ files

I have trained a keras machine learning model in python tensorflow 1.14 and my goal is to use that trained model to aid in performing fluid simulation calculations in C++. For this reason, I would like to use the tensorflow C++ API to run the previously trained model. I have been following the tutorial found here: http://www.bitbionic.com/2017/08/18/run-your-keras-models-in-c-tensorflow/ (however using r1.14 instead of r1.1 - but note I have tried with r1.1 as well). I am using Python 2.7, GCC 9.2.1, Bazel 0.24.1 - this is what is tested by Google here: https://www.tensorflow.org/install/source with the exception of GCC (4.8 by google).
The steps I have taken are as follows:
Clone tensorflow and checkout r1.14
Configure with default settings:
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.24.1 installed.
Please specify the location of python. [Default is /usr/bin/python]:
Found possible Python library paths:
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
Please input the desired Python library path to use. Default is [/usr/local/lib/python2.7/dist-packages]
Do you wish to build TensorFlow with XLA JIT support? [Y/n]:
XLA JIT support will be enabled for TensorFlow.
Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]:
No OpenCL SYCL support will be enabled for TensorFlow.
Do you wish to build TensorFlow with ROCm support? [y/N]:
No ROCm support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]:
No CUDA support will be enabled for TensorFlow.
Do you wish to download a fresh release of clang? (Experimental) [y/N]:
Clang will not be downloaded.
Do you wish to build TensorFlow with MPI support? [y/N]:
No MPI support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]:
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]:
Not configuring the WORKSPACE for Android builds.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
--config=mkl # Build with MKL support.
--config=monolithic # Config for mostly static monolithic build.
--config=gdr # Build with GDR support.
--config=verbs # Build with libverbs support.
--config=ngraph # Build with Intel nGraph support.
--config=numa # Build with NUMA support.
--config=dynamic_kernels # (Experimental) Build kernels into separate shared objects.
Preconfigured Bazel build configs to DISABLE default on features:
--config=noaws # Disable AWS S3 filesystem support.
--config=nogcp # Disable GCP support.
--config=nohdfs # Disable HDFS support.
--config=noignite # Disable Apache Ignite support.
--config=nokafka # Disable Apache Kafka support.
--config=nonccl # Disable NVIDIA NCCL support.
Configuration finished
I was recieving a build error (shown below), so I patched this release to fix an error I was receiving with what is described here: https://github.com/clearlinux/distribution/issues/1151 (not included in tutorial)
ERROR: /home/mark/.cache/bazel/_bazel_mark/0de26f992c566e8f868a9b2c0c3da3e9/external/grpc/BUILD:507:1: C++ compilation of rule '#grpc//:gpr_base' failed (Exit 1): gcc failed: error executing command
(cd /home/mark/.cache/bazel/_bazel_mark/0de26f992c566e8f868a9b2c0c3da3e9/execroot/org_tensorflow && \
exec env - \
PATH=/home/mark/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/cuda/bin:/snap/bin \
PWD=/proc/self/cwd \
PYTHON_BIN_PATH=/usr/bin/python \
PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
TF_CONFIGURE_IOS=0 \
TF_DOWNLOAD_CLANG=0 \
TF_NEED_CUDA=0 \
TF_NEED_OPENCL_SYCL=0 \
TF_NEED_ROCM=0 \
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/external/grpc/_objs/gpr_base/log_linux.pic.d '-frandom-seed=bazel-out/k8-opt/bin/external/grpc/_objs/gpr_base/log_linux.pic.o' -fPIC '-DGRPC_ARES=0' -iquote external/grpc -iquote bazel-out/k8-opt/genfiles/external/grpc -iquote bazel-out/k8-opt/bin/external/grpc -isystem external/grpc/include -isystem bazel-out/k8-opt/genfiles/external/grpc/include -isystem bazel-out/k8-opt/bin/external/grpc/include -mavx '-mfpmath=both' -msse4.2 -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/grpc/src/core/lib/gpr/log_linux.cc -o bazel-out/k8-opt/bin/external/grpc/_objs/gpr_base/log_linux.pic.o)
Execution platform: #bazel_tools//platforms:host_platform
external/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'
43 | static long gettid(void) { return syscall(__NR_gettid); }
| ^~~~~~
In file included from /usr/include/unistd.h:1170,
from external/grpc/src/core/lib/gpr/log_linux.cc:41:
/usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
34 | extern __pid_t gettid (void) __THROW;
| ^~~~~~
external/grpc/src/core/lib/gpr/log_linux.cc:43:13: warning: 'long int gettid()' defined but not used [-Wunused-function]
43 | static long gettid(void) { return syscall(__NR_gettid); }
| ^~~~~~
Target //tensorflow:libtensorflow_cc.so failed to build
INFO: Elapsed time: 513.481s, Critical Path: 35.74s
INFO: 1907 processes: 1907 local.
FAILED: Build did NOT complete successfully
The patch application: downloaded https://github.com/clearlinux-pkgs/tensorflow/blob/master/Add-grpc-fix-for-gettid.patch and then from tensorflow root
>> git am Add-grpc-fix-for-gettid.patch
Bazel build process then completes with no error and creation of .so file. I would show output here but it's very long - if needed I can paste it somewhere.
bazel build --jobs=4 --verbose_failures -c opt --copt=-mavx --copt=-mfpmath=both --copt=-msse4.2 //tensorflow:libtensorflow_cc.so
Made a project with the main.cpp file in the tutorial (found here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/label_image/main.cc) and a CMakeLists file:
cmake_minimum_required(VERSION 3.16)
project(TensorflowTesting)
set(CMAKE_CXX_STANDARD 14)
#link to tensorflow headers
include_directories(SYSTEM /home/mark/Research/tensorflow_test)
include_directories(SYSTEM /home/mark/Research/tensorflow_test/bazel-tensorflow_test/external/eigen_archive)
include_directories(SYSTEM /home/mark/Research/tensorflow_test/bazel-tensorflow_test/external/protobuf/src)
include_directories(SYSTEM /home/mark/Research/tensorflow_test/bazel-tensorflow_test/bazel-genfiles)
#link to shared object
link_directories(/home/mark/Research/tensorflow_test/bazel-bin/tensorflow) #have to link to the .a and .so files
add_executable(TensorflowTesting main.cpp)
target_link_libraries(TensorflowTesting tensorflow_cc)
When I try to build this, it gives me the error:
In file included from /home/mark/Research/tensorflow_test/tensorflow/core/framework/tensor.h:22,
from /home/mark/Research/tensorflow_test/tensorflow/cc/framework/ops.h:21,
from /home/mark/Research/tensorflow_test/tensorflow/cc/ops/const_op.h:19,
from /home/mark/CLionProjects/TensorflowTesting/main.cpp:38:
/home/mark/Research/tensorflow_test/tensorflow/core/framework/allocator.h:24:10: fatal error: absl/strings/string_view.h: No such file or directory
24 | #include "absl/strings/string_view.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [CMakeFiles/TensorflowTesting.dir/build.make:63: CMakeFiles/TensorflowTesting.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/TensorflowTesting.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TensorflowTesting.dir/rule] Error 2
make: *** [Makefile:118: TensorflowTesting] Error 2
And I was able to get around this error by the suggestion here: https://github.com/tensorflow/tensorflow/issues/22007 (added in root of tf) - However this seems wrong that I need to manually include this library.
git clone https://github.com/abseil/abseil-cpp.git
ln -s abseil-cpp/absl ./absl
Now when I try to build this, I get an error:
In file included from /home/mark/Research/tensorflow_test/tensorflow/core/framework/tensor.h:23,
from /home/mark/Research/tensorflow_test/tensorflow/cc/framework/ops.h:21,
from /home/mark/Research/tensorflow_test/tensorflow/cc/ops/const_op.h:19,
from /home/mark/CLionProjects/TensorflowTesting/main.cpp:38:
/home/mark/Research/tensorflow_test/tensorflow/core/framework/tensor_shape.h:22:10: fatal error: tensorflow/core/framework/types.pb.h: No such file or directory
22 | #include "tensorflow/core/framework/types.pb.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [CMakeFiles/TensorflowTesting.dir/build.make:63: CMakeFiles/TensorflowTesting.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/TensorflowTesting.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TensorflowTesting.dir/rule] Error 2
make: *** [Makefile:118: TensorflowTesting] Error 2
I have tried many suggestions to fix this. Including also trying to run tensorflow/contrib/makefile/build_all_linux.sh, but when I do, I recieve the error:
remote: Total 73632 (delta 33), reused 36 (delta 12), pack-reused 73529
Receiving objects: 100% (73632/73632), 60.29 MiB | 12.97 MiB/s, done.
Resolving deltas: 100% (50705/50705), done.
Note: checking out '5902e759108d14ee8e6b0b07653dac2f4e70ac73'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 5902e7591 Add missing declaration in protobuf_headers
Submodule 'third_party/benchmark' (https://github.com/google/benchmark.git) registered for path 'third_party/benchmark'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/googletest'
Cloning into '/home/mark/Research/tensorflow_test/tensorflow/contrib/makefile/downloads/protobuf/third_party/benchmark'...
Cloning into '/home/mark/Research/tensorflow_test/tensorflow/contrib/makefile/downloads/protobuf/third_party/googletest'...
Submodule path 'third_party/benchmark': checked out '5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8'
Submodule path 'third_party/googletest': checked out 'c3bb0ee2a63279a803aaad956b9b26d74bf9e6e2'
cat: third_party/eigen3/gebp_neon.patch: No such file or directory
download_dependencies.sh completed successfully.
g++ -M -std=c++11 -DNSYNC_USE_CPP11_TIMEPOINT -DNSYNC_ATOMIC_CPP11 -I../../platform/c++11.futex -I../../platform/c++11 -I../../platform/gcc -I../../platform/posix -pthread -I../../public -I../../internal ../../internal/*.c ../../testing/*.c ../../platform/linux/src/nsync_semaphore_futex.c ../../platform/c++11/src/per_thread_waiter.cc ../../platform/c++11/src/yield.cc ../../platform/c++11/src/time_rep_timespec.cc ../../platform/c++11/src/nsync_panic.cc \
../../platform/c++11/src/start_thread.cc > dependfile
g++ -DNSYNC_USE_CPP11_TIMEPOINT -DNSYNC_ATOMIC_CPP11 -I../../platform/c++11.futex -I../../platform/c++11 -I../../platform/gcc -I../../platform/posix -pthread -I../../public -I../../internal -O -std=c++11 -Werror -Wall -Wextra -pedantic -c ../../internal/common.c
g++ -DNSYNC_USE_CPP11_TIMEPOINT -DNSYNC_ATOMIC_CPP11 -I../../platform/c++11.futex -I../../platform/c++11 -I../../platform/gcc -I../../platform/posix -pthread -I../../public -I../../internal -O -std=c++11 -Werror -Wall -Wextra -pedantic -c ../../internal/counter.c
../../internal/counter.c: In function ‘nsync::nsync_counter_s_* nsync::nsync_counter_new(uint32_t)’:
../../internal/counter.c:39:28: error: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct nsync::nsync_counter_s_’ with no trivial copy-assignment; use value-initialization instead [-Werror=class-memaccess]
39 | memset (c, 0, sizeof (*c));
| ^
../../internal/counter.c:29:8: note: ‘struct nsync::nsync_counter_s_’ declared here
29 | struct nsync_counter_s_ {
| ^~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [../../platform/posix/make.common:72: counter.o] Error 1
I'm not sure where to go from here and I was hoping to get a suggestion. I would be happy to follow another tutorial if one is suggested here as this one may be out of date. I appreciate any help!
After frustration with the above, I took a different route and ended up using https://github.com/FloopCZ/tensorflow_cc to solve the problem. I had to change versions of tensorflow to v1.15.0. Following the readme and by manually disabling CUDA support in CMake, I was able to compile and install TensorFlow to be used by CMake without bazel. I'm pretty sure I was close with my previous methodology but it was beginning to get messy and the current solution seems more practical for me.

QT MYSQL drive build, undefined reference to `mysql_get_client_version#0'

I am trying to build the QMYSQL drive, I followed Document (https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows)
it recommond me runned the code :
cd %QTDIR%\qtbase\src\plugins\sqldrivers
qmake -- MYSQL_INCDIR=C:/MySQL/include "MYSQL_LIBDIR=C:/MYSQL/MySQL Server <version>/lib/opt"
nmake sub-mysql
There is no "Libs & Include Files" Module in mysql "Custom Install", so I select the folder from the sql serves.
I run the code on cmd:
cd C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers
qmake -- "MYSQL_INCDIR=C:/MySql/MySQL Server 8.0/include" "MYSQL_LIBDIR=C:/MySql/MySQL Server 8.0/lib"
the result is :
info: creating stash file C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\.qmake.stash
Running configuration tests...
Checking for DB2 (IBM)... no
Checking for InterBase... no
Checking for MySQL... no
Checking for OCI (Oracle)... no
Checking for ODBC... yes
Checking for PostgreSQL... no
Checking for SQLite (version 2)... no
Checking for TDS (Sybase)... no
Done running configuration tests.
Configure summary:
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... yes
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt is now configured for building. Just run 'mingw32-make'.
Once everything is built, you must run 'mingw32-make install'.
Qt will be installed into 'C:\Qt\5.12.6\mingw73_32'.
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
it seems like does not detected mysql. what should I do to build the mysql drive.
I checked the the config log for qmake:
Trying source 5 (type inline) of library mysql ...
+ cd /d C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\5.12.6\mingw73_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = \"C:/MySql/MySQL Server 8.0/lib/libmysql.lib\"" "QMAKE_INCDIR_MYSQL = \"C:/MySql/MySQL Server 8.0/include\"" C:/Qt/5.12.6/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
> Info: creating stash file C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
+ cd /d C:\Qt\5.12.6\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& mingw32-make
> g++ -c -fno-keep-inline-dllexport -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -I"C:\MySql\MySQL Server 8.0\include" -IC:\Qt\5.12.6\mingw73_32\mkspecs\win32-g++ -o main.o main.cpp
> g++ -Wl,-s -Wl,-subsystem,console -mthreads -o mysql.exe main.o -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib "C:\MySql\MySQL Server 8.0\lib\libmysql.lib"
> c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: main.o:main.cpp:(.text.startup+0xc): undefined reference to `mysql_get_client_version#0'
> collect2.exe: error: ld returned 1 exit status
> mingw32-make: *** [Makefile:66: mysql.exe] Error 1
I think here is my problem,
undefined reference to `mysql_get_client_version#0'
but I do not know how to solve it.I am sure there is a "mysql.h" file in "include" folder with a method
unsigned long STDCALL mysql_get_client_version(void);
I solved it.
I solved It the qmake is 86X, and server is 64X. change a 64X qmake worked
this doc is better then old one.
https://doc-snapshots.qt.io/qt5-5.14/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows

( __ printf __ ) cannot be found in DLL (programfiles(x86)\codeblocks\mingw\bin\as.exe)

I'm trying to learn wxwidgets for cross platform GUI development, however I faced a problem.
When try to build wxwidgets with mingW32 I run into errors. I installed minGW32 with codeblocks 16.1 (works fine), added PATH to System Environment. Downloaded all possibilities from wxwidgets.org. None of them wants to compile when I try to compile wxwidgets library from cmd with mingw32. I go into wxwidgets/build/msw, typed several versions but to mention one:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITIC=1 UNICODE=1
(tried without shared, monolitic, even debug mode)
About the error:
( __ printf __ ) cannot be found in DLL
(programfiles(x86)\codeblocks\mingw\bin\as.exe)
I have the exe, tried to reinstall everything from scratch several times. I'm using Windows 10.
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
makefile.gcc:5778: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Update:
After reinstalling and deleting everything connected to this, the problem has changed. The code I use, tried without the flag, and with flag but only"-std=gnu++11" too:
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11"
The new error code:
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
gcc: error: CreateProcess: No such file or directory
makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Any infos about the fact that I could not ever compile wxwidget with codeblocks' built in compiler? without addons?
Delete everything: wxWidgets, Code::Blocks and MinGW or TDM-GCC
* Download and install C::B, without MinGW or TDM
* Download TDM-GCC from here. If you install both 32 & 64 bits versions I suggest you to install them in two different folders.
* Download wxWidgets
Open a command window. Say you have TDM at "C:\TDM32" and wxWidgets at "C:\myWX".
Use these commands to compile wxWidgets:
PATH=%PATH%;C:\TDM32\bin
cd C:\myWX\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITIC=1 UNICODE=1
This should build an only .dll file with most of wxWidgets. Not OpenGL.
If you prefer several .dll don't use "Monolitic=1"
If you prefer not using wx'dlls, but static '.a' files added to your app, don't use "shared=1"
If you want to step into wxWidgets code when using a debugger, use "BUILD=debug"
If you want OpenGL use "USE_OPENGL=1"
To build wxWidgets with C++11 use CXXFLAGS="-std=gnu++11"
For your own app you must tell C::B:
* where the TDM compiler can be found
* where the wxWidgets headers can be found
* where the wxWidgets libraries (.dll or .a depending if you compiled with "shared") can be found

error happens during installation of pyipopt in Ubuntu 12.04

having installed IPOPT and trying to install pyipopt in Ubuntu 12.04 box, I encountered the following error:
python setup.py install
results in the following error:
running install
running build
running build_py
running build_ext
building 'pyipoptcore' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o
In file included from src/callback.c:36:0:
src/hook.h:5:29: fatal error: IpStdCInterface.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
any ideas ?
this is the interface for the ipopt library which is required to compile. as stated in the setup.py file
# You will probably have to edit this file in unpredictable ways
# if you want pyipopt to work for you, sorry.
the easiest way to handle this is to adjust the setup.py accordingly:
# When I installed Ipopt from source, I used the
# --prefix=/usr/local
# option, so this is where I want pyipopt to look for my ipopt installation.
# I only installed from source because the ipopt packaging
# for my linux distribution was buggy,
# so by the time you read this the bugs have probably been fixed
# and you will want to specify a different directory here.
IPOPT_DIR = '/usr/local/'
adjust IPOPT_DIR to the path where the library has been installed on your system, which of course should has been conducted anyway.
EDIT:
If you are installing from source, just use --prefix=/usr/local for the configure script and compile and install the library by running make; sudo make install. Then you don't have to change the setup.py file.