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

Problems building from Matlab R2018a with "Visual Studio 15 2017" #75

Closed
plebelshawca opened this issue Nov 6, 2018 · 6 comments
Closed

Comments

@plebelshawca
Copy link

Are there any updates that apply to this?
I use windows 10.
I get a lot of the following when building from Matlab R2018a with "Visual Studio 15 2017" :

....\metis-5.1.0\GKlib\gk_types.h(22): error C2061: syntax error: identifier 'gk_idx_t'
....\metis-5.1.0\GKlib\gk_types.h(22): error C2059: syntax error: ';'
....\metis-5.1.0\GKlib\gk_struct.h(24): error C2061: syntax error: identifier 'ssize_t'
....\metis-5.1.0\GKlib\gk_struct.h(24): error C2059: syntax error: '}'
....\metis-5.1.0\GKlib\gk_struct.h(25): error C2061: syntax error: identifier 'ssize_t'
....\metis-5.1.0\GKlib\gk_struct.h(25): error C2059: syntax error: '}'
....\metis-5.1.0\GKlib\gk_struct.h(26): error C2061: syntax error: identifier 'ssize_t'
....\metis-5.1.0\GKlib\gk_struct.h(26): error C2059: syntax error: '}'
....\metis-5.1.0\GKlib\gk_struct.h(27): error C2061: syntax error: identifier 'ssize_t'
....\metis-5.1.0\GKlib\gk_struct.h(27): error C2059: syntax error: '}'
....\metis-5.1.0\GKlib\gk_struct.h(28): error C2061: syntax error: identifier 'ssize_t'
....\metis-5.1.0\GKlib\gk_struct.h(28): error C2061: syntax error: identifier 'val'
....\metis-5.1.0\GKlib\gk_struct.h(28): error C2059: syntax error: ';'
....\metis-5.1.0\GKlib\gk_struct.h(28): error C2059: syntax error: '}'

Yet I can use make/cmake to create METIS.sln Visual Studio Project that I seem to be able to compile
I also seem to have similar problems compiling directly from Cygwin.
(Somewhere I saw a comment that this is untested).

@jlblancoc
Copy link
Owner

I think I don't fully understand what you mean with:

building from Matlab R2018a

This project is aimed at providing a CMake way to generate VS solutions, so anything else (as Cygwin, MinGW,etc.) is untested and probably incompatible...

@pflashan
Copy link

pflashan commented Nov 9, 2018

Any chance this is problem #23 again? I was getting similar output in VS2017 when building Metis. I applied the same fix, namely to edit metis\GKLib\gkarch.h to only define rint(x) if _MSC_VER < 1800. The relevant section of gkarch.h looks like this:

#ifdef __MSC__
/* MSC does not have rint() function */
#if (_MSC_VER < 1800)
#define rint(x) ((int)((x)+0.5))  
#endif

Probably worth a shot - it fixed my errors.

@NeroBurner
Copy link
Collaborator

NeroBurner commented Nov 13, 2018

in cmake there is specific code to check if rint exists to prevent redefinition

include(CheckCXXSymbolExists)
check_cxx_symbol_exists(rint cmath HAVE_RINT)
if (HAVE_RINT)
add_definitions(-DHAVE_RINT)
endif()

edit: I've search the project, but this flag HAVE_RINT isn't used in any cpp file? I'm at a loss here
edit2: here it is, my detection was disabled by the following commit 7929332 maybe we should revert it or handle differently

@jlblancoc
Copy link
Owner

@plebelshawca I just rebuilt everything in master using MSVC 2017 and it builds cleanly (well... hundreds of warnings, but that's an upstream issue ;-).

Are you using the version from master or the last release (1.4.0)?

@plebelshawca
Copy link
Author

plebelshawca commented Nov 15, 2018 via email

@jlblancoc
Copy link
Owner

Closing due to lack of activity, please reopen if the problem persists after updating the latest git version.

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

No branches or pull requests

4 participants