Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken again on Windows #270

Closed
feldmeier opened this issue Mar 10, 2020 · 13 comments · Fixed by #274
Closed

Broken again on Windows #270

feldmeier opened this issue Mar 10, 2020 · 13 comments · Fixed by #274
Labels

Comments

@feldmeier
Copy link
Collaborator

Severity Code Description Project File Line Suppression State
Error C2065 'CMAKE_BUILD_TYPE': undeclared identifier libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\presolve\Presolve.cpp 197
Error C2039 'tolower': is not a member of 'std' libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\presolve\ICrash.cpp 36
Error C2039 'min': is not a member of 'std' libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\util\HighsUtils.cpp 586
Error C2039 'min': is not a member of 'std' libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\util\HighsUtils.cpp 732
Error C3861 'min': identifier not found libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\util\HighsUtils.cpp 586
Error C3861 'min': identifier not found libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\util\HighsUtils.cpp 732
Error C2039 'max': is not a member of 'std' libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\util\HighsUtils.cpp 43
Error C3861 'max': identifier not found libhighs C:\Users\Michael\Documents\GitHub\HiGHS\src\util\HighsUtils.cpp 43

@feldmeier
Copy link
Collaborator Author

If working around the above issues, linking issues arise:

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "void __cdecl writeSolutionToFile(struct _iobuf *,class HighsLp const &,struct HighsBasis const &,struct HighsSolution const &,bool)" (?writeSolutionToFile@@YAXPEAU_iobuf@@AEBVHighsLp@@AEBUHighsBasis@@AEBUHighsSolution@@_N@Z) referenced in function "public: enum HighsStatus __cdecl Highs::writeSolution(class std::basic_string<char,struct std::char_traits,class std::allocator >,bool)const " (?writeSolution@Highs@@qeba?AW4HighsStatus@@v?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@_N@Z) libhighs C:\Users\Michael\Documents\GitHub\HiGHS\build\src\Highs.obj 1
Error LNK2019 unresolved external symbol "void __cdecl updateResidualIca(class HighsLp const &,struct HighsSolution const &,class std::vector<double,class std::allocator > &)" (?updateResidualIca@@YAXAEBVHighsLp@@AEBUHighsSolution@@aeav?$vector@NV?$allocator@N@std@@@std@@@z) referenced in function "void __cdecl updateParameters(struct Quadratic &,struct ICrashOptions const &,int)" (?updateParameters@@YAXAEAUQuadratic@@AEBUICrashOptions@@h@Z) libhighs C:\Users\Michael\Documents\GitHub\HiGHS\build\src\ICrash.obj 1
Error LNK2019 unresolved external symbol "void __cdecl updateResidual(bool,class HighsLp const &,struct HighsSolution const &,class std::vector<double,class std::allocator > &)" (?updateResidual@@YAX_NAEBVHighsLp@@AEBUHighsSolution@@aeav?$vector@NV?$allocator@N@std@@@std@@@z) referenced in function "void __cdecl update(struct Quadratic &)" (?update@@YAXAEAUQuadratic@@@z) libhighs C:\Users\Michael\Documents\GitHub\HiGHS\build\src\ICrash.obj 1

@galabovaa
Copy link
Contributor

Fixed above compile errors and removed the whole component causing the link issue, since I can't build on windows yet.

@feldmeier Did you have to do anything for OpenMP? Can you see if this builds on your machine?

I tried to get it done and got a compile error about a pragma task

@galabovaa galabovaa linked a pull request Mar 25, 2020 that will close this issue
@feldmeier
Copy link
Collaborator Author

MSVC only provides builtin OMP 2, and #pragma omp task is a OMP 3 feature. I usually test on windows with the OpenMP option disabled in CMake.

I will test on my machine when it arrives here (probably tomorrow)

@mckib2
Copy link
Contributor

mckib2 commented Mar 28, 2020

I get the following on Windows 10 VM when compiling with OpenMP enabled:

C:\Users\nicho\HiGHS\src\simplex\HDual.cpp(1040,18): error C3001: 'task': expected an OpenMP directive name [C:\Users\nicho
HiGHS\build\src\libhighs.vcxproj]
C:\Users\nicho\HiGHS\src\simplex\HDual.cpp(1045,18): error C3001: 'task': expected an OpenMP directive name [C:\Users\nicho
HiGHS\build\src\libhighs.vcxproj]
C:\Users\nicho\HiGHS\src\simplex\HDual.cpp(1051,18): error C3001: 'task': expected an OpenMP directive name [C:\Users\nicho
HiGHS\build\src\libhighs.vcxproj]
C:\Users\nicho\HiGHS\src\simplex\HDual.cpp(1053,18): error C3001: 'task': expected an OpenMP directive name [C:\Users\nicho
HiGHS\build\src\libhighs.vcxproj]
C:\Users\nicho\HiGHS\src\simplex\HDual.cpp(1055,22): error C3001: 'taskwait': expected an OpenMP directive name [C:\Users\ni
cho\HiGHS\build\src\libhighs.vcxproj]

@mckib2
Copy link
Contributor

mckib2 commented Mar 28, 2020

Compiling with OpenMP disabled, still get the following linking errors:

Auto build dll exports
Creating library C:/Users/nicho/HiGHS/build/lib/Debug/highs.lib and object C:/Users/nicho/HiGHS/build/lib/Debug/highs.e
xp
Highs.obj : error LNK2019: unresolved external symbol "void __cdecl writeSolutionToFile(struct _iobuf *,class HighsLp const
&,struct HighsBasis const &,struct HighsSolution const &,bool)" (?writeSolutionToFile@@YAXPEAU_iobuf@@AEBVHighsLp@@AEBUHighs
Basis@@AEBUHighsSolution@@_N@Z) referenced in function "public: enum HighsStatus __cdecl Highs::writeSolution(class std::bas
ic_string<char,struct std::char_traits,class std::allocator >,bool)const " (?writeSolution@Highs@@qeba?AW4HighsS
tatus@@v?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@_N@Z) [C:\Users\nicho\HiGHS\build\src\libhighs.vcxproj]
Hint on symbols that are defined and could potentially match:
"void __cdecl writeSolutionToFile(struct _iobuf *,class HighsLp const &,class HighsBasis const &,class HighsSolution c
onst &,bool)" (?writeSolutionToFile@@YAXPEAU_iobuf@@AEBVHighsLp@@AEBVHighsBasis@@AEBVHighsSolution@@_N@Z)
C:\Users\nicho\HiGHS\build\bin\Debug\highs.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\nicho\HiGHS\build\src
\libhighs.vcxproj]

@feldmeier
Copy link
Collaborator Author

@galabovaa these errors should be due to there being both class and struct named HighsBasis, HighsSolution. Some of these are wrong forward declarations (e.g. class HighsSolution; in ICrashUtil.h line 20, while HighsSolution is defined as struct in HighsLp.h line 327)

@galabovaa
Copy link
Contributor

Did you pull all the changes from the branch? ICrashUtil.h shoule be gone now, until it's fixed.

The resolving of names is high on my todo list

@mckib2
Copy link
Contributor

mckib2 commented Mar 29, 2020

@galabovaa Yes, I had checked out the windows branch.

@galabovaa
Copy link
Contributor

Thank you @mckib2, it should now be fixed (according to the new GA test, I still don't have a win machine) Would you or @feldmeier please double check before I merge into master?

@mckib2
Copy link
Contributor

mckib2 commented Mar 30, 2020

@galabovaa I also don't have a Windows machine, just a VM. Let me start it up and take a look

@mckib2
Copy link
Contributor

mckib2 commented Mar 30, 2020

Still get the following:

     Creating library C:/Users/nicho/HiGHS/build/lib/Debug/highs.lib and object C:/Users/nicho/HiGHS/build/lib/Debug/highs.e
  xp
Highs.obj : error LNK2019: unresolved external symbol "void __cdecl writeSolutionToFile(struct _iobuf *,class HighsLp const
&,struct HighsBasis const &,struct HighsSolution const &,bool)" (?writeSolutionToFile@@YAXPEAU_iobuf@@AEBVHighsLp@@AEBUHighs
Basis@@AEBUHighsSolution@@_N@Z) referenced in function "public: enum HighsStatus __cdecl Highs::writeSolution(class std::bas
ic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)const " (?writeSolution@Highs@@QEBA?AW4HighsS
tatus@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) [C:\Users\nicho\HiGHS\build\src\libhighs.vcxproj]
    Hint on symbols that are defined and could potentially match:
      "void __cdecl writeSolutionToFile(struct _iobuf *,class HighsLp const &,class HighsBasis const &,class HighsSolution c
  onst &,bool)" (?writeSolutionToFile@@YAXPEAU_iobuf@@AEBVHighsLp@@AEBVHighsBasis@@AEBVHighsSolution@@_N@Z)
C:\Users\nicho\HiGHS\build\bin\Debug\highs.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\nicho\HiGHS\build\src
\libhighs.vcxproj]

Here's what I'm doing -- maybe @feldmeier has some suggestions if I am building incorrectly:

mkdir build && cd build
cmake -DOPENMP=OFF ..
cmake --build .

EDIT: I've taken a look at CI builds for windows, looks like I need MSYS2

@mckib2
Copy link
Contributor

mckib2 commented Mar 30, 2020

It is working when I build like this from an MSYS2 terminal:

mkdir build && cd build
cmake -DOPENMP=OFF ..
cmake --build . --config Release

Building from CMD or MINGW64 terminal (e.g., used by git GUI) results in failing build with errors above. I'm not a Windows user, but I'll go ahead and make a pull request with some docs for Windows build.

@galabovaa
Copy link
Contributor

@mckib2 would you please try the code below again on your VM?

Also the openmp option should work with OpenMP 3.0 I think

mkdir build && cd build
cmake -DOPENMP=OFF ..
cmake --build .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants