CNS errors before/after recompilation

I recompiled CNS with the files provided in the HADDOCK2.2 distribution

I get the following error message:

cns < run1/protocols/generate_A.inp
%SETFPEPS increase value of MXFPEPS2 and recompile
%SETFPEPS error encountered: Could not determine machine epsilon
(CNS is in mode: SET ABORT=NORMal END)


ABORT mode will terminate program execution.


Program will stop immediately.

But if I adjust this param MXFPEPS2 in machvar.inc I get another error

cns_solve_1.3/intel-x86_64bit-linux/bin/cns < run1/protocols/generate_A.inp
%SETFPEPS Machine epsilon determined to be 0.494-323
%SETFPEPS error encountered: Machine epsilon value is too small
(CNS is in mode: SET ABORT=NORMal END)

What am I doing wrong?

Eiso

Googling this error message you can find a number of possible solutions/causes.
It seems to be related to 32/64 bits and depending on the compiler you are using.

Various solutions have been proposed:

  1. Removing -fast-math as a compiler option

  2. Modify the machvar.f like this (line numbers on the left). The file should in the source folder
    65 ONEP = DPTRUNC(ONE) + DPTRUNC(FPEPS) 66 ONEM = DPTRUNC(ONE) - DPTRUNC(FPEPS) 67 IF (ONE .EQ. ONEP .OR. ONE .EQ. ONEM) THEN 68 I = I - 1
    Let us know what works for you and also which compiler/OS combination your are using

1 Like

those lines were already in the code.

Iā€™m using Centos-7 + gfortran
%fortran --version
GNU Fortran (GCC) 4.9.2

Iā€™ll try to remove the flagā€¦

E

removing the -ffast-math gets rid of the %SETFPEPS error but
creates a new one.

cns_solve_1.3/intel-x86_64bit-linux/bin/cns < run1/protocols/generate_A.inp

[ā€¦snipā€¦]
RTFRDR>! DNA-RNA-ALLATOM.TOP
RTFRDR>
RTFRDR>set message ? end eval ($old_message=$result) set echo ? end eval ($old_echo=$result)
MESSage=NORM
EVALUATE: symbol $OLD_MESSAGE set to ā€œNORMā€ (string)
ECHO=TRUE {ON}
EVALUATE: symbol $OLD_ECHO set to TRUE (logical)
RTFRDR>set message=off echo=off end
%AUTOAN error encountered: exceeded MXRTP (RTF) parameter --> recompile program
(CNS is in mode: SET ABORT=NORMal END)


ABORT mode will terminate program execution.


Program will stop immediately.

I will try adjusting MXRTP but Iā€™m a bit surprised. The system is not very large
(170aa)

Eiso

Indeed - we run into that too. Probably coming from reading several parameter files in the script

could be due to the ACPYPE topologies, they have more dihedrals than
usual prodrg topologies.

You could distribute the cns source files with adjusted params right?
Or is it unusual that this is a problem?

I set MXRTP to 4000 and now thereā€™s not error.
Do you expect a performance hit from leaving the -ffast-math out?

E

Eiso

indeed - will make a note of this.

Dear Eiso,

if you fixed the problem, could you please let me know more in detail that how you fix same error as follows ?. how to remove the -fast-math as a compiler option ?.
Because i am getting same error. I am trying to compile with gcc and gfortan !
%SETFPEPS Machine epsilon determined to be 0.494-323
%SETFPEPS error encountered: Machine epsilon value is too small
(CNS is in mode: SET ABORT=NORMal END)

Thanking you !

I am using OS X EI Captain
version 10.11.3
Mac Pro (Early 2009)

Dear Dr. Alexandre Bonvin,

could you please let me know that how to issue the command for Removing -fast-math as a compiler option ?. Because i am getting following error. while cns installation.

%SETFPEPS Machine epsilon determined to be 0.494-323
%SETFPEPS error encountered: Machine epsilon value is too small

Thanking you !

this worked for me

I set MXRTP to 4000 and now thereā€™s no error

E

Srinivas Penumutchu wrote:

simply edit the Makefile you are using and remove that option

1 Like

Dear Eiso,

Where did you edit the MXRTP ?. Could you please let me know file name and location ?

Thanking you !

in rtf.inc in the source directory

1 Like

Thanks you Dr. Alexandre Bonvin, , finally it is working after i did four modifications ! I hope it will be helpful to someone :slight_smile:

first modification
set MXFPEPS2 value to 8192 in machvar.inc

second modification
removed flag -fastm in make file

third modification
MXRTP to 4000 in rtf.inc in the source directory

fourth modification

add the below line in the machvar.f
WRITE (6,ā€™(I6,E10.3,E10.3)ā€™) I, ONEP, ONEM
just above line 67, which looks like this:
IF (ONE .EQ. ONEP .OR. ONE .EQ. ONEM) THEN

These are two unrelated errors:

What @eiso was dealing with is a problem of the number of parameters and the ā€˜dynamicā€™ memory allocation of CNS.

What @srinivas_penumutchu found happens quite often in Mac OSX and for some reason is only solved with the solution you posted, which just adds a print statementā€¦ This will add a bunch of unnecessary output to the CNS initialization headers thoughā€¦ Would be great if someone with more FORTRAN skills could take a look at it!

Suggestion for a proper solution to this problem:

Replace the SETFPEPS subroutine as follows

C ==========================================================================
C
SUBROUTINE SETFPEPS
C
IMPLICIT NONE
C I/O
INCLUDE ā€˜numbers.incā€™
INCLUDE ā€˜machvar.incā€™
C
C Determine the machine epsilon i.e. the smallest FPEPS such that both
C 1+FPEPS and 1-FPEPS are different from 1.
C
C local
DOUBLE PRECISION ONEDP
DOUBLE COMPLEX DBCOMP
C
C external
C NONE
C
C begin
C
C ONEDP doesnā€™t really need to be defined - EPSILON() only needs to know
C the type
ONEDP=(1.00)
FPEPS = EPSILON(ONEDP)
DBCOMP = DCMPLX(ZERO,ZERO)
CALL DECLAR(ā€˜FP_EPSILONā€™, ā€˜DPā€™, ā€™ ', DBCOMP, FPEPS)
RETURN
END

Thanks Brian - is this generic for any OS? Or OSX-specific?

Hi Alexandre,

This should be a generic solution. I see the issue on LINUX (CentOS 7) with gcc 4.8.5.

Brian

Hi Srinivas sir,
Can you please explain how to remove flag -fastm in the makefile?

After replacing subrotines in machvar.f file
and then recompile cns_solve
shows error:

make[3]: Target '../bin/cns_solve' not remade because of errors.
Makefile:58: recipe for target 'cns_solve' failed
make[2]: *** [cns_solve] Error 2
Makefile:64: recipe for target 'cns_solve' failed
make[1]: *** [cns_solve] Error 2