error: no member named 'emplace' , when compiling Liquibook using make all - c++11

In file included from ./Market.h:6:
In file included from
/Users/shubhamsharma/projects/liquibook/src/book/depth_order_book.h:6:
/Users/shubhamsharma/projects/liquibook/src/book/order_book.h:559:17:
error: no member named 'emplace' in
'std::__1::multimap<liquibook::book::ComparablePrice,
liquibook::book::OrderTracker<std::__1::shared_ptr<orderentry::Order> >,
std::__1::less<liquibook::book::ComparablePrice>, std::__1::allocator<std::__1::pair<const
liquibook::book::ComparablePrice, liquibook::book::OrderTracker<std::__1::shared_ptr<orderentry::Order> > > >
>'
stopBids_.emplace(key, std::move(tracker));
I have set all the environment variables, Makefile is generated using MPC, The error comes after make all. I have tried upgrading my gcc to 4.9 but still the same error occurs. Please help!

Related

How do I include mkl_vsl modules for random number generators e.g. 'vsrnggaussian'? (Fortran)

I'm new to Fortran (gfortran on windows) and want to use the random number generator vsrnggaussian.
vsrnggaussian needs the Intel MKL VSL modules 'mkl_vsl_type' and 'mkl_vsl' which are provided in the mkl_vsl.f90 file. This file needs to be included to generate the module files 'mkl_vsl_type.mod' and 'mkl_vsl.mod' which are used to process the Fortran use clauses referencing to the VSL interface:
use mkl_vsl_type
use mkl_vsl
I tried multiple things to include the mkl_vsl.f90 file but none of them work:
I inserted the file into the project directory --> 793 errors occured (can't list all of them here in detail) such as:
Unexpected data declaration statement at (1)
[...] at (1) has no implicit type
expecting [...] statement at (1)
unexpected [...] statement at (1)
and finally Fatal Error: Cannot open module file 'mkl_vsl_type.mod' for reading at (1): No such file or directory. compilation terminated. "gfortran -g -o incl_mkl.exe ../incl_mkl.f90" terminated with exit code 1. Build might be incomplete.
I used the full path in the include statement: INCLUDE 'C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/mkl_vsl.f90' --> Error: Can't open included file
I tried the -Idir compiler command: gfortran -I/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/ -g -o incl_mkl.exe --> gfortran: error: Files: no such file or directory
I put this into the makefile: INCLUDES=-I. -I/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/ --> Error: Can't open included file
How do I include the mkl_vsl.f90 file??
edit: my simple code to include the mkl_vsl.f90 file
(this code will be compiled first before i compile my main code with vsrnggaussian):
Program INCL
IMPLICIT NONE
INCLUDE 'mkl_vsl.f90'
!INCLUDE 'C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/mkl_vsl.f90'
END Program
You'd need to USE both vsl_type and vsl modules. The reason is that the derived types in vsl are defined in vsl_type. MWE
Program INCL
use mkl_vsl_type
use mkl
IMPLICIT NONE
write(6, *) 'hello world'
END Program
You would need to pass the address to file mkl_vsl.f90 to ifort and the mkl flag.
ifort -mkl foo.f90 <address>/mkl_vsl.f90
For using any specific subroutine of MKL consult their website. There is also extensive examples that come with MKL. You may find it in C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/examples or something like that.

Error installing a .pro file, with Eigen, libigl dependencies on Debian

Im trying to install a .pro file using 'make' on Debian-9. The dependencies are Qt5, GSL, libigl, Eigen and Boost, which their latest versions are installed.
I used the following:
# cd build
# qmake -qt=qt5 ../qt/myfile.pro
# make
And here is the error I get:
../libigl/include/igl/copyleft/boolean/../cgal/order_facets_around_edge.cpp:203:36: error: ‘Eigen::PlainObjectBase<Derived>::PlainObjectBase() [with Derived = Eigen::Matrix<int, -1, 1>]’ is protected within this context
Eigen::PlainObjectBase<DerivedI> positive_order, negative_order;
^~~~~~~~~~~~~~
In file included from /usr/local/include/eigen3/Eigen/Core:457:0,
from ../libigl/include/igl/copyleft/boolean/mesh_boolean.h:15,
from ../src/mesh.cpp:12:
/usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h:484:25: note: declared protected here
EIGEN_STRONG_INLINE PlainObjectBase() : m_storage()
^~~~~~~~~~~~~~~
In file included from ../libigl/include/igl/copyleft/boolean/../cgal/order_facets_around_edge.h:75:0,
from ../libigl/include/igl/copyleft/boolean/../cgal/propagate_winding_numbers.cpp:18,
from ../libigl/include/igl/copyleft/boolean/../cgal/propagate_winding_numbers.h:101,
from ../libigl/include/igl/copyleft/boolean/mesh_boolean.cpp:13,
from ../libigl/include/igl/copyleft/boolean/mesh_boolean.h:172,
from ../src/mesh.cpp:12:
../libigl/include/igl/copyleft/boolean/../cgal/order_facets_around_edge.cpp:203:52: error: ‘Eigen::PlainObjectBase<Derived>::PlainObjectBase() [with Derived = Eigen::Matrix<int, -1, 1>]’ is protected within this context
Eigen::PlainObjectBase<DerivedI> positive_order, negative_order;
^~~~~~~~~~~~~~
In file included from /usr/local/include/eigen3/Eigen/Core:457:0,
from ../libigl/include/igl/copyleft/boolean/mesh_boolean.h:15,
from ../src/mesh.cpp:12:
/usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h:484:25: note: declared protected here
EIGEN_STRONG_INLINE PlainObjectBase() : m_storage()
^~~~~~~~~~~~~~~
Makefile:891: recipe for target 'mesh.o' failed
Could someone please kindly help me solving the issue here?
This line
Eigen::PlainObjectBase<DerivedI> positive_order, negative_order;
won't compile. It may have once compiled for older Eigen versions -- but this is not how Eigen-Base types are supposed to be used, so it likely was never working as intended (that is also the reason why Base-constructors where made protected in Eigen).
However, that line does not exist in the most recent order_facets_around_edge.cpp, so you appear to be using an outdated libigl version.

crosscompile can't find header files for net-snmp (i686/mips64)

I'm currently trying to cross compile onto mips64 using a shared object library, when I run the following command:
toby#cbmFinal:~/x-tools/mips64-n64-linux-gnu/bin$ ./mips64-n64-linux-gnu-gcc -I /home/toby/Downloads/net-snmp-5.5.2.1/include/net-snmp/ -L /usr/lib64/libnetsnmp.so ~/BsDiagnostics/snmpdemoapp.c -o snmpdemoapp
It throws an error saying it can't find the header files:
/home/toby/BsDiagnostics/snmpdemoapp.c:1:38: error: net-snmp/net-snmp-config.h: No such file or directory
/home/toby/BsDiagnostics/snmpdemoapp.c:2:40: error: net-snmp/net-snmp-includes.h: No such file or directory
/home/toby/BsDiagnostics/snmpdemoapp.c: In function 'main':
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: 'netsnmp_session' undeclared (first use in this function)
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: (Each undeclared identifier is reported only once
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: for each function it appears in.)
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: expected ';' before 'session'
etc etc
I have checked the dir and they're all there, I can also do them each manually using -include but then have a bunch of other headers I can't all -include.
toby#cbmFinal:~/Downloads/net-snmp-5.5.2.1/include/net-snmp$ ls
agent definitions.h mib_api.h.gch output_api.h session_api.h.gch utilities.h
config_api.h library net-snmp-config.h pdu_api.h snmpv3_api.h varbind_api.h
config_api.h.gch machine net-snmp-config.h.in pdu_api.h.gch system varbind_api.h.gch
data_access mib_api.h net-snmp-includes.h session_api.h types.h version.h
Any help would be appreciated. Thanks!
Fixed, was a syntax error.
Correct command was:
toby#cbmFinal:~/x-tools/mips64-n64-linux-gnu/bin$ ./mips64-n64-linux-gnu-gcc -I/home/toby/Downloads/net-snmp-5.5.2.1/include/ -L/usr/lib64 -lnetsnmp ~/BsDiagnostics/snmpdemoapp.c -o snmpdemoapp

compile option for rcpp and lib files in windows

Hi I am trying to work with the rcpp. For this I want some cpp code which loads a dll by use of a lib-file (which has the same name as ). the code which I let run is:
cppFunction(includes=c("#include "windef.h","#include \"C:/data/Rdata/IHUAPI.H\" "), 'int functietom(int a){long serverhandle;int lRet;lRet = ihuConnect ( "historian1",NULL,NULL, &serverhandle ); return 5;}', verbose
= TRUE)
I get the following error:
undefined reference to `ihuConnect#16' collect2: ld returned 1 exit
status Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object
'C:/Users/user1663/AppData/Local/Temp/RtmpSW1Ki7/sourcecpp_1a04df63309/sourceCpp_26588.dll':
LoadLibrary failure:
the ihuConnect function is located in the ihuapi.lib and ihuape.dll files. In c++ in visual studio I add the lib file as added dependency and then I get rid of this error because I also sometimes get this error and then it was that I forgot to add the lib file in the compilation.
Thus My question is: how can I add this lib file as option in the compilation.
when I use dyn.load
("C:/data/Rdata/ihUAPI.dll")
and then check if it is loaded then he says yes
the problem is that getDLLRegisteredRoutines('ihUAPI', addNames = TRUE)
then it says:
data frame with 0 columns and 0 rows
so the dll seems not to contain the functions but it does when I use it from visual studio.
So please some help with lib-files and ddl-files
Tom Wambecq
You missed the Rcpp FAQ entry 2.9 'Can I use Rcpp with Visual Studio ?'.
And to kill all the suspense: No, you cannot.

GHC :: Linking agains sqlite3 fails on Windows

I created simple application, which uses sqlite3 as it's datastore back-end. I faced no problems when building and running it on Linux, but after I tried to build it on Windows, I see weird linking error:
Linking dist\build\hnotes\hnotes.exe ...
C:\Documents and Settings\Admin\Application Data\cabal\sqlite-0.5.2.2\ghc-7.0.4/libHSsqlite-0.5.2.2.
a(sqlite3-local.o):sqlite3-local.c:(.text+0x21): undefined reference to `sqlite3_temp_directory'
C:\Documents and Settings\Admin\Application Data\cabal\sqlite-0.5.2.2\ghc-7.0.4/libHSsqlite-0.5.2.2.
a(sqlite3-local.o):sqlite3-local.c:(.text+0x40): undefined reference to `sqlite3_temp_directory'
collect2: v ld 1
cabal.EXE: Error: some packages failed to install:
hnotes-0.1 failed during the building phase. The exception was:
ExitFailure 1
What may be wrong there? I suspect that qalite3.dll has to be added to linking stage, but have no idea how to do that. Adding --extra-lib-dirs=path-to-sqlite-dll doesn't help either (perhaps because I need to update my cabal file somehow, to support this?).
Not sure if It's a bug or not, but the error comes from the sqlite3.h include of the sqlite package.
A look in the file shows this
/*
** CAPI3REF: Name Of The Folder Holding Temporary Files {H10310} <S20000>
**
** If this global variable is made to point to a string which is
** the name of a folder (a.k.a. directory), then all temporary files
** created by SQLite will be placed in that directory. If this variable
** is a NULL pointer, then SQLite performs a search for an appropriate
** temporary file directory.
**
** It is not safe to modify this variable once a [database connection]
** has been opened. It is intended that this variable be set once
** as part of process initialization and before any SQLite interface
** routines have been call and remain unchanged thereafter.
*/
SQLITE_EXTERN char *sqlite3_temp_directory;
so it's declared as an extern. So simple test:
module Main where
import Database.SQLite
main
= do hwd <- openConnection "test"
closeConnection hwd
putStrLn "done"
This crashes during linking as expected with the error you have above.
So I created a small C test file foo.c
#include "sqlite-0.5.2.2\\include\\sqlite3-local.h"
char* sqlite3_temp_directory = "C:\\test2";
So I'm defining a temp_directory and then I pass the c file along during compilation of the haskell source
$ ghc test.hs foo.c
[1 of 1] Compiling Main ( test.hs, test.o )
Linking test.exe ...
and then running it also returns the expected result
$ ./test
done
So it seems that you just need to give a value for the sqlite3_temp_directory, which if you set it to a NULL pointer will use the TMP/TEMP etc variables as defined in the SQLLITE manual.
edit, follow up on why it worked on Linux but not on windows
In the sqlite package, there's a file sqlite3.c under the folder sqlite3.6. This provides a bunch of defaults for the sqlite package.
when on linux OS_UNIX is defined and when on linux it uses the defines under OS_WIN.
The function we're interested in is the function which sets the temporary directory. for unix this'll be unixGetTempname and for windows winGetTempname.
If you look at the implementation of both these functions, for the unix one it has list of directories that it'll try
static const char *azDirs[] = {
0,
"/var/tmp",
"/usr/tmp",
"/tmp",
".",
};
it tries to access them in order and the one it can write to it uses to generate a temporary folder in.
For windows however one of the first lines are:
if( sqlite3_temp_directory ){
sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", sqlite3_temp_directory);
}else if( isNT() ){
so for windows sqlite3_temp_directory is actually used. This is why it doesn't compile if It can't find it.

Resources