Project

General

Profile

Bug #505

Version.h Not found

Added by Kyle Beauchamp over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Building with CMake in windows (MSVS 2008) fails because version.h is not in the include path. This has been happening for months now, but as we're approaching a release, we might want to streamline the build process.

4>version.c
4>C:\FAH\gromacs-build-aug12\src\gmxlib\version.c(1): catastrophic error: could not open source file "version.h"
4> #include "version.h"
4>

My (hack!) solution to this has been to copy version.h to the include directory

cp gromacssrc/src/gmxlib/version.h gromacssrc/include

History

#1 Updated by Kyle Beauchamp over 9 years ago

This may be related to bug 476.

#2 Updated by Teemu Murtola over 9 years ago

This works fine for me with CMake 2.6.2 on Linux, even with the build directory completely outside the source tree. I don't know how CMake decides when to set the -I flag for out-of-tree builds, but it does it correctly for me, but apparently not on Windows.

The proper fix should be to change the first line of src/gmxlib/version.c.cmakein to #include "PROJECT_SOURCE_DIR/src/gmxlib/version.h" to not rely on -I being set correctly. Could you try whether this fixes your problem? Bug 476 only concerns autoconf, and neither of these bugs affect released versions because the version generation is only used for trees checked out of git.

#3 Updated by Kyle Beauchamp over 9 years ago

Thanks,

I'll give this a try when attempt a fresh GIT pull (likely the next 1-2 days).

And I agree--my linux builds always work out of the box, so it appears that this is MSVS specific.

Thanks

#4 Updated by Erik Lindahl over 9 years ago

I've never had any problems with version.h under Windows 7 (64-bit), MSVC 2008, and cmake-2.8 - all installed in default locations.

Kyle, could you try with more verbose output during the cmake configuration stage and see what happens? Is there any command (cmake?) that isn't found?

#5 Updated by Kyle Beauchamp over 9 years ago

This is user error on my part. I had been including extra path within the source tree.

Sorry about that.

Also available in: Atom PDF