NONMEM and g77

5 messages 2 people Latest: Nov 18, 2008

RE: NONMEM and g77

From: Steve Chapel Date: November 14, 2008 technical
I've been able to compile and run NONMEM VI version 2.0 using nmqual-6.3.3 and gfortran 4.3, both on Windows and on Linux. I had to make the following changes: On Windows, edit changes.g77.nm6.xml: change CONOUT$ to a filename such as NMOUTPUT http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32784 On Linux, edit changes.nix.nm6.xml: change the second /dev/null to /dev/tty and the third /dev/null to JUNK http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38122 I used the MinGW version of the gcc compilers on Windows and the version of gcc that ships with Fedora 10 on Linux. Ignore the huge number of warning messages the compiler spits out. When I test using runtest.pl, I get the same output as with g77 3.4.5 and 3.4.6. Steve
Quoted reply history
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darin Perusich Sent: Tuesday, September 02, 2008 9:38 AM To: [EMAIL PROTECTED] Cc: [email protected] Subject: Re: [NMusers] NONMEM and g77 gfortran releases after version 4.1 are not compatible with NONMEM because it is a Fortran 95 compiler and NONMEM is written to conform with the Fortran 77 standard. The gfortran developers claim that "most" Fortran 77 code "should" work with minimal or no code modifications but this didn't prove to be the case. I tried getting NONMEM to build with gfortran 4.2.x for the better part of a day using a myriad of compatibility options but it was to no avail, at which point I switched to GNU Fortran g77 3.3.5 and have had no issues what so ever. If anyone has had success building NONMEM with recent releases gfortran I'd be very interested in knowing which version and the options used. -- Darin Perusich Unix Systems Administrator Cognigen Corporation 395 Youngs Rd. Williamsville, NY 14221 Phone: 716-633-3463 Email: [EMAIL PROTECTED]

Re: NONMEM and g77

From: Nick Holford Date: November 17, 2008 technical
Steve, By sending CONOUT$ to NMOUTPUT I think this means you dont get any intermediate output on the console screen. So why did you make this change? I find it quite helpful to be able to watch the progress of a run. Would you please give a brief explanation of why you made these changes for Windows and Linux? Nick Steve Chapel wrote: > I've been able to compile and run NONMEM VI version 2.0 using nmqual-6.3.3 > and gfortran 4.3, both on Windows and on Linux. I had to make the following > changes: > > On Windows, edit changes.g77.nm6.xml: > change CONOUT$ to a filename such as NMOUTPUT > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32784 > > On Linux, edit changes.nix.nm6.xml: > change the second /dev/null to /dev/tty and the third /dev/null to JUNK > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38122 > > I used the MinGW version of the gcc compilers on Windows and the version of > gcc that ships with Fedora 10 on Linux. > > Ignore the huge number of warning messages the compiler spits out. When I > test using runtest.pl, I get the same output as with g77 3.4.5 and 3.4.6. > > Steve >
Quoted reply history
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Darin Perusich > Sent: Tuesday, September 02, 2008 9:38 AM > To: [EMAIL PROTECTED] > Cc: [email protected] > Subject: Re: [NMusers] NONMEM and g77 > > gfortran releases after version 4.1 are not compatible with NONMEM because it is a Fortran 95 compiler and NONMEM is written to conform with the Fortran 77 standard. The gfortran developers claim that "most" Fortran 77 code "should" work with minimal or no code modifications but this didn't prove to be the case. I tried getting NONMEM to build with gfortran 4.2.x for the better part of a day using a myriad of compatibility options but it was to no avail, at which point I switched to GNU Fortran g77 3.3.5 and have had no issues what so ever. > > If anyone has had success building NONMEM with recent releases gfortran I'd be very interested in knowing which version and the options used. -- Nick Holford, Dept Pharmacology & Clinical Pharmacology University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand [EMAIL PROTECTED] tel:+64(9)923-6730 fax:+64(9)373-7090 http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford

RE: NONMEM and g77

From: Steve Chapel Date: November 17, 2008 technical
I made the changes so that NONMEM VI would be able to run with gfortran. On Windows, if you do not make the change, you get the error: Fortran runtime error: Bad file descriptor when you run NONMEM VI. On Linux, if you do not make the change, you get the error: Fortran runtime error: File already opened in another unit When you run NONMEM VI. I linked to the gcc bug reports I filed for these problems. It looks like the Linux problem will not be fixed, but it isn't much of a problem because you can still get NONMEM VI to report output to the console screen. In fact, the change I show causes output to be reported to the console screen instead of being thrown away. On Windows, gcc needs to be fixed to allow output to go to the console screen. I'll see what I can do to motivate gcc developers to fix the problem. It looks like a patch to fix the problem is ready. I will tell them that we have discussed the issue on this mailing list and that NONMEM users are waiting for a resolution of the issue. Steve
Quoted reply history
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Holford Sent: Monday, November 17, 2008 3:12 AM To: nmusers Subject: Re: [NMusers] NONMEM and g77 Steve, By sending CONOUT$ to NMOUTPUT I think this means you dont get any intermediate output on the console screen. So why did you make this change? I find it quite helpful to be able to watch the progress of a run. Would you please give a brief explanation of why you made these changes for Windows and Linux? Nick Steve Chapel wrote: > I've been able to compile and run NONMEM VI version 2.0 using nmqual-6.3.3 > and gfortran 4.3, both on Windows and on Linux. I had to make the following > changes: > > On Windows, edit changes.g77.nm6.xml: > change CONOUT$ to a filename such as NMOUTPUT > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32784 > > On Linux, edit changes.nix.nm6.xml: > change the second /dev/null to /dev/tty and the third /dev/null to JUNK > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38122 > > I used the MinGW version of the gcc compilers on Windows and the version of > gcc that ships with Fedora 10 on Linux. > > Ignore the huge number of warning messages the compiler spits out. When I > test using runtest.pl, I get the same output as with g77 3.4.5 and 3.4.6. > > Steve > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Darin Perusich > Sent: Tuesday, September 02, 2008 9:38 AM > To: [EMAIL PROTECTED] > Cc: [email protected] > Subject: Re: [NMusers] NONMEM and g77 > > gfortran releases after version 4.1 are not compatible with NONMEM > because it is a Fortran 95 compiler and NONMEM is written to conform > with the Fortran 77 standard. The gfortran developers claim that "most" > Fortran 77 code "should" work with minimal or no code modifications but > this didn't prove to be the case. I tried getting NONMEM to build with > gfortran 4.2.x for the better part of a day using a myriad of > compatibility options but it was to no avail, at which point I switched > to GNU Fortran g77 3.3.5 and have had no issues what so ever. > > If anyone has had success building NONMEM with recent releases gfortran > I'd be very interested in knowing which version and the options used. > > -- Nick Holford, Dept Pharmacology & Clinical Pharmacology University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand [EMAIL PROTECTED] tel:+64(9)923-6730 fax:+64(9)373-7090 http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford

Re: NONMEM and g77

From: Nick Holford Date: November 18, 2008 technical
Steve, I can confirm that CONOUT$ does not work with gfortran and Windows 2003 Server. Thanks for the suggestion on how to work around this compiler bug/feature. Its hard to believe they can produce a compiler that cannot write to the console. Have you done any benchmarking of gfortran performance? I find that the Intel compilers (I'm currently using 10.1) are about 2 x faster than gfortran with NONMEM VI under Windows 2003 Server (g77 is a bit faster than gfortran). Nick Steve Chapel wrote: > I made the changes so that NONMEM VI would be able to run with gfortran. > > On Windows, if you do not make the change, you get the error: > Fortran runtime error: Bad file descriptor > when you run NONMEM VI. > > On Linux, if you do not make the change, you get the error: > Fortran runtime error: File already opened in another unit > When you run NONMEM VI. > > I linked to the gcc bug reports I filed for these problems. > > It looks like the Linux problem will not be fixed, but it isn't much of a > problem because you can still get NONMEM VI to report output to the console > screen. In fact, the change I show causes output to be reported to the > console screen instead of being thrown away. > > On Windows, gcc needs to be fixed to allow output to go to the console > screen. I'll see what I can do to motivate gcc developers to fix the > problem. It looks like a patch to fix the problem is ready. I will tell them > that we have discussed the issue on this mailing list and that NONMEM users > are waiting for a resolution of the issue. > > Steve >
Quoted reply history
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Nick Holford > Sent: Monday, November 17, 2008 3:12 AM > To: nmusers > Subject: Re: [NMusers] NONMEM and g77 > > Steve, > > By sending CONOUT$ to NMOUTPUT I think this means you dont get any intermediate output on the console screen. So why did you make this change? I find it quite helpful to be able to watch the progress of a run. > > Would you please give a brief explanation of why you made these changes for Windows and Linux? > > Nick > > Steve Chapel wrote: > > > I've been able to compile and run NONMEM VI version 2.0 using nmqual-6.3.3 > > and gfortran 4.3, both on Windows and on Linux. I had to make the > > following > > > changes: > > > > On Windows, edit changes.g77.nm6.xml: > > change CONOUT$ to a filename such as NMOUTPUT > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32784 > > > > On Linux, edit changes.nix.nm6.xml: > > change the second /dev/null to /dev/tty and the third /dev/null to JUNK > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38122 > > > > I used the MinGW version of the gcc compilers on Windows and the version > > of > > > gcc that ships with Fedora 10 on Linux. > > > > Ignore the huge number of warning messages the compiler spits out. When I > > test using runtest.pl, I get the same output as with g77 3.4.5 and 3.4.6. > > > > Steve > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > On > > > Behalf Of Darin Perusich > > Sent: Tuesday, September 02, 2008 9:38 AM > > To: [EMAIL PROTECTED] > > Cc: [email protected] > > Subject: Re: [NMusers] NONMEM and g77 > > > > gfortran releases after version 4.1 are not compatible with NONMEM because it is a Fortran 95 compiler and NONMEM is written to conform with the Fortran 77 standard. The gfortran developers claim that "most" Fortran 77 code "should" work with minimal or no code modifications but this didn't prove to be the case. I tried getting NONMEM to build with gfortran 4.2.x for the better part of a day using a myriad of compatibility options but it was to no avail, at which point I switched to GNU Fortran g77 3.3.5 and have had no issues what so ever. > > > > If anyone has had success building NONMEM with recent releases gfortran I'd be very interested in knowing which version and the options used. -- Nick Holford, Dept Pharmacology & Clinical Pharmacology University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand [EMAIL PROTECTED] tel:+64(9)923-6730 fax:+64(9)373-7090 http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford

RE: NONMEM and g77

From: Steve Chapel Date: November 18, 2008 technical
The gfortran compiler can produce programs that output to the console, but apparently not by opening the console device with a unit number as NONMEM does. There is a fix ready for gfortran, and it may be included in gfortran 4.5. I haven't done any benchmarking of the performance of different compilers. I first wanted to give GCC a fighting chance against commercial compilers by using GCC 4.x, which boasts much better optimization than GCC 3.x. I do know that using the -O2 option, instead of the -O option used in nmqual-6.3.3, with g77 3.4.x gives about a 10% increase in speed. I would suspect that using g77 3.4.x instead of g77 2.95 also gives a significant increase in speed. It's odd that you're finding that g77 NONMEM builds are faster than gfortran NONMEM builds. GCC 4.x is supposed to be much better at optimizing than GCC 3.x. I'll be sure to test both g77 and gfortran against other compilers when it comes time to do that. Steve
Quoted reply history
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Holford Sent: Tuesday, November 18, 2008 4:14 AM To: 'nmusers' Subject: Re: [NMusers] NONMEM and g77 Steve, I can confirm that CONOUT$ does not work with gfortran and Windows 2003 Server. Thanks for the suggestion on how to work around this compiler bug/feature. Its hard to believe they can produce a compiler that cannot write to the console. Have you done any benchmarking of gfortran performance? I find that the Intel compilers (I'm currently using 10.1) are about 2 x faster than gfortran with NONMEM VI under Windows 2003 Server (g77 is a bit faster than gfortran). Nick Steve Chapel wrote: > I made the changes so that NONMEM VI would be able to run with gfortran. > > On Windows, if you do not make the change, you get the error: > Fortran runtime error: Bad file descriptor > when you run NONMEM VI. > > On Linux, if you do not make the change, you get the error: > Fortran runtime error: File already opened in another unit > When you run NONMEM VI. > > I linked to the gcc bug reports I filed for these problems. > > It looks like the Linux problem will not be fixed, but it isn't much of a > problem because you can still get NONMEM VI to report output to the console > screen. In fact, the change I show causes output to be reported to the > console screen instead of being thrown away. > > On Windows, gcc needs to be fixed to allow output to go to the console > screen. I'll see what I can do to motivate gcc developers to fix the > problem. It looks like a patch to fix the problem is ready. I will tell them > that we have discussed the issue on this mailing list and that NONMEM users > are waiting for a resolution of the issue. > > Steve > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Nick Holford > Sent: Monday, November 17, 2008 3:12 AM > To: nmusers > Subject: Re: [NMusers] NONMEM and g77 > > Steve, > > By sending CONOUT$ to NMOUTPUT I think this means you dont get any > intermediate output on the console screen. So why did you make this > change? I find it quite helpful to be able to watch the progress of a run. > > Would you please give a brief explanation of why you made these changes > for Windows and Linux? > > Nick > > Steve Chapel wrote: > >> I've been able to compile and run NONMEM VI version 2.0 using nmqual-6.3.3 >> and gfortran 4.3, both on Windows and on Linux. I had to make the >> > following > >> changes: >> >> On Windows, edit changes.g77.nm6.xml: >> change CONOUT$ to a filename such as NMOUTPUT >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32784 >> >> On Linux, edit changes.nix.nm6.xml: >> change the second /dev/null to /dev/tty and the third /dev/null to JUNK >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38122 >> >> I used the MinGW version of the gcc compilers on Windows and the version >> > of > >> gcc that ships with Fedora 10 on Linux. >> >> Ignore the huge number of warning messages the compiler spits out. When I >> test using runtest.pl, I get the same output as with g77 3.4.5 and 3.4.6. >> >> Steve >> >> >> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> > On > >> Behalf Of Darin Perusich >> Sent: Tuesday, September 02, 2008 9:38 AM >> To: [EMAIL PROTECTED] >> Cc: [email protected] >> Subject: Re: [NMusers] NONMEM and g77 >> >> gfortran releases after version 4.1 are not compatible with NONMEM >> because it is a Fortran 95 compiler and NONMEM is written to conform >> with the Fortran 77 standard. The gfortran developers claim that "most" >> Fortran 77 code "should" work with minimal or no code modifications but >> this didn't prove to be the case. I tried getting NONMEM to build with >> gfortran 4.2.x for the better part of a day using a myriad of >> compatibility options but it was to no avail, at which point I switched >> to GNU Fortran g77 3.3.5 and have had no issues what so ever. >> >> If anyone has had success building NONMEM with recent releases gfortran >> I'd be very interested in knowing which version and the options used. >> >> >> > > -- Nick Holford, Dept Pharmacology & Clinical Pharmacology University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand [EMAIL PROTECTED] tel:+64(9)923-6730 fax:+64(9)373-7090 http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford