Share 
Follow 
AboutDownloadsDocumentsForumsWikiIssuesNews
Date:
2013-03-20 00:58
Priority:
3
State:
Open
Submitted by:
Mark Williamson (mjw)
Assigned to:
Nobody (None)
Resolution:
none
Summary:
Compiling with MinGW (under Win7) needs -fpermissive

Detailed description
When compiling OpenMM5.0 with MinGW under Win7, the following CMake addition is needed:

CMAKE_CXX_FLAGS:STRING=-fpermissive

to avoid this error:

C:\temp\openmm5.0withcustomnonbondedforcepme\olla\src\Platform.cpp
C:\temp\openmm5.0withcustomnonbondedforcepme\olla\src\Platform.cpp: In function 'void initializePlugins(std::vector<HINSTANCE__*>&)':
C:\temp\openmm5.0withcustomnonbondedforcepme\olla\src\Platform.cpp:172:75: error: invalid conversion from 'FARPROC {aka int (*)()}' to 'void*' [-fpermissive]
C:\temp\openmm5.0withcustomnonbondedforcepme\olla\src\Platform.cpp:178:81: error: invalid conversion from 'FARPROC {aka int (*)()}' to 'void*' [-fpermissive]
mingw32-make[2]: *** [CMakeFiles/OpenMM.dir/olla/src/Platform.cpp.obj] Error 1

Add A Comment: Notepad

Message  ↓
Date: 2013-03-24 18:03
Sender: Mark Williamson

Hi Peter,

Sure, here are the steps I followed:

Compiling OpenMM5.0 with Win7, Eclipse 3.8, MinGW and CMake
===========================================================
0) Ensure Eclipse 3.8.2 and CDT 8.1 is installed.

1) Install CMake GUI (2.8.10.2)

2) Install MinGW with C++ support (via
mingw-get-inst-20120426.exe)

3) Ensure the system PATH contains C:\MinGW\bin (or wherever
it was installed)

4) Unzip OpenMM5 to C:\temp\OpenMM5

5) Run the Cmake GUI
a) Navigate “Where is the source code” to C:\temp\OpenMM5
b) Set “where to build” to C:\temp\build
c) Say yes to create dir
d) Set the generator to be “Eclipse CD4 - MinGW makefiles”
e) Click configure
f) Set CMAKE_SH to nothing
g) Click configure
h) Deselect OPENMM_BUILD_PYTHON_WRAPPERS
i) Click configure
j) Click generate

6) Open Eclipse

7) Import the project

File-->Import-> General existing project into workspace

8) Right click on Project name (OpenMM@Build) in “Project
Explorer” and click build

Note the following changes will need to be made to the
OpenMM code for it to compile:

1) Replace all instances of sprintf_s with snprintf
2) The CMakeCache.txt in the build directory needs to be
modified so that
CMAKE_CXX_FLAGS:STRING=-fpermissive


Whilst, the above steps are a little ad-hoc, I was able to
successfully build a debug version (i.e. using -g) and use
the inbuild debugger interface in Eclipse to trace program
execution; very useful.

Date: 2013-03-20 04:05
Sender: Peter Eastman

MinGW is not an environment we support. That said, if you're able to get it working, we would definitely be interested to hear exactly what steps it required.

No Changes Have Been Made to This Item

Feedback