--- imach/src/imach.c 2014/12/16 10:52:11 1.164 +++ imach/src/imach.c 2014/12/22 15:17:42 1.168 @@ -1,6 +1,22 @@ -/* $Id: imach.c,v 1.164 2014/12/16 10:52:11 brouard Exp $ +/* $Id: imach.c,v 1.168 2014/12/22 15:17:42 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.168 2014/12/22 15:17:42 brouard + Summary: udate + + Revision 1.167 2014/12/22 13:50:56 brouard + Summary: Testing uname and compiler version and if compiled 32 or 64 + + Testing on Linux 64 + + Revision 1.166 2014/12/22 11:40:47 brouard + *** empty log message *** + + Revision 1.165 2014/12/16 11:20:36 brouard + Summary: After compiling on Visual C + + * imach.c (Module): Merging 1.61 to 1.162 + Revision 1.164 2014/12/16 10:52:11 brouard Summary: Merging with Visual C after suppressing some warnings for unused variables. Also fixing Saito's bug 0.98Xn @@ -497,9 +513,8 @@ end */ +#define POWELL /* Instead of NLOPT */ - - #include #include #include @@ -513,6 +528,7 @@ #include #include +#include #include #include /* extern int errno; */ @@ -531,6 +547,7 @@ #include #endif + #ifdef NLOPT #include typedef struct { @@ -573,11 +590,11 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.164 2014/12/16 10:52:11 brouard Exp $ */ +/* $Id: imach.c,v 1.168 2014/12/22 15:17:42 brouard Exp $ */ /* $State: Exp $ */ -char version[]="Imach version 0.99, September 2014,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121)"; -char fullversion[]="$Revision: 1.164 $ $Date: 2014/12/16 10:52:11 $"; +char version[]="Imach version 0.98nY, December 2014,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015"; +char fullversion[]="$Revision: 1.168 $ $Date: 2014/12/22 15:17:42 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -691,7 +708,12 @@ static double maxarg1,maxarg2; #define SIGN(a,b) ((b)>0.0 ? fabs(a) : -fabs(a)) #define rint(a) floor(a+0.5) - +/* http://www.thphys.uni-heidelberg.de/~robbers/cmbeasy/doc/html/myutils_8h-source.html */ +/* #define mytinydouble 1.0e-16 */ +/* #define DEQUAL(a,b) (fabs((a)-(b))
  • Graphs ",stepm,subdirf2(optionfilefiname,"pe"),jj1,subdirf2(optionfilefiname,"pe"),jj1,subdirf2(optionfilefiname,"pe"),jj1); /* Period (stable) prevalence in each health state */ for(cpt=1; cpt<=nlstate;cpt++){ - fprintf(fichtm,"
    - Convergence from cross-sectional prevalence in each state (1 to %d) to period (stable) prevalence in specific state %d %s%d_%d.png
    \ -",nlstate, cpt, subdirf2(optionfilefiname,"p"),cpt,jj1,subdirf2(optionfilefiname,"p"),cpt,jj1,subdirf2(optionfilefiname,"p"),cpt,jj1); + fprintf(fichtm,"
    - Convergence to period (stable) prevalence in state %d. Or probability to be in state %d being in state (1 to %d) at different ages. %s%d_%d.png
    \ +", cpt, cpt, nlstate, subdirf2(optionfilefiname,"p"),cpt,jj1,subdirf2(optionfilefiname,"p"),cpt,jj1,subdirf2(optionfilefiname,"p"),cpt,jj1); } for(cpt=1; cpt<=nlstate;cpt++) { fprintf(fichtm,"\n
    - Life expectancy by health state (%d) at initial age and its decomposition into health expectancies in each alive state (1 to %d) : %s%d%d.png
    \ @@ -5406,6 +5428,65 @@ calandcheckages(int imx, int maxwav, dou return (1); } +syscompilerinfo() + { + /* #include "syscompilerinfo.h"*/ +#include +#if defined(__GNUC__) +# if defined(__GNUC_PATCHLEVEL__) +# define __GNUC_VERSION__ (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +# else +# define __GNUC_VERSION__ (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100) +# endif +#endif + +// http://stackoverflow.com/questions/4605842/how-to-identify-platform-compiler-from-preprocessor-macros +#ifdef _WIN32 // note the underscore: without it, it's not msdn official! + // Windows (x64 and x86) +#elif __unix__ // all unices, not all compilers + // Unix +#elif __linux__ + // linux +#elif __APPLE__ + // Mac OS, not sure if this is covered by __posix__ and/or __unix__ though... +#endif + +/* __MINGW32__ */ +/* __CYGWIN__ */ +/* __MINGW64__ */ +// http://msdn.microsoft.com/en-us/library/b0084kay.aspx +/* _MSC_VER //the Visual C++ compiler is 17.00.51106.1, the _MSC_VER macro evaluates to 1700. Type cl /? */ +/* _MSC_FULL_VER //the Visual C++ compiler is 15.00.20706.01, the _MSC_FULL_VER macro evaluates to 150020706 */ +/* _WIN64 // Defined for applications for Win64. */ +/* _M_X64 // Defined for compilations that target x64 processors. */ +/* _DEBUG // Defined when you compile with /LDd, /MDd, and /MTd. */ +#include +#if UINTPTR_MAX == 0xffffffff + printf("32-bit \n"); /* 32-bit */ +#elif UINTPTR_MAX == 0xffffffffffffffff + printf("64-bit \n");/* 64-bit */ +#else + printf("wtf-bit \n"); /* wtf */ +#endif + +struct utsname sysInfo; + + if (uname(&sysInfo) != -1) { + puts(sysInfo.sysname); + puts(sysInfo.nodename); + puts(sysInfo.release); + puts(sysInfo.version); + puts(sysInfo.machine); + } + else + perror("uname() error"); + printf("GNU C version %d\n", __GNUC_VERSION__); + printf("GNU libc version: %s\n", gnu_get_libc_version()); + + } /***********************************************/ /**************** Main Program *****************/ @@ -5436,7 +5517,7 @@ int main(int argc, char *argv[]) double agedeb; double ageminpar=1.e20,agemin=1.e20, agemaxpar=-1.e20, agemax=-1.e20; - + double fret; double dum; /* Dummy variable */ double ***p3mat; double ***mobaverage; @@ -5583,6 +5664,8 @@ int main(int argc, char *argv[]) optionfilext=%s\n\ optionfilefiname='%s'\n",pathimach,pathtot,path,optionfile,optionfilext,optionfilefiname); + syscompilerinfo(); + printf("Local time (at start):%s",strstart); fprintf(ficlog,"Local time (at start): %s",strstart); fflush(ficlog);