error: ‘shared_mutex’ is not a member of ‘std’ using ReaderLock = std::shared_lock<std::shared_mutex>; - c++

i'm trying to use microsoft SEAL library for homomorphic encryption and following the steps from the below link https://github.com/cyberweapons/SEAL/blob/master/INSTALL.txt
when i use command cmake .
terminal shows below result
-- SEAL detected (version 2.3.1)
-- SEAL build type: Release
-- SEAL debug mode: OFF
-- SEAL using Microsoft GSL: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ravindra/Desktop/../../MiSEAL/SEAL/SEALExamples
after that when i give make command it should generate a file main.cpp.o instead it is giving the following errors.
[ 50%] Building CXX object CMakeFiles/sealexamples.dir/main.cpp.o
In file included from /usr/local/include/seal/util/mempool.h:12:0,
from /usr/local/include/seal/memorypoolhandle.h:6,
from /usr/local/include/seal/biguint.h:6,
from /usr/local/include/seal/bigpoly.h:9,
from /usr/local/include/seal/seal.h:3,
from /home/ravindra/Desktop/SakhaProjects/S20_AI/MiSEAL/SEAL/SEALExamples/main.cpp:12:
/usr/local/include/seal/util/locks.h:12:45: error: ‘shared_mutex’ is not a member of ‘std’
using ReaderLock = std::shared_lock<std::shared_mutex>;
^~~
/usr/local/include/seal/util/locks.h:12:45: error: ‘shared_mutex’ is not a member of ‘std’
/usr/local/include/seal/util/locks.h:12:62: error: template argument 1 is invalid
using ReaderLock = std::shared_lock<std::shared_mutex>;
^
/usr/local/include/seal/util/locks.h:14:45: error: ‘shared_mutex’ is not a member of ‘std’
using WriterLock = std::unique_lock<std::shared_mutex>;
^~~
/usr/local/include/seal/util/locks.h:14:45: error: ‘shared_mutex’ is not a member of ‘std’
/usr/local/include/seal/util/locks.h:14:62: error: template argument 1 is invalid
using WriterLock = std::unique_lock<std::shared_mutex>;
^
/usr/local/include/seal/util/locks.h:21:20: error: ‘ReaderLock’ does not name a type
inline ReaderLock acquire_read()
^~~~~~~~~~
/usr/local/include/seal/util/locks.h:26:20: error: ‘WriterLock’ does not name a type
inline WriterLock acquire_write()
^~~~~~~~~~
/usr/local/include/seal/util/locks.h:31:20: error: ‘ReaderLock’ does not name a type
inline ReaderLock try_acquire_read()
^~~~~~~~~~
/usr/local/include/seal/util/locks.h:36:20: error: ‘WriterLock’ does not name a type
inline WriterLock try_acquire_write()
^~~~~~~~~~
/usr/local/include/seal/util/locks.h:46:18: error: ‘shared_mutex’ in namespace ‘std’ does not name a type
std::shared_mutex rw_lock_mutex_;
^~~~~~~~~~~~
In file included from /usr/local/include/seal/memorypoolhandle.h:6:0,
from /usr/local/include/seal/biguint.h:6,
from /usr/local/include/seal/bigpoly.h:9,
from /usr/local/include/seal/seal.h:3,
from /home/ravindra/Desktop/SakhaProjects/S20_AI/MiSEAL/SEAL/SEALExamples/main.cpp:12:
/usr/local/include/seal/util/mempool.h: In member function ‘virtual int64_t seal::util::MemoryPoolMT::pool_count() const’:
/usr/local/include/seal/util/mempool.h:561:17: error: ‘ReaderLock’ was not declared in this scope
ReaderLock lock(pools_locker_.acquire_read());
^~~~~~~~~~
CMakeFiles/sealexamples.dir/build.make:62: recipe for target 'CMakeFiles/sealexamples.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/sealexamples.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/sealexamples.dir/all' failed
make[1]: *** [CMakeFiles/sealexamples.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
i am new to SEAL library also i am a beginner to c++ programming, please someone help me to fix this issues.

Hi i found the solution,
i have included following commands in CMakeLists.txt file continued with the steps
`
# Below is TFHE START
export TFHE_PREFIX=/usr/local
export CPLUS_INCLUDE_PATH=${TFHE_PREFIX}/include:${CPLUS_INCLUDE_PATH}
export C_INCLUDE_PATH=${TFHE_PREFIX}/include:${C_INCLUDE_PATH}
export LIBRARY_PATH=${TFHE_PREFIX}/lib:${LIBRARY_PATH}
export LD_LIBRARY_PATH=${TFHE_PREFIX}/lib:${LD_LIBRARY_PATH}
# Below is TFHE END
`

Related

How to get the emgucv compiled on my Ubuntu 18.04? It is said to support Ubuntu

First I am not very familiar with C++ compile process, but I have to compile the emgucv repository on Ubuntu 18.04. I follow the instruction and try to figure out things by searching through Stack Exchange.
I got every dependencies setup, then the only file I need to execute is this one.
Although it is written for 16.04, seems to work for 18.04, but the compilation throws an error. It says _MAX_DRIVE, _MAX_DIR, _MAX_PATH, DWORD, errno_t, etc. are not declared. As suggested by the comment, they are Windows-specific. The error occurs in this file. And the module that contains this file is this.
My question is how to get this compiled on Ubuntu 18.04? I am very confused, since Emgucv says they support Linux (instruction at the end), and I believe others could have successfully compiled it on their Linux. I attempted to replace those constants _MAX_DRIVE, _MAX_DIR, _MAX_PATH by just numbers, the DWORD by unsigned long, and errno_t by int, then it says now GetModuleFileName, _splitpath_s are not declared. I don't know how to do. Is there anyway for this to work for Ubuntu?
[ 74%] Building CXX object Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/tesseract-ocr.git/src/ccutil/mainblk.cpp.o
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp: In member function ‘void tesseract::CCUtil::main_setup(const char*, const char*)’:
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:77:16: error: ‘_MAX_DRIVE’ was not declared in this scope
char drive[_MAX_DRIVE];
^~~~~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:78:14: error: ‘_MAX_DIR’ was not declared in this scope
char dir[_MAX_DIR];
^~~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:79:15: error: ‘_MAX_PATH’ was not declared in this scope
char path[_MAX_PATH];
^~~~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:83:5: error: ‘DWORD’ was not declared in this scope
DWORD length = GetModuleFileName(nullptr, path, sizeof(path));
^~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:85:9: error: ‘length’ was not declared in this scope
if (length > 0 && length < sizeof(path)) {
^~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:85:39: error: ‘path’ was not declared in this scope
if (length > 0 && length < sizeof(path)) {
^~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:86:7: error: ‘errno_t’ was not declared in this scope
errno_t result = _splitpath_s(path, drive, sizeof(drive),
^~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:88:11: error: ‘result’ was not declared in this scope
if (result == ERANGE) {
^~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:92:17: error: ‘drive’ was not declared in this scope
datadir = drive;
^~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:93:18: error: ‘dir’ was not declared in this scope
datadir += dir;
^~~
Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/build.make:302: recipe for target 'Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/tesseract-ocr.git/src/ccutil/mainblk.cpp.o' failed
make[2]: *** [Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/tesseract-ocr.git/src/ccutil/mainblk.cpp.o] Error 1
CMakeFiles/Makefile2:5929: recipe for target 'Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/all' failed
make[1]: *** [Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
Emgu CV compile manual for Ubuntu
The commands are summarized below
git clone https://github.com/emgucv/emgucv emgucv
cd emgucv
git submodule update --init --recursive
cd platforms/ubuntu/16.04
./apt_install_dependency.sh
./cmake_configure.sh

I failed to build Qt

I want to build Qt for my windows machine but it doesn't work.
I entered from a directory called Qt-5.8.0-build:
..\Qt-5.8.0-src\configure.bat -debug-and-release -platform win32-g++ -prefix C:\Qt\Qt-5.8.0-bin-x64
But I got some errors:
C:/Qt/Qt-5.8.0-src/qtbase/tools/configure/environment.cpp: In static member function 'static Compiler Environment::detectCompiler()':
C:/Qt/Qt-5.8.0-src/qtbase/tools/configure/environment.cpp:144:50: error: 'KEY_WOW64_32KEY' was not declared in this scope
KEY_WOW64_32KEY).toLower();
^
C:/Qt/Qt-5.8.0-src/qtbase/tools/configure/environment.cpp: In static member function 'static QString Environment::execute(const QString&, int*)':
C:/Qt/Qt-5.8.0-src/qtbase/tools/configure/environment.cpp:389:60: error: '_popen' was not declared in this scope
FILE *proc = _popen(command.toLatin1().constData(), "r");
^
C:/Qt/Qt-5.8.0-src/qtbase/tools/configure/environment.cpp:399:29: error: '_pclose' was not declared in this scope
int r = _pclose(proc);
^
<builtin>: recipe for target 'environment.o' failed
mingw32-make: *** [environment.o] Error 1
What could I do to make it work?
Thanks for help

Error building openCV - dumpOpenCLDevice() method error

I have been trying to build opencv for over a week now using the instructions at
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html and http://miloq.blogspot.com/2012/12/install-opencv-ubuntu-linux.html however every time I get to the 'make' step, I get an error:
In file included from /home/sello/opencv-2.4.9/modules/nonfree/perf/perf_main.cpp:28:0:
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp: In function ‘void dumpOpenCLDevice()’:
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:88:9: error: ‘PlatformsInfo’ is not a member of ‘cv::ocl’
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:88:32: error: expected ‘;’ before ‘platforms’
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:89:9: error: ‘getOpenCLPlatforms’ is not a member of ‘cv::ocl’
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:89:37: error: ‘platforms’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:95:19: error: ‘DevicesInfo’ in namespace ‘cv::ocl’ does not name a type
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:96:39: error: ‘devices’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:98:23: error: ‘DeviceInfo’ in namespace ‘cv::ocl’ does not name a type
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:99:33: error: ‘current_device’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:99:62: error: ‘CVCL_DEVICE_TYPE_CPU’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:100:71: error: ‘CVCL_DEVICE_TYPE_GPU’ was not declared in this scope
In file included from /home/sello/opencv-2.4.9/modules/nonfree/perf/perf_main.cpp:28:0:
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:108:15: error: ‘DeviceInfo’ in namespace ‘cv::ocl’ does not name a type
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:110:9: error: ‘deviceInfo’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:111:9: error: ‘deviceInfo’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:113:25: error: ‘deviceInfo’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:113:50: error: ‘CVCL_DEVICE_TYPE_CPU’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:114:61: error: ‘CVCL_DEVICE_TYPE_GPU’ was not declared in this scope
make[2]: *** [modules/nonfree/CMakeFiles/opencv_perf_nonfree.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/nonfree/CMakeFiles/opencv_perf_nonfree.dir/all] Error 2
make: *** [all] Error 2
The process works well for a while and then stops at 79% with the above error. I thought the problem might be caused by the fact that I did not have the OpenCL library installed. I installed it as shown at www.amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/07/AMD_APP_SDK_Installation_Notes.pdf and still no luck. I am running ubuntu 12.04 and OpenCV 2.4.9. The installed version of AMD APP SDK is 2.8.1.0. Please help. I am at my wits end here.
I experienced the same problem and solved it for me by compiling OpenCV without modules needing GPU functionality using the following cmake command in the release folder:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_OPENCL=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -D BUILD_opencv_nonfree=OFF -D BUILD_opencv_stitching=OFF -D BUILD_opencv_superres=OFF ..
The following modules are then deactivated: gpu, nonfree, stitching, superres

Getting ‘_internal_get_deleter’ missing error in Boost library

I successfully build boost_1_45_0 using source code in Ubuntu but when i am using BOOST to build another package:
Scanning dependencies of target GraphMolWrap
[ 98%] Building CXX object
Code/JavaWrappers/gmwrapper/CMakeFiles/GraphMolWrap.dir/GraphMolJavaJAVA_wrap.cxx.o
/opt/RDKit/build/Code/JavaWrappers/gmwrapper/GraphMolJavaJAVA_wrap.cxx: In function ‘jlong
Java_org_RDKit_RDKFuncsJNI_Shared_1Int_1Array_1_1internal_1get_1deleter(JNIEnv*, jclass,
jlong,
jobject, jlong)’:
/opt/RDKit/build/Code/JavaWrappers/gmwrapper/GraphMolJavaJAVA_wrap.cxx:134276:68: error:
‘const class boost::shared_array<int>’ has no member named ‘_internal_get_deleter’
/opt/RDKit/build/Code/JavaWrappers/gmwrapper/GraphMolJavaJAVA_wrap.cxx: In function ‘jlong
Java_org_RDKit_RDKFuncsJNI_Shared_1Double_1Array_1_1internal_1get_1deleter(JNIEnv*, jclass,
jlon g, jobject, jlong)’:
/opt/RDKit/build/Code/JavaWrappers/gmwrapper/GraphMolJavaJAVA_wrap.cxx:134936:71: error:
‘const class boost::shared_array<double>’ has no member named ‘_internal_get_deleter’
make[2]: ***
[Code/JavaWrappers/gmwrapper/CMakeFiles/GraphMolWrap.dir/GraphMolJavaJAVA_wrap.cxx.o] Error
1
make[1]: *** [Code/JavaWrappers/gmwrapper/CMakeFiles/GraphMolWrap.dir/all] Error 2
make: *** [all] Error 2
HIGHLIGHTING Error: const class boost::shared_array<double>’ has no member named ‘_internal_get_deleter’

Qt::What needs to be included in the configuration to use dbus?

I'm using stripped down as much as possible configuration of Qt but now I need to use the dbus and can't figure out what I need to include to be able to use it? There doesnt seem to be anything obvious to me using the qconfig tool. The errors I get at the moment when making are:
qdbus_symbols.cpp:53: error: expected initializer before ‘*’ token
qdbus_symbols.cpp: In function ‘void qdbus_unloadLibDBus()’:
qdbus_symbols.cpp:57: error: ‘qdbus_libdbus’ was not declared in this scope
qdbus_symbols.cpp: In function ‘bool qdbus_loadLibDBus()’:
qdbus_symbols.cpp:67: error: ‘QLibrary’ was not declared in this scope
qdbus_symbols.cpp:67: error: ‘lib’ was not declared in this scope
qdbus_symbols.cpp:67: error: ‘qdbus_libdbus’ was not declared in this scope
qdbus_symbols.cpp:71: error: expected type-specifier before ‘QLibrary’
qdbus_symbols.cpp:71: error: expected ‘;’ before ‘QLibrary’
qdbus_symbols.cpp:85: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
qdbus_symbols.cpp: In function ‘void* qdbus_resolve_conditionally(const char*)’:
qdbus_symbols.cpp:93: error: ‘qdbus_libdbus’ was not declared in this scope
qdbus_symbols.cpp: In function ‘void* qdbus_resolve_me(const char*)’:
qdbus_symbols.cpp:103: error: ‘qdbus_libdbus’ was not declared in this scope
make[1]: *** [.obj/release-static-emb-x86/qdbus_symbols.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/mark/qt-qvfb-4.5.3-static/src/dbus'
make: *** [sub-dbus-make_default-ordered] Error 2
Does anyone know a module that I must not be including which is necessary or how to find out? thanks
QT += dbus
should be enough to include the dbus option in the .pro project file, ins't it?
I need more info to give apropriate answer.