AD3 icon indicating copy to clipboard operation
AD3 copied to clipboard

Installation Failed on windows

Open tesla1060 opened this issue 11 years ago • 40 comments

Hi, I have used pip install ad3 to install, I am receiving the below error,

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C
4530: C++ exception handler used, but unwind semantics are not enabled. Specify   /EHsc

ad3/FactorGraph.cpp(21) : fatal error C1083: Cannot open include file: 'sys/time
.h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
iled with exit status 2

Is that because sys/time not in win32 ?

tesla1060 avatar Aug 26 '13 07:08 tesla1060

Hi,

Thanks for reporting that. I just committed a fix that I hope can solve that problem. I don't have a windows machine at hand right now so I can't test it right away, but if you are able to test please let me know if it worked.

André

2013/8/26 tesla1060 [email protected]

Hi, I have used pip install ad3 to install, I am receiving the below error,

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

ad3/FactorGraph.cpp(21) : fatal error C1083: Cannot open include file: 'sys/time .h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa iled with exit status 2

Is that because sys/time not in win32 ?

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7 .

andre-martins avatar Aug 26 '13 10:08 andre-martins

Hi, I am not sure how to install this without pip. Do I download the source? But it seems the installation instruction requires make

tesla1060 avatar Aug 26 '13 11:08 tesla1060

I just realized that installing is not completely trivial as we didn't merge our changes upstream to @andre-martins' repo. Will do a pull-request for that.

amueller avatar Aug 26 '13 11:08 amueller

Ok, I pulled the changes in the pystruct repo. @tesla1060 could you please try: pip install https://github.com/pystruct/AD3/archive/master.zip

Thanks :)

amueller avatar Aug 26 '13 12:08 amueller

There is a new error

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
3 /GS- /DNDEBUG -I. -I./ad3 -I./Eigen /Tpad3/FactorGraph.cpp /Fobuild\temp.win32
-2.7\ad3/FactorGraph.obj

FactorGraph.cpp

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C
4530: C++ exception handler used, but unwind semantics are not enabled. Specify
/EHsc

ad3/FactorGraph.cpp(22) : fatal error C1083: Cannot open include file: 'gettimeo
fday.h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
iled with exit status 2

tesla1060 avatar Aug 27 '13 01:08 tesla1060

Just committed a fix. Can you please update and try?

André

2013/8/27 tesla1060 [email protected]

There is a new error

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -I. -I./ad3 -I./Eigen /Tpad3/FactorGraph.cpp /Fobuild\temp.win32 -2.7\ad3/FactorGraph.obj

FactorGraph.cpp

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

ad3/FactorGraph.cpp(22) : fatal error C1083: Cannot open include file: 'gettimeo fday.h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa iled with exit status 2

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23307031 .

andre-martins avatar Aug 27 '13 10:08 andre-martins

Hi do I still use pip install https://github.com/pystruct/AD3/archive/master.zip

If yes, the same error message still show.

tesla1060 avatar Aug 27 '13 11:08 tesla1060

Did you run git pull and deleted all the object files? You shouldn't get that error message, because I removed

-#include <gettimeofday.h>

so the code is not trying to include that header file anymore...

André

2013/8/27 tesla1060 [email protected]

Hi do I still use pip install https://github.com/pystruct/AD3/archive/master.zip

If yes, the same error message still show.

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23329201 .

andre-martins avatar Aug 27 '13 11:08 andre-martins

err, sorry, I am not sure how install from the source in Windows.

tesla1060 avatar Aug 27 '13 11:08 tesla1060

Please do pip install https://github.com/andre-martins/AD3/archive/master.zip

@andre-martins: that fetches the current master branch as zip and runs python setup.py install The command that @tesla1060 ran still pointed to the pystruct version that didn't have your commit.

amueller avatar Aug 27 '13 12:08 amueller

well, I am still getting the same error here

pip install https://github.com/andre-martins/AD3/archive/master.zip

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
3 /GS- /DNDEBUG -I. -I./ad3 -I./Eigen /Tpad3/FactorGraph.cpp /Fobuild\temp.win32
-2.7\ad3/FactorGraph.obj

FactorGraph.cpp

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C
4530: C++ exception handler used, but unwind semantics are not enabled. Specify
/EHsc

ad3/FactorGraph.cpp(22) : fatal error C1083: Cannot open include file: 'gettimeo
fday.h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
iled with exit status 2

tesla1060 avatar Aug 27 '13 12:08 tesla1060

The line is actually still there @andre-martins.

amueller avatar Aug 27 '13 12:08 amueller

Sorry, my bad... Just removed that line and committed a new version. Let me know if it works now.

André

2013/8/27 tesla1060 [email protected]

well, I am still getting the same error here

pip install https://github.com/andre-martins/AD3/archive/master.zip

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -I. -I./ad3 -I./Eigen /Tpad3/FactorGraph.cpp /Fobuild\temp.win32 -2.7\ad3/FactorGraph.obj

FactorGraph.cpp

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

ad3/FactorGraph.cpp(22) : fatal error C1083: Cannot open include file: 'gettimeo fday.h': No such file or directory

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa iled with exit status 2

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23332417 .

andre-martins avatar Aug 27 '13 12:08 andre-martins

OK. that error is gone, but here is a new one though,

ad3/GenericFactor.cpp(200) : error C2668: 'sqrt' : ambiguous call to overloaded
function

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(581): cou
ld be 'long double sqrt(long double)'

    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(533): or
  'float sqrt(float)'

    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(128): or
  'double sqrt(double)'

    while trying to match the argument list '(unsigned int)'

tesla1060 avatar Aug 27 '13 12:08 tesla1060

Fixed. Can you try again?

2013/8/27 tesla1060 [email protected]

OK. that error is gone, but here is a new one though,

ad3/GenericFactor.cpp(200) : error C2668: 'sqrt' : ambiguous call to overloaded function

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(581): cou ld be 'long double sqrt(long double)'

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(533): or

'float sqrt(float)'

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(128): or

'double sqrt(double)'

while trying to match the argument list '(unsigned int)'

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23333271 .

andre-martins avatar Aug 27 '13 13:08 andre-martins

That one is gone, but more emerged...

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C
4530: C++ exception handler used, but unwind semantics are not enabled. Specify
/EHsc

ad3/Utils.cpp(41) : error C2065: 'FILETIME' : undeclared identifier

ad3/Utils.cpp(41) : error C2146: syntax error : missing ';' before identifier 'f
t'

ad3/Utils.cpp(41) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(47) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(47) : error C3861: 'GetSystemTimeAsFileTime': identifier not found


ad3/Utils.cpp(49) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(49) : error C2228: left of '.dwHighDateTime' must have class/struc
t/union

    type is ''unknown-type''

ad3/Utils.cpp(51) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(51) : error C2228: left of '.dwLowDateTime' must have class/struct
/union

    type is ''unknown-type''

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
iled with exit status 2

tesla1060 avatar Aug 27 '13 13:08 tesla1060

Can you try to uncomment line 26 in Utils.cpp?

//#include <windows.h> //I've ommited this line.

If it works, I'll commit the change.

André

2013/8/27 tesla1060 [email protected]

That one is gone, but more emerged...

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

ad3/Utils.cpp(41) : error C2065: 'FILETIME' : undeclared identifier

ad3/Utils.cpp(41) : error C2146: syntax error : missing ';' before identifier 'f t'

ad3/Utils.cpp(41) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(47) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(47) : error C3861: 'GetSystemTimeAsFileTime': identifier not found

ad3/Utils.cpp(49) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(49) : error C2228: left of '.dwHighDateTime' must have class/struc t/union

type is ''unknown-type''

ad3/Utils.cpp(51) : error C2065: 'ft' : undeclared identifier

ad3/Utils.cpp(51) : error C2228: left of '.dwLowDateTime' must have class/struct /union

type is ''unknown-type''

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa iled with exit status 2

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23336855 .

andre-martins avatar Aug 27 '13 13:08 andre-martins

No, a lot more errors

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -I. -I./ad3 -I./Eigen /Tpad3/Utils.cpp /Fobuild\temp.win32-2.7\a d3/Utils.obj

Utils.cpp

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(111) : error C20 11: 'AD3::timeval' : 'struct' type redefinition

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(56) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(56) : error C2227: left of '->tv_sec' must point to class/struct/u nion/generic type

ad3/Utils.cpp(57) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(57) : error C2227: left of '->tv_usec' must point to class/struct/ union/generic type

ad3/Utils.cpp(76) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(76) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(76) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(76) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(77) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(77) : error C2228: left of '.tv_usec' must have class/struct/union

ad3/Utils.cpp(77) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(77) : error C2228: left of '.tv_usec' must have class/struct/union

ad3/Utils.cpp(81) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(81) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(81) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(81) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(82) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(82) : error C2228: left of '.tv_usec' must have class/struct/union

ad3/Utils.cpp(82) : error C2027: use of undefined type 'AD3::timeval'

    c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(82) : error C2228: left of '.tv_usec' must have class/struct/union

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa iled with exit status 2

tesla1060 avatar Aug 28 '13 01:08 tesla1060

OK. I finally got to try this in a Windows machine and made it to at least generate Utils.obj. I didn't try a full compilation, but I think it should work now with the latest commit. Can you please try? Thanks.

2013/8/28 tesla1060 [email protected]

No, a lot more errors

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -I. -I./ad3 -I./Eigen /Tpad3/Utils.cpp /Fobuild\temp.win32-2.7\a d3/Utils.obj

Utils.cpp

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(111) : error C20 11: 'AD3::timeval' : 'struct' type redefinition

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(56) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(56) : error C2227: left of '->tv_sec' must point to class/struct/u nion/generic type

ad3/Utils.cpp(57) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(57) : error C2227: left of '->tv_usec' must point to class/struct/ union/generic type

ad3/Utils.cpp(76) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(76) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(76) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(76) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(77) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(77) : error C2228: left of '.tv_usec' must have class/struct/union

ad3/Utils.cpp(77) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(77) : error C2228: left of '.tv_usec' must have class/struct/union

ad3/Utils.cpp(81) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(81) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(81) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(81) : error C2228: left of '.tv_sec' must have class/struct/union

ad3/Utils.cpp(82) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(82) : error C2228: left of '.tv_usec' must have class/struct/union

ad3/Utils.cpp(82) : error C2027: use of undefined type 'AD3::timeval'

c:\users\shuo\appdata\local\temp\pip-fpur5d-build\ad3\Utils.h(46) : see

declaration of 'AD3::timeval'

ad3/Utils.cpp(82) : error C2228: left of '.tv_usec' must have class/struct/union

error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa iled with exit status 2

Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23384621 .

andre-martins avatar Aug 28 '13 11:08 andre-martins

OK, i can install now, thanks!

tesla1060 avatar Aug 28 '13 12:08 tesla1060

Great! :-)

2013/8/28 tesla1060 [email protected]

OK, i can install now, thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/andre-martins/AD3/issues/7#issuecomment-23410873 .

andre-martins avatar Aug 28 '13 13:08 andre-martins

Hi,

can someone write a simple and clear readme how to compile on Windows?

Cloning and running setup.py build errors:

...
c:\src\ad3\ad3\factor.h(415) : error C4716: 'AD3::FactorBUDGET::AddEvidence' : must return a value
c:\src\ad3\ad3\factor.h(466) : error C4716: 'AD3::FactorKNAPSACK::AddEvidence' : must return a value
error: command 'C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

After reading README install instruction it seemed that maybe I should run make first:

$ make
cd ad3 && make
make[1]: Entering directory `/c/src/AD3/ad3'
g++ -O3 -Wall -Wno-sign-compare -c -fmessage-length=0 -I./ad3/ -I../Eigen -fPIC FactorGraph.cpp
FactorGraph.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 // Copyright (c) 2012 Andre Martins
 ^
In file included from FactorGraph.cpp:22:0:
Utils.h:34:8: error: redefinition of 'struct timeval'
 struct timeval {
        ^
In file included from c:\mingw\include\windows.h:98:0,
                 from Utils.h:32,
                 from FactorGraph.cpp:22:
c:\mingw\include\winsock2.h:109:8: error: previous definition of 'struct timeval'
 struct timeval {
        ^
FactorGraph.cpp: In member function 'void AD3::FactorGraph::ConvertToBinaryFactorGraph(AD3::FactorGraph*)':
FactorGraph.cpp:91:26: warning: unused variable 'multi_variable' [-Wunused-variable]
           MultiVariable *multi_variable = factor_dense->GetMultiVariable(j);
                          ^
FactorGraph.cpp: In member function 'int AD3::FactorGraph::RunBranchAndBound(double, std::vector<bool>&, int, std::vector<double>*, std::vector<double>*, double*, double*, double*)':
FactorGraph.cpp:774:10: warning: unused variable 'upper_bound_zero' [-Wunused-variable]
   double upper_bound_zero;
          ^
FactorGraph.cpp:797:10: warning: unused variable 'upper_bound_one' [-Wunused-variable]
   double upper_bound_one;
          ^
make[1]: *** [FactorGraph.o] Error 1
make[1]: Leaving directory `/c/src/AD3/ad3'
make: *** [libad3] Error 2

?

klonuo avatar Sep 23 '14 09:09 klonuo

Hi klonuo,

I just fixed the "must return a value" errors. Can you pull the new version and try running setup.py again?

I think you shouldn't need to run make (that is an old README and I should remove it from the repo, the right README is ad3/python/README.md.)

Let me know if it worked (I don't have a Windows machine at hand right now).

André

2014-09-23 10:27 GMT+01:00 klonuo [email protected]:

Hi,

can someone write a simple and clear readme how to compile on Windows?

Cloning and running setup.py build errors:

... c:\src\ad3\ad3\factor.h(415) : error C4716: 'AD3::FactorBUDGET::AddEvidence' : must return a value c:\src\ad3\ad3\factor.h(466) : error C4716: 'AD3::FactorKNAPSACK::AddEvidence' : must return a value error: command 'C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe' failed with exit status 2

After reading README install instruction it seemed that maybe I should run make first:

$ make cd ad3 && make make[1]: Entering directory /c/src/AD3/ad3' g++ -O3 -Wall -Wno-sign-compare -c -fmessage-length=0 -I./ad3/ -I../Eigen -fPIC FactorGraph.cpp FactorGraph.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default] // Copyright (c) 2012 Andre Martins ^ In file included from FactorGraph.cpp:22:0: Utils.h:34:8: error: redefinition of 'struct timeval' struct timeval { ^ In file included from c:\mingw\include\windows.h:98:0, from Utils.h:32, from FactorGraph.cpp:22: c:\mingw\include\winsock2.h:109:8: error: previous definition of 'struct timeval' struct timeval { ^ FactorGraph.cpp: In member function 'void AD3::FactorGraph::ConvertToBinaryFactorGraph(AD3::FactorGraph*)': FactorGraph.cpp:91:26: warning: unused variable 'multi_variable' [-Wunused-variable] MultiVariable *multi_variable = factor_dense->GetMultiVariable(j); ^ FactorGraph.cpp: In member function 'int AD3::FactorGraph::RunBranchAndBound(double, std::vector<bool>&, int, std::vector<double>*, std::vector<double>*, double*, double*, double*)': FactorGraph.cpp:774:10: warning: unused variable 'upper_bound_zero' [-Wunused-variable] double upper_bound_zero; ^ FactorGraph.cpp:797:10: warning: unused variable 'upper_bound_one' [-Wunused-variable] double upper_bound_one; ^ make[1]: *** [FactorGraph.o] Error 1 make[1]: Leaving directory/c/src/AD3/ad3' make: *** [libad3] Error 2

?

— Reply to this email directly or view it on GitHub https://github.com/andre-martins/AD3/issues/7#issuecomment-56494763.

andre-martins avatar Sep 23 '14 10:09 andre-martins

Hi Andre,

I don't see any commit. Can you post the diff, I'll make a patch?

klonuo avatar Sep 23 '14 11:09 klonuo

My bad, I forgot to push. It's there now.

2014-09-23 12:15 GMT+01:00 klonuo [email protected]:

Hi Andre,

I don't see any commit. Can you post the diff, I'll make a patch?

— Reply to this email directly or view it on GitHub https://github.com/andre-martins/AD3/issues/7#issuecomment-56505338.

andre-martins avatar Sep 23 '14 11:09 andre-martins

Thanks

It compiled fine now

Cheers

klonuo avatar Sep 23 '14 12:09 klonuo

Sorry digging up this again, I now get

ad3/Utils.cpp:34:8:error redefinition of 'struct timezone'

previous definition in ``x86_64-w64-mingw32/include/time.h``

This is using mingw gcc as delivered by the anaconda package.

amueller avatar Dec 01 '14 19:12 amueller

EDIT: This comment has proven to be useless, since the difference was not in the source, but in the compiler configuration. See below.

I had this issue ; I no longer have this issue. I just compiled my vs project and it worked fine. However, I don't recall what I did to solve it. You may diff through my ad3 source files:

https://www.dropbox.com/s/gri3nmesqev40vy/win_friendly_ad3.zip?dl=0

If you can't find any difference, it means that the solution was somewhere in vsproject/os properties. If you do find a difference, it's probably that, since I didn't change anything else (I think).

Good luck.

smiranda avatar Dec 02 '14 12:12 smiranda

Have you guys managed to solve this? I'm getting the same error:

ad3/Utils.cpp:34:8: error: redefinition of 'struct timezone'
 struct timezone
        ^
In file included from ad3/Utils.h:23:0,
                 from ad3/Utils.cpp:19:
C:/Program Files/TDM-GCC/x86_64-w64-mingw32/include/time.h:260:8: error: previous definition of 'struct timezone'
 struct timezone {
        ^

The diffs by smiranda showed only one change which doesn't seem to be relevant:

--- a/ad3/GenericFactor.cpp
+++ b/ad3/GenericFactor.cpp
@@ -20,7 +20,7 @@
 #include "Utils.h"
 #define EIGEN
 #ifdef EIGEN
-#include <../Eigen/Eigenvalues>
+#include <C:\Users\ssm\Documents\Visual Studio 2013\Projects\StaticAD3Lib\AD3Lib\Eigen\Eigenvalues>
 #else
 #include "lapacke/lapacke.h"
 #endif

I'm on Win8.1 64bit.

Cheers

kiwitea avatar Jan 12 '15 10:01 kiwitea

Hello again.

I just downloaded a clean master-branch from the repo and did the following steps in visual studio 2013:

  1. New Project Console Win32; Project Type (in the wizard) : Static Library.
  2. Right click the project ; Add Existing files; select the ad3 source files.
  3. You'll also have to add that eigen folder somewhere.
  4. Project Properties -> Configuration Properties -> C/C++ -> Preprocessor -> add "_CRT_SECURE_NO_WARNINGS" to PreprocessorDefinitions
  5. Build.

It works for me, Win8.1 64bit.

Hope this helps.

smiranda avatar Jan 12 '15 15:01 smiranda