Problem with fortran compilation of source in github

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Charles Brooks
Posts: 35
Joined: Fri Feb 24, 2012 11:48 am

Problem with fortran compilation of source in github

Post by Charles Brooks » Fri Jan 16, 2015 9:44 am

Dear Peter,

I pulled the github repository to build from this for testing/development of the OpenMM/CHARMM interface and find that (differing from the 6.2 release code) that there are two function names that exceed the maximum allowed in length of a function/subroutine name in fortran2003 of 63 characters, these are the functions:

OpenMM_MonteCarloAnisotropicBarostat_usesPeriodicBoundaryConditions 67 char
OpenMM_MonteCarloMembraneBarostat_usesPeriodicBoundaryConditions 64 char


This inhibits builds of any of the fortran code, because the fortran compiler chokes on OpenMMFortranModule.f90.

Is it straightforward to shorten these names?

Thanks,

Charlie

User avatar
Michael Sherman
Posts: 798
Joined: Fri Apr 01, 2005 6:05 pm

Re: Problem with fortran compilation of source in github

Post by Michael Sherman » Fri Jan 16, 2015 11:18 am

Hi, Charlie. A possible workaround -- your Fortran compiler may permit use of longer identifiers (though non-standard). For example, gfortran has a command line flag -fmax-identifier-length=n.

Regards,
Sherm

User avatar
Peter Eastman
Posts: 2543
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with fortran compilation of source in github

Post by Peter Eastman » Fri Jan 16, 2015 11:44 am

Fortran makes me sad.

How about if the Fortran wrapper just truncated the names to 63 characters? Those particular functions aren't even ones that users are likely to call.

Peter

User avatar
Charles Brooks
Posts: 35
Joined: Fri Feb 24, 2012 11:48 am

Re: Problem with fortran compilation of source in github

Post by Charles Brooks » Fri Jan 16, 2015 12:29 pm

Dear Michael and Peter,

Unfortunately, even though the option to increase the identifier length exists, it cannot go beyond 62:

Fatal Error: Maximum supported identifier length is 63

Thus, this isn't a solution. I have simply commented out those two functions in the fortran wrapper as a temporary fix, but it may be the case that the MCBarostat for membranes (which is related to what we did here, I think) will be used and needed in the future. Thus truncating the names, or commenting out the routines isn't a longer term fix. Also, as I think I noted, one cannot build the f90 examples because of this as well.

Finally, the reason I compiled this was to be able to take advantage of Peter's bug fix to the issue with the CustomCOmpoundBondForce, however, as demonstrated with the attached tar file providing a simple test that if I either of the two CustomCoumpoundBondForces I get a result (which I've verified is correct), but if I apply both at once, only one of them is computed (it happens to be the first one). I think this too is a bug, and that the two forces should be additive. Can you let me know?

Thanks,

Charlie
Attachments
failCCBF.tgz
(1.59 KiB) Downloaded 12 times

User avatar
Peter Eastman
Posts: 2543
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with fortran compilation of source in github

Post by Peter Eastman » Fri Jan 16, 2015 12:45 pm

Truncating the names wouldn't prevent you from calling them. It would just make it a little less convenient. But like I said, these aren't methods that users are actually expected to call. They exist primarily for internal use.

Peter

User avatar
Peter Eastman
Posts: 2543
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with fortran compilation of source in github

Post by Peter Eastman » Tue Jan 20, 2015 12:45 pm

I merged the change so it truncates function names to 63 characters. I verified that the Fortran examples now compile.

Peter

POST REPLY