I'm having a problem compiling mysql connectors C++ with mingw, as posted in the official website, you should run cmake to configure the source, then run a mingw32-make... the cmake needs to have the boost library installed, so i got it and compiled it (it says many updated, 40 targets skipped and failed to update 24).
After that tried to run cmake on mysql connector source, it output no errors and work just fine, when trying to do the final step mingw32-make, it gives lots of errors, many of then are redefinitions... the log is below. Please help me i really need it.
C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\bin>mingw32-make
[ 0%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/mysql_art_resultset.cpp.obj
C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:1:0: warning: -fPIC
ignored for target (all code is position independent) [enabled by default]
In file included from C:/MySQL/MySQL_Server_5.6/include/my_global.h:72:0,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\nativeapi/mysql_private_iface.h:57,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_util.h:30,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:31:
C:/MySQL/MySQL_Server_5.6/include/my_config.h:509:0: warning: "isnan" redefined [enabled by default]
In file included from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:28:0:
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/math.h:480:0: note: this is the location of the previous definition
In file included from C:/MySQL/MySQL_Server_5.6/include/my_global.h:72:0,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\nativeapi/mysql_private_iface.h:57,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_util.h:30,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:31:
C:/MySQL/MySQL_Server_5.6/include/my_config.h:517:0: warning: "strtok_r" redefined [enabled by default]
In file included from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/i686-w64-mingw32/bits/gthr-default.h:41:0,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/i686-w64-mingw32/bits/gthr.h:150,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/ext/atomicity.h:34,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/bits/ios_base.h:41,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/ios:43,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/istream:40,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/sstream:39,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:27:
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/pthread.h:460:0: note: this is the location of the previous definition
In file included from C:/MySQL/MySQL_Server_5.6/include/my_global.h:72:0,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\nativeapi/mysql_private_iface.h:57,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_util.h:30,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:31:
C:/MySQL/MySQL_Server_5.6/include/my_config.h:527:0: warning: "NOMINMAX" redefined [enabled by default]
In file included from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/i686-w64-mingw32/bits/c++config.h:414:0,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/iosfwd:40,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/ios:39,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/istream:40,
from c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/sstream:39,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:27:
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/i686-w64-mingw32/bits/os_defines.h:46:0: note: this is the location of the previous definition
In file included from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_util.h:30:0,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:31:
C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\nativeapi/mysql_private_iface.h:81:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
In file included from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.c
pp:36:0:
C:/Users/Hugo/Downloads/mysql-connector-c++-1.1.2/cppconn/exception.h:48:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
C:/Users/Hugo/Downloads/mysql-connector-c++-1.1.2/cppconn/exception.h:52:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
C:/Users/Hugo/Downloads/mysql-connector-c++-1.1.2/cppconn/exception.h:53:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
C:/Users/Hugo/Downloads/mysql-connector-c++-1.1.2/cppconn/exception.h:58:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:162:1: error: invalid suffix "ui64" on integer constant
C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:162:1: error: invalid suffix "ui64" on integer constant
In file included from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\nativeapi/mysql_private_iface.h:57:0,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_util.h:30,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:31:
C:/MySQL/MySQL_Server_5.6/include/my_global.h: In function 'double rint(double)':
C:/MySQL/MySQL_Server_5.6/include/my_global.h:1160:35: error: 'double rint(double)' was declared 'extern' and later 'static' [-fpermissive]
In file included from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:28:0:
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/math.h:783:23: error: previous declaration of 'double rint(double)' [-fpermissive]
In file included from D:/boost_1_53_0/boost/assert.hpp:81:0,
from D:/boost_1_53_0/boost/smart_ptr/shared_ptr.hpp:29,
from D:/boost_1_53_0/boost/shared_ptr.hpp:17,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_util.h:33,
from C:\Users\Hugo\Downloads\mysql-connector-c++-1.1.2\driver\mysql_art_resultset.cpp:31:
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/cstdlib: At global scope:
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/cstdlib:196:11: error: '::strtoll' has not been declared
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/cstdlib:197:11: error: '::strtoull' has not been declared
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/cstdlib:219:22: error: '__gnu_cxx::strtoll' has not been declared
c:\qt\qt5.0.1\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/include/c++/cstdlib:220:22: error: '__gnu_cxx::strtoull' has not been declared
driver\CMakeFiles\mysqlcppconn.dir\build.make:57: recipe for target 'driver/CMakeFiles/mysqlcppconn.dir/mysql_art_resultset.cpp.obj' failed
mingw32-make[2]: *** [driver/CMakeFiles/mysqlcppconn.dir/mysql_art_resultset.cpp.obj] Error 1
CMakeFiles\Makefile2:94: recipe for target 'driver/CMakeFiles/mysqlcppconn.dir/all' failed
mingw32-make[1]: *** [driver/CMakeFiles/mysqlcppconn.dir/all] Error 2
makefile:135: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
The mysql connector c++ source code is garbage, unfortunately.
It redefines functions that are defined in the standard library and then includes the standard library, or depends on non-standard functions that are not included in every implementation.
Since the standard library does not check to see if its functions and structs have already been defined, you end up with multiple definition errors all over the place.
Also, the problem is made worse for you in that mysql connector has not been ported for mingw. To compile on windows you are required to use visual studio.
It get's better. They only support visual studio 8 and 9.
If you follow these instructions exactly,
http://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-windows.html
then you might be able to get it to work, but you must not deviate from any version numbers. Use an old version of cmake, an old version of visual studio. They have not tested nor do they care about compatibility with any modern versions of build tools.
Related
I am struggling my way through making daal work in my project, and have now come across the following error - I am struggling to make any sense of it and not quite sure where to even start with debugging.
I am trying to replicate this website's code: https://www.codeproject.com/Articles/1151606/Lightning-Fast-R-Machine-Learning-Algorithms but in Windows 10, and have the following software (exactly as per the website):
Intel DAAL 2017 Beta update 1
R version 3.3.1 (Bug in Your Hair)
Rcpp package version 0.12.5
Inline package version 0.3.14
e1071 package version 1.6-7
I have done the following:
copied the daal packages from C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include into the Include for R
followed the instructions in https://software.intel.com/en-us/get-started-with-daal-for-windows
The following is the error I am getting - please help me someone as I am struggling!
file473877c213b9.cpp: In function 'SEXPREC* file473877c213b9(SEXP, SEXP)':
file473877c213b9.cpp:37:49: error: incomplete universal character name \U
std::string fname = Rcpp::as<std::string>(-"C:\Users\Documents\BAJAJ.csv");
^
file473877c213b9.cpp:37:49: warning: unknown escape sequence: '\D'
file473877c213b9.cpp:37:49: warning: unknown escape sequence: '\B'
file473877c213b9.cpp:37:49: error: wrong type argument to unary minus
file473877c213b9.cpp:38:29: error: no matching function for call to 'as(int)'
int k = Rcpp::as<int>(7);
---------------------------------------------------------------------------------
make: *** [file473877c213b9.o] Error 1
Warning message:
running command 'make -f "C:/R/R-33~1.1/etc/x64/Makeconf" -f "C:/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file473877c213b9.dll" WIN=64 TCLBIN=64 OBJECTS="file473877c213b9.o"' had status 2
---------------------------------------------------------------------------------
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file3f9022477144.cpp:3:0:
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include\daal.h:25:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(disable:809)
^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include\daal.h:38:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(lib, "tbb.lib" )
^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include\daal.h:39:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(lib, "tbbmalloc.lib" )
^
In file included from C:/R/R-33~1.1/include/data_management/data/data_dictionary.h:35:0,
from C:/R/R-33~1.1/include/data_management/data_source/data_source.h:33,
from C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\in
In addition: Warning message:
running command 'C:/R/R-33~1.1/bin/x64/R CMD SHLIB file3f9022477144.cpp 2> file3f9022477144.cpp.err.txt' had status 1
Many thanks in advance for any help anyone can provide (i'm not a coder so am struggling!)
Keyur
edit 21 July 2018 - excerpts of my code to provide further details
library(Rcpp)
library(inline)
# Create and register a Rcpp plugin
plug <- Rcpp:::Rcpp.plugin.maker(
include.before = "#include <C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries_2017.1.143\\windows\\daal\\include\\daal.h> ",
libs = paste("/Qdaal[-C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries_2017.1.143\\windows\\daal\\lib\\intel64_win\\daal_core.lib]",
"/Qdaal[-C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries_2017.1.143\\windows\\daal\\lib\\intel64_win\\daal_thread.lib]", sep=""))
registerPlugin("daalNB", plug)
# load data
readCSV <- '
using namespace daal;
using namespace daal::data_management;
// Inputs:
// file - file name
// ncols - number of columns in file
std::string fname = Rcpp::as<std::string>("C://Users//Documents//BAJAJ.csv");
int k = Rcpp::as<int>(7);......***rest of the code as per the website referenced above, ie same code for the readCSV, train and predict functions***
Functions to actually call the functions:
# R function for loading data and labels
loadData <- cxxfunction(signature(file="character", ncols="integer"),readCSV, plugin="daalNB")
# R function for training a model
nbTrain <- cxxfunction(signature(X="raw", y="raw", nclasses="integer"),
train, plugin="daalNB")
# R function for scoring
nbPredict <- cxxfunction(signature(model="raw", X="raw", nclasses="integer"),
predict, plugin="daalNB")
The errors I am getting in relation to the readCSV <- function:
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/as.h:151:29: note: template argument deduction/substitution failed:
file40e81ac24329.cpp:36:89: note: cannot convert '"C://Users//Documents//BAJAJ.csv"' (type 'const char [40]') to type 'SEXP'
std::string fname = Rcpp::as<std::string>("C://Users//Documents//BAJAJ.csv");
^
file40e81ac24329.cpp:37:29: error: no matching function for call to 'as(int)'
int k = Rcpp::as<int>(7);
make: *** [file40e81ac24329.o] Error 1
Warning message:
running command 'make -f "C:/R/R-33~1.1/etc/x64/Makeconf" -f "C:/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file40e81ac24329.dll" WIN=64 TCLBIN=64 OBJECTS="file40e81ac24329.o"' had status 2
ERROR(s) during compilation: source code errors or compiler configuration errors!
The below error summmary appears in red in the R Studio console:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file40e81ac24329.cpp:3:0:
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include\daal.h:25:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(disable:809)
^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include\daal.h:38:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(lib, "tbb.lib" )
^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\include\daal.h:39:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(lib, "tbbmalloc.lib" )
^
In file included from C:/R/R-33~1.1/include/data_management/data/data_dictionary.h:35:0,
from C:/R/R-33~1.1/include/data_management/data_source/data_source.h:33,
from C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\daal\in
In addition: Warning message:
running command 'C:/R/R-33~1.1/bin/x64/R CMD SHLIB file40e81ac24329.cpp 2> file40e81ac24329.cpp.err.txt' had status 1
Edit - 23 July 2018
I made the changes to the csv path as suggested by Ralf, and also inserted the following in the Makevars.win file:
CXX=C:/IntelSWTools2018/compilers_and_libraries_2018.3.210/windows/bin/intel64/icl.exe
CXXFLAGS=-I"C:/IntelSWTools2018/compilers_and_libraries_2018.3.210/windows/daal/include" -I"C:/IntelSWTools2018/compilers_and_libraries_2018.3.210/windows/compiler/include" -I"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt" -I"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include
Now am getting the following errors:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.3.210 Build 20180410
Copyright (C) 1985-2018 Intel Corporation. All rights reserved.
icl: NOTE: The evaluation period for this product ends on 4-aug-2018 UTC.
compilation aborted for file35d0134c2a9d.cpp (code 2)
make: *** [file35d0134c2a9d.o] Error 2
Warning message:
running command 'make -f "C:/R/R-33~1.1/etc/x64/Makeconf" -f "C:/R/R-33~1.1/share/make/winshlib.mk" -f "C:/Users/Documents/.R/Makevars.win" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file35d0134c2a9d.dll" WIN=64 TCLBIN=64 OBJECTS="file35d0134c2a9d.o"' had status 2
In addition: Warning message:
running command 'C:/R/R-33~1.1/bin/x64/R CMD SHLIB file35d0134c2a9d.cpp 2> file35d0134c2a9d.cpp.err.txt' had status 1
I can see a few lines in the code which suggest some issues, but cant make head or tail of these:
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/xmmintrin.h(61): error #2277: invalid definition of __m128; use #include "xmmintrin.h" instead
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/xlocale(341): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/xlocale(367): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/internal/NAComparator.h(62): error: expected a ")"
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/r_cast.h(32): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/module/Module_generated_CppFunction.h(53): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/module/Module_generated_CppFunction.h(93): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/api/meat/module/Module.h(40): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Users/Documents/R/win-library/3.3/Rcpp/include/Rcpp/api/meat/module/Module.h(40): warning #583: C++ exception handler found but /EHsc option was not specified
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/xstring(2195): warning #583: C++ exception handler found but /EHsc option was not specified
Edit 25 July 2018
Have now gone back to the exact packages daal versions noted in the website (very old!), and changed the CSV path as per Ralf's suggestion, and am getting the following compilation errors:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! file2ddc1463da6.o:file2ddc1463da6.cpp:(.text+0x2e6): undefined reference to `daal::data_management::interface1::SerializationIface::serialize(daal::data_management::interface1::InputDataArchive&)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text+0x304): undefined reference to `daal::data_management::interface1::SerializationIface::serialize(daal::data_management::interface1::InputDataArchive&)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text$_ZN4daal15data_management10interface118SerializationIfacenwEy[_ZN4daal15data_management10interface118SerializationIfacenwEy]+0x16): undefined reference to `daal::services::daal_malloc(unsigned long long, unsigned long long)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text$_ZN4daal15data_management10interface118SerializationIfacenaEy[_ZN4daal15data_management10interface118SerializationIfacenaEy]+0x16): undefined reference to `daal::services::daal_malloc(unsigned long long, unsigned long long)'
fi
The source of these are a tonne of lines such as:
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text+0x2e6): undefined reference to `daal::data_management::interface1::SerializationIface::serialize(daal::data_management::interface1::InputDataArchive&)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text+0x304): undefined reference to `daal::data_management::interface1::SerializationIface::serialize(daal::data_management::interface1::InputDataArchive&)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text$_ZN4daal15data_management10interface118SerializationIfacenwEy[_ZN4daal15data_management10interface118SerializationIfacenwEy]+0x16): undefined reference to `daal::services::daal_malloc(unsigned long long, unsigned long long)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text$_ZN4daal15data_management10interface118SerializationIfacenaEy[_ZN4daal15data_management10interface118SerializationIfacenaEy]+0x16): undefined reference to `daal::services::daal_malloc(unsigned long long, unsigned long long)'
file2ddc1463da6.o:file2ddc1463da6.cpp:(.text$_ZN4daal15data_management10interface118SerializationIfacedlEPvy[_ZN4daal15data_management10interface118SerializationIfacedlEPvy]+0x15): undefined reference to `daal::services::daal_free(void*)'
The Rcpp::as function you use is needed to convert between an R internal data type (SEXP) and normal C++ data types (int, string, ...). This is needed when you pass arguments from R to your C++ function. Since you specify the parameter in the C++ code, you do not need this function. The following should work in your readCsv function:
std::string fname = "C:/Users/Documents/BAJAJ.csv";
int k = 7;
Alternatively you can stick to the version from the tutorial where these parameters are passed in from R.
BTW, you don’t need to double /. Only \ has a special meaning and has to be doubled to refer to the literal version.
I have prepared a llvm-clang compiler targeting 32bit Windows. I used 3.7.1 and applied this patch. I get to something that almost works, apart that I have errors with boost.
If I compile my project (that normally works with mingw-gcc) using my usual boost 1.53 headers I have troubles including boost/interprocess components
In file included from [...]/Boost/include-WINDOWS/boost-1_53\boost/interprocess/sync/interprocess_semaphore.hpp:24:
In file included from [...]/Boost/include-WINDOWS/boost-1_53\boost/interprocess/exceptions.hpp:20:
In file included from [...]/Boost/include-WINDOWS/boost-1_53\boost/interprocess/errors.hpp:37:
[...]/Boost/include-WINDOWS/boost-1_53\boost/interprocess/detail/win32_api.hpp:878:48: error: conflicting types for 'VirtualProtect'
If I then try to recompile boost with:
bootstrap.bat mingw
b2 toolset=clang --with-thread --with-filesystem --with-signals --with-test --with-system --with-regex --with-program_options --with-serialization variant=release link=shared threading=multi
Depending on the various version of boost I get a lot of warnings that I could try to ignore, but also some errors:
For 1.56 and 1.57 just these: (is not much, but I don't know how to get rid of it)
In file included from libs\serialization\src\xml_wiarchive.cpp:35:
.\boost/archive/impl/archive_serializer_map.ipp:41:34: error: redeclaration of 'boost::archive::detail::archive_serializer_map::insert' cannot add 'dllexport' attribute
archive_serializer_map<Archive>::insert(const basic_serializer * bs){
^
.\boost/archive/detail/archive_serializer_map.hpp:42:17: note: previous declaration is here
static bool insert(const basic_serializer * bs);
^
In file included from libs\serialization\src\xml_wiarchive.cpp:35:
.\boost/archive/impl/archive_serializer_map.ipp:49:34: error: redeclaration of 'boost::archive::detail::archive_serializer_map::erase' cannot add 'dllexport' attribute
archive_serializer_map<Archive>::erase(const basic_serializer * bs){
^
.\boost/archive/detail/archive_serializer_map.hpp:43:17: note: previous declaration is here
static void erase(const basic_serializer * bs);
^
In file included from libs\serialization\src\xml_wiarchive.cpp:35:
.\boost/archive/impl/archive_serializer_map.ipp:61:34: error: redeclaration of 'boost::archive::detail::archive_serializer_map::find' cannot add 'dllexport' attribute
archive_serializer_map<Archive>::find(
^
.\boost/archive/detail/archive_serializer_map.hpp:44:37: note: previous declaration is here
static const basic_serializer * find(
^
For 1.59 and 1.60 a bunch of MMX related error, which is, as far as I can see, not a feature that I can control when preparing my llvm-clang:
clang-linux.compile.c++.without-pth bin.v2\libs\thread\build\clang-linux-3.7.1\debug\threading-multi\win32\thread.obj
In file included from libs\thread\src\win32\thread.cpp:17:
In file included from .\boost/thread/thread_only.hpp:15:
In file included from .\boost/thread/win32/thread_data.hpp:11:
In file included from .\boost/thread/win32/thread_primitives.hpp:18:
In file included from .\boost/detail/interlocked.hpp:154:
In file included from C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\intrin.h:26:
In file included from C:\Programs\MinGW\i686-w64-mingw32\include\Intrin.h:154:
In file included from C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mm3dnow.h:27:
C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mmintrin.h:28:2: error: "MMX instruction set not enabled"
#error "MMX instruction set not enabled"
^
In file included from libs\thread\src\win32\thread.cpp:17:
In file included from .\boost/thread/thread_only.hpp:15:
In file included from .\boost/thread/win32/thread_data.hpp:11:
In file included from .\boost/thread/win32/thread_primitives.hpp:18:
In file included from .\boost/detail/interlocked.hpp:154:
In file included from C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\intrin.h:26:
In file included from C:\Programs\MinGW\i686-w64-mingw32\include\Intrin.h:154:
C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mm3dnow.h:42:41: error: use of undeclared identifier '__v8qi'
return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2);
^
C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mm3dnow.h:42:55: error: use of undeclared identifier '__v8qi'
return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2);
^
C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mm3dnow.h:47:38: error: cannot convert '__m64' to '__v2sf' (vector of 2 'float' values) without a conversion operator
return (__m64)__builtin_ia32_pf2id((__v2sf)__m);
^~~~~~~~~~~
C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mm3dnow.h:52:38: error: cannot convert '__m64' to '__v2sf' (vector of 2 'float' values) without a conversion operator
return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2);
^~~~~~~~~~~~
C:\Programs\LLVM\bin\..\lib\clang\3.7.1\include\mm3dnow.h:52:52: error: cannot convert '__m64' to '__v2sf' (vector of 2 'float' values) without a conversion operator
return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2);
^~~~~~~~~~~~
Is there a way to get any version of boost to work with clang 32bit under Windows in a MinGW set up?
I have also tried llvm 3.8.0, but I cannot prepare it because my MinGW toolchain doesn't support some part of C++11 (and so other versions that I have tried, see here).
As to boost.thread:
After adding -msse (or whatever) (that resolves MMX instruction set not enabled error) just add -DBOOST_USE_WINDOWS_H to cxxflags to resolve different declarations of many system functions at Windows headers and at boost.date_time.
Eg:
cxxflags="-msse -DBOOST_USE_WINDOWS_H"
I am trying work with FingerPrinter SDK, it shows an example to runs it on linux, i run it on linux cuz its more customizable than windows, well i followed all instructions included to build and compile, but i get this error. These SDK uses libusb library and some usb rules, both are perfectly installed and allowed. Hope get some help.
this is the complete pack where you can find all codes and readmes.
Dowload code!
In file included from /usr/include/x86_64-linux-gnu/bits/waitstatus.h:64:0,
from /usr/include/stdlib.h:42,
from /usr/include/usb.h:15,
from ../lnx/usbl.c:10:
../endian.h:44:10: error: #error Header <endian.h> should define macro __BYTE_ORDER.
#error Header <endian.h> should define macro __BYTE_ORDER.
^
In file included from /usr/include/stdlib.h:42:0,
from /usr/include/usb.h:15,
from ../lnx/usbl.c:10:
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:79:15: error: duplicate member ‘__w_retcode’
unsigned int __w_retcode:8;
^
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:80:15: error: duplicate member ‘__w_coredump’
unsigned int __w_coredump:1;
^
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:81:15: error: duplicate member ‘__w_termsig’
unsigned int __w_termsig:7;
^
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:93:15: error: duplicate member ‘__w_stopsig’
unsigned int __w_stopsig:8; /* Stopping signal. */
^
/usr/include/x86_64-linux-gnu/bits/waitstatus.h:94:15: error: duplicate member ‘__w_stopval’
unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
^
The stdlib.h is including the endian.h from your (or the SDK's) source code instead of the one from the standard include files, thus __BYTE_ORDER is never defined. Find the conflicting endian.h file and rename it. Or remove -I compilation flag from your tool chain.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598600
Welcome to tool chain configuration hell.
I downloaded boost and am doing this
admin#US01WKS03044 /cygdrive/c/Users/admin/Downloads/boost_1_49_0
$ ./bootstrap.bat gcc
Building Boost.Build engine
filent.c:35:21: fatal error: direct.h: No such file or directory
# include <direct.h>
^
compilation terminated.
jam.c: In function ‘main’:
jam.c:181:25: error: ‘environ’ undeclared (first use in this function)
#define use_environ environ
^
jam.c:417:22: note: in expansion of macro ‘use_environ’
var_defines( use_environ, 1 );
^
jam.c:181:25: note: each undeclared identifier is reported only once for each function it appears in
#define use_environ environ
^
jam.c:417:22: note: in expansion of macro ‘use_environ’
var_defines( use_environ, 1 );
^
jam.c: In function ‘executable_path’:
jam.c:628:18: warning: comparison between pointer and integer
if (argv0[0] == "/")
^
pathunix.c:276:19: fatal error: tchar.h: No such file or directory
#include <tchar.h>
^
compilation terminated.
builtins.c:39:0: warning: "WIFEXITED" redefined
# define WIFEXITED(w) (((w) & 0XFFFFFF00) == 0)
^
In file included from /usr/include/cygwin/stdlib.h:14:0,
from /usr/include/stdlib.h:25,
from jam.h:89,
from builtins.c:7:
/usr/include/cygwin/wait.h:34:0: note: this is the location of the previous definition
#define WIFEXITED(w) ((__wait_status_to_int(w) & 0xff) == 0)
^
builtins.c:40:0: warning: "WEXITSTATUS" redefined
# define WEXITSTATUS(w)(w)
^
In file included from /usr/include/cygwin/stdlib.h:14:0,
from /usr/include/stdlib.h:25,
from jam.h:89,
from builtins.c:7:
/usr/include/cygwin/wait.h:39:0: note: this is the location of the previous definition
#define WEXITSTATUS(w) ((__wait_status_to_int(w) >> 8) & 0xff)
^
Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.
You can try to obtain a prebuilt binary from
http://sf.net/project/showfiles.php?group_id=7586&package_id=72941
Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.
Any suggestions on why I might be getting this error ?
The file bootstrap.bat is for building Boost from the Windows command prompt in order to create a native Windows version of Boost. If you want to build a Cygwin version of Boost from the Cygwin shell you should follow the instructions for building Boost on Unix-type systems.
Or as this message at the top of Boost's Getting Started on Windows page says:
A note to Cygwin and MinGW users
If you plan to use your tools from the Windows command prompt, you're in the
right place. If you plan to build from the Cygwin bash shell, you're actually
running on a POSIX platform and should follow the instructions for
getting started on Unix variants.
Waf outputs errors like the following
Waf: Entering directory `/home/atomos/dc_mmo/netclient/build'
[47/53] c: c_lib/c_lib.c -> build/c_lib/c_lib.c.1.o
In file included from ../c_lib/c_lib.c:12:
../c_lib/./physics/common.c: In function ‘rk4_accelerate’:
../c_lib/./physics/common.c:301: warning: unused variable ‘spring’
In file included from ../c_lib/c_lib.c:15:
../c_lib/./objects/grenade.c: In function ‘grenade_draw’:
../c_lib/./objects/grenade.c:91: error: ‘a’ undeclared (first use in this function)
../c_lib/./objects/grenade.c:91: error: (Each undeclared identifier is reported only once
../c_lib/./objects/grenade.c:91: error: for each function it appears in.)
In file included from ../c_lib/c_lib.c:16:
../c_lib/./objects/neutron.c: In function ‘neutron_draw’:
../c_lib/./objects/neutron.c:191: error: ‘a’ undeclared (first use in this function)
In file included from ../c_lib/./agent/agent_include.h:21,
from ../c_lib/c_lib.c:23:
../c_lib/./agent/./agent_client.c: In function ‘set_agent_control_state’:
../c_lib/./agent/./agent_client.c:58: warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘int *’
How can i get Anjuta to show errors at bottom and allow me to jump to error by clicking on it?
How can I configure Anjuta to run my build system on compile?
The problem is that eclipse looks for make: in the error code (this should be configurable) So you have to patch eclipse or waf so they agree on the format of the error message.
There was a patch to waf in this bug