diff --git a/.gitignore b/.gitignore index 054f1164e..366bd057a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,1295 @@ **/.DS_Store /benchmarks-opt.txt /benchmarks-saf.txt +/admb +/admb.cmd +/admb.sh +/examples/admb-re/bcb/admodel.cov +/examples/admb-re/bcb/admodel.dep +/examples/admb-re/bcb/admodel.hes +/examples/admb-re/bcb/bcb +/examples/admb-re/bcb/bcb.bar +/examples/admb-re/bcb/bcb.bgs +/examples/admb-re/bcb/bcb.cor +/examples/admb-re/bcb/bcb.cpp +/examples/admb-re/bcb/bcb.eva +/examples/admb-re/bcb/bcb.htp +/examples/admb-re/bcb/bcb.log +/examples/admb-re/bcb/bcb.luu +/examples/admb-re/bcb/bcb.obj +/examples/admb-re/bcb/bcb.par +/examples/admb-re/bcb/bcb.rep +/examples/admb-re/bcb/bcb.rhes +/examples/admb-re/bcb/bcb.std +/examples/admb-re/bcb/fmin.log +/examples/admb-re/bcb/hesscheck +/examples/admb-re/bcb/hessian.bin +/examples/admb-re/biglog/admodel.cov +/examples/admb-re/biglog/admodel.dep +/examples/admb-re/biglog/admodel.hes +/examples/admb-re/biglog/biglog +/examples/admb-re/biglog/biglog.b01 +/examples/admb-re/biglog/biglog.b02 +/examples/admb-re/biglog/biglog.bar +/examples/admb-re/biglog/biglog.bgs +/examples/admb-re/biglog/biglog.cor +/examples/admb-re/biglog/biglog.cpp +/examples/admb-re/biglog/biglog.eva +/examples/admb-re/biglog/biglog.htp +/examples/admb-re/biglog/biglog.log +/examples/admb-re/biglog/biglog.luu +/examples/admb-re/biglog/biglog.obj +/examples/admb-re/biglog/biglog.p01 +/examples/admb-re/biglog/biglog.p02 +/examples/admb-re/biglog/biglog.par +/examples/admb-re/biglog/biglog.rhes +/examples/admb-re/biglog/biglog.std +/examples/admb-re/biglog/fmin.log +/examples/admb-re/biglog/hesscheck +/examples/admb-re/biglog/hessian.bin +/examples/admb-re/caest/admodel.cov +/examples/admb-re/caest/admodel.dep +/examples/admb-re/caest/admodel.hes +/examples/admb-re/caest/caest +/examples/admb-re/caest/caest.b01 +/examples/admb-re/caest/caest.bar +/examples/admb-re/caest/caest.bgs +/examples/admb-re/caest/caest.cor +/examples/admb-re/caest/caest.cpp +/examples/admb-re/caest/caest.eva +/examples/admb-re/caest/caest.htp +/examples/admb-re/caest/caest.log +/examples/admb-re/caest/caest.luu +/examples/admb-re/caest/caest.obj +/examples/admb-re/caest/caest.p01 +/examples/admb-re/caest/caest.par +/examples/admb-re/caest/caest.r01 +/examples/admb-re/caest/caest.rep +/examples/admb-re/caest/caest.rhes +/examples/admb-re/caest/caest.std +/examples/admb-re/caest/fmin.log +/examples/admb-re/caest/hesscheck +/examples/admb-re/caest/hessian.bin +/examples/admb-re/gamma/admodel.cov +/examples/admb-re/gamma/admodel.dep +/examples/admb-re/gamma/admodel.hes +/examples/admb-re/gamma/fmin.log +/examples/admb-re/gamma/hesscheck +/examples/admb-re/gamma/hessian.bin +/examples/admb-re/gamma/liver_gamma +/examples/admb-re/gamma/liver_gamma.b01 +/examples/admb-re/gamma/liver_gamma.bar +/examples/admb-re/gamma/liver_gamma.bgs +/examples/admb-re/gamma/liver_gamma.cor +/examples/admb-re/gamma/liver_gamma.cpp +/examples/admb-re/gamma/liver_gamma.eva +/examples/admb-re/gamma/liver_gamma.htp +/examples/admb-re/gamma/liver_gamma.log +/examples/admb-re/gamma/liver_gamma.obj +/examples/admb-re/gamma/liver_gamma.p01 +/examples/admb-re/gamma/liver_gamma.par +/examples/admb-re/gamma/liver_gamma.rhes +/examples/admb-re/gamma/liver_gamma.std +/examples/admb-re/glmmadmb/admodel.cov +/examples/admb-re/glmmadmb/admodel.dep +/examples/admb-re/glmmadmb/admodel.hes +/examples/admb-re/glmmadmb/b1 +/examples/admb-re/glmmadmb/b2 +/examples/admb-re/glmmadmb/bvprobit +/examples/admb-re/glmmadmb/bvprobit.b01 +/examples/admb-re/glmmadmb/bvprobit.bar +/examples/admb-re/glmmadmb/bvprobit.bgs +/examples/admb-re/glmmadmb/bvprobit.cor +/examples/admb-re/glmmadmb/bvprobit.cpp +/examples/admb-re/glmmadmb/bvprobit.eva +/examples/admb-re/glmmadmb/bvprobit.htp +/examples/admb-re/glmmadmb/bvprobit.log +/examples/admb-re/glmmadmb/bvprobit.obj +/examples/admb-re/glmmadmb/bvprobit.p01 +/examples/admb-re/glmmadmb/bvprobit.par +/examples/admb-re/glmmadmb/bvprobit.r01 +/examples/admb-re/glmmadmb/bvprobit.rep +/examples/admb-re/glmmadmb/bvprobit.rhes +/examples/admb-re/glmmadmb/bvprobit.std +/examples/admb-re/glmmadmb/fmin.log +/examples/admb-re/glmmadmb/glmmadmb +/examples/admb-re/glmmadmb/glmmadmb.b01 +/examples/admb-re/glmmadmb/glmmadmb.b02 +/examples/admb-re/glmmadmb/glmmadmb.b03 +/examples/admb-re/glmmadmb/glmmadmb.b04 +/examples/admb-re/glmmadmb/glmmadmb.bar +/examples/admb-re/glmmadmb/glmmadmb.bgs +/examples/admb-re/glmmadmb/glmmadmb.cor +/examples/admb-re/glmmadmb/glmmadmb.cpp +/examples/admb-re/glmmadmb/glmmadmb.eva +/examples/admb-re/glmmadmb/glmmadmb.htp +/examples/admb-re/glmmadmb/glmmadmb.log +/examples/admb-re/glmmadmb/glmmadmb.luu +/examples/admb-re/glmmadmb/glmmadmb.obj +/examples/admb-re/glmmadmb/glmmadmb.p01 +/examples/admb-re/glmmadmb/glmmadmb.p02 +/examples/admb-re/glmmadmb/glmmadmb.p03 +/examples/admb-re/glmmadmb/glmmadmb.p04 +/examples/admb-re/glmmadmb/glmmadmb.par +/examples/admb-re/glmmadmb/glmmadmb.r01 +/examples/admb-re/glmmadmb/glmmadmb.r02 +/examples/admb-re/glmmadmb/glmmadmb.r03 +/examples/admb-re/glmmadmb/glmmadmb.r04 +/examples/admb-re/glmmadmb/glmmadmb.rep +/examples/admb-re/glmmadmb/glmmadmb.rhes +/examples/admb-re/glmmadmb/glmmadmb.shess +/examples/admb-re/glmmadmb/glmmadmb.std +/examples/admb-re/glmmadmb/hesscheck +/examples/admb-re/glmmadmb/hessian.bin +/examples/admb-re/glmmadmb/phi.rep +/examples/admb-re/glmmadmb/s1 +/examples/admb-re/glmmadmb/s2 +/examples/admb-re/kidney/admodel.cov +/examples/admb-re/kidney/admodel.dep +/examples/admb-re/kidney/admodel.hes +/examples/admb-re/kidney/fmin.log +/examples/admb-re/kidney/hesscheck +/examples/admb-re/kidney/hessian.bin +/examples/admb-re/kidney/kidney +/examples/admb-re/kidney/kidney.bar +/examples/admb-re/kidney/kidney.bgs +/examples/admb-re/kidney/kidney.cor +/examples/admb-re/kidney/kidney.cpp +/examples/admb-re/kidney/kidney.eva +/examples/admb-re/kidney/kidney.htp +/examples/admb-re/kidney/kidney.log +/examples/admb-re/kidney/kidney.luu +/examples/admb-re/kidney/kidney.obj +/examples/admb-re/kidney/kidney.par +/examples/admb-re/kidney/kidney.rep +/examples/admb-re/kidney/kidney.rhes +/examples/admb-re/kidney/kidney.std +/examples/admb-re/lidar/admodel.cov +/examples/admb-re/lidar/admodel.dep +/examples/admb-re/lidar/admodel.hes +/examples/admb-re/lidar/fmin.log +/examples/admb-re/lidar/hesscheck +/examples/admb-re/lidar/hessian.bin +/examples/admb-re/lidar/lidar +/examples/admb-re/lidar/lidar.b01 +/examples/admb-re/lidar/lidar.bar +/examples/admb-re/lidar/lidar.bgs +/examples/admb-re/lidar/lidar.cor +/examples/admb-re/lidar/lidar.cpp +/examples/admb-re/lidar/lidar.eva +/examples/admb-re/lidar/lidar.htp +/examples/admb-re/lidar/lidar.log +/examples/admb-re/lidar/lidar.luu +/examples/admb-re/lidar/lidar.obj +/examples/admb-re/lidar/lidar.p01 +/examples/admb-re/lidar/lidar.par +/examples/admb-re/lidar/lidar.r01 +/examples/admb-re/lidar/lidar.rep +/examples/admb-re/lidar/lidar.rhes +/examples/admb-re/lidar/lidar.std +/examples/admb-re/logistic/admodel.cov +/examples/admb-re/logistic/admodel.dep +/examples/admb-re/logistic/admodel.hes +/examples/admb-re/logistic/fmin.log +/examples/admb-re/logistic/hesscheck +/examples/admb-re/logistic/hessian.bin +/examples/admb-re/logistic/logistic +/examples/admb-re/logistic/logistic.b01 +/examples/admb-re/logistic/logistic.bar +/examples/admb-re/logistic/logistic.bgs +/examples/admb-re/logistic/logistic.cor +/examples/admb-re/logistic/logistic.cpp +/examples/admb-re/logistic/logistic.eva +/examples/admb-re/logistic/logistic.htp +/examples/admb-re/logistic/logistic.log +/examples/admb-re/logistic/logistic.luu +/examples/admb-re/logistic/logistic.obj +/examples/admb-re/logistic/logistic.p01 +/examples/admb-re/logistic/logistic.par +/examples/admb-re/logistic/logistic.r01 +/examples/admb-re/logistic/logistic.rep +/examples/admb-re/logistic/logistic.rhes +/examples/admb-re/logistic/logistic.std +/examples/admb-re/nbmm/admodel.cov +/examples/admb-re/nbmm/admodel.dep +/examples/admb-re/nbmm/admodel.hes +/examples/admb-re/nbmm/fmin.log +/examples/admb-re/nbmm/hesscheck +/examples/admb-re/nbmm/hessian.bin +/examples/admb-re/nbmm/nbmm +/examples/admb-re/nbmm/nbmm.b01 +/examples/admb-re/nbmm/nbmm.b02 +/examples/admb-re/nbmm/nbmm.bar +/examples/admb-re/nbmm/nbmm.bgs +/examples/admb-re/nbmm/nbmm.cor +/examples/admb-re/nbmm/nbmm.cpp +/examples/admb-re/nbmm/nbmm.eva +/examples/admb-re/nbmm/nbmm.htp +/examples/admb-re/nbmm/nbmm.log +/examples/admb-re/nbmm/nbmm.luu +/examples/admb-re/nbmm/nbmm.obj +/examples/admb-re/nbmm/nbmm.p01 +/examples/admb-re/nbmm/nbmm.p02 +/examples/admb-re/nbmm/nbmm.par +/examples/admb-re/nbmm/nbmm.r01 +/examples/admb-re/nbmm/nbmm.r02 +/examples/admb-re/nbmm/nbmm.rep +/examples/admb-re/nbmm/nbmm.rhes +/examples/admb-re/nbmm/nbmm.std +/examples/admb-re/nested4/admodel.cov +/examples/admb-re/nested4/admodel.dep +/examples/admb-re/nested4/admodel.hes +/examples/admb-re/nested4/fmin.log +/examples/admb-re/nested4/hesscheck +/examples/admb-re/nested4/hessian.bin +/examples/admb-re/nested4/nested4 +/examples/admb-re/nested4/nested4.b01 +/examples/admb-re/nested4/nested4.bar +/examples/admb-re/nested4/nested4.bgs +/examples/admb-re/nested4/nested4.cor +/examples/admb-re/nested4/nested4.cpp +/examples/admb-re/nested4/nested4.eva +/examples/admb-re/nested4/nested4.htp +/examples/admb-re/nested4/nested4.log +/examples/admb-re/nested4/nested4.obj +/examples/admb-re/nested4/nested4.p01 +/examples/admb-re/nested4/nested4.par +/examples/admb-re/nested4/nested4.r01 +/examples/admb-re/nested4/nested4.rep +/examples/admb-re/nested4/nested4.rhes +/examples/admb-re/nested4/nested4.std +/examples/admb-re/orange/admodel.cov +/examples/admb-re/orange/admodel.dep +/examples/admb-re/orange/admodel.hes +/examples/admb-re/orange/fmin.log +/examples/admb-re/orange/hesscheck +/examples/admb-re/orange/hessian.bin +/examples/admb-re/orange/orange +/examples/admb-re/orange/orange.b01 +/examples/admb-re/orange/orange.bar +/examples/admb-re/orange/orange.bgs +/examples/admb-re/orange/orange.cor +/examples/admb-re/orange/orange.cpp +/examples/admb-re/orange/orange.eva +/examples/admb-re/orange/orange.htp +/examples/admb-re/orange/orange.log +/examples/admb-re/orange/orange.obj +/examples/admb-re/orange/orange.p01 +/examples/admb-re/orange/orange.par +/examples/admb-re/orange/orange.r01 +/examples/admb-re/orange/orange.rep +/examples/admb-re/orange/orange.rhes +/examples/admb-re/orange/orange.std +/examples/admb-re/orange2/admodel.cov +/examples/admb-re/orange2/admodel.dep +/examples/admb-re/orange2/admodel.hes +/examples/admb-re/orange2/fmin.log +/examples/admb-re/orange2/hesscheck +/examples/admb-re/orange2/hessian.bin +/examples/admb-re/orange2/orange2 +/examples/admb-re/orange2/orange2.b01 +/examples/admb-re/orange2/orange2.bar +/examples/admb-re/orange2/orange2.bgs +/examples/admb-re/orange2/orange2.cor +/examples/admb-re/orange2/orange2.cpp +/examples/admb-re/orange2/orange2.eva +/examples/admb-re/orange2/orange2.htp +/examples/admb-re/orange2/orange2.log +/examples/admb-re/orange2/orange2.luu +/examples/admb-re/orange2/orange2.obj +/examples/admb-re/orange2/orange2.p01 +/examples/admb-re/orange2/orange2.par +/examples/admb-re/orange2/orange2.r01 +/examples/admb-re/orange2/orange2.rep +/examples/admb-re/orange2/orange2.rhes +/examples/admb-re/orange2/orange2.std +/examples/admb-re/orange_cor/admodel.cov +/examples/admb-re/orange_cor/admodel.dep +/examples/admb-re/orange_cor/admodel.hes +/examples/admb-re/orange_cor/fmin.log +/examples/admb-re/orange_cor/hesscheck +/examples/admb-re/orange_cor/hessian.bin +/examples/admb-re/orange_cor/orange_cor +/examples/admb-re/orange_cor/orange_cor.b01 +/examples/admb-re/orange_cor/orange_cor.bar +/examples/admb-re/orange_cor/orange_cor.bgs +/examples/admb-re/orange_cor/orange_cor.cor +/examples/admb-re/orange_cor/orange_cor.cpp +/examples/admb-re/orange_cor/orange_cor.eva +/examples/admb-re/orange_cor/orange_cor.htp +/examples/admb-re/orange_cor/orange_cor.log +/examples/admb-re/orange_cor/orange_cor.obj +/examples/admb-re/orange_cor/orange_cor.p01 +/examples/admb-re/orange_cor/orange_cor.par +/examples/admb-re/orange_cor/orange_cor.r01 +/examples/admb-re/orange_cor/orange_cor.rep +/examples/admb-re/orange_cor/orange_cor.rhes +/examples/admb-re/orange_cor/orange_cor.std +/examples/admb-re/pheno/admodel.cov +/examples/admb-re/pheno/admodel.dep +/examples/admb-re/pheno/admodel.hes +/examples/admb-re/pheno/fmin.log +/examples/admb-re/pheno/hesscheck +/examples/admb-re/pheno/hessian.bin +/examples/admb-re/pheno/pheno +/examples/admb-re/pheno/pheno.b01 +/examples/admb-re/pheno/pheno.bar +/examples/admb-re/pheno/pheno.bgs +/examples/admb-re/pheno/pheno.cor +/examples/admb-re/pheno/pheno.cpp +/examples/admb-re/pheno/pheno.eva +/examples/admb-re/pheno/pheno.htp +/examples/admb-re/pheno/pheno.log +/examples/admb-re/pheno/pheno.obj +/examples/admb-re/pheno/pheno.p01 +/examples/admb-re/pheno/pheno.par +/examples/admb-re/pheno/pheno.r01 +/examples/admb-re/pheno/pheno.rep +/examples/admb-re/pheno/pheno.rhes +/examples/admb-re/pheno/pheno.std +/examples/admb-re/polio/admodel.cov +/examples/admb-re/polio/admodel.dep +/examples/admb-re/polio/admodel.hes +/examples/admb-re/polio/fmin.log +/examples/admb-re/polio/hesscheck +/examples/admb-re/polio/hessian.bin +/examples/admb-re/polio/polio +/examples/admb-re/polio/polio.b01 +/examples/admb-re/polio/polio.bar +/examples/admb-re/polio/polio.bgs +/examples/admb-re/polio/polio.cor +/examples/admb-re/polio/polio.cpp +/examples/admb-re/polio/polio.eva +/examples/admb-re/polio/polio.htp +/examples/admb-re/polio/polio.log +/examples/admb-re/polio/polio.luu +/examples/admb-re/polio/polio.obj +/examples/admb-re/polio/polio.p01 +/examples/admb-re/polio/polio.par +/examples/admb-re/polio/polio.r01 +/examples/admb-re/polio/polio.rep +/examples/admb-re/polio/polio.rhes +/examples/admb-re/polio/polio.std +/examples/admb-re/sdv/admodel.cov +/examples/admb-re/sdv/admodel.dep +/examples/admb-re/sdv/admodel.hes +/examples/admb-re/sdv/fmin.log +/examples/admb-re/sdv/hesscheck +/examples/admb-re/sdv/hessian.bin +/examples/admb-re/sdv/sdv +/examples/admb-re/sdv/sdv.b01 +/examples/admb-re/sdv/sdv.bar +/examples/admb-re/sdv/sdv.bgs +/examples/admb-re/sdv/sdv.cor +/examples/admb-re/sdv/sdv.cpp +/examples/admb-re/sdv/sdv.eva +/examples/admb-re/sdv/sdv.htp +/examples/admb-re/sdv/sdv.log +/examples/admb-re/sdv/sdv.luu +/examples/admb-re/sdv/sdv.obj +/examples/admb-re/sdv/sdv.p01 +/examples/admb-re/sdv/sdv.par +/examples/admb-re/sdv/sdv.r01 +/examples/admb-re/sdv/sdv.rep +/examples/admb-re/sdv/sdv.rhes +/examples/admb-re/sdv/sdv.std +/examples/admb-re/skewed/admodel.cov +/examples/admb-re/skewed/admodel.dep +/examples/admb-re/skewed/admodel.hes +/examples/admb-re/skewed/diet +/examples/admb-re/skewed/diet.b01 +/examples/admb-re/skewed/diet.bar +/examples/admb-re/skewed/diet.bgs +/examples/admb-re/skewed/diet.cor +/examples/admb-re/skewed/diet.cpp +/examples/admb-re/skewed/diet.eva +/examples/admb-re/skewed/diet.htp +/examples/admb-re/skewed/diet.log +/examples/admb-re/skewed/diet.obj +/examples/admb-re/skewed/diet.p01 +/examples/admb-re/skewed/diet.par +/examples/admb-re/skewed/diet.r01 +/examples/admb-re/skewed/diet.rep +/examples/admb-re/skewed/diet.rhes +/examples/admb-re/skewed/diet.std +/examples/admb-re/skewed/diet_sk +/examples/admb-re/skewed/diet_sk.b01 +/examples/admb-re/skewed/diet_sk.b02 +/examples/admb-re/skewed/diet_sk.bar +/examples/admb-re/skewed/diet_sk.bgs +/examples/admb-re/skewed/diet_sk.cor +/examples/admb-re/skewed/diet_sk.cpp +/examples/admb-re/skewed/diet_sk.eva +/examples/admb-re/skewed/diet_sk.htp +/examples/admb-re/skewed/diet_sk.log +/examples/admb-re/skewed/diet_sk.obj +/examples/admb-re/skewed/diet_sk.p01 +/examples/admb-re/skewed/diet_sk.p02 +/examples/admb-re/skewed/diet_sk.par +/examples/admb-re/skewed/diet_sk.r01 +/examples/admb-re/skewed/diet_sk.r02 +/examples/admb-re/skewed/diet_sk.rep +/examples/admb-re/skewed/diet_sk.rhes +/examples/admb-re/skewed/diet_sk.std +/examples/admb-re/skewed/fmin.log +/examples/admb-re/skewed/hesscheck +/examples/admb-re/skewed/hessian.bin +/examples/admb-re/socatt/admodel.cov +/examples/admb-re/socatt/admodel.dep +/examples/admb-re/socatt/admodel.hes +/examples/admb-re/socatt/fmin.log +/examples/admb-re/socatt/hesscheck +/examples/admb-re/socatt/hessian.bin +/examples/admb-re/socatt/socatt +/examples/admb-re/socatt/socatt.bar +/examples/admb-re/socatt/socatt.bgs +/examples/admb-re/socatt/socatt.cor +/examples/admb-re/socatt/socatt.cpp +/examples/admb-re/socatt/socatt.eva +/examples/admb-re/socatt/socatt.htp +/examples/admb-re/socatt/socatt.log +/examples/admb-re/socatt/socatt.obj +/examples/admb-re/socatt/socatt.par +/examples/admb-re/socatt/socatt.rep +/examples/admb-re/socatt/socatt.rhes +/examples/admb-re/socatt/socatt.std +/examples/admb-re/spatial/admodel.cov +/examples/admb-re/spatial/admodel.dep +/examples/admb-re/spatial/admodel.hes +/examples/admb-re/spatial/classcode.tmp +/examples/admb-re/spatial/fmin.log +/examples/admb-re/spatial/hesscheck +/examples/admb-re/spatial/hessian.bin +/examples/admb-re/spatial/spatial +/examples/admb-re/spatial/spatial.b01 +/examples/admb-re/spatial/spatial.bar +/examples/admb-re/spatial/spatial.bgs +/examples/admb-re/spatial/spatial.cor +/examples/admb-re/spatial/spatial.cpp +/examples/admb-re/spatial/spatial.eva +/examples/admb-re/spatial/spatial.htp +/examples/admb-re/spatial/spatial.log +/examples/admb-re/spatial/spatial.luu +/examples/admb-re/spatial/spatial.obj +/examples/admb-re/spatial/spatial.p01 +/examples/admb-re/spatial/spatial.par +/examples/admb-re/spatial/spatial.r01 +/examples/admb-re/spatial/spatial.rep +/examples/admb-re/spatial/spatial.rhes +/examples/admb-re/spatial/spatial.std +/examples/admb-re/union/admodel.cov +/examples/admb-re/union/admodel.dep +/examples/admb-re/union/admodel.hes +/examples/admb-re/union/fmin.log +/examples/admb-re/union/hesscheck +/examples/admb-re/union/hessian.bin +/examples/admb-re/union/union +/examples/admb-re/union/union.b01 +/examples/admb-re/union/union.bar +/examples/admb-re/union/union.bgs +/examples/admb-re/union/union.cor +/examples/admb-re/union/union.cpp +/examples/admb-re/union/union.eva +/examples/admb-re/union/union.htp +/examples/admb-re/union/union.log +/examples/admb-re/union/union.luu +/examples/admb-re/union/union.obj +/examples/admb-re/union/union.p01 +/examples/admb-re/union/union.par +/examples/admb-re/union/union.r01 +/examples/admb-re/union/union.rep +/examples/admb-re/union/union.rhes +/examples/admb-re/union/union.std +/examples/admb-re/weights/admodel.cov +/examples/admb-re/weights/admodel.dep +/examples/admb-re/weights/admodel.hes +/examples/admb-re/weights/binomial +/examples/admb-re/weights/binomial.b01 +/examples/admb-re/weights/binomial.bar +/examples/admb-re/weights/binomial.bgs +/examples/admb-re/weights/binomial.cor +/examples/admb-re/weights/binomial.cpp +/examples/admb-re/weights/binomial.eva +/examples/admb-re/weights/binomial.htp +/examples/admb-re/weights/binomial.log +/examples/admb-re/weights/binomial.obj +/examples/admb-re/weights/binomial.p01 +/examples/admb-re/weights/binomial.par +/examples/admb-re/weights/binomial.rhes +/examples/admb-re/weights/binomial.std +/examples/admb-re/weights/fmin.log +/examples/admb-re/weights/hesscheck +/examples/admb-re/weights/hessian.bin +/examples/admb/buscycle/admodel.cov +/examples/admb/buscycle/admodel.dep +/examples/admb/buscycle/admodel.hes +/examples/admb/buscycle/fmin.log +/examples/admb/buscycle/ham4 +/examples/admb/buscycle/ham4.b01 +/examples/admb/buscycle/ham4.b02 +/examples/admb/buscycle/ham4.b03 +/examples/admb/buscycle/ham4.b04 +/examples/admb/buscycle/ham4.bar +/examples/admb/buscycle/ham4.cor +/examples/admb/buscycle/ham4.cpp +/examples/admb/buscycle/ham4.eva +/examples/admb/buscycle/ham4.htp +/examples/admb/buscycle/ham4.log +/examples/admb/buscycle/ham4.obj +/examples/admb/buscycle/ham4.p01 +/examples/admb/buscycle/ham4.p02 +/examples/admb/buscycle/ham4.p03 +/examples/admb/buscycle/ham4.p04 +/examples/admb/buscycle/ham4.par +/examples/admb/buscycle/ham4.r01 +/examples/admb/buscycle/ham4.r02 +/examples/admb/buscycle/ham4.r03 +/examples/admb/buscycle/ham4.r04 +/examples/admb/buscycle/ham4.rep +/examples/admb/buscycle/ham4.std +/examples/admb/buscycle/ham5 +/examples/admb/buscycle/ham5.b01 +/examples/admb/buscycle/ham5.b02 +/examples/admb/buscycle/ham5.b03 +/examples/admb/buscycle/ham5.b04 +/examples/admb/buscycle/ham5.bar +/examples/admb/buscycle/ham5.cor +/examples/admb/buscycle/ham5.cpp +/examples/admb/buscycle/ham5.eva +/examples/admb/buscycle/ham5.htp +/examples/admb/buscycle/ham5.log +/examples/admb/buscycle/ham5.obj +/examples/admb/buscycle/ham5.p01 +/examples/admb/buscycle/ham5.p02 +/examples/admb/buscycle/ham5.p03 +/examples/admb/buscycle/ham5.p04 +/examples/admb/buscycle/ham5.par +/examples/admb/buscycle/ham5.r01 +/examples/admb/buscycle/ham5.r02 +/examples/admb/buscycle/ham5.r03 +/examples/admb/buscycle/ham5.r04 +/examples/admb/buscycle/ham5.rep +/examples/admb/buscycle/ham5.std +/examples/admb/buscycle/qafter4.tex +/examples/admb/buscycle/qafter5.tex +/examples/admb/buscycle/qbefore4.tex +/examples/admb/buscycle/qbefore5.tex +/examples/admb/catage/admodel.cov +/examples/admb/catage/admodel.dep +/examples/admb/catage/admodel.hes +/examples/admb/catage/catage +/examples/admb/catage/catage.b01 +/examples/admb/catage/catage.b02 +/examples/admb/catage/catage.bar +/examples/admb/catage/catage.cor +/examples/admb/catage/catage.cpp +/examples/admb/catage/catage.eva +/examples/admb/catage/catage.htp +/examples/admb/catage/catage.log +/examples/admb/catage/catage.obj +/examples/admb/catage/catage.p01 +/examples/admb/catage/catage.p02 +/examples/admb/catage/catage.par +/examples/admb/catage/catage.r01 +/examples/admb/catage/catage.r02 +/examples/admb/catage/catage.rep +/examples/admb/catage/catage.std +/examples/admb/catage/fmin.log +/examples/admb/chem_eng/admodel.cov +/examples/admb/chem_eng/admodel.dep +/examples/admb/chem_eng/admodel.hes +/examples/admb/chem_eng/chem_eng +/examples/admb/chem_eng/chem_eng.bar +/examples/admb/chem_eng/chem_eng.cor +/examples/admb/chem_eng/chem_eng.cpp +/examples/admb/chem_eng/chem_eng.eva +/examples/admb/chem_eng/chem_eng.htp +/examples/admb/chem_eng/chem_eng.log +/examples/admb/chem_eng/chem_eng.obj +/examples/admb/chem_eng/chem_eng.par +/examples/admb/chem_eng/chem_eng.std +/examples/admb/chem_eng/fmin.log +/examples/admb/finance/admodel.cov +/examples/admb/finance/admodel.dep +/examples/admb/finance/admodel.hes +/examples/admb/finance/finance +/examples/admb/finance/finance.b01 +/examples/admb/finance/finance.b02 +/examples/admb/finance/finance.bar +/examples/admb/finance/finance.cor +/examples/admb/finance/finance.cpp +/examples/admb/finance/finance.eva +/examples/admb/finance/finance.htp +/examples/admb/finance/finance.log +/examples/admb/finance/finance.obj +/examples/admb/finance/finance.p01 +/examples/admb/finance/finance.p02 +/examples/admb/finance/finance.par +/examples/admb/finance/finance.std +/examples/admb/finance/fmin.log +/examples/admb/forest/admodel.cov +/examples/admb/forest/admodel.dep +/examples/admb/forest/admodel.hes +/examples/admb/forest/fmin.log +/examples/admb/forest/forest +/examples/admb/forest/forest.b01 +/examples/admb/forest/forest.bar +/examples/admb/forest/forest.cor +/examples/admb/forest/forest.cpp +/examples/admb/forest/forest.eva +/examples/admb/forest/forest.htp +/examples/admb/forest/forest.log +/examples/admb/forest/forest.obj +/examples/admb/forest/forest.p01 +/examples/admb/forest/forest.par +/examples/admb/forest/forest.r01 +/examples/admb/forest/forest.rep +/examples/admb/forest/forest.std +/examples/admb/pella_t/admodel.cov +/examples/admb/pella_t/admodel.dep +/examples/admb/pella_t/admodel.hes +/examples/admb/pella_t/fmin.log +/examples/admb/pella_t/pella_t +/examples/admb/pella_t/pella_t.b01 +/examples/admb/pella_t/pella_t.b02 +/examples/admb/pella_t/pella_t.b03 +/examples/admb/pella_t/pella_t.bar +/examples/admb/pella_t/pella_t.cor +/examples/admb/pella_t/pella_t.cpp +/examples/admb/pella_t/pella_t.eva +/examples/admb/pella_t/pella_t.htp +/examples/admb/pella_t/pella_t.log +/examples/admb/pella_t/pella_t.obj +/examples/admb/pella_t/pella_t.p01 +/examples/admb/pella_t/pella_t.p02 +/examples/admb/pella_t/pella_t.p03 +/examples/admb/pella_t/pella_t.par +/examples/admb/pella_t/pella_t.std +/examples/admb/prof_like/admodel.cov +/examples/admb/prof_like/admodel.dep +/examples/admb/prof_like/admodel.hes +/examples/admb/prof_like/bhplfine +/examples/admb/prof_like/bhplfine.bar +/examples/admb/prof_like/bhplfine.cor +/examples/admb/prof_like/bhplfine.cpp +/examples/admb/prof_like/bhplfine.eva +/examples/admb/prof_like/bhplfine.htp +/examples/admb/prof_like/bhplfine.log +/examples/admb/prof_like/bhplfine.obj +/examples/admb/prof_like/bhplfine.par +/examples/admb/prof_like/bhplfine.prf +/examples/admb/prof_like/bhplfine.std +/examples/admb/prof_like/dgs2 +/examples/admb/prof_like/diags +/examples/admb/prof_like/fmin.log +/examples/admb/prof_like/loga_pl.plt +/examples/admb/prof_like/logb_pl.plt +/examples/admb/robreg/admodel.cov +/examples/admb/robreg/admodel.dep +/examples/admb/robreg/admodel.hes +/examples/admb/robreg/fmin.log +/examples/admb/robreg/vonb +/examples/admb/robreg/vonb.bar +/examples/admb/robreg/vonb.cor +/examples/admb/robreg/vonb.cpp +/examples/admb/robreg/vonb.eva +/examples/admb/robreg/vonb.htp +/examples/admb/robreg/vonb.log +/examples/admb/robreg/vonb.obj +/examples/admb/robreg/vonb.par +/examples/admb/robreg/vonb.std +/examples/admb/robreg/vonbr +/examples/admb/robreg/vonbr.b01 +/examples/admb/robreg/vonbr.bar +/examples/admb/robreg/vonbr.cor +/examples/admb/robreg/vonbr.cpp +/examples/admb/robreg/vonbr.eva +/examples/admb/robreg/vonbr.htp +/examples/admb/robreg/vonbr.log +/examples/admb/robreg/vonbr.obj +/examples/admb/robreg/vonbr.p01 +/examples/admb/robreg/vonbr.par +/examples/admb/robreg/vonbr.std +/examples/admb/simple/admodel.cov +/examples/admb/simple/admodel.dep +/examples/admb/simple/admodel.hes +/examples/admb/simple/fmin.log +/examples/admb/simple/simple +/examples/admb/simple/simple.bar +/examples/admb/simple/simple.cor +/examples/admb/simple/simple.cpp +/examples/admb/simple/simple.eva +/examples/admb/simple/simple.htp +/examples/admb/simple/simple.log +/examples/admb/simple/simple.obj +/examples/admb/simple/simple.par +/examples/admb/simple/simple.std +/examples/admb/truncreg/admodel.cov +/examples/admb/truncreg/admodel.dep +/examples/admb/truncreg/admodel.hes +/examples/admb/truncreg/fmin.log +/examples/admb/truncreg/truncreg +/examples/admb/truncreg/truncreg.bar +/examples/admb/truncreg/truncreg.cor +/examples/admb/truncreg/truncreg.cpp +/examples/admb/truncreg/truncreg.eva +/examples/admb/truncreg/truncreg.htp +/examples/admb/truncreg/truncreg.log +/examples/admb/truncreg/truncreg.obj +/examples/admb/truncreg/truncreg.par +/examples/admb/truncreg/truncreg.rep +/examples/admb/truncreg/truncreg.std +/examples/admb/vol/admodel.cov +/examples/admb/vol/admodel.dep +/examples/admb/vol/admodel.hes +/examples/admb/vol/fmin.log +/examples/admb/vol/n2mvol +/examples/admb/vol/n2mvol.b01 +/examples/admb/vol/n2mvol.bar +/examples/admb/vol/n2mvol.cor +/examples/admb/vol/n2mvol.cpp +/examples/admb/vol/n2mvol.eva +/examples/admb/vol/n2mvol.htp +/examples/admb/vol/n2mvol.log +/examples/admb/vol/n2mvol.obj +/examples/admb/vol/n2mvol.p01 +/examples/admb/vol/n2mvol.par +/examples/admb/vol/n2mvol.r01 +/examples/admb/vol/n2mvol.rep +/examples/admb/vol/n2mvol.std +/examples/autodif/bigmin/bigmin +/examples/autodif/bigmin/bigmin.obj +/examples/autodif/bigmin/fmin.log +/examples/autodif/bigmin/matinv.est +/examples/autodif/hemholtz/fmin.log +/examples/autodif/hemholtz/hem_func.obj +/examples/autodif/hemholtz/hemholtz +/examples/autodif/hemholtz/hemholtz.obj +/examples/autodif/io_examp/file1.tmp +/examples/autodif/io_examp/file2.tmp +/examples/autodif/io_examp/fmin.log +/examples/autodif/io_examp/io_examp +/examples/autodif/io_examp/io_examp.obj +/examples/autodif/mixture/fmin.log +/examples/autodif/mixture/normsim +/examples/autodif/mixture/normsim.frq +/examples/autodif/mixture/normsim.obj +/examples/autodif/mixture/normsim.out +/examples/autodif/newt/fmin.log +/examples/autodif/newt/newt +/examples/autodif/newt/newt.obj +/examples/autodif/simple/fcomp_s.obj +/examples/autodif/simple/fmin.log +/examples/autodif/simple/s1 +/examples/autodif/simple/s1.obj +/examples/autodif/simple/simp1 +/examples/autodif/simple/simp1.obj +/examples/autodif/simple/simple +/examples/autodif/simple/simple.obj +/examples/autodif/simple/simple2 +/examples/autodif/simple/simple2.obj +/examples/autodif/struct/fmin.log +/examples/autodif/struct/oldstr +/examples/autodif/struct/oldstr.obj +/examples/autodif/struct/struct +/examples/autodif/struct/struct.obj +/outputs-opt.txt +/outputs-saf.txt +/tests/4darray/4darray +/tests/4darray/4darray.bar +/tests/4darray/4darray.cor +/tests/4darray/4darray.cpp +/tests/4darray/4darray.eva +/tests/4darray/4darray.htp +/tests/4darray/4darray.log +/tests/4darray/4darray.obj +/tests/4darray/4darray.par +/tests/4darray/4darray.std +/tests/4darray/admodel.cov +/tests/4darray/admodel.dep +/tests/4darray/admodel.hes +/tests/4darray/fmin.log +/tests/adnuts/adaptation.csv +/tests/adnuts/adapted_metric.txt +/tests/adnuts/admodel.cov +/tests/adnuts/admodel.dep +/tests/adnuts/admodel.hes +/tests/adnuts/adnuts +/tests/adnuts/adnuts.bar +/tests/adnuts/adnuts.cor +/tests/adnuts/adnuts.cpp +/tests/adnuts/adnuts.eva +/tests/adnuts/adnuts.htp +/tests/adnuts/adnuts.log +/tests/adnuts/adnuts.mc2 +/tests/adnuts/adnuts.mcm +/tests/adnuts/adnuts.obj +/tests/adnuts/adnuts.par +/tests/adnuts/adnuts.psv +/tests/adnuts/adnuts.std +/tests/adnuts/adnuts_psv.txt +/tests/adnuts/fmin.log +/tests/adnuts/output_psv +/tests/adnuts/rwm_lp.txt +/tests/adnuts/sims +/tests/adnuts/unbounded.csv +/tests/bessel/bessel +/tests/bessel/bessel.cpp +/tests/bessel/bessel.htp +/tests/bessel/bessel.log +/tests/bessel/bessel.obj +/tests/bessel/fmin.log +/tests/beta2/admodel.cov +/tests/beta2/admodel.dep +/tests/beta2/admodel.hes +/tests/beta2/beta2 +/tests/beta2/beta2.bar +/tests/beta2/beta2.cor +/tests/beta2/beta2.cpp +/tests/beta2/beta2.eva +/tests/beta2/beta2.htp +/tests/beta2/beta2.log +/tests/beta2/beta2.obj +/tests/beta2/beta2.par +/tests/beta2/beta2.std +/tests/beta2/fmin.log +/tests/beta3/admodel.cov +/tests/beta3/admodel.dep +/tests/beta3/admodel.hes +/tests/beta3/beta3 +/tests/beta3/beta3.bar +/tests/beta3/beta3.bgs +/tests/beta3/beta3.cor +/tests/beta3/beta3.cpp +/tests/beta3/beta3.eva +/tests/beta3/beta3.htp +/tests/beta3/beta3.log +/tests/beta3/beta3.luu +/tests/beta3/beta3.obj +/tests/beta3/beta3.par +/tests/beta3/beta3.rhes +/tests/beta3/beta3.std +/tests/beta3/fmin.log +/tests/beta3/hesscheck +/tests/beta3/hessian.bin +/tests/beta_deviate/admodel.cov +/tests/beta_deviate/admodel.dep +/tests/beta_deviate/admodel.hes +/tests/beta_deviate/fmin.log +/tests/beta_deviate/hesscheck +/tests/beta_deviate/hessian.bin +/tests/beta_deviate/minto +/tests/beta_deviate/minto.bar +/tests/beta_deviate/minto.bgs +/tests/beta_deviate/minto.cor +/tests/beta_deviate/minto.cpp +/tests/beta_deviate/minto.eva +/tests/beta_deviate/minto.htp +/tests/beta_deviate/minto.log +/tests/beta_deviate/minto.obj +/tests/beta_deviate/minto.par +/tests/beta_deviate/minto.rhes +/tests/beta_deviate/minto.std +/tests/beta_regression/admodel.cov +/tests/beta_regression/admodel.dep +/tests/beta_regression/admodel.hes +/tests/beta_regression/b1 +/tests/beta_regression/b2 +/tests/beta_regression/beta_regression +/tests/beta_regression/beta_regression.b01 +/tests/beta_regression/beta_regression.bar +/tests/beta_regression/beta_regression.bgs +/tests/beta_regression/beta_regression.cor +/tests/beta_regression/beta_regression.cpp +/tests/beta_regression/beta_regression.eva +/tests/beta_regression/beta_regression.htp +/tests/beta_regression/beta_regression.log +/tests/beta_regression/beta_regression.luu +/tests/beta_regression/beta_regression.obj +/tests/beta_regression/beta_regression.p01 +/tests/beta_regression/beta_regression.par +/tests/beta_regression/beta_regression.psv +/tests/beta_regression/beta_regression.r01 +/tests/beta_regression/beta_regression.rep +/tests/beta_regression/beta_regression.rhes +/tests/beta_regression/beta_regression.std +/tests/beta_regression/data +/tests/beta_regression/fmin.log +/tests/beta_regression/hesscheck +/tests/beta_regression/hessian.bin +/tests/beta_regression/hybrid_seed +/tests/beta_regression/s1 +/tests/beta_regression/s2 +/tests/beta_regression/sims +/tests/betai/admodel.cov +/tests/betai/admodel.dep +/tests/betai/admodel.hes +/tests/betai/betai +/tests/betai/betai.bar +/tests/betai/betai.cor +/tests/betai/betai.cpp +/tests/betai/betai.eva +/tests/betai/betai.htp +/tests/betai/betai.log +/tests/betai/betai.obj +/tests/betai/betai.par +/tests/betai/betai.std +/tests/betai/fmin.log +/tests/betareg/a +/tests/betareg/admodel.cov +/tests/betareg/admodel.dep +/tests/betareg/admodel.hes +/tests/betareg/b1 +/tests/betareg/b2 +/tests/betareg/betareg +/tests/betareg/betareg.b01 +/tests/betareg/betareg.b02 +/tests/betareg/betareg.bar +/tests/betareg/betareg.bgs +/tests/betareg/betareg.cor +/tests/betareg/betareg.cpp +/tests/betareg/betareg.eva +/tests/betareg/betareg.htp +/tests/betareg/betareg.log +/tests/betareg/betareg.luu +/tests/betareg/betareg.obj +/tests/betareg/betareg.p01 +/tests/betareg/betareg.p02 +/tests/betareg/betareg.par +/tests/betareg/betareg.r01 +/tests/betareg/betareg.r02 +/tests/betareg/betareg.rep +/tests/betareg/betareg.rhes +/tests/betareg/betareg.std +/tests/betareg/data +/tests/betareg/fmin.log +/tests/betareg/hesscheck +/tests/betareg/hessian.bin +/tests/betareg/s1 +/tests/betareg/s2 +/tests/colfill/colfill +/tests/colfill/colfill.bar +/tests/colfill/colfill.cpp +/tests/colfill/colfill.htp +/tests/colfill/colfill.log +/tests/colfill/colfill.obj +/tests/colfill/colfill.par +/tests/colfill/colfill.rep +/tests/colfill/fmin.log +/tests/cov_re/admodel.cov +/tests/cov_re/admodel.dep +/tests/cov_re/admodel.hes +/tests/cov_re/cov_re +/tests/cov_re/cov_re.bar +/tests/cov_re/cov_re.bgs +/tests/cov_re/cov_re.cor +/tests/cov_re/cov_re.cpp +/tests/cov_re/cov_re.eva +/tests/cov_re/cov_re.htp +/tests/cov_re/cov_re.log +/tests/cov_re/cov_re.luu +/tests/cov_re/cov_re.obj +/tests/cov_re/cov_re.par +/tests/cov_re/cov_re.rhes +/tests/cov_re/cov_re.std +/tests/cov_re/cov_re_sep +/tests/cov_re/cov_re_sep.bar +/tests/cov_re/cov_re_sep.bgs +/tests/cov_re/cov_re_sep.cor +/tests/cov_re/cov_re_sep.cpp +/tests/cov_re/cov_re_sep.eva +/tests/cov_re/cov_re_sep.htp +/tests/cov_re/cov_re_sep.log +/tests/cov_re/cov_re_sep.obj +/tests/cov_re/cov_re_sep.par +/tests/cov_re/cov_re_sep.rhes +/tests/cov_re/cov_re_sep.std +/tests/cov_re/fmin.log +/tests/cov_re/hesscheck +/tests/cov_re/hessian.bin +/tests/ctl/admodel.cov +/tests/ctl/admodel.dep +/tests/ctl/admodel.hes +/tests/ctl/example +/tests/ctl/example.b01 +/tests/ctl/example.bar +/tests/ctl/example.cor +/tests/ctl/example.cpp +/tests/ctl/example.eva +/tests/ctl/example.htp +/tests/ctl/example.log +/tests/ctl/example.obj +/tests/ctl/example.p01 +/tests/ctl/example.par +/tests/ctl/example.std +/tests/ctl/fmin.log +/tests/data_adstring_array/data_adstring_array +/tests/data_adstring_array/data_adstring_array.bar +/tests/data_adstring_array/data_adstring_array.cor +/tests/data_adstring_array/data_adstring_array.cpp +/tests/data_adstring_array/data_adstring_array.eva +/tests/data_adstring_array/data_adstring_array.htp +/tests/data_adstring_array/data_adstring_array.log +/tests/data_adstring_array/data_adstring_array.obj +/tests/data_adstring_array/data_adstring_array.par +/tests/data_adstring_array/data_adstring_array.rep +/tests/data_adstring_array/data_adstring_array.std +/tests/dd2/dd2 +/tests/dd2/dd2.cpp +/tests/dd2/dd2.htp +/tests/dd2/dd2.log +/tests/dd2/dd2.obj +/tests/dd2/f1b2list1 +/tests/dd2/f1b2list12 +/tests/dd2/f1b2list13 +/tests/dd2/fmin.log +/tests/dd2/nf1b2list1 +/tests/dd2/nf1b2list12 +/tests/dd2/nf1b2list13 +/tests/expm/admodel.cov +/tests/expm/admodel.dep +/tests/expm/admodel.hes +/tests/expm/expm +/tests/expm/expm.bar +/tests/expm/expm.cor +/tests/expm/expm.cpp +/tests/expm/expm.eva +/tests/expm/expm.htp +/tests/expm/expm.log +/tests/expm/expm.obj +/tests/expm/expm.par +/tests/expm/expm.std +/tests/expm/fmin.log +/tests/f1b2vc5/f1b2vc5 +/tests/f1b2vc5/f1b2vc5.b01 +/tests/f1b2vc5/f1b2vc5.bar +/tests/f1b2vc5/f1b2vc5.cpp +/tests/f1b2vc5/f1b2vc5.htp +/tests/f1b2vc5/f1b2vc5.log +/tests/f1b2vc5/f1b2vc5.obj +/tests/f1b2vc5/f1b2vc5.p01 +/tests/f1b2vc5/f1b2vc5.par +/tests/f1b2vc5/fmin.log +/tests/globals/main +/tests/globals/main.obj +/tests/gradients_output/admodel.cov +/tests/gradients_output/admodel.dep +/tests/gradients_output/admodel.hes +/tests/gradients_output/de +/tests/gradients_output/de.b01 +/tests/gradients_output/de.bar +/tests/gradients_output/de.cor +/tests/gradients_output/de.cpp +/tests/gradients_output/de.eva +/tests/gradients_output/de.htp +/tests/gradients_output/de.log +/tests/gradients_output/de.obj +/tests/gradients_output/de.p01 +/tests/gradients_output/de.par +/tests/gradients_output/de.r01 +/tests/gradients_output/de.rep +/tests/gradients_output/de.std +/tests/gradients_output/fmin.log +/tests/hysimple/admodel.cov +/tests/hysimple/admodel.dep +/tests/hysimple/admodel.hes +/tests/hysimple/fmin.log +/tests/hysimple/hybrid_seed +/tests/hysimple/hysimple +/tests/hysimple/hysimple.bar +/tests/hysimple/hysimple.cor +/tests/hysimple/hysimple.cpp +/tests/hysimple/hysimple.eva +/tests/hysimple/hysimple.htp +/tests/hysimple/hysimple.log +/tests/hysimple/hysimple.obj +/tests/hysimple/hysimple.par +/tests/hysimple/hysimple.psv +/tests/hysimple/hysimple.std +/tests/hysimple/sims +/tests/orange_mvn/admodel.cov +/tests/orange_mvn/admodel.dep +/tests/orange_mvn/admodel.hes +/tests/orange_mvn/fmin.log +/tests/orange_mvn/hesscheck +/tests/orange_mvn/hessian.bin +/tests/orange_mvn/orange_mvn +/tests/orange_mvn/orange_mvn.b01 +/tests/orange_mvn/orange_mvn.bar +/tests/orange_mvn/orange_mvn.bgs +/tests/orange_mvn/orange_mvn.cor +/tests/orange_mvn/orange_mvn.cpp +/tests/orange_mvn/orange_mvn.eva +/tests/orange_mvn/orange_mvn.htp +/tests/orange_mvn/orange_mvn.log +/tests/orange_mvn/orange_mvn.obj +/tests/orange_mvn/orange_mvn.p01 +/tests/orange_mvn/orange_mvn.par +/tests/orange_mvn/orange_mvn.r01 +/tests/orange_mvn/orange_mvn.rep +/tests/orange_mvn/orange_mvn.rhes +/tests/orange_mvn/orange_mvn.std +/tests/poisp/admodel.cov +/tests/poisp/admodel.dep +/tests/poisp/admodel.hes +/tests/poisp/fmin.log +/tests/poisp/poisp +/tests/poisp/poisp.bar +/tests/poisp/poisp.cor +/tests/poisp/poisp.cpp +/tests/poisp/poisp.eva +/tests/poisp/poisp.htp +/tests/poisp/poisp.log +/tests/poisp/poisp.obj +/tests/poisp/poisp.par +/tests/poisp/poisp.std +/tests/priors/fmin.log +/tests/priors/rat +/tests/priors/rat.b01 +/tests/priors/rat.b02 +/tests/priors/rat.bar +/tests/priors/rat.cpp +/tests/priors/rat.htp +/tests/priors/rat.log +/tests/priors/rat.obj +/tests/priors/rat.p01 +/tests/priors/rat.p02 +/tests/priors/rat.par +/tests/priors/rat.r01 +/tests/priors/rat.r02 +/tests/priors/rat.rep +/tests/priors/ratre +/tests/priors/ratre.b01 +/tests/priors/ratre.b02 +/tests/priors/ratre.bar +/tests/priors/ratre.cpp +/tests/priors/ratre.htp +/tests/priors/ratre.log +/tests/priors/ratre.obj +/tests/priors/ratre.p01 +/tests/priors/ratre.p02 +/tests/priors/ratre.par +/tests/priors/ratre.r01 +/tests/priors/ratre.r02 +/tests/priors/ratre.rep +/tests/qbeta/fmin.log +/tests/qbeta/qbeta +/tests/qbeta/qbeta.cpp +/tests/qbeta/qbeta.htp +/tests/qbeta/qbeta.log +/tests/qbeta/qbeta.obj +/tests/rgamma/fmin.log +/tests/rgamma/gamm1 +/tests/rgamma/gamm1.obj +/tests/rgamma/testgamm +/tests/rgamma/testgamm.obj +/tests/simple_mcmc/admodel.cov +/tests/simple_mcmc/admodel.dep +/tests/simple_mcmc/admodel.hes +/tests/simple_mcmc/fmin.log +/tests/simple_mcmc/posteriors.rep +/tests/simple_mcmc/simple_mcmc +/tests/simple_mcmc/simple_mcmc.bar +/tests/simple_mcmc/simple_mcmc.cor +/tests/simple_mcmc/simple_mcmc.cpp +/tests/simple_mcmc/simple_mcmc.ecm +/tests/simple_mcmc/simple_mcmc.eva +/tests/simple_mcmc/simple_mcmc.hst +/tests/simple_mcmc/simple_mcmc.htp +/tests/simple_mcmc/simple_mcmc.log +/tests/simple_mcmc/simple_mcmc.mc2 +/tests/simple_mcmc/simple_mcmc.mcm +/tests/simple_mcmc/simple_mcmc.obj +/tests/simple_mcmc/simple_mcmc.par +/tests/simple_mcmc/simple_mcmc.psv +/tests/simple_mcmc/simple_mcmc.std +/tests/simple_mcmc/sims +/tests/testminmax/admodel.cov +/tests/testminmax/admodel.dep +/tests/testminmax/admodel.hes +/tests/testminmax/fmin.log +/tests/testminmax/testminmax +/tests/testminmax/testminmax.bar +/tests/testminmax/testminmax.cor +/tests/testminmax/testminmax.cpp +/tests/testminmax/testminmax.eva +/tests/testminmax/testminmax.htp +/tests/testminmax/testminmax.log +/tests/testminmax/testminmax.obj +/tests/testminmax/testminmax.par +/tests/testminmax/testminmax.std +/tests/tiny_ad_fe/admodel.cov +/tests/tiny_ad_fe/admodel.dep +/tests/tiny_ad_fe/admodel.hes +/tests/tiny_ad_fe/fmin.log +/tests/tiny_ad_fe/tiny_ad_fe +/tests/tiny_ad_fe/tiny_ad_fe.bar +/tests/tiny_ad_fe/tiny_ad_fe.cor +/tests/tiny_ad_fe/tiny_ad_fe.cpp +/tests/tiny_ad_fe/tiny_ad_fe.eva +/tests/tiny_ad_fe/tiny_ad_fe.htp +/tests/tiny_ad_fe/tiny_ad_fe.log +/tests/tiny_ad_fe/tiny_ad_fe.obj +/tests/tiny_ad_fe/tiny_ad_fe.par +/tests/tiny_ad_fe/tiny_ad_fe.std +/tests/tiny_ad_re/admodel.cov +/tests/tiny_ad_re/admodel.dep +/tests/tiny_ad_re/admodel.hes +/tests/tiny_ad_re/fmin.log +/tests/tiny_ad_re/hesscheck +/tests/tiny_ad_re/hessian.bin +/tests/tiny_ad_re/tiny_ad_re +/tests/tiny_ad_re/tiny_ad_re.bar +/tests/tiny_ad_re/tiny_ad_re.bgs +/tests/tiny_ad_re/tiny_ad_re.cor +/tests/tiny_ad_re/tiny_ad_re.cpp +/tests/tiny_ad_re/tiny_ad_re.eva +/tests/tiny_ad_re/tiny_ad_re.htp +/tests/tiny_ad_re/tiny_ad_re.log +/tests/tiny_ad_re/tiny_ad_re.luu +/tests/tiny_ad_re/tiny_ad_re.obj +/tests/tiny_ad_re/tiny_ad_re.par +/tests/tiny_ad_re/tiny_ad_re.rhes +/tests/tiny_ad_re/tiny_ad_re.std +/tests/tinyfun/admodel.cov +/tests/tinyfun/admodel.dep +/tests/tinyfun/admodel.hes +/tests/tinyfun/fmin.log +/tests/tinyfun/tinyfun +/tests/tinyfun/tinyfun.bar +/tests/tinyfun/tinyfun.cor +/tests/tinyfun/tinyfun.cpp +/tests/tinyfun/tinyfun.eva +/tests/tinyfun/tinyfun.htp +/tests/tinyfun/tinyfun.log +/tests/tinyfun/tinyfun.obj +/tests/tinyfun/tinyfun.par +/tests/tinyfun/tinyfun.std +/tests/vectorize/admodel.cov +/tests/vectorize/admodel.dep +/tests/vectorize/admodel.hes +/tests/vectorize/fmin.log +/tests/vectorize/vectorize +/tests/vectorize/vectorize.bar +/tests/vectorize/vectorize.cor +/tests/vectorize/vectorize.cpp +/tests/vectorize/vectorize.eva +/tests/vectorize/vectorize.htp +/tests/vectorize/vectorize.log +/tests/vectorize/vectorize.obj +/tests/vectorize/vectorize.par +/tests/vectorize/vectorize.std +/tests/vonmises/admodel.cov +/tests/vonmises/admodel.dep +/tests/vonmises/admodel.hes +/tests/vonmises/fmin.log +/tests/vonmises/vonmises +/tests/vonmises/vonmises.bar +/tests/vonmises/vonmises.cor +/tests/vonmises/vonmises.cpp +/tests/vonmises/vonmises.eva +/tests/vonmises/vonmises.htp +/tests/vonmises/vonmises.log +/tests/vonmises/vonmises.obj +/tests/vonmises/vonmises.par +/tests/vonmises/vonmises.std diff --git a/contrib/GNUmakefile b/contrib/GNUmakefile index c24002f4d..2b085ebc0 100644 --- a/contrib/GNUmakefile +++ b/contrib/GNUmakefile @@ -30,9 +30,9 @@ ifeq ($(CMDSHELL),cmd) ifeq ($(CXX),g++) ifeq ($(findstring g++.exe,$(shell where g++.exe 2>&1 | findstr g++.exe)),g++.exe) ifeq ($(findstring x86_64,$(shell g++ -dumpmachine)),x86_64) - OSNAME=mingw64 + OSNAME=-mingw64 else - OSNAME=mingw32 + OSNAME=-mingw32 endif CXXVERSION=-g++$(basename $(basename $(shell g++ -dumpversion))) endif @@ -42,16 +42,16 @@ ifeq ($(CMDSHELL),cmd) $(warning "Warning: Unable to find clang++ compiler.") endif ifeq ($(findstring x86_64,$(shell $(CXX) -dumpmachine)),x86_64) - OSNAME=win64 + OSNAME=-win64 else - OSNAME=win32 + OSNAME=-win32 endif CXXVERSION=-clang++$(basename $(basename $(shell $(CXX) -dumpversion))) endif ifeq ($(DEBUG),yes) - CONTRIB_OBJS_DIR:=$(CONTRIB_OBJS_DIR)\$(OSNAME)$(CXXVERSION)-debug + CONTRIB_OBJS_DIR:=$(CONTRIB_OBJS_DIR)$(OSNAME)$(CXXVERSION)-debug else - CONTRIB_OBJS_DIR:=$(CONTRIB_OBJS_DIR)\$(OSNAME)$(CXXVERSION) + CONTRIB_OBJS_DIR:=$(CONTRIB_OBJS_DIR)$(OSNAME)$(CXXVERSION) endif CONTRIB_BIN=$(addsuffix \bin,$(CONTRIB_DIR)) CONTRIB_INCLUDE=$(addsuffix \include,$(CONTRIB_DIR)) @@ -64,46 +64,44 @@ else endif ifeq ($(UNAME_S),Linux) ifeq (i686,$(findstring i686,$(shell $(CXX) -dumpmachine))) - OSNAME=i686-linux + OSNAME=-i686-linux else - OSNAME=x86_64-linux + OSNAME=-x86_64-linux endif endif ifeq ($(UNAME_S),Darwin) ifeq (i686,$(findstring i686,$(shell $(CXX) -dumpmachine))) - OSNAME=i686-macos + OSNAME=-i686-macos else - OSNAME=x86_64-macos + OSNAME=-x86_64-macos endif endif ifeq ($(findstring _NT,$(UNAME_S)),_NT) ifeq ($(CXX),g++) ifeq ($(findstring g++.exe,$(shell where g++.exe 2>&1 | findstr g++.exe)),g++.exe) ifeq ($(findstring x86_64,$(shell g++ -dumpmachine)),x86_64) - OSNAME=mingw64 + OSNAME=-mingw64 else - OSNAME=mingw32 + OSNAME=-mingw32 endif endif endif ifeq ($(CXX),clang++) ifeq ($(findstring x86_64,$(shell clang++ -dumpmachine)),x86_64) - OSNAME=win64 + OSNAME=-win64 else - OSNAME=win32 + OSNAME=-win32 endif endif endif ifeq ($(CXX),g++) ifeq ($(UNAME_S),Darwin) - ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) - CXXVERSION=-clang11 + ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) + CXXVERSION=-clang10 + else ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) + CXXVERSION=-clang11 else - ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) - CXXVERSION=-clang10 - else - CXXVERSION=-clang - endif + CXXVERSION=-clang endif else CXXVERSION=-g++$(basename $(basename $(shell $(CXX) -dumpversion))) @@ -111,14 +109,12 @@ else endif ifeq ($(CXX),clang++) ifeq ($(UNAME_S),Darwin) - ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) - CXXVERSION=-clang11 + ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) + CXXVERSION=-clang10 + else ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) + CXXVERSION=-clang11 else - ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) - CXXVERSION=-clang10 - else - CXXVERSION=-clang - endif + CXXVERSION=-clang endif else CXXVERSION=-clang++$(basename $(basename $(shell $(CXX) -dumpversion))) @@ -126,14 +122,12 @@ else endif ifeq ($(CXX),c++) ifeq ($(UNAME_S),Darwin) - ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) - CXXVERSION=-clang11 + ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) + CXXVERSION=-clang10 + else ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) + CXXVERSION=-clang11 else - ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) - CXXVERSION=-clang10 - else - CXXVERSION=-clang - endif + CXXVERSION=-clang endif else CXXVERSION=-c++$(basename $(basename $(shell $(CXX) -dumpversion))) @@ -147,9 +141,9 @@ else endif CONTRIB_DIR=../../build/$(ADMB_VER)/ ifeq ($(DEBUG),yes) - CONTRIB_OBJS_PREFIX=build/objects/$(OSNAME)$(CXXVERSION)$(SHARED)-debug + CONTRIB_OBJS_PREFIX=build/objects$(OSNAME)$(CXXVERSION)$(SHARED)-debug else - CONTRIB_OBJS_PREFIX=build/objects/$(OSNAME)$(CXXVERSION)$(SHARED) + CONTRIB_OBJS_PREFIX=build/objects$(OSNAME)$(CXXVERSION)$(SHARED) endif CONTRIB_OBJS_DIR=../../$(CONTRIB_OBJS_PREFIX) CONTRIB_BIN=$(addsuffix bin/,$(CONTRIB_DIR)) @@ -171,39 +165,39 @@ all: shared: libs ifeq ($(DEBUG),yes) ifeq ($(CMDSHELL),cmd) - $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contrib$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contrib-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contrib$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contrib$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive ifndef SAFE_ONLY - $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contribo$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contribo-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contribo$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contribo$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive endif else ifeq (clang,$(findstring clang,$(shell $(CXX) --version))) - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION)-shared-debug.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION)-shared-debug.a ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION)-shared-debug.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION)-shared-debug.a endif else - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive endif endif endif else ifeq ($(CMDSHELL),cmd) - $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contrib$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contrib-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contrib$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contrib$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive ifndef SAFE_ONLY - $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contribo$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contribo-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\$(ADMB_VER)\lib\admb-contribo$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\$(ADMB_VER)\lib\libadmb-contribo$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive endif else ifeq (clang,$(findstring clang,$(shell $(CXX) --version))) - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION)-shared.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION)-shared.a ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION)-shared.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION)-shared.a endif else - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contrib-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contrib$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contribo-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-contribo$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive endif endif endif @@ -223,69 +217,74 @@ libs: contrib-libs: contrib-ecolib contrib-gdbprintlib contrib-qfclib contrib-statslib contrib-src ifeq ($(CMDSHELL),cmd) ifeq ($(DEBUG),yes) - if exist "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" del "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" - copy "src\$(CONTRIB_LIB)\libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" - $(AR) -rs "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "..\build\objects\$(OSNAME)$(CXXVERSION)-debug\saflp-contrib-*.obj" + if exist "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" del "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" + copy "src\$(CONTRIB_LIB)\libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" + $(AR) -rs "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "..\build\objects$(OSNAME)$(CXXVERSION)-debug\saflp-contrib-*.obj" ifndef SAFE_ONLY - if exist "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" del "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" - copy "src\$(CONTRIB_LIB)\libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" - $(AR) -rs "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "..\build\objects\$(OSNAME)$(CXXVERSION)-debug\optlp-contrib-*.obj" + if exist "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" del "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" + copy "src\$(CONTRIB_LIB)\libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" + $(AR) -rs "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a" "..\build\objects$(OSNAME)$(CXXVERSION)-debug\optlp-contrib-*.obj" endif else - if exist "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a" del "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a" - copy "src\$(CONTRIB_LIB)\libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a" "src\$(CONTRIB_LIB)\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a" - cd ..\build && $(AR) -rs "admb\lib\libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a" "objects\$(OSNAME)$(CXXVERSION)\saflp-contrib-*.obj" + if exist "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a" del "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a" + copy "src\$(CONTRIB_LIB)\libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a" "src\$(CONTRIB_LIB)\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a" + cd ..\build && $(AR) -rs "admb\lib\libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a" "objects$(OSNAME)$(CXXVERSION)\saflp-contrib-*.obj" ifndef SAFE_ONLY - if exist "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a" del "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a" - copy "src\$(CONTRIB_LIB)\libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a" "src\$(CONTRIB_LIB)\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a" - $(AR) -rs ..\build\$(ADMB_VER)\lib\libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a "..\build\objects\$(OSNAME)$(CXXVERSION)\optlp-contrib-*.obj" + if exist "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a" del "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a" + copy "src\$(CONTRIB_LIB)\libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a" "src\$(CONTRIB_LIB)\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a" + $(AR) -rs ..\build\$(ADMB_VER)\lib\libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a "..\build\objects$(OSNAME)$(CXXVERSION)\optlp-contrib-*.obj" endif endif else ifeq ($(DEBUG),yes) ifdef SHARED - rm -vf src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - cp -vf src/$(CONTRIB_LIB)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + cp -vf src/$(CONTRIB_LIB)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj ifndef SAFE_ONLY - rm -vf src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - cp -vf src/$(CONTRIB_LIB)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + cp -vf src/$(CONTRIB_LIB)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj endif else - rm -vf src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - cp -vf src/$(CONTRIB_LIB)libadmb-$(OSNAME)$(CXXVERSION)-debug.a src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + cp -vf src/$(CONTRIB_LIB)libadmb$(OSNAME)$(CXXVERSION)-debug.a src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj ifndef SAFE_ONLY - rm -vf src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - cp -vf src/$(CONTRIB_LIB)libadmbo-$(OSNAME)$(CXXVERSION)-debug.a src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + cp -vf src/$(CONTRIB_LIB)libadmbo$(OSNAME)$(CXXVERSION)-debug.a src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj endif endif else ifdef SHARED - rm -vf src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a - cp -vf src/$(CONTRIB_LIB)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a + cp -vf src/$(CONTRIB_LIB)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj ifndef SAFE_ONLY - rm -vf src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a - cp -vf src/$(CONTRIB_LIB)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a + cp -vf src/$(CONTRIB_LIB)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj endif else - rm -vf src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a - cp -vf src/$(CONTRIB_LIB)libadmb-$(OSNAME)$(CXXVERSION).a src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib-$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a + cp -vf src/$(CONTRIB_LIB)libadmb$(OSNAME)$(CXXVERSION).a src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contrib$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/saflp-contrib-*.obj ifndef SAFE_ONLY - rm -vf src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a - cp -vf src/$(CONTRIB_LIB)libadmbo-$(OSNAME)$(CXXVERSION).a src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a - $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo-$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj + rm -vf src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a + cp -vf src/$(CONTRIB_LIB)libadmbo$(OSNAME)$(CXXVERSION).a src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a + $(AR) -rs src/$(CONTRIB_LIB)libadmb-contribo$(OSNAME)$(CXXVERSION)$(SHARED).a ../$(CONTRIB_OBJS_PREFIX)/optlp-contrib-*.obj endif endif endif endif contrib-ad2csv: contrib-dirs +ifeq ($(CMDSHELL),cmd) + if not exist ..\build\ad2csv md ..\build\ad2csv +else + mkdir -p ../build/ad2csv +endif $(MAKE) --directory=ad2csv CXXFLAGS= LDFLAGS= OPTION=$(OPTION) CONTRIB_BIN=$(CONTRIB_BIN) contrib-ecolib: diff --git a/contrib/Makefile b/contrib/Makefile index f4255ef13..c299360c0 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -55,8 +55,8 @@ contrib-libs: contrib-ecolib contrib-gdbprintlib contrib-qfclib contrib-statslib !ENDIF contrib-ad2csv: + if not exist ..\build\ad2csv md ..\build\ad2csv pushd ad2csv& $(MAKE) /nologo - copy ad2csv\ad2csv.exe $(DESTDIR)\bin contrib-ecolib: pushd ecolib& $(MAKE) /nologo diff --git a/contrib/ad2csv/GNUmakefile b/contrib/ad2csv/GNUmakefile index d7402fae6..529c3d733 100644 --- a/contrib/ad2csv/GNUmakefile +++ b/contrib/ad2csv/GNUmakefile @@ -13,16 +13,16 @@ ifeq ($(OS),Windows_NT) endif endif -OPTION=-f - ifeq ($(CMDSHELL),cmd) -$(CONTRIB_BIN)\ad2csv.exe: ad2csv.cpp main.cpp - ..\..\admb.cmd $(OPTION) $^ - copy ad2csv.exe $@ +$(CONTRIB_BIN)ad2csv.exe: ad2csv.cpp main.cpp + ..\..\admb.cmd $(OPTION) -c -o ..\..\build\ad2csv\main.obj main.cpp + ..\..\admb.cmd $(OPTION) -c -o ..\..\build\ad2csv\ad2csv.obj ad2csv.cpp + ..\..\admb.cmd $(OPTION) -o $@ ..\..\build\ad2csv\ad2csv.obj ..\..\build\ad2csv\main.obj else $(CONTRIB_BIN)ad2csv: ad2csv.cpp main.cpp - ../../admb$(EXT) $(OPTION) $^ - cp ad2csv $@ + ../../admb$(EXT) $(OPTION) -c -o ../../build/ad2csv/ad2csv.obj ad2csv.cpp + ../../admb$(EXT) $(OPTION) -c -o ../../build/ad2csv/main.obj main.cpp + ../../admb$(EXT) $(OPTION) -o $@ ../../build/ad2csv/ad2csv.obj ../../build/ad2csv/main.obj endif clean: diff --git a/contrib/ad2csv/Makefile b/contrib/ad2csv/Makefile index b2725e599..8c20597e0 100644 --- a/contrib/ad2csv/Makefile +++ b/contrib/ad2csv/Makefile @@ -1,8 +1,12 @@ all: !IF DEFINED(DEBUG) - ..\..\admb.cmd -g ad2csv.cpp main.cpp + ..\..\admb.cmd -g -c -o ..\..\build\ad2csv\ad2csv.obj ad2csv.cpp + ..\..\admb.cmd -g -c -o ..\..\build\ad2csv\main.obj main.cpp + ..\..\admb.cmd -g -o ..\..\build\admb\bin\ad2csv.exe ..\..\build\ad2csv\ad2csv.obj ..\..\build\ad2csv\main.obj !ELSE - ..\..\admb.cmd ad2csv.cpp main.cpp + ..\..\admb.cmd -c -o ..\..\build\ad2csv\ad2csv.obj ad2csv.cpp + ..\..\admb.cmd -c -o ..\..\build\ad2csv\main.obj main.cpp + ..\..\admb.cmd -o ..\..\build\admb\bin\ad2csv.exe ..\..\build\ad2csv\ad2csv.obj ..\..\build\ad2csv\main.obj !ENDIF clean: diff --git a/contrib/admb-rules.mak b/contrib/admb-rules.mak index 2f9d7fbd3..bb9c10c45 100644 --- a/contrib/admb-rules.mak +++ b/contrib/admb-rules.mak @@ -31,20 +31,16 @@ endif $(SAFE_PREFIX)%.obj: %.cpp ifeq ($(CMDSHELL),cmd) - ..\..\admb.cmd -c $(OPTION) $< - copy $(basename $<).obj "$@" + ..\..\admb.cmd -c $(OPTION) -o "$@" $< else - ../../admb$(EXT) -c $(OPTION) $< - cp $(basename $<).obj $@ + ../../admb$(EXT) -c $(OPTION) -o $@ $< endif $(OPT_PREFIX)%.obj: %.cpp ifeq ($(CMDSHELL),cmd) - ..\..\admb.cmd -c -f $(OPTION) $< - copy $(basename $<).obj "$@" + ..\..\admb.cmd -c -f $(OPTION) -o "$@" $< else - ../../admb$(EXT) -c -f $(OPTION) $< - cp $(basename $<).obj $@ + ../../admb$(EXT) -c -f $(OPTION) -o $@ $< endif includes: diff --git a/contrib/ecolib/Makefile b/contrib/ecolib/Makefile index 118a0b822..f5ed8bab9 100644 --- a/contrib/ecolib/Makefile +++ b/contrib/ecolib/Makefile @@ -41,19 +41,17 @@ all: $(OPT) $(SAF) $(OPT):: $(@B:contrib-optlp-ecolib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c -f $? + ..\..\admb -c -f -o $@ $? !ELSE - ..\..\admb -c -f -g $? + ..\..\admb -c -f -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ $(SAF):: $(@B:contrib-saflp-ecolib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c $? + ..\..\admb -c -o $@ $? !ELSE - ..\..\admb -c -g $? + ..\..\admb -c -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ includes: $(HEADERS) copy $(HEADERS) $(CONTRIB_INCLUDE) diff --git a/contrib/gdbprintlib/Makefile b/contrib/gdbprintlib/Makefile index f912e1ac9..c0a13711b 100644 --- a/contrib/gdbprintlib/Makefile +++ b/contrib/gdbprintlib/Makefile @@ -41,20 +41,17 @@ all: $(OPT) $(SAF) $(OPT):: $(@B:contrib-optlp-gdbprintlib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c -g -f $? + ..\..\admb -c -g -f -o $@ $? !ELSE - ..\..\admb -c -f $? + ..\..\admb -c -f -o $@ $? !ENDIf - copy $(?:.cpp=.obj) $@ - $(SAF):: $(@B:contrib-saflp-gdbprintlib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c -g $? + ..\..\admb -c -g -o $@ $? !ELSE - ..\..\admb -c $? + ..\..\admb -c -o $@ $? !ENDIf - copy $(?:.cpp=.obj) $@ includes: $(HEADERS) for %%a in ($(HEADERS)) do copy %%a $(CONTRIB_INCLUDE) diff --git a/contrib/qfclib/Makefile b/contrib/qfclib/Makefile index 74946046d..e8ba9efad 100644 --- a/contrib/qfclib/Makefile +++ b/contrib/qfclib/Makefile @@ -41,19 +41,17 @@ all: $(OPT) $(SAF) $(OPT):: $(@B:contrib-optlp-qfclib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c -f $? + ..\..\admb -c -f -o $@ $? !ELSE - ..\..\admb -c -f -g $? + ..\..\admb -c -f -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ $(SAF):: $(@B:contrib-saflp-qfclib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c $? + ..\..\admb -c -o $@ $? !ELSE - ..\..\admb -c -g $? + ..\..\admb -c -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ includes: $(HEADERS) copy $(HEADERS) $(CONTRIB_INCLUDE) diff --git a/contrib/src/Makefile b/contrib/src/Makefile index d1fddfcbe..ce277995b 100644 --- a/contrib/src/Makefile +++ b/contrib/src/Makefile @@ -41,19 +41,17 @@ all: $(OPT) $(SAF) $(OPT):: $(@B:contrib-optlp-src-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c -f $? + ..\..\admb -c -f -o $@ $? !ELSE - ..\..\admb -c -f -g $? + ..\..\admb -c -f -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ $(SAF):: $(@B:contrib-saflp-src-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c $? + ..\..\admb -c -o $@ $? !ELSE - ..\..\admb -c -g $? + ..\..\admb -c -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ includes: $(HEADERS) copy $(HEADERS) $(CONTRIB_INCLUDE) diff --git a/contrib/statslib/Makefile b/contrib/statslib/Makefile index 8cd7c49c9..d15364a64 100644 --- a/contrib/statslib/Makefile +++ b/contrib/statslib/Makefile @@ -41,21 +41,17 @@ all: $(OPT) $(SAF) $(OPT):: $(@B:contrib-optlp-statslib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c -f $? + ..\..\admb -c -f -o $@ $? !ELSE - ..\..\admb -c -f -g $? + ..\..\admb -c -f -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ - $(SAF):: $(@B:contrib-saflp-statslib-=).cpp !IF DEFINED(DEBUG) - ..\..\admb -c $? + ..\..\admb -c -o $@ $? !ELSE - ..\..\admb -c -g $? + ..\..\admb -c -g -o $@ $? !ENDIF - copy $(?:.cpp=.obj) $@ - includes: $(HEADERS) copy $(HEADERS) $(CONTRIB_INCLUDE) diff --git a/scripts/admb/admb b/scripts/admb/admb index 4d1deb711..56b809de4 100755 --- a/scripts/admb/admb +++ b/scripts/admb/admb @@ -103,17 +103,16 @@ nontpls= for file in $* do - extension="${file#*.}" - if [ "$extension" = "$file" ]; then - tpls="$tpls $file" - elif [ "$extension" = "tpl" ]; then + if [ "${file: -4}" = ".tpl" ]; then tpls="$tpls ${file%.*}" - elif [ "$extension" = "cpp" -o "$extension" = "c" -o "$extension" = "cc" -o "$extension" = "cxx" ]; then + elif [ "${file: -4}" = ".cpp" -o "${file: -2}" = ".c" -o "${file: -3}" = ".cc" -o "${file: -4}" = ".cxx" ]; then srcs="$srcs $file" nontpls="$nontpls $file" - elif [ "$extension" = "o" -o "$extension" = "obj" ]; then + elif [ "${file: -2}" = ".o" -o "${file: -4}" = ".obj" ]; then objs="$objs $file" nontpls="$nontpls $file" + else + tpls="$tpls $file" fi done if [ -z "$tpls" ]; then @@ -136,9 +135,9 @@ if [ "$UNAME_S" == "Linux" ]; then CXX=g++ fi if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=x86_64-linux + OS_NAME=-x86_64-linux else - OS_NAME=i686-linux + OS_NAME=-i686-linux fi fi if [ "$UNAME_S" == "Darwin" ]; then @@ -146,9 +145,9 @@ if [ "$UNAME_S" == "Darwin" ]; then CXX=c++ fi if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=x86_64-macos + OS_NAME=-x86_64-macos else - OS_NAME=i686-macos + OS_NAME=-i686-macos fi fi if [[ "$UNAME_S" =~ "_NT" ]]; then @@ -157,16 +156,16 @@ if [[ "$UNAME_S" =~ "_NT" ]]; then fi if [ "$CXX" == "clang++" ]; then if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=win64 + OS_NAME=-win64 else - OS_NAME=win32 + OS_NAME=-win32 fi fi if [ "$CXX" == "g++" ]; then if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=mingw64 + OS_NAME=-mingw64 else - OS_NAME=mingw32 + OS_NAME=-mingw32 fi fi fi @@ -289,6 +288,9 @@ elif [ "$CXX" == "g++" ]; then CXXFLAGS="-std=c++0x $CXXFLAGS" LDFLAGS="-std=c++0x $LDFLAGS" fi + elif [ "$GCCMAJVER" == "5" ]; then + CXXFLAGS="-std=c++11 $CXXFLAGS" + LDFLAGS="-std=c++11 $LDFLAGS" else CXXFLAGS="-std=c++14 $CXXFLAGS" LDFLAGS="-std=c++14 $LDFLAGS" @@ -298,7 +300,7 @@ CXXFLAGS="$CXXFLAGS -D_USE_MATH_DEFINES" if [ "$library" == "opt" ]; then CXXFLAGS="$CXXFLAGS -DOPT_LIB" fi -if [[ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" || -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]]; then +if [[ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" || -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]]; then CXXFLAGS="$CXXFLAGS -DUSE_ADMB_CONTRIBS -I. -I\"$ADMB_HOME/include\" -I\"$ADMB_HOME/include/contrib\"" else CXXFLAGS="$CXXFLAGS -I. -I\"$ADMB_HOME/include\"" @@ -348,8 +350,19 @@ do echo -e "\\nError: $file not found\\n" exit 1 fi - - fileobj=${file%.*}.obj + if [ ! -z "$compileonly" ]; then + if [ ! -z "$output" ]; then + if [ ${output: -4} == ".obj" ]; then + fileobj="$output" + else + fileobj="$output".obj + fi + else + fileobj=${file%.*}.obj + fi + else + fileobj=${file%.*}.obj + fi rm -f $fileobj CMD="$CXX -c $CXXFLAGS -o$fileobj $file" echo -e \\n\*\*\* Compile: $file\\n$CMD @@ -359,7 +372,11 @@ do echo -e "\\nError: Could not compile $file\\n" exit 1 fi - tplobjs="$tplobjs $fileobj" + if [ ! -z "$tplobjs" ]; then + tplobjs="$tplobjs $fileobj" + else + tplobjs="$fileobj" + fi done for file in $srcs @@ -368,7 +385,19 @@ do echo -e "\\nError: $file not found\\n" exit 1 fi - fileobj=${file%.*}.obj + if [ ! -z "$compileonly" ]; then + if [ ! -z "$output" ]; then + if [ ${output: -4} == ".obj" ]; then + fileobj="$output" + else + fileobj="$output".obj + fi + else + fileobj=${file%.*}.obj + fi + else + fileobj=${file%.*}.obj + fi rm -f $fileobj CMD="$CXX -c $CXXFLAGS -o$fileobj $file" echo -e \\n\*\*\* Compile: $file\\n$CMD @@ -385,11 +414,12 @@ do done if [ ! -z "$compileonly" ]; then - objects=$tplobjs if [ ! -z "$objs" ]; then objects=$objs + else + objects=$tplobjs fi - echo -e "\\nCompiled $objects.\\n" + echo -e "Compiled $objects\\n" exit 0 fi @@ -407,70 +437,70 @@ do fi CMD="$CMD $file $objs" if [ ! -z "$debug" ]; then - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED-debug.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED-debug.a\\n" exit 0 fi fi fi fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED.a\\n" exit 0 fi fi @@ -500,8 +530,7 @@ if [[ "$tplobjs" == "" ]]; then listobjs= for file in $nontpls do - extension="${file#*.}" - if [ "$extension" = "o" -o "$extension" = "obj" ]; then + if [ "${file: -2}" = ".o" -o "${file: -4}" = ".obj" ]; then listobjs="$listobjs $file" else listobjs="$listobjs ${file%.*}.obj" @@ -518,70 +547,70 @@ if [[ "$tplobjs" == "" ]]; then fi CMD="$CMD $listobjs" if [ ! -z "$debug" ]; then - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED-debug.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED-debug.a\\n" exit 0 fi fi fi fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED.a\\n" exit 0 fi fi diff --git a/scripts/admb/admb.bat b/scripts/admb/admb.bat index ccdd2c699..4d7fc6c79 100644 --- a/scripts/admb/admb.bat +++ b/scripts/admb/admb.bat @@ -52,6 +52,7 @@ if not defined ADMB_HOME ( set tpls= set srcs= set objs= +set output= for %%a in (%*) do ( set arg=%%a if "!arg:~0,1!"=="-" ( @@ -67,6 +68,9 @@ for %%a in (%*) do ( if "!arg!"=="-g" ( set g= -g ) + if "!arg!"=="-o" ( + set option_o= -o + ) if "!arg!"=="-r" ( set r = -r set parser=tpl2rem @@ -101,17 +105,33 @@ for %%a in (%*) do ( ) ) if "%%~xa"==".o" ( - if not defined objs ( - set objs=!arg! + if defined option_o ( + set output=!arg! + set option_o= ) else ( - set objs=!objs! !arg! + if not defined objs ( + set objs=!arg! + ) else ( + set objs=!objs! !arg! + ) ) ) if "%%~xa"==".obj" ( - if not defined objs ( - set objs=!arg! + if defined option_o ( + set output=!arg! + set option_o= ) else ( - set objs=!objs! !arg! + if not defined objs ( + set objs=!arg! + ) else ( + set objs=!objs! !arg! + ) + ) + ) + if "%%~xa"==".exe" ( + if defined option_o ( + set output=!arg! + set option_o= ) ) ) @@ -260,26 +280,10 @@ if "!CXX!"=="cl" ( ) for /f %%i in ('!CXX! -dumpversion ^| findstr /b 5.') do ( set CXXMAJORNUMBER=-g++5 - set STDCXX=-std=c++14 - ) - for /f %%i in ('!CXX! -dumpversion ^| findstr /b 6.') do ( - set CXXMAJORNUMBER=-g++6 - set STDCXX=-std=c++14 - ) - for /f %%i in ('!CXX! -dumpversion ^| findstr /b 7.') do ( - set CXXMAJORNUMBER=-g++7 - set STDCXX=-std=c++14 - ) - for /f %%i in ('!CXX! -dumpversion ^| findstr /b 8.') do ( - set CXXMAJORNUMBER=-g++8 - set STDCXX=-std=c++14 - ) - for /f %%i in ('!CXX! -dumpversion ^| findstr /b 9.') do ( - set CXXMAJORNUMBER=-g++9 - set STDCXX=-std=c++14 + set STDCXX=-std=c++11 ) - for /f %%i in ('!CXX! -dumpversion ^| findstr /b 10.') do ( - set CXXMAJORNUMBER=-g++10 + for /f "tokens=1,2,3 delims=." %%i in ('!CXX! -dumpversion') do ( + set CXXMAJORNUMBER=-g++%%i set STDCXX=-std=c++14 ) ) @@ -515,7 +519,11 @@ for %%b in (!tpls!) do ( set tpl=%%~nb @REM set CMD=adcomp!d!!g!!r!!fast! !tpl! if "!CXX!"=="cl" ( - set CMD=!CXX!!CXXFLAGS! /Fo!tpl!.obj !tpl!.cpp + if defined output ( + set CMD=!CXX!!CXXFLAGS! /Fo!output! !tpl!.cpp + ) else ( + set CMD=!CXX!!CXXFLAGS! /Fo!tpl!.obj !tpl!.cpp + ) ) else ( set CMD=!CXX!!CXXFLAGS! -o !tpl!.obj !tpl!.cpp ) @@ -538,28 +546,49 @@ if defined srcs ( set filename=%%~na @REM set CMD=adcomp!d!!g!!r!!fast! !src! if "!CXX!"=="cl" ( - set CMD=!CXX!!CXXFLAGS! /Fo!filename!.obj !filename!.cpp + if defined output ( + set CMD=!CXX!!CXXFLAGS! /Fo!output! !filename!.cpp + ) else ( + set CMD=!CXX!!CXXFLAGS! /Fo!filename!.obj !filename!.cpp + ) ) else ( - set CMD=!CXX!!CXXFLAGS! -o !filename!.obj !filename!.cpp + if defined output ( + set CMD=!CXX!!CXXFLAGS! -o !output! !filename!.cpp + ) else ( + set CMD=!CXX!!CXXFLAGS! -o !filename!.obj !filename!.cpp + ) ) echo.&echo *** Compile: !src! echo !CMD! call !CMD! - if not exist !filename!.obj ( - echo.&echo Error: Unable to build !src! to !filename!.obj - goto ERROR + if defined output ( + if not exist !output! ( + echo.&echo Error: Unable to build !src! to !output! + goto ERROR + ) else ( + if not defined objs ( + set objs=!output! + ) else ( + set objs=!objs! !output! + ) + ) ) else ( - if not defined objs ( - set objs=!filename!.obj + if not exist !filename!.obj ( + echo.&echo Error: Unable to build !src! to !filename!.obj + goto ERROR ) else ( - set objs=!objs! !filename!.obj + if not defined objs ( + set objs=!filename!.obj + ) else ( + set objs=!objs! !filename!.obj + ) ) ) ) ) :linker if defined compileonly ( - echo.&echo Compiled !objs!. + echo.&echo Compiled !objs! goto EOF ) if not defined tpls ( @@ -580,7 +609,11 @@ if not defined tpls ( set CMD=!LD!!LDFLAGS! -o !main!.dll !objs! !libs! ) else ( if "!CXX!"=="cl" ( - set CMD=!LD!!LDFLAGS! /nologo /Fe!main!.exe !objs! !libs! + if defined output ( + set CMD=!LD!!LDFLAGS! /nologo /Fe!output! !objs! !libs! + ) else ( + set CMD=!LD!!LDFLAGS! /nologo /Fe!main!.exe !objs! !libs! + ) ) else ( set CMD=!LD!!LDFLAGS! -o !main!.exe !objs! !libs! ) @@ -589,16 +622,30 @@ if not defined tpls ( echo !CMD! call !CMD! || goto ERROR if defined d ( - if not exist !main!.dll ( - goto ERROR - ) - echo.&echo Successfully built '!main!.dll'. + if defined output ( + if not exist !output! ( + goto ERROR + ) + echo.&echo Successfully built '!output!'. + ) else ( + if not exist !main!.dll ( + goto ERROR + ) + echo.&echo Successfully built '!main!.dll'. + ) goto SUCCESS ) else ( - if not exist !main!.exe ( - goto ERROR + if defined output ( + if not exist !output! ( + goto ERROR + ) + echo.&echo Successfully built '!output!'. + ) else ( + if not exist !main!.exe ( + goto ERROR + ) + echo.&echo Successfully built '!main!.exe'. ) - echo.&echo Successfully built '!main!.exe'. goto EOF ) ) @@ -620,7 +667,11 @@ if not defined tpls ( ) else ( if "!CXX!"=="cl" ( if defined objs ( - set CMD=!LD!!LDFLAGS! /nologo /Fe!tpl!.exe !tpl!.obj !objs! !libs! + if defined output ( + set CMD=!LD!!LDFLAGS! /nologo /Fe!output! !tpl!.obj !objs! !libs! + ) else ( + set CMD=!LD!!LDFLAGS! /nologo /Fe!tpl!.exe !tpl!.obj !objs! !libs! + ) ) else ( set CMD=!LD!!LDFLAGS! /nologo /Fe!tpl!.exe !tpl!.obj !libs! ) diff --git a/scripts/admb/admb.sh b/scripts/admb/admb.sh index 30212994e..593870b14 100644 --- a/scripts/admb/admb.sh +++ b/scripts/admb/admb.sh @@ -103,17 +103,16 @@ nontpls= for file in $* do - extension="${file#*.}" - if [ "$extension" = "$file" ]; then - tpls="$tpls $file" - elif [ "$extension" = "tpl" ]; then + if [ "${file: -4}" = ".tpl" ]; then tpls="$tpls ${file%.*}" - elif [ "$extension" = "cpp" -o "$extension" = "c" -o "$extension" = "cc" -o "$extension" = "cxx" ]; then + elif [ "${file: -4}" = ".cpp" -o "${file: -2}" = ".c" -o "${file: -3}" = ".cc" -o "${file: -4}" = ".cxx" ]; then srcs="$srcs $file" nontpls="$nontpls $file" - elif [ "$extension" = "o" -o "$extension" = "obj" ]; then + elif [ "${file: -2}" = ".o" -o "${file: -4}" = ".obj" ]; then objs="$objs $file" nontpls="$nontpls $file" + else + tpls="$tpls $file" fi done if [ -z "$tpls" ]; then @@ -136,9 +135,9 @@ if [ "$UNAME_S" == "Linux" ]; then CXX=g++ fi if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=x86_64-linux + OS_NAME=-x86_64-linux else - OS_NAME=i686-linux + OS_NAME=-i686-linux fi fi if [ "$UNAME_S" == "Darwin" ]; then @@ -146,9 +145,9 @@ if [ "$UNAME_S" == "Darwin" ]; then CXX=c++ fi if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=x86_64-macos + OS_NAME=-x86_64-macos else - OS_NAME=i686-macos + OS_NAME=-i686-macos fi fi if [[ "$UNAME_S" =~ "_NT" ]]; then @@ -157,16 +156,16 @@ if [[ "$UNAME_S" =~ "_NT" ]]; then fi if [ "$CXX" == "clang++" ]; then if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=win64 + OS_NAME=-win64 else - OS_NAME=win32 + OS_NAME=-win32 fi fi if [ "$CXX" == "g++" ]; then if [[ "`$CXX -dumpmachine`" =~ "x86_64" ]]; then - OS_NAME=mingw64 + OS_NAME=-mingw64 else - OS_NAME=mingw32 + OS_NAME=-mingw32 fi fi fi @@ -289,6 +288,9 @@ elif [ "$CXX" == "g++" ]; then CXXFLAGS="-std=c++0x $CXXFLAGS" LDFLAGS="-std=c++0x $LDFLAGS" fi + elif [ "$GCCMAJVER" == "5" ]; then + CXXFLAGS="-std=c++11 $CXXFLAGS" + LDFLAGS="-std=c++11 $LDFLAGS" else CXXFLAGS="-std=c++14 $CXXFLAGS" LDFLAGS="-std=c++14 $LDFLAGS" @@ -298,7 +300,7 @@ CXXFLAGS="$CXXFLAGS -D_USE_MATH_DEFINES" if [ "$library" == "opt" ]; then CXXFLAGS="$CXXFLAGS -DOPT_LIB" fi -if [[ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" || -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]]; then +if [[ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" || -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]]; then CXXFLAGS="$CXXFLAGS -DUSE_ADMB_CONTRIBS -I. -I\"$ADMB_HOME/include\" -I\"$ADMB_HOME/include/contrib\"" else CXXFLAGS="$CXXFLAGS -I. -I\"$ADMB_HOME/include\"" @@ -348,8 +350,19 @@ do echo -e "\\nError: $file not found\\n" exit 1 fi - - fileobj=${file%.*}.obj + if [ ! -z "$compileonly" ]; then + if [ ! -z "$output" ]; then + if [ ${output: -4} == ".obj" ]; then + fileobj="$output" + else + fileobj="$output".obj + fi + else + fileobj=${file%.*}.obj + fi + else + fileobj=${file%.*}.obj + fi rm -f $fileobj CMD="$CXX -c $CXXFLAGS -o$fileobj $file" echo -e \\n\*\*\* Compile: $file\\n$CMD @@ -359,7 +372,11 @@ do echo -e "\\nError: Could not compile $file\\n" exit 1 fi - tplobjs="$tplobjs $fileobj" + if [ ! -z "$tplobjs" ]; then + tplobjs="$tplobjs $fileobj" + else + tplobjs="$fileobj" + fi done for file in $srcs @@ -368,7 +385,19 @@ do echo -e "\\nError: $file not found\\n" exit 1 fi - fileobj=${file%.*}.obj + if [ ! -z "$compileonly" ]; then + if [ ! -z "$output" ]; then + if [ ${output: -4} == ".obj" ]; then + fileobj="$output" + else + fileobj="$output".obj + fi + else + fileobj=${file%.*}.obj + fi + else + fileobj=${file%.*}.obj + fi rm -f $fileobj CMD="$CXX -c $CXXFLAGS -o$fileobj $file" echo -e \\n\*\*\* Compile: $file\\n$CMD @@ -385,11 +414,12 @@ do done if [ ! -z "$compileonly" ]; then - objects=$tplobjs if [ ! -z "$objs" ]; then objects=$objs + else + objects=$tplobjs fi - echo -e "\\nCompiled $objects.\\n" + echo -e "Compiled $objects\\n" exit 0 fi @@ -407,70 +437,70 @@ do fi CMD="$CMD $file $objs" if [ ! -z "$debug" ]; then - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED-debug.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED-debug.a\\n" exit 0 fi fi fi fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED.a\\n" exit 0 fi fi @@ -500,8 +530,7 @@ if [[ "$tplobjs" == "" ]]; then listobjs= for file in $nontpls do - extension="${file#*.}" - if [ "$extension" = "o" -o "$extension" = "obj" ]; then + if [ "${file: -2}" = ".o" -o "${file: -4}" = ".obj" ]; then listobjs="$listobjs $file" else listobjs="$listobjs ${file%.*}.obj" @@ -518,70 +547,70 @@ if [[ "$tplobjs" == "" ]]; then fi CMD="$CMD $listobjs" if [ ! -z "$debug" ]; then - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED-debug.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED-debug.a\\n" exit 0 fi fi fi fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contribo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb-contrib$CXXVERSION$SHARED-debug.a\"" fi else - if [ -f "$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a" ]; then + if [ -f "$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a" ]; then if [[ "$library" == "opt" ]]; then - CMD="$CMD \"$ADMB_HOME/lib/libadmbo-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmbo$CXXVERSION$SHARED-debug.a\"" else - CMD="$CMD \"$ADMB_HOME/lib/libadmb-$CXXVERSION$SHARED-debug.a\"" + CMD="$CMD \"$ADMB_HOME/lib/libadmb$CXXVERSION$SHARED-debug.a\"" fi else - echo -e "\\nError: Unable to find libadmb-contrib-$CXXVERSION$SHARED.a\\n" + echo -e "\\nError: Unable to find libadmb-contrib$CXXVERSION$SHARED.a\\n" exit 0 fi fi diff --git a/src/GNUmakefile b/src/GNUmakefile index c283476a8..5cb9781e2 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -32,9 +32,9 @@ ifeq ($(CMDSHELL),cmd) ifeq ($(CXX),g++) ifeq ($(findstring g++.exe,$(shell where g++.exe 2>&1 | findstr g++.exe)),g++.exe) ifeq ($(findstring x86_64,$(shell g++ -dumpmachine)),x86_64) - OSNAME=mingw64 + OSNAME=-mingw64 else - OSNAME=mingw32 + OSNAME=-mingw32 endif CXXVERSION=-g++$(basename $(basename $(shell g++ -dumpversion))) endif @@ -44,16 +44,16 @@ ifeq ($(CMDSHELL),cmd) $(warning "Warning: Unable to find clang++ compiler.") endif ifeq ($(findstring x86_64,$(shell $(CXX) -dumpmachine)),x86_64) - OSNAME=win64 + OSNAME=-win64 else - OSNAME=win32 + OSNAME=-win32 endif CXXVERSION=-clang++$(basename $(basename $(shell $(CXX) -dumpversion))) endif ifdef SHARED - OBJSDIR:=$(addsuffix \$(OSNAME)$(CXXVERSION)-shared,$(OBJSDIR)) + OBJSDIR:=$(addsuffix $(OSNAME)$(CXXVERSION)-shared,$(OBJSDIR)) else - OBJSDIR:=$(addsuffix \$(OSNAME)$(CXXVERSION),$(OBJSDIR)) + OBJSDIR:=$(addsuffix $(OSNAME)$(CXXVERSION),$(OBJSDIR)) endif ifdef DEBUG OBJSDIR:=$(addsuffix -debug,$(OBJSDIR)) @@ -74,33 +74,33 @@ else endif ifeq ($(UNAME_S),Linux) ifeq (i686,$(findstring i686,$(shell $(CXX) -dumpmachine))) - OSNAME=i686-linux + OSNAME=-i686-linux else - OSNAME=x86_64-linux + OSNAME=-x86_64-linux endif endif ifeq ($(UNAME_S),Darwin) ifeq (i686,$(findstring i686,$(shell $(CXX) -dumpmachine))) - OSNAME=i686-macos + OSNAME=-i686-macos else - OSNAME=x86_64-macos + OSNAME=-x86_64-macos endif endif ifeq ($(findstring _NT,$(UNAME_S)),_NT) ifeq ($(CXX),g++) ifeq ($(findstring g++.exe,$(shell where g++.exe 2>&1 | findstr g++.exe)),g++.exe) ifeq ($(findstring x86_64,$(shell g++ -dumpmachine)),x86_64) - OSNAME=mingw64 + OSNAME=-mingw64 else - OSNAME=mingw32 + OSNAME=-mingw32 endif endif endif ifeq ($(CXX),clang++) ifeq ($(findstring x86_64,$(shell clang++ -dumpmachine)),x86_64) - OSNAME=win64 + OSNAME=-win64 else - OSNAME=win32 + OSNAME=-win32 endif endif endif @@ -109,14 +109,12 @@ else else ifeq ($(CXX),g++) ifeq ($(UNAME_S),Darwin) - ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) + ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) + CXXVERSION=-clang10 + else ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) CXXVERSION=-clang11 else - ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) - CXXVERSION=-clang10 - else - CXXVERSION=-clang - endif + CXXVERSION=-clang endif else CXXVERSION=-g++$(basename $(basename $(shell $(CXX) -dumpversion))) @@ -124,14 +122,12 @@ else endif ifeq ($(CXX),clang++) ifeq ($(UNAME_S),Darwin) - ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) + ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) + CXXVERSION=-clang10 + else ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) CXXVERSION=-clang11 else - ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) - CXXVERSION=-clang10 - else - CXXVERSION=-clang - endif + CXXVERSION=-clang endif else CXXVERSION=-clang++$(basename $(basename $(shell $(CXX) -dumpversion))) @@ -139,14 +135,12 @@ else endif ifeq ($(CXX),c++) ifeq ($(UNAME_S),Darwin) - ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) + ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) + CXXVERSION=-clang10 + else ifeq (clang-11,$(findstring clang-11,$(shell $(CXX) --version))) CXXVERSION=-clang11 else - ifeq (clang-10,$(findstring clang-10,$(shell $(CXX) --version))) - CXXVERSION=-clang10 - else - CXXVERSION=-clang - endif + CXXVERSION=-clang endif else CXXVERSION=-c++$(basename $(basename $(shell $(CXX) -dumpversion))) @@ -162,9 +156,9 @@ else $(warning Unknown CXX = "$(CXX)" results in empty CXXVERSION.) endif ifdef SHARED - OBJSDIR=../build/objects/$(OSNAME)$(CXXVERSION)-shared + OBJSDIR=../build/objects$(OSNAME)$(CXXVERSION)-shared else - OBJSDIR=../build/objects/$(OSNAME)$(CXXVERSION) + OBJSDIR=../build/objects$(OSNAME)$(CXXVERSION) endif ifeq ($(DEBUG),yes) OBJSDIR:=$(sort $(addsuffix -debug, $(OBJSDIR))) @@ -214,14 +208,12 @@ ifeq ($(CMDSHELL),cmd) ifeq ($(CXX),g++) ifeq ($(findstring g++.exe,$(shell where g++.exe 2>&1 | findstr g++.exe)),g++.exe) GCCMAJVER:="GCCVER$(shell gcc -dumpversion)" - ifeq (GCCVER7,$(findstring GCCVER7,$(GCCMAJVER))) - ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) + ifeq (GCCVER4,$(findstring GCCVER4,$(GCCMAJVER))) + ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) + else ifeq (GCCVER5,$(findstring GCCVER5,$(GCCMAJVER))) + ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) else - ifeq (GCCVER6,$(findstring GCCVER6,$(GCCMAJVER))) - ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) - else - ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) - endif + ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) endif endif endif @@ -230,33 +222,29 @@ else ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) else ifeq ($(CXX),clang++) - ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) - else - ifeq ($(CXX),icpc) - ICPCMAJVER:=$(shell icpc -dumpversion | cut -f1 -d. ) - ifeq ("$(ICPCMAJVER)","17") - ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) - else - ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) - endif + ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) + else ifeq ($(CXX),icpc) + ICPCMAJVER:=$(shell icpc -dumpversion | cut -f1 -d. ) + ifeq ("$(ICPCMAJVER)","17") + ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) else - ifeq ($(CXX),CC) + ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) + endif + else ifeq ($(CXX),CC) + ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) + else ifeq ($(CXX),g++) + GCCMAJVER:=$(shell gcc -dumpversion | cut -f1 -d. ) + ifeq ("$(GCCMAJVER)","4") + GCCMINVER:=$(shell gcc -dumpversion | cut -f2 -d. ) + ifeq ("$(GCCMINVER)","9") ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) else - ifeq ($(CXX),g++) - GCCMAJVER:=$(shell gcc -dumpversion | cut -f1 -d. ) - ifeq ("$(GCCMAJVER)","4") - GCCMINVER:=$(shell gcc -dumpversion | cut -f2 -d. ) - ifeq ("$(GCCMINVER)","9") - ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) - else - ADCXXFLAGS:= -std=c++0x $(ADCXXFLAGS) - endif - else - ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) - endif - endif + ADCXXFLAGS:= -std=c++0x $(ADCXXFLAGS) endif + else ifeq ("$(GCCMAJVER)","5") + ADCXXFLAGS:= -std=c++11 $(ADCXXFLAGS) + else + ADCXXFLAGS:= -std=c++14 $(ADCXXFLAGS) endif endif endif @@ -341,35 +329,35 @@ shared: libs $(MAKE) bins ifeq ($(DEBUG),yes) ifeq ($(CMDSHELL),cmd) - $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admb-$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmb-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive - $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admbo-$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmbo-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admb$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmb$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admbo$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmbo$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive else ifeq (clang,$(findstring clang,$(shell $(CXX) --version))) - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION)-shared-debug.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION)-shared-debug.a ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION)-shared-debug.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION)-shared-debug.a endif else - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION)-shared-debug.a -Wl,--no-whole-archive endif endif endif else ifeq ($(CMDSHELL),cmd) - $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admb-$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmb-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive - $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admbo-$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmbo-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admb$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmb$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -static -shared $(LDFLAGS) -o ..\build\admb\lib\admbo$(OSNAME)$(CXXVERSION).dll -Wl,--whole-archive ..\build\admb\lib\libadmbo$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive else ifeq (clang,$(findstring clang,$(shell $(CXX) --version))) - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION)-shared.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION)-shared.a ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION)-shared.a + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION).so -Wl,-force_load ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION)-shared.a endif else - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmb$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive ifndef SAFE_ONLY - $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmbo-$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive + $(CXX) -shared $(LDFLAGS) -o ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION).so -Wl,--whole-archive ../build/$(ADMB_VER)/lib/libadmbo$(OSNAME)$(CXXVERSION)-shared.a -Wl,--no-whole-archive endif endif endif @@ -397,8 +385,8 @@ ifeq ($(CMDSHELL),cmd) if not exist ${DIST}\bin md ${DIST}\bin copy df1b2-separable\seddf1b* ${DIST}\bin copy df1b2-separable\sedf1b2* ${DIST}\bin - echo set ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)>${DIST}\bin\admb-cfg-$(OSNAME)$(CXXVERSION).bat - echo set ADMB_CFG_LDFLAGS=$(USER_LDFLAGS)>>${DIST}\bin\admb-cfg-$(OSNAME)$(CXXVERSION).bat + echo set ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)>${DIST}\bin\admb-cfg$(OSNAME)$(CXXVERSION).bat + echo set ADMB_CFG_LDFLAGS=$(USER_LDFLAGS)>>${DIST}\bin\admb-cfg$(OSNAME)$(CXXVERSION).bat copy ..\utilities\sed.exe ${DIST}\bin copy ..\utilities\libiconv2.dll ${DIST}\bin copy ..\utilities\libintl3.dll ${DIST}\bin @@ -408,8 +396,10 @@ ifeq ($(CMDSHELL),cmd) copy ..\scripts\admb\root-admb.bat ${DIST}\admb.cmd copy ..\scripts\admb\adlink.bat ${DIST}\bin\adlink.cmd copy ..\scripts\admb\adcomp.bat ${DIST}\bin\adcomp.cmd - $(MAKE) --directory=df1b2-separable CC=gcc DIST=..\${DIST} bins - $(MAKE) --directory=nh99 CC=gcc DIST=..\${DIST} bins + if not exist ..\build\tpl2rem md ..\build\tpl2rem + $(MAKE) --directory=df1b2-separable CC=gcc DIST=..\${DIST} CMDSHELL=${CMDSHELL} bins + if not exist ..\build\tpl2cpp md ..\build\tpl2cpp + $(MAKE) --directory=nh99 CC=gcc DIST=..\${DIST} CMDSHELL=${CMDSHELL} bins else mkdir -p ${DIST}/bin cp df1b2-separable/seddf1b* df1b2-separable/sedf1b2* ${DIST}/bin @@ -417,10 +407,10 @@ else cp ../scripts/admb/adlink-shared ${DIST}/bin/adlink endif ifeq ($(OS),Windows_NT) - echo set ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)>${DIST}/bin/admb-cfg-$(OSNAME)$(CXXVERSION).bat - echo set ADMB_CFG_LDFLAGS=-static $(USER_LDFLAGS)>>${DIST}/bin/admb-cfg-$(OSNAME)$(CXXVERSION).bat - echo "ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)">${DIST}/bin/admb-cfg-$(OSNAME)$(CXXVERSION).sh - echo "ADMB_CFG_LDFLAGS=-static $(USER_LDFLAGS)">>${DIST}/bin/admb-cfg-$(OSNAME)$(CXXVERSION).sh + echo set ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)>${DIST}/bin/admb-cfg$(OSNAME)$(CXXVERSION).bat + echo set ADMB_CFG_LDFLAGS=-static $(USER_LDFLAGS)>>${DIST}/bin/admb-cfg$(OSNAME)$(CXXVERSION).bat + echo "ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)">${DIST}/bin/admb-cfg$(OSNAME)$(CXXVERSION).sh + echo "ADMB_CFG_LDFLAGS=-static $(USER_LDFLAGS)">>${DIST}/bin/admb-cfg$(OSNAME)$(CXXVERSION).sh cp ../scripts/admb/admb.sh ${DIST}/bin/admb.sh cp ../scripts/admb/root-admb.sh ../admb.sh cp ../scripts/admb/admb.sh ${DIST}/admb.sh @@ -432,8 +422,8 @@ else cp ../scripts/admb/adcomp.bat ${DIST}/bin/adcomp.cmd cp ../scripts/admb/adlink.bat ${DIST}/bin/adlink.cmd else - echo "ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)">${DIST}/bin/admb-cfg-$(OSNAME)$(CXXVERSION).sh - echo "ADMB_CFG_LDFLAGS=$(USER_LDFLAGS)">>${DIST}/bin/admb-cfg-$(OSNAME)$(CXXVERSION).sh + echo "ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)">${DIST}/bin/admb-cfg$(OSNAME)$(CXXVERSION).sh + echo "ADMB_CFG_LDFLAGS=$(USER_LDFLAGS)">>${DIST}/bin/admb-cfg$(OSNAME)$(CXXVERSION).sh cp ../scripts/admb/admb ${DIST}/bin cp ../scripts/admb/adlink ${DIST}/bin cp ../scripts/admb/adcomp ${DIST}/bin @@ -442,74 +432,76 @@ else ln -sf build/$(ADMB_VER)/bin/admb .. #cp ../scripts/admb/root-admb ../admb endif - $(MAKE) --directory=df1b2-separable CC=$(CC) DIST=../${DIST} bins - $(MAKE) --directory=nh99 CC=$(CC) DIST=../${DIST} bins + mkdir -p ../build/tpl2rem + $(MAKE) --directory=df1b2-separable CC=$(CC) DIST=../${DIST} CMDSHELL= bins + mkdir -p ../build/tpl2cpp + $(MAKE) --directory=nh99 CC=$(CC) DIST=../${DIST} CMDSHELL= bins endif libs: objects ifeq ($(DEBUG),yes) ifeq ($(CMDSHELL),cmd) if not exist ${DIST}\lib md ${DIST}\lib - if exist ${DIST}\lib\libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a del ${DIST}\lib\libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - if exist ${DIST}\lib\libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a del ${DIST}\lib\libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + if exist ${DIST}\lib\libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a del ${DIST}\lib\libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + if exist ${DIST}\lib\libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a del ${DIST}\lib\libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a else mkdir -p ${DIST}/lib - rm -vf ${DIST}/lib/libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a - rm -vf ${DIST}/lib/libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + rm -vf ${DIST}/lib/libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a + rm -vf ${DIST}/lib/libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a endif ifeq ($(CMDSHELL),cmd) - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-linad99-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-linad99-*.obj else - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-linad99-[f]*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-linad99-[^f]*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-linad99-[f]*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-linad99-[^f]*.obj endif - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-df1b2-separable-*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-nh99-*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-tools99-*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-sparse-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-df1b2-separable-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-nh99-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-tools99-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)saflp-sparse-*.obj ifndef SAFE_ONLY ifeq ($(CMDSHELL),cmd) - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-linad99-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-linad99-*.obj else - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-linad99-[f]*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-linad99-[^f]*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-linad99-[f]*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-linad99-[^f]*.obj endif - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-df1b2-separable-*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-nh99-*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-tools99-*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-sparse-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-df1b2-separable-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-nh99-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-tools99-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED)-debug.a $(OBJSDIR)optlp-sparse-*.obj endif else ifeq ($(CMDSHELL),cmd) if not exist ${DIST}\lib md ${DIST}\lib - if exist ${DIST}\lib\libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a del ${DIST}\lib\libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a - if exist ${DIST}\lib\libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a del ${DIST}\lib\libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a + if exist ${DIST}\lib\libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a del ${DIST}\lib\libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a + if exist ${DIST}\lib\libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a del ${DIST}\lib\libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a else mkdir -p ${DIST}/lib - rm -vf ${DIST}/lib/libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a - rm -vf ${DIST}/lib/libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a + rm -vf ${DIST}/lib/libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a + rm -vf ${DIST}/lib/libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a endif ifeq ($(CMDSHELL),cmd) - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-linad99-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-linad99-*.obj else - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-linad99-[f]*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-linad99-[^f]*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-linad99-[f]*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-linad99-[^f]*.obj endif - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-df1b2-separable-*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-nh99-*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-tools99-*.obj - $(AR) -rs $(LIBSDIR)libadmb-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-sparse-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-df1b2-separable-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-nh99-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-tools99-*.obj + $(AR) -rs $(LIBSDIR)libadmb$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)saflp-sparse-*.obj ifndef SAFE_ONLY ifeq ($(CMDSHELL),cmd) - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-linad99-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-linad99-*.obj else - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-linad99-[f]*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-linad99-[^f]*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-linad99-[f]*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-linad99-[^f]*.obj endif - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-df1b2-separable-*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-nh99-*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-tools99-*.obj - $(AR) -rs $(LIBSDIR)libadmbo-$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-sparse-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-df1b2-separable-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-nh99-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-tools99-*.obj + $(AR) -rs $(LIBSDIR)libadmbo$(OSNAME)$(CXXVERSION)$(SHARED).a $(OBJSDIR)optlp-sparse-*.obj endif endif diff --git a/src/Makefile b/src/Makefile index 4ce89ca86..adac15656 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,8 +2,6 @@ ADMB_VER=admb !ENDIF -LEXDESTDIR=..\build\lex - #SAFE_ALL= /DSAFE_ALL !IF ([cl /? 2>&1 | findstr /C:"Compiler Version 19." > nul] == 0) @@ -164,22 +162,24 @@ bins: libs lexfiles: lexdestdir $(DESTDIR)\bin\tpl2cpp.exe $(DESTDIR)\bin\tpl2rem.exe lexdestdir: - IF NOT EXIST $(LEXDESTDIR) md $(LEXDESTDIR) + IF NOT EXIST ..\build md ..\build + IF NOT EXIST ..\build\tpl2cpp md ..\build\tpl2cpp + IF NOT EXIST ..\build\\tpl2rem md ..\build\tpl2rem IF NOT EXIST $(DESTDIR)\bin md $(DESTDIR)\bin -$(DESTDIR)\bin\tpl2cpp.exe: $(LEXDESTDIR)\tpl2cpp.c - $(CC) /nologo /TC /Fo$(LEXDESTDIR)\ /Fe$@ $(LEXDESTDIR)\tpl2cpp.c +$(DESTDIR)\bin\tpl2cpp.exe: ..\build\tpl2cpp\tpl2cpp.c + $(CC) /nologo /TC /Fo..\build\tpl2cpp\ /Fe$@ ..\build\tpl2cpp\tpl2cpp.c -$(LEXDESTDIR)\tpl2cpp.c: nh99\tpl2cpp.lex - ..\utilities\flex -o$(LEXDESTDIR)\lex.yy.c nh99\tpl2cpp.lex - ..\utilities\sed -f nh99\sedflex $(LEXDESTDIR)\lex.yy.c > $@ +..\build\tpl2cpp\tpl2cpp.c: nh99\tpl2cpp.lex + ..\utilities\flex -o..\build\tpl2cpp\lex.yy.c nh99\tpl2cpp.lex + ..\utilities\sed -f nh99\sedflex ..\build\tpl2cpp\lex.yy.c > $@ -$(DESTDIR)\bin\tpl2rem.exe: $(LEXDESTDIR)\tpl2rem.c - $(CC) /nologo /TC /Fo$(LEXDESTDIR)\ /Fe$@ $(LEXDESTDIR)\tpl2rem.c +$(DESTDIR)\bin\tpl2rem.exe: ..\build\tpl2rem\tpl2rem.c + $(CC) /nologo /TC /Fo..\build\tpl2rem\ /Fe$@ ..\build\tpl2rem\tpl2rem.c -$(LEXDESTDIR)\tpl2rem.c: df1b2-separable\tpl2rem.lex - ..\utilities\flex -o$(LEXDESTDIR)\lex.yy.c df1b2-separable\tpl2rem.lex - ..\utilities\sed -f df1b2-separable\sedflex $(LEXDESTDIR)\lex.yy.c > $@ +..\build\tpl2rem\tpl2rem.c: df1b2-separable\tpl2rem.lex + ..\utilities\flex -o..\build\tpl2rem\lex.yy.c df1b2-separable\tpl2rem.lex + ..\utilities\sed -f df1b2-separable\sedflex ..\build\tpl2rem\lex.yy.c > $@ libs: objects IF NOT EXIST $(DESTDIR)\lib md $(DESTDIR)\lib diff --git a/src/df1b2-separable/GNUmakefile b/src/df1b2-separable/GNUmakefile index 2cf6e06a4..57478a779 100644 --- a/src/df1b2-separable/GNUmakefile +++ b/src/df1b2-separable/GNUmakefile @@ -1,30 +1,35 @@ ifeq ($(OS),Windows_NT) - ifneq ($(findstring sh.exe,$(shell where sh.exe 2>&1 | findstr sh.exe)),sh.exe) -SHELL=cmd + ifeq ($(CMDSHELL),cmd) PATH:=$(PATH):..\..\utilities bins: $(DIST)\bin\tpl2rem.exe -$(DIST)\bin\tpl2rem.exe: tpl2rem.c +$(DIST)\bin\tpl2rem.exe: ..\..\build\tpl2rem\tpl2rem.c else PATH:=$(PATH):../../utilities bins: $(DIST)/bin/tpl2rem.exe -$(DIST)/bin/tpl2rem.exe: tpl2rem.c +$(DIST)/bin/tpl2rem.exe: ../../build/tpl2rem/tpl2rem.c endif else bins: $(DIST)/bin/tpl2rem -$(DIST)/bin/tpl2rem: tpl2rem.c +$(DIST)/bin/tpl2rem: ../../build/tpl2rem/tpl2rem.c endif $(CC) $(CFLAGS) -o $@ $< -tpl2rem.c: lex.yy.c -ifneq ($(OS),Windows_NT) +ifeq ($(CMDSHELL),cmd) +..\..\build\tpl2rem\tpl2rem.c: ..\..\build\tpl2rem\lex.yy.c + sed -f sedflex ..\..\build\tpl2rem\lex.yy.c > $@ +else +../../build/tpl2rem/tpl2rem.c: ../../build/tpl2rem/lex.yy.c rm -vf $@ if [ "`cat $^ | wc -l`" -eq 0 ]; then echo "Error: lex.yy.c is empty."; exit 1; fi + sed -f sedflex ../../build/tpl2rem/lex.yy.c > $@ endif - sed -f sedflex $^ > $@ -lex.yy.c: tpl2rem.lex -ifneq ($(OS),Windows_NT) +ifeq ($(CMDSHELL),cmd) +..\..\build\tpl2rem\lex.yy.c: tpl2rem.lex + flex -v -w -o..\..\build\tpl2rem\lex.yy.c $^ +else +../../build/tpl2rem/lex.yy.c: tpl2rem.lex rm -vf $@ @if [ -z "`command -v flex`" ]; then echo "Error: Unable to find flex."; exit 1; fi + flex -v -w -o../../build/tpl2rem/lex.yy.c $^ endif - flex -v -w $^ diff --git a/src/df1b2-separable/tpl2rem.lex b/src/df1b2-separable/tpl2rem.lex index 816ff2fd2..55b50ffb9 100644 --- a/src/df1b2-separable/tpl2rem.lex +++ b/src/df1b2-separable/tpl2rem.lex @@ -3789,6 +3789,9 @@ PARAMETER_SECTION { fprintf(fdat,"%s", " static int mceval_phase(void)\n" " {\n return initial_params::mceval_phase;\n }\n"); + fprintf(fdat,"%s", " static int hessian_phase(void)\n" + " {\n return initial_params::in_hessian_phase;\n }\n"); + fprintf(fdat,"%s", " static int sd_phase(void)\n" " {\n return initial_params::sd_phase;\n }\n"); diff --git a/src/linad99/dfpool.cpp b/src/linad99/dfpool.cpp index 88e3e236b..cb77a0ff8 100644 --- a/src/linad99/dfpool.cpp +++ b/src/linad99/dfpool.cpp @@ -15,41 +15,63 @@ #if defined(USE_VECTOR_SHAPE_POOL) -bool vector_shape::allocated = false; -bool vector_shapex::allocated = false; -bool arr_link::allocated = false; +bool cleanup_arr_link_xpool = false; +bool cleanup_vector_shape_xpool = false; +bool cleanup_vector_shapex_xpool = false; -#if defined(THREAD_SAFE) - pthread_mutex_t mutex_dfpool = PTHREAD_MUTEX_INITIALIZER; -#endif +vector_shape_pool* arr_link::xpool = nullptr; +vector_shape_pool* vector_shape::xpool = nullptr; +vector_shape_pool* vector_shapex::xpool = nullptr; -vector_shape_pool::vector_shape_pool(void) : dfpool(sizeof(vector_shape)) +void cleanup_xpools() { - _allocated = nullptr; + if (arr_link::xpool) + { + if (arr_link::xpool->num_allocated > 0) + { + cleanup_arr_link_xpool = true; + } + else + { + delete arr_link::xpool; + arr_link::xpool = nullptr; + } + } + if (vector_shape::xpool) + { + if (vector_shape::xpool->num_allocated > 0) + { + cleanup_vector_shape_xpool = true; + } + else + { + delete vector_shape::xpool; + vector_shape::xpool = nullptr; + } + } + if (vector_shapex::xpool) + { + if (vector_shapex::xpool->num_allocated > 0) + { + cleanup_vector_shapex_xpool = true; + } + else + { + delete vector_shapex::xpool; + vector_shapex::xpool = nullptr; + } + } } +#if defined(THREAD_SAFE) + pthread_mutex_t mutex_dfpool = PTHREAD_MUTEX_INITIALIZER; +#endif + #if defined(THREAD_SAFE) ts_vector_shape_pool::ts_vector_shape_pool(int n) : tsdfpool(n) { ;} #endif -vector_shape_pool::vector_shape_pool( - const size_t n, bool* allocated) : dfpool(n) -{ - _allocated = allocated; - if (_allocated) - { - *_allocated = true; - } -} -vector_shape_pool::~vector_shape_pool() -{ - if (_allocated) - { - *_allocated = false; - _allocated = nullptr; - } -} /** * Description not yet available. * \param @@ -57,15 +79,30 @@ vector_shape_pool::~vector_shape_pool() void* vector_shape::operator new(size_t n) { #if defined(DEBUG) - if (n != xpool.size) + if (n != xpool->size) { cerr << "incorrect size requested in dfpool" << endl; ad_exit(1); } #endif - return vector_shape::get_xpool().alloc(); + if (!xpool) + { + xpool = new vector_shape_pool(sizeof(vector_shape)); + } + return xpool->alloc(); +} +void vector_shape::operator delete(void* ptr, size_t) +{ + xpool->free(ptr); + if (cleanup_vector_shape_xpool) + { + if (xpool->num_allocated <= 0) + { + delete xpool; + xpool = nullptr; + } + } } - /** * Description not yet available. * \param @@ -73,15 +110,30 @@ void* vector_shape::operator new(size_t n) void* arr_link::operator new(size_t n) { #if defined(DEBUG) - if (n != xpool.size) + if (n != xpool->size) { cerr << "incorrect size requested in dfpool" << endl; ad_exit(1); } #endif - return arr_link::get_xpool().alloc(); + if (!xpool) + { + xpool = new vector_shape_pool(sizeof(arr_link)); + } + return xpool->alloc(); +} +void arr_link::operator delete(void* ptr, size_t) +{ + xpool->free(ptr); + if (cleanup_arr_link_xpool) + { + if (xpool->num_allocated <= 0) + { + delete xpool; + xpool = nullptr; + } + } } - /** * Description not yet available. * \param @@ -89,13 +141,29 @@ void* arr_link::operator new(size_t n) void* vector_shapex::operator new(size_t n) { #if defined(DEBUG) - if (n != xpool.size) + if (n != xpool->size) { cerr << "incorrect size requested in dfpool" << endl; ad_exit(1); } #endif - return vector_shapex::get_xpool().alloc(); + if (!xpool) + { + xpool = new vector_shape_pool(sizeof(vector_shapex)); + } + return xpool->alloc(); +} +void vector_shapex::operator delete(void* ptr, size_t) +{ + xpool->free(ptr); + if (cleanup_vector_shapex_xpool) + { + if (xpool->num_allocated <= 0) + { + delete xpool; + xpool = nullptr; + } + } } #if defined(__CHECK_MEMORY__) diff --git a/src/linad99/dfpool.h b/src/linad99/dfpool.h index b70d1c8a9..a47185c14 100644 --- a/src/linad99/dfpool.h +++ b/src/linad99/dfpool.h @@ -80,7 +80,7 @@ class dfpool dfpool(); dfpool(const dfpool&) = delete; dfpool(const size_t); - ~dfpool(); + virtual ~dfpool(); dfpool& operator=(const dfpool&) = delete; diff --git a/src/linad99/dvect9.cpp b/src/linad99/dvect9.cpp index 1839e3ca5..4b0e2310c 100644 --- a/src/linad99/dvect9.cpp +++ b/src/linad99/dvect9.cpp @@ -143,6 +143,7 @@ dvector::dvector(const char* s) << "dvector::dvector(char* filename)\n"; ad_exit(1); } + infile.width(MAX_FIELD_LENGTH); char* field = new char[MAX_FIELD_LENGTH + 1]; infile.width(MAX_FIELD_LENGTH + 1); int count = 0; @@ -226,6 +227,8 @@ dvector::dvector(const char* s) } delete[] field; field = 0; + + infile.close(); } delete [] t; t = 0; @@ -334,6 +337,7 @@ void dvector::allocate(const char* s) ad_exit(1); } + infile.width(MAX_FIELD_LENGTH); char* field = new char[MAX_FIELD_LENGTH + 1]; infile.width(MAX_FIELD_LENGTH + 1); @@ -418,6 +422,8 @@ void dvector::allocate(const char* s) } delete [] field; field = 0; + + infile.close(); } delete [] t; t = 0; diff --git a/src/linad99/dvector.cpp b/src/linad99/dvector.cpp index 0a9d6ffb7..3285e602d 100644 --- a/src/linad99/dvector.cpp +++ b/src/linad99/dvector.cpp @@ -64,9 +64,6 @@ Produces an error if the double* member v is NULL. */ dvector::~dvector() { -#if defined(USE_VECTOR_SHAPE_POOL) - if (!vector_shapex::allocated) return; -#endif if (shape) { if (shape->ncopies) diff --git a/src/linad99/fvar.hpp b/src/linad99/fvar.hpp index a3de17683..37c40d018 100644 --- a/src/linad99/fvar.hpp +++ b/src/linad99/fvar.hpp @@ -106,7 +106,7 @@ Macro definitions. #include #endif -//#define USE_VECTOR_SHAPE_POOL +#define USE_VECTOR_SHAPE_POOL #if defined(USE_DDOUBLE) # include @@ -473,13 +473,17 @@ class kkludge_object{}; * Description not yet available. * \param */ -class vector_shape_pool:public dfpool +class vector_shape_pool: public dfpool { - bool* _allocated; public: - vector_shape_pool(); - vector_shape_pool(const size_t, bool* allocated); - ~vector_shape_pool(); + vector_shape_pool(): dfpool() {} + vector_shape_pool(const size_t n): dfpool(n) {} + vector_shape_pool(const vector_shape_pool&) = delete; + vector_shape_pool(vector_shape_pool&&) = delete; + ~vector_shape_pool() {} + + vector_shape_pool& operator=(const vector_shape_pool&) = delete; + vector_shape_pool& operator=(vector_shape_pool&&) = delete; }; /** @@ -500,21 +504,16 @@ class ts_vector_shape_pool:public tsdfpool */ class vector_shape { - public: #if defined(USE_VECTOR_SHAPE_POOL) - static bool allocated; - static vector_shape_pool& get_xpool() - { - static vector_shape_pool xpool( - sizeof(vector_shape), &vector_shape::allocated); - return xpool; - } +public: + static vector_shape_pool* xpool; + void* operator new(size_t); - void operator delete(void* ptr, size_t) - { vector_shape::get_xpool().free(ptr); } + void operator delete(void* ptr, size_t); vector_shape(const vector_shape&) = delete; vector_shape& operator=(const vector_shape&) = delete; #endif +public: unsigned int ncopies; void shift(int min); @@ -2022,22 +2021,17 @@ class arr_link unsigned int size; unsigned long int offset; - public: #if defined(USE_VECTOR_SHAPE_POOL) - static bool allocated; - static vector_shape_pool& get_xpool() - { - static vector_shape_pool xpool( - sizeof(arr_link), &arr_link::allocated); - return xpool; - } +public: + static vector_shape_pool* xpool; + void* operator new(size_t); - void operator delete(void* ptr, size_t) - { arr_link::get_xpool().free(ptr); } + void operator delete(void* ptr, size_t); arr_link(const arr_link&) = delete; arr_link& operator=(const arr_link&) = delete; #endif +public: arr_link(); arr_link* get_prev() const diff --git a/src/linad99/fvar_io2.cpp b/src/linad99/fvar_io2.cpp index 3c860249c..2ade7e47a 100644 --- a/src/linad99/fvar_io2.cpp +++ b/src/linad99/fvar_io2.cpp @@ -197,6 +197,8 @@ dvar_vector::dvar_vector(const char * s) } delete[] field; field = 0; + + infile.close(); } delete [] t; t = 0; diff --git a/src/linad99/gradstrc.cpp b/src/linad99/gradstrc.cpp index 0beb63a14..40a01048c 100644 --- a/src/linad99/gradstrc.cpp +++ b/src/linad99/gradstrc.cpp @@ -171,6 +171,10 @@ size_t gradient_structure::totalbytes(void) /// Close gradient and variable files and free gradient structure memory. void cleanup_temporary_files() { +#if defined(USE_VECTOR_SHAPE_POOL) + void cleanup_xpools(); + cleanup_xpools(); +#endif if (gradient_structure::fp) { delete gradient_structure::fp; diff --git a/src/linad99/i5arr.cpp b/src/linad99/i5arr.cpp index e756a05c2..a85585940 100644 --- a/src/linad99/i5arr.cpp +++ b/src/linad99/i5arr.cpp @@ -228,3 +228,12 @@ const int& i5_array::operator()(int i, int j, int k, int l, int m) const return elem(i)(j, k, l, m); } #endif +/// Initialize i5_array elements with zeros. +void i5_array::initialize() +{ + const int max = indexmax(); + for (int i5 = indexmin(); i5 <= max; ++i5) + { + elem(i5).initialize(); + } +} diff --git a/src/linad99/ivector.cpp b/src/linad99/ivector.cpp index 4f90dfba5..e709bfc0c 100644 --- a/src/linad99/ivector.cpp +++ b/src/linad99/ivector.cpp @@ -90,9 +90,6 @@ ivector::~ivector() /// Deallocate i3_array memory. void ivector::deallocate() { -#if defined(USE_VECTOR_SHAPE_POOL) - if (!vector_shapex::allocated) return; -#endif //Called by destructor to deallocate memory for a ivector object. //Produces an error if the int* member is NULL. if (shape) diff --git a/src/linad99/vector_shapex.h b/src/linad99/vector_shapex.h index 6b8d12e40..aa844498d 100644 --- a/src/linad99/vector_shapex.h +++ b/src/linad99/vector_shapex.h @@ -45,6 +45,16 @@ Holds "shape" information for vector objects. */ class vector_shapex { +#if defined(USE_VECTOR_SHAPE_POOL) +public: + static vector_shape_pool* xpool; + + void* operator new(size_t); + void operator delete(void* ptr, size_t); + vector_shapex(const vector_shapex&) = delete; + vector_shapex& operator=(const vector_shapex&) = delete; +#endif + public: vector_shapex(int lb, int ub, void *p):index_min(lb), index_max(ub), ncopies(0), trueptr(p) @@ -55,20 +65,6 @@ class vector_shapex { return trueptr; } -#if defined(USE_VECTOR_SHAPE_POOL) - static bool allocated; - static vector_shape_pool& get_xpool() - { - static vector_shape_pool xpool( - sizeof(vector_shapex), &vector_shapex::allocated); - return xpool; - } - void* operator new(size_t); - void operator delete(void* ptr, size_t) - { vector_shapex::get_xpool().free(ptr); } - vector_shapex(const vector_shapex&) = delete; - vector_shapex& operator=(const vector_shapex&) = delete; -#endif void shift(int min); int index_min; ///< Minimum valid subscript diff --git a/src/linad99/vspline.cpp b/src/linad99/vspline.cpp index d825455ca..c3136f74e 100644 --- a/src/linad99/vspline.cpp +++ b/src/linad99/vspline.cpp @@ -24,7 +24,10 @@ dvar_vector spline_cubic_set (int n, const dvector& t, const dvar_vector& y, int ibcbeg, dvariable ybcbeg, int ibcend, dvariable ybcend ); /** \ingroup cub_spline - * Cubic spline interpolation. + * Cubic spline interpolation allows users to model natural cubic spline + * (2nd derivative of boundary nodes is set to zero) as an alternative of + * use of 1st derivative of boundary nodes. This can be accomplished b + * setting yp1 and ypn of function spline to >0.99e30 * * \param _xa array of abscissa * \param _ya array of corresponding values \f$y_i=f(x_i)\f$ diff --git a/src/nh99/GNUmakefile b/src/nh99/GNUmakefile index a53905562..e4e196bf6 100644 --- a/src/nh99/GNUmakefile +++ b/src/nh99/GNUmakefile @@ -1,17 +1,16 @@ ifeq ($(OS),Windows_NT) - ifneq ($(findstring sh.exe,$(shell where sh.exe 2>&1 | findstr sh.exe)),sh.exe) -SHELL=cmd + ifeq ($(CMDSHELL),cmd) PATH:=$(PATH):..\..\utilities bins: $(DIST)\bin\tpl2cpp.exe -$(DIST)\bin\tpl2cpp.exe: tpl2cpp.c +$(DIST)\bin\tpl2cpp.exe: ..\..\build\tpl2cpp\tpl2cpp.c else PATH:=$(PATH):../../utilities bins: $(DIST)/bin/tpl2cpp.exe -$(DIST)/bin/tpl2cpp.exe: tpl2cpp.c +$(DIST)/bin/tpl2cpp.exe: ../../build/tpl2cpp/tpl2cpp.c endif else bins: $(DIST)/bin/tpl2cpp -$(DIST)/bin/tpl2cpp: tpl2cpp.c +$(DIST)/bin/tpl2cpp: ../../build/tpl2cpp/tpl2cpp.c endif ifeq ("$(CC)","cc") @@ -20,16 +19,22 @@ else $(CC) $(CFLAGS) -Wno-format -o $@ $< endif -tpl2cpp.c: lex.yy.c -ifneq ($(OS),Windows_NT) +ifeq ($(CMDSHELL),cmd) +..\..\build\tpl2cpp\tpl2cpp.c: ..\..\build\tpl2cpp\lex.yy.c + sed -f sedflex ..\..\build\tpl2cpp\lex.yy.c > $@ +else +../../build/tpl2cpp/tpl2cpp.c: ../../build/tpl2cpp/lex.yy.c rm -vf $@ if [ "`cat $^ | wc -l`" -eq 0 ]; then echo "Error: lex.yy.c is empty."; exit 1; fi + sed -f sedflex ../../build/tpl2cpp/lex.yy.c > $@ endif - sed -f sedflex lex.yy.c > $@ -lex.yy.c: tpl2cpp.lex -ifneq ($(OS),Windows_NT) +ifeq ($(CMDSHELL),cmd) +..\..\build\tpl2cpp\lex.yy.c: tpl2cpp.lex + flex -v -w -o..\..\build\tpl2cpp\lex.yy.c $^ +else +../../build/tpl2cpp/lex.yy.c: tpl2cpp.lex rm -vf $@ if [ -z "`command -v flex`" ]; then echo "Error: Unable to find flex."; exit 1; fi + flex -v -w -o../../build/tpl2cpp/lex.yy.c $^ endif - flex -v -w $^ diff --git a/src/nh99/admodel.h b/src/nh99/admodel.h index d51154119..721ed1905 100644 --- a/src/nh99/admodel.h +++ b/src/nh99/admodel.h @@ -52,6 +52,7 @@ #pragma interface #endif +#include class laplace_approximation_calculator; void cleanup_laplace_stuff(laplace_approximation_calculator *); @@ -753,23 +754,30 @@ class pvm_int : public pvm_params class initial_params; typedef initial_params* pinitial_params; -typedef void* ptovoid; + /** For storing void pointers in a array. */ class adlist_ptr { - ptovoid* ptr; - unsigned int current_size; unsigned int current; + unsigned int current_size; + typedef void* ptovoid; + ptovoid* ptr; void resize(void); - void add_to_list(void* p); + std::vector list; + void add_to_list(void*); + public: - adlist_ptr(unsigned int init_size); + adlist_ptr(); + adlist_ptr(const adlist_ptr&) = delete; + adlist_ptr(adlist_ptr&&) = delete; ~adlist_ptr(); void initialize(); + void allocate(unsigned int init_size); + pinitial_params& operator[](int i); friend class initial_params; @@ -840,19 +848,16 @@ class initial_params double get_scalefactor(); void set_scalefactor(const double); //Resizeable arrays -#if defined(USE_PTR_INIT_PARAMS) - static initial_params* varsptr[]; -#else - static adlist_ptr varsptr; -#endif static int num_initial_params; - static const int max_num_initial_params; + static int max_num_initial_params; + static adlist_ptr varsptr; static int straight_through_flag; static int num_active_initial_params; static int max_number_phases; static int current_phase; static int restart_phase; static int sd_phase; + static bool in_hessian_phase; static int mc_phase; static int mceval_phase; int phase_start; @@ -1966,7 +1971,8 @@ class function_minimizer void sgibbs_mcmc_routine(int,int,double,int); void hybrid_mcmc_routine(int,int,double,int); - // Functions added by Cole for HMC. + /// hess_step is used for HMC. See details in function_minimizer::hess_step. + void hess_step(); bool choleski_decomp_hmc(const dmatrix& metric, dmatrix& L); bool calculate_chd_and_inverse(int nvar, const dmatrix& metric, dmatrix& chd, dmatrix& chdinv); @@ -2017,7 +2023,7 @@ class function_minimizer void hess_routine_and_constraint(int iprof, const dvector& g, dvector& fg); dmatrix diag_hess_routine(void); - void hess_inv(void); + bool hess_inv(); void depvars_routine(void); void sd_routine(void); int ef_(double * f, double * x); diff --git a/src/nh99/hmc_functions.cpp b/src/nh99/hmc_functions.cpp index bfe206bee..e586dd5a9 100644 --- a/src/nh99/hmc_functions.cpp +++ b/src/nh99/hmc_functions.cpp @@ -30,6 +30,187 @@ using std::queue; #endif #include +/** + Experimental feature to take Newton steps using the inverse + Hessian to get much closer to the optimum and reduce the + maximum gradient arbitrarily close to 0. + + Let x be the current MLE parameter vector. Then a single step + consists of calculating x'=x-inv(Hessian)*gradient. This + calculation is done in the unbounded parameter space. + + This feature is initiated by calling "-hess_step N + -hess_step_tol eps" to specify the maximum number of steps (N) + and a minimum threshold for the maximum gradient (eps), below + which is deemed sufficient and causes the function to exit + early with success. The defaults are N=1 and eps=1e-12. The + function will also exit early if the gradients get worse as a + result of a step, printing information about which + parameters. If successful, the new MLE is deemed improved and + is propagated through the model to update all output files. + + The upside of this feature is it confirms that the geometry + near the mode is quadratic and well represented by the + Hessian. It may also slightly improve the MLE and uncertainty + estimates. The downside is that the Hessian needs to be + recalculated and inverted at each step so it is costly + computationally. + + Typical usage is to optimize model, then use this feature if + convergence is suspect. + + \author Cole Monnahan +*/ +void function_minimizer::hess_step(){ + // Read in the number of steps and optional tolerance + int N_hess_steps=1; + int _N_hess_steps; + int on, nopt; + if ( (on=option_match(ad_comm::argc,ad_comm::argv,"-hess_step",nopt))>-1) { + if (!nopt){ + cout << "Number of hess_steps not specified, using default of 1" << endl; + } else { + istringstream ist(ad_comm::argv[on+1]); + ist >> _N_hess_steps; + if (_N_hess_steps<=0) { + cerr << "Error: hess_step tolerance must be positive"; + ad_exit(1); + } else { + N_hess_steps=_N_hess_steps; + } + } + } + double eps=1e-12; + double _eps; + if ( (on=option_match(ad_comm::argc,ad_comm::argv,"-hess_step_tol",nopt))>-1) { + if (!nopt){ + cout << "No tolerance given, using default of 1e-12" << endl; + } else { + istringstream ist(ad_comm::argv[on+1]); + ist >> _eps; + if (_eps<=0) { + cerr << "Error: hess_step tolerance must be positive"; + ad_exit(1); + } else { + eps=_eps; + } + } + } + cout << "Experimental feature to take up to " << N_hess_steps; + cout << " Newton step(s) using the inverse Hessian" << endl; + // Let x'=x-inv(Hessian)*gradient, where x is MLE in + // unbounded space and it's corresponding gradient and + // Hessian. Need to calculate x' then push through + // model and calculate SD report stuff + initial_params::current_phase=initial_params::max_number_phases; + int nvar=initial_params::nvarcalc(); // get the number of active parameters + independent_variables mle(1,nvar); // original bounded MLE + independent_variables mle2(1,nvar); // updated bounded MLE + independent_variables x(1,nvar); // original unbounded MLE + independent_variables x2(1,nvar); // updated unbounded MLE + dvector gr0(1,nvar); // original gradients + dvector gr(1,nvar); // + dvector gr2(1,nvar); // updated gradients + double maxgrad0, mingrad0, maxgrad, maxgrad2, mingrad2; + read_mle_hmc(nvar, mle); // takes MLE from admodel.hes file + + // Push the original bounded MLE through the model + initial_params::restore_all_values(mle,1); + gradient_structure::set_YES_DERIVATIVES(); // don't know what this does + // This copies the unbounded parameters into x + initial_params::xinit(x); + dvar_vector vx=dvar_vector(x); + initial_params::reset(vx); + *objective_function_value::pobjfun=0.0; + userfunction(); + gradcalc(nvar,gr0); // initial unbounded gradient + maxgrad0=max(fabs(gr0)); + mingrad0=min(fabs(gr0)); + + cout << "Initial max gradient=" << maxgrad0 << " and min gradient= " << mingrad0 << endl; + dmatrix S(1,nvar,1,nvar); // covar (inverse Hess) in unbounded space + dvector scale(1,nvar); // dummy var + int hbf; // dummy var + + // Initial for first iteration + gr=gr0; maxgrad=maxgrad0; + + int Nstep=0; + for(int ii=1; ii<=N_hess_steps; ii++){ + Nstep++; + // Get the covar matrix from file, assuming last run was good + read_covariance_matrix(S,nvar, hbf, scale); + x2=x-S*gr; // the updated MLE in unbounded space + // Push the new unbounded MLE through the model + dvar_vector vx2=dvar_vector(x2); + initial_params::reset(vx2); + *objective_function_value::pobjfun=0.0; + userfunction(); + // Updated quantities after taking step + gradcalc(nvar,gr2); + maxgrad2=max(fabs(gr2)); + mingrad2=min(fabs(gr2)); + initial_params::copy_all_values(mle2,1.0); + // Check whether to break out of loop early + if( (maxgrad2 < eps) & (ii < N_hess_steps)){ + cout << "Step " << ii << ": Max gradient "<< maxgrad2 << + " below threshold of " << eps << " so exiting early" << endl; + break; + } else if(maxgrad2>maxgrad) { + // which ones got worse? + int jj = 1; + for (int i = 0; i < initial_params::num_initial_params; ++i) { + if (active(*initial_params::varsptr[i])) { + int jmax = (int)initial_params::varsptr[i]->size_count(); + for (int j = 1; j <= jmax; ++j) { + if(abs(gr(jj)) < abs(gr2(jj))){ + cout << (initial_params::varsptr[i])->label(); + if (jmax > 1) { + cout << "(" << j << ")"; + } + cout << ": original grad=" << gr(jj) << " and updated grad=" << gr2(jj) << endl; + } + ++jj; + } + } + } + cerr << endl << + "Experimental feature -hess_step resulted in worse gradients (above)." << endl << + "Consider reoptimizing model to reset files. This suggests that the" << endl << + "the negative log-likelihood is not quadratic at the mode, or that the" << endl << + "Hessian does not approximate it well. In short, it suggests the model is" << endl << + "not converged. Check model structure and other output files to investigate" << endl << + "potential causes and solutions." << endl; + ad_exit(1); + } else { + // Was successful but not good enough to break early + cout << "Step " << ii << ": Updated max gradient=" << maxgrad2 << + " and min gradient= " << mingrad2 << endl; + x=x2; gr=gr2; maxgrad=maxgrad2; + // If not the last step then want to skip the sd_calcs + // which are slow so manually update admodel.cov whereas + // below computations1() runs everything so do that if last + // step + if(ii!=N_hess_steps){ + hess_routine(); // Calculate new Hessian + depvars_routine(); // calculate derivatives of sdreport variables + hess_inv(); // Invert Hess and write to admodel.cov + } + } + }// end loop over hess_steps + // Finished successully so run the opitmizer without + // taking any steps to produce updated output files + // with this new MLE value. + function_minimizer::maxfn=0; + computations1(ad_comm::argc,ad_comm::argv); + cout << endl << "The " << Nstep << " Hessian step(s) reduced maxgrad from " << + maxgrad0 << " to " << maxgrad2 << "." << endl << + "All output files should be updated, but confirm as this is experimental still." << endl << + "The fact this was successful gives strong evidence of convergence to a mode" << endl << + "with quadratic log-likelihood surface." << endl; +} + + int function_minimizer::compute_next_window(int i, int warmup, int w1, int aws, int w3){ int anw; @@ -204,7 +385,7 @@ void function_minimizer::build_tree(int nvar, dvector& gr, dmatrix& chd, double // s' from the first execution above is 1 by definition (inside this // if statement), while _sprime is s''. So need to reset s': bool b = stop_criterion(nvar, thetaminus0, thetaplus0, rminus0, rplus0); - _sprime = _sprime*b; + _sprime = _sprime && b; _nprime = nprime_temp; } // end building second trajectory } // end recursion branch (j>0) @@ -226,7 +407,7 @@ bool function_minimizer::stop_criterion(int nvar, dvector& thetaminus, dvector& x2+=thetavec(i)*rplus(i); } // TRUE if both are TRUE, FALSE if at least one. - bool criterion = (x1 >=0) * (x2 >=0); + bool criterion = (x1 >=0) && (x2 >=0); return criterion; } @@ -433,45 +614,45 @@ void function_minimizer::read_mle_hmc(int nvar, dvector& mle) { adstring tmpstring = "admodel.hes"; uistream cif((char*)tmpstring); if (!cif) { - cerr << "Error reading the bounded MLE values from admodel.hes which are needed " - << endl << "to rescale the mass matrix. Try re-optimizing model." << endl; + cerr << "Error reading admodel.hes file to get MLE values. Try re-optimizing model." << endl; ad_exit(1); } int tmp_nvar = 0; cif >> tmp_nvar; if (nvar !=tmp_nvar) { - cerr << "Error reading the bounded MLE values from admodel.hes which are needed " - << endl << "to rescale the mass matrix. Try re-optimizing model." << endl; + cerr << "The number of variables in admodel.hes " << tmp_nvar << " does not match " << nvar << + ". Try re-optimizing model." << endl; ad_exit(1); } dmatrix hess(1,tmp_nvar,1,tmp_nvar); cif >> hess; if (!cif) { - cerr << "Error reading the bounded MLE values from admodel.hes which are needed " - << endl << "to rescale the mass matrix. Try re-optimizing model." << endl; + cerr << "Error reading the Hessian matrix from admodel.hes. Try re-optimizing model." << endl; ad_exit(1); } int oldHbf; cif >> oldHbf; if (!cif) { - cerr << "Error reading the bounded MLE values from admodel.hes which are needed " - << endl << "to rescale the mass matrix. Try re-optimizing model." << endl; + cerr << "Error reading the hybrid flag from admodel.hes. Try re-optimizing model." << endl; ad_exit(1); } dvector sscale(1,tmp_nvar); cif >> sscale; if (!cif) { - cerr << "Error reading the bounded MLE values from admodel.hes which are needed " - << endl << "to rescale the mass matrix. Try re-optimizing model." << endl; + cerr << "Error reading the transformation scales from admodel.hes. Try re-optimizing model." << endl; ad_exit(1); } // Read in the MLEs finally int temp=0; cif >> temp; - cif >> mle; - // Temp is a unique flag to make sure the mle values were written (that + // temp is a unique flag to make sure the mle values were written (that // admodel.hes is not too old) if(temp != -987 || !cif){ + cerr << "Error reading the check value from admodel.hes. Try re-optimizing model." << endl; + ad_exit(1); + } + cif >> mle; + if(!cif){ cerr << "Error reading the bounded MLE values from admodel.hes. Try re-optimizing model." << endl; ad_exit(1); } diff --git a/src/nh99/mod_hess.cpp b/src/nh99/mod_hess.cpp index 586cbe084..ef099abfd 100644 --- a/src/nh99/mod_hess.cpp +++ b/src/nh99/mod_hess.cpp @@ -13,8 +13,10 @@ void set_labels_for_hess(int); // estimate the matrix of second derivatives void ad_update_hess_stats_report(int i,int nvar); +bool initial_params::in_hessian_phase = false; void function_minimizer::hess_routine(void) { + initial_params::in_hessian_phase = true; if (random_effects_flag && lapprox != 0) { if (laplace_approximation_calculator::alternative_user_function_flag == 1) @@ -49,6 +51,7 @@ void function_minimizer::hess_routine(void) { hess_routine_noparallel(); } + initial_params::in_hessian_phase = false; } void function_minimizer::hess_routine_noparallel(void) { @@ -484,7 +487,7 @@ void function_minimizer::depvars_routine(void) /** Symmetrize and invert the hessian */ -void function_minimizer::hess_inv(void) +bool function_minimizer::hess_inv(void) { initial_params::set_inactive_only_random_effects(); int nvar=initial_params::nvarcalc(); // get the number of active parameters @@ -672,7 +675,7 @@ void function_minimizer::hess_inv(void) if (hess(i,i) <= 0.0) { hess_errorreport(); - ad_exit(1); + return false; } } } @@ -686,6 +689,7 @@ void function_minimizer::hess_inv(void) ofs << sscale; } } + return true; } void hess_calcreport(int i,int nvar) { diff --git a/src/nh99/model.cpp b/src/nh99/model.cpp index b4237a4fa..e65ad59a6 100644 --- a/src/nh99/model.cpp +++ b/src/nh99/model.cpp @@ -5,6 +5,9 @@ * Copyright (c) 2008-2012 Regents of the University of California */ #include +#ifdef DEBUG + #include +#endif #ifdef ISZERO #undef ISZERO @@ -13,14 +16,8 @@ int initial_params::num_initial_params = 0; -const int initial_params::max_num_initial_params = 4000; -#if defined(USE_PTR_INIT_PARAMS) - initial_params* initial_params::varsptr[ - initial_params::max_num_initial_params + 1]; -#else - adlist_ptr initial_params::varsptr( - initial_params::max_num_initial_params); -#endif +adlist_ptr initial_params::varsptr; + int initial_params::max_number_phases=1; int initial_params::current_phase=1; int initial_params::restart_phase=0; @@ -131,20 +128,8 @@ void initial_params::allocate(int _phase_start) void initial_params::add_to_list() { - if (num_initial_params >= initial_params::max_num_initial_params) - { - cerr << " This version of ADMB only supports " - << initial_params::max_num_initial_params - << " initial parameter objects.\n"; - ad_exit(1); - } - // this is the list of fundamental objects -#if defined(USE_PTR_INIT_PARAMS) - varsptr[num_initial_params] = this; -#else varsptr.add_to_list(this); -#endif num_initial_params++; } @@ -1307,33 +1292,46 @@ void initial_params::set_random_effects_inactive(void) {;} pinitial_params& adlist_ptr::operator[](int i) { - return (pinitial_params&)ptr[i]; +#ifdef DEBUG + assert(i < current); +#endif + + unsigned int index = static_cast(i); + if (index < current_size) + { + return (pinitial_params&)ptr[index]; + } + return (pinitial_params&)list[index - current_size]; +} +int initial_params::max_num_initial_params = 0; +/// Default constructor +adlist_ptr::adlist_ptr() +{ + current = 0; + current_size = 0; + ptr = nullptr; } /** Construct array with init_size. */ -adlist_ptr::adlist_ptr(unsigned int init_size) +void adlist_ptr::allocate(unsigned int init_size) { current = 0; - ptr = new ptovoid[init_size]; - if (ptr == 0) + if (init_size > 0) { - cerr << "Error: allocating memory in adlist_ptr" << endl; - } - current_size = init_size; -} -void adlist_ptr::initialize() -{ - for (unsigned int i = 0; i < current_size; ++i) - { - ptr[i] = 0; + ptr = new ptovoid[init_size] { nullptr }; + if (ptr == 0) + { + cerr << "Error: allocating memory in adlist_ptr" << endl; + ad_exit(1); + } + current_size = init_size; } - //reset current index to beginning - current = 0; } /** Double array size if needed. */ +/* void adlist_ptr::resize(void) { current_size *= 2; @@ -1350,21 +1348,31 @@ void adlist_ptr::resize(void) ptr = tmp; tmp = 0; } +*/ +void adlist_ptr::initialize() +{ + for (unsigned int i = 0; i < current_size; ++i) + { + ptr[i] = 0; + } + list.clear(); + //reset current index to beginning + current = 0; +} /** Store pointer p to array. */ void adlist_ptr::add_to_list(void* p) { - if (current > current_size) + if (current >= current_size) { - cerr << "This can't happen in adlist_ptr" << endl; - exit(1); + list.push_back(p); + ++current; } - if (current == current_size) + else { - resize(); + ptr[current++] = p; } - ptr[current++] = p; } /** Destructor @@ -1376,4 +1384,5 @@ adlist_ptr::~adlist_ptr() delete [] ptr; ptr = 0; } + list.clear(); } diff --git a/src/nh99/model7.cpp b/src/nh99/model7.cpp index da2327381..54ccf827f 100644 --- a/src/nh99/model7.cpp +++ b/src/nh99/model7.cpp @@ -12,19 +12,24 @@ #include #endif -#if defined(_MSC_VER) -void strip_full_path(const adstring& _s) +adstring strip_full_path(const adstring& _s) { - adstring& s = (adstring&)_s; - size_t n = s.size(); + size_t n = _s.size(); size_t i = n - 1; for (; i >= 1; i--) { - if ( s(i) == '\\' || s(i) == '/' || s(i) == ':') break; +#if defined(_WIN32) + if (_s(i) == '\\' || _s(i) == '/' || _s(i) == ':') break; +#else + if (_s(i) == '/' || _s(i) == ':') break; +#endif } - s = s(i + 1, n); + + adstring s(1, n - i); + s = _s(i + 1, n); + + return s; } -#endif void set_signal_handlers(void) { @@ -121,12 +126,9 @@ ad_comm::ad_comm(int _argc,char * _argv[]) } */ set_signal_handlers(); - adprogram_name=_argv[0]; + adprogram_name = strip_full_path((adstring)_argv[0]); //int len=strlen(_argv[0]); //for (int i=1;i<=len;i++) adprogram_name[i]=tolower(adprogram_name[i]); -#if defined(_MSC_VER) - strip_full_path(adprogram_name); -#endif adstring workdir; ad_getcd(workdir); if (_argc>1) @@ -233,6 +235,10 @@ ad_comm::ad_comm(int _argc,char * _argv[]) "N\n"); (*ad_printf)( " -gbs N set GRADSTACK_BUFFER_SIZE to N " "(ARRAY_MEMBLOCK_SIZE)\n"); + (*ad_printf)( " -hess_step N take N Newton steps with inverse Hessian\n"); + (*ad_printf)( " -hess_step_tol eps set hess_step tolerance to eps\n"); + (*ad_printf)( " -mip N set maximum the number of initial parameters " + "to a value N that is greater than zero (default is 4000).\n"); #if defined(USE_ADPVM) (*ad_printf)( " -master run as PVM master program\n"); (*ad_printf)( " -slave run as PVM slave program\n"); diff --git a/src/nh99/modspmin.cpp b/src/nh99/modspmin.cpp index bf7a47a03..b6cb4795f 100644 --- a/src/nh99/modspmin.cpp +++ b/src/nh99/modspmin.cpp @@ -39,20 +39,27 @@ extern admb_javapointers * adjm_ptr; #if defined (AD_DEMO) write_banner_stuff(); #endif - if (option_match(argc,argv,"-mceval") == -1) - { - computations1(argc,argv); - } - else - { - initial_params::mceval_phase=1; - mcmc_eval(); - initial_params::mceval_phase=0; - } - other_calculations(); - - final_calcs(); - // clean up if have random effects + if (option_match(argc,argv,"-mceval") == -1) + { + if(!(option_match(argc,argv,"-hess_step") == -1)) + { + // Experimental feature to take Newton steps after + // previous optimization + // Note: ::computations1 is called at the end of hess_step function. + hess_step(); + } + else + { + computations1(argc,argv); + } + } else { + initial_params::mceval_phase=1; + mcmc_eval(); + initial_params::mceval_phase=0; + } + other_calculations(); + final_calcs(); + // clean up if have random effects // cleanup_laplace_stuff(lapprox); } @@ -204,7 +211,7 @@ extern admb_javapointers * adjm_ptr; #endif { depvars_routine(); - hess_inv(); + if (!hess_inv()) break; if (spminflag==0) { sd_routine(); diff --git a/src/nh99/nuts.cpp b/src/nh99/nuts.cpp index 4919e7ef1..9696fa792 100644 --- a/src/nh99/nuts.cpp +++ b/src/nh99/nuts.cpp @@ -651,7 +651,7 @@ void function_minimizer::nuts_mcmc_routine(int nmcmc,int iseed0,double dscale, // Test if a u-turn occured across the whole subtree j. Previously we // only tested sub-subtrees. b= stop_criterion(nvar, thetaminus_end, thetaplus_end, rminus_end, rplus_end); - s = _sprime*b; + s = _sprime && b; // Increment valid points and depth n += _nprime; ++j; if(j>=max_treedepth) break; diff --git a/src/nh99/tpl2cpp.lex b/src/nh99/tpl2cpp.lex index df81ee592..4d266ec2b 100644 --- a/src/nh99/tpl2cpp.lex +++ b/src/nh99/tpl2cpp.lex @@ -3684,6 +3684,9 @@ PARAMETER_SECTION { fprintf(fdat,"%s", " static int mceval_phase(void)\n" " {\n return initial_params::mceval_phase;\n }\n"); + fprintf(fdat,"%s", " static int hessian_phase(void)\n" + " {\n return initial_params::in_hessian_phase;\n }\n"); + fprintf(fdat,"%s", " static int sd_phase(void)\n" " {\n return initial_params::sd_phase;\n }\n"); diff --git a/src/nh99/xmodelm3.cpp b/src/nh99/xmodelm3.cpp index 8acc20841..93155b4c2 100644 --- a/src/nh99/xmodelm3.cpp +++ b/src/nh99/xmodelm3.cpp @@ -539,13 +539,30 @@ function_minimizer::function_minimizer(long int sz): spminflag=0; repeatminflag=0; - int ssz; + int ssz = 0; int nopt=get_option_number("-ams", "-ams option needs positive integer -- ignored",ssz); if (nopt>-1 && ssz>0) { sz=ssz; } + ssz = -1; + nopt = get_option_number("-mip", + "Warning: Invalid non-positive argument for command line option -mip.", ssz); + + if (nopt == 1) + { + if (ssz > 0) + { + initial_params::max_num_initial_params = ssz; + } + else + { + cerr << "Warning: Invalid non-positive argument for command line option -mip.\n" + "The default value (" << initial_params::max_num_initial_params << ") will be used.\n"; + } + } + initial_params::varsptr.allocate(static_cast(initial_params::max_num_initial_params)); #ifdef __BORLANDC__ long int lssz; diff --git a/src/tools99/cifstrem.cpp b/src/tools99/cifstrem.cpp index 763170501..2c425501c 100644 --- a/src/tools99/cifstrem.cpp +++ b/src/tools99/cifstrem.cpp @@ -17,6 +17,10 @@ using std::istringstream; #include "cifstrem.h" +#ifdef DEBUG +#include +#endif + /** Destructor */ @@ -44,22 +48,30 @@ char* cifstream::signature() int c = bp->sgetc(); int n = 0; - while ((n < SIGNATURE_LENGTH) && (c != '\n')) + while (c != '\n' && c != '\r' && c != EOF) { - signature_line[n++] = (char)c; + cout << (char)c << endl; + if (n < SIGNATURE_LENGTH) + { + signature_line[n] = (char)c; + cout << signature_line << endl; + ++n; + } c = bp->snextc(); } - signature_line[n++] = '\0'; + signature_line[n] = '\0'; + strcpy(comment_line, signature_line); - // read until end of line incase line is longer than SIGNATURE_LENGTH - while (c != '\n') + // just position buffer to first character of next line + if (c == '\r') + { + c = bp->snextc(); + } + if (c == '\n') { c = bp->snextc(); } - - // just position buffer to first character of next line - bp->snextc(); line++; } @@ -105,80 +117,86 @@ cifstream::cifstream(const char* fn, int open_m, char cc) memset(comment_line, '\0', SIGNATURE_LENGTH); memset(signature_line, '\0', SIGNATURE_LENGTH); } - -void cifstream::filter(void) +/** +Move file pointer past comments and empty lines to next data field. +Also, sets comment_line and signature_line instances if found. +*/ +void cifstream::filter() { - //char testc = bp->NEXTCHAR(); - int testc = bp->sgetc(); - // cout << "in filter testc= " << testc << endl; - while (isspace(testc)) - { - testc = bp->snextc(); - // cout << "in filter testc= " << testc << endl; - } - - while ( (good()) && (testc == COMMENT_CHAR) && (testc != EOF)) + int c = bp->sgetc(); + do { - int n = 0; - // skip characters until newline - do + if (c == '#') { - if (n < SIGNATURE_LENGTH) - comment_line[n++] = (char)testc; - - testc = bp->snextc(); - //cout << "in filter testc= " << testc << endl; - if (testc == '\n') + int n = 0; + while (c != '\r' && c != '\n' && c != EOF) { - comment_line[n++] = '\0'; - if (line == 1) - strcpy(signature_line, comment_line); - line ++; - field = 0; + if (n < SIGNATURE_LENGTH) + { + comment_line[n] = (char)c; + ++n; + } + c = bp->snextc(); } - } while (testc != '\n'); - - // get first character in next line - testc = bp->snextc(); - - while (testc == ' ' || testc == '\n' || testc == '\r') - testc = bp->snextc(); - } - if ( (!good()) || (testc == EOF)) + comment_line[n] = '\0'; + if (line == 1) + { + strcpy(signature_line, comment_line); + } + ++line; + field = 0; + } + else if (isspace(c)) + { + c = bp->snextc(); + } + else + { + break; + } + } while (c != EOF); + if (c == EOF) { - if (testc == EOF) - set_eof_bit(); + set_eof_bit(); report_error( - "function: void cifstream::prefilter(); premature end of file?"); + "function: void cifstream::filter(); premature end of file?"); } } +/** +Extract a single field into s from data file. +\param s stores the data field +\param space_flag includes spaces in data field when active. (default off) +*/ void cifstream::get_field(char* s, int space_flag) { filter(); - // remove leading blanks int testc = bp->sgetc(); - while (isspace(testc)) - { - testc = bp->snextc(); - } int n = 0; if (!space_flag) { - while ( (n < FILTER_BUF_SIZE) && !isspace(testc) && (testc != EOF)) + while (n < FILTER_BUF_SIZE && !isspace(testc)) { s[n++] = (char)testc; testc = bp->snextc(); + if (!good() || testc == EOF) + { + break; + } } } else { - while ( (n < FILTER_BUF_SIZE) && (testc != EOF)) + while (n < FILTER_BUF_SIZE) { s[n++] = (char)testc; testc = bp->snextc(); + if (!good() || testc == EOF) + { + break; + } } } if (n>=FILTER_BUF_SIZE) @@ -186,8 +204,7 @@ void cifstream::get_field(char* s, int space_flag) report_error("function: void cifstream::prefilter();" " Buffer size exceeded?"); } - - if ( (!good()) || (testc == EOF)) + if (!good() || testc == EOF) { if (testc == EOF) set_eof_bit(); @@ -195,7 +212,7 @@ void cifstream::get_field(char* s, int space_flag) "function: void cifstream::prefilter(); premature end of file?"); } s[n++] = '\0'; - field ++; + field++; } /** Reads to s from input cifstream. @@ -394,8 +411,10 @@ cifstream& cifstream::operator>>(const double& _x) if (s) { get_field(s); - if (s[0]=='#' && s[1] == '\0') - get_field(s); + +#ifdef DEBUG + assert((s[0]!='#' && s[1] != '\0'); +#endif #if !defined(__BORLANDC__) istringstream is(s); diff --git a/src/tools99/cifstrem.h b/src/tools99/cifstrem.h index ee1cc0a9a..df54f6c34 100644 --- a/src/tools99/cifstrem.h +++ b/src/tools99/cifstrem.h @@ -173,7 +173,12 @@ class cifstream : public ifstream void filter(); adstring get_file_name(void); + /// Returns the last comment line. char* comment() { return comment_line; } +#ifdef DEBUG + /// Returns the signature which is the first commented line of the data file. + char* get_signature() { return &signature_line[0]; } +#endif char* signature(); cifstream& operator>>(const dvariable& z); diff --git a/src/tools99/string4.cpp b/src/tools99/string4.cpp index 7fb8d2a54..a2aa23447 100644 --- a/src/tools99/string4.cpp +++ b/src/tools99/string4.cpp @@ -40,22 +40,41 @@ istream& operator>>(istream& c, line_adstring& t) { const unsigned int max_length = 1025; char tmp[max_length + 1]; - char ch = (char)c.get(); // throw away the newline at the end of the last line if necessary - if (ch == '\n') ch = (char)c.get(); + //if (ch == '\r') ch = (char)c.get(); unsigned int ii = 0; - while (ch != '\n' && ch != EOF) + while (ii <= max_length) { - if (ii == max_length) + char ch = (char)c.get(); + if (ch == '\r') { - cerr << "Error -- Maximum line_adstring length exceeded in " - << "istream& operator>>(istream&, line_adstring&)" << endl; - ad_exit(1); + char p = (char)c.peek(); + if (p == '\n') + { + ch = (char)c.get(); + } + break; } - tmp[ii++] = ch; - ch = (char)c.get(); + else if (ch == '\n') + { + break; + } + else if (ch == EOF) + { + break; + } + else + { + tmp[ii++] = ch; + } + } + if (ii > max_length) + { + cerr << "Error -- Maximum line_adstring length exceeded in " + << "istream& operator>>(istream&, line_adstring&)" << endl; + ad_exit(1); } tmp[ii] = '\0'; t = tmp; diff --git a/tests/GNUmakefile b/tests/GNUmakefile index 66c077acc..c35719144 100644 --- a/tests/GNUmakefile +++ b/tests/GNUmakefile @@ -98,10 +98,12 @@ core-tpls:\ tpl-f1b2vc5\ cpp-globals\ tpl-gradients_output\ + tpl-hess_step\ tpl-high_iarray\ tpl-hysimple\ tpl-initializationfunction\ tpl-issue108\ + tpl-issue158\ tpl-lprof\ tpl-mcmc-theta\ tpl-orange_mvn\ @@ -109,6 +111,7 @@ core-tpls:\ tpl-qbeta\ tpl-rsimple\ tpl-simple_mcmc\ + tpl-strip_full_path\ tpl-testminmax\ tpl-tiny\ tpl-tiny_ad_fe\ @@ -131,9 +134,15 @@ contrib-tpls:\ remote-contrib-tpls:\ tpl-agemat +tpl-strip_full_path: + $(MAKE) --directory=strip_full_path + cpp-globals: $(MAKE) --directory=globals +tpl-issue158: + $(MAKE) --directory=issue158 + tpl-f1b2vc5: $(MAKE) --directory=f1b2vc5 @@ -209,6 +218,9 @@ tpl-betareg: tpl-beta_regression: $(MAKE) --directory=beta_regression +tpl-hess_step: + $(MAKE) --directory=hess_step + tpl-changepoint: $(MAKE) --directory=changepoint @@ -297,8 +309,12 @@ total-clean: clean clean: ifeq ($(CMDSHELL),cmd) @if exist SS3 rmdir /s /q SS3 + @if exist outputs-examples-opt.txt del /Q outputs-examples-opt.txt 2> nul + @if exist outputs-examples-saf.txt del /Q outputs-examples-saf.txt 2> nul else @rm -rvf SS3 + @rm -vf outputs-examples-opt.txt + @rm -vf outputs-examples-saf.txt endif $(MAKE) --directory=4darray clean $(MAKE) --directory=adnuts clean @@ -326,6 +342,7 @@ endif $(MAKE) --directory=gmrf clean $(MAKE) --directory=gradients_output clean $(MAKE) --directory=gtests clean + $(MAKE) --directory=hess_step clean $(MAKE) --directory=high_iarray clean $(MAKE) --directory=hysimple clean $(MAKE) --directory=initializationfunction clean @@ -339,6 +356,7 @@ endif $(MAKE) --directory=rgamma clean $(MAKE) --directory=rsimple clean $(MAKE) --directory=simple_mcmc clean + $(MAKE) --directory=strip_full_path clean $(MAKE) --directory=testminmax clean $(MAKE) --directory=tiny clean $(MAKE) --directory=tiny_ad_fe clean @@ -347,6 +365,7 @@ endif $(MAKE) --directory=vectorize clean $(MAKE) --directory=vonmises clean $(MAKE) --directory=../examples/admb/prof_like clean + $(MAKE) --directory=issue158 clean dist-clean: ifeq ($(CMDSHELL),cmd) @@ -409,6 +428,7 @@ get-outputs: $(MAKE) --directory=glmmadmb get-outputs $(MAKE) --directory=globals get-outputs $(MAKE) --directory=gradients_output get-outputs + $(MAKE) --directory=hess_step get-outputs $(MAKE) --directory=high_iarray get-outputs $(MAKE) --directory=hysimple get-outputs $(MAKE) --directory=initializationfunction get-outputs diff --git a/tests/gtests/GNUmakefile b/tests/gtests/GNUmakefile index 1a556b7c4..6b435f294 100644 --- a/tests/gtests/GNUmakefile +++ b/tests/gtests/GNUmakefile @@ -385,6 +385,17 @@ ifeq ($(CMDSHELL),cmd) @del test_cifstream_darray.txt 2>NUL @del test_cifstream_dvariable.txt 2>NUL @del test_cifstream_iarray.txt 2>NUL + @del test_cifstream_float_dos.txt 2>NUL + @del /Q big_signature_n.txt 2>NUL + @del /Q big_signature_r.txt 2>NUL + @del /Q big_signature_rn.txt 2>NUL + @del /Q maxlimit1.txt 2>NUL + @del /Q maxlimit2.txt 2>NUL + @del /Q maxlimit3.txt 2>NUL + @del /Q maxlimita.txt 2>NUL + @del /Q test_dvar_vector_read_from_file.txt 2>NUL + @del /Q test_dvector_read_from_file2.txt 2>NUL + @del /Q test_dvector_read_from_file3.txt 2>NUL else @rm -vf test_i4_array.txt @rm -vf test_i5_array.txt @@ -485,4 +496,15 @@ else @rm -vf test_cifstream_iarray.txt @rm -vf datafiledoesexist.dat @rm -vf pinfiledoesexist.pin + @rm -vf test_cifstream_float_dos.txt + @rm -vf big_signature_n.txt + @rm -vf big_signature_r.txt + @rm -vf big_signature_rn.txt + @rm -vf maxlimit1.txt + @rm -vf maxlimit2.txt + @rm -vf maxlimit3.txt + @rm -vf maxlimita.txt + @rm -vf test_dvar_vector_read_from_file.txt + @rm -vf test_dvector_read_from_file2.txt + @rm -vf test_dvector_read_from_file3.txt endif diff --git a/tests/gtests/test_adlist_ptr.cpp b/tests/gtests/test_adlist_ptr.cpp index 0d889857f..6a852546c 100644 --- a/tests/gtests/test_adlist_ptr.cpp +++ b/tests/gtests/test_adlist_ptr.cpp @@ -5,6 +5,7 @@ class test_adlist_ptr: public ::testing::Test {}; TEST_F(test_adlist_ptr, constructor) { - adlist_ptr list(0); + adlist_ptr list; + list.allocate(0); list.initialize(); } diff --git a/tests/gtests/test_cifstream.cpp b/tests/gtests/test_cifstream.cpp index 0f2d964ad..41159d1d3 100644 --- a/tests/gtests/test_cifstream.cpp +++ b/tests/gtests/test_cifstream.cpp @@ -31,7 +31,7 @@ TEST_F(test_cifstream, call_signature_twice) char* signature2 = cifs.signature(); ASSERT_STREQ("//MY Signature", signature2); } -TEST_F(test_cifstream, big_signature) +TEST_F(test_cifstream, big_signature_file) { cifstream cifs("big_signature.txt"); char* bigsignature = cifs.signature(); @@ -42,6 +42,45 @@ TEST_F(test_cifstream, big_signature) cifs.getline(line, 5, '\n'); ASSERT_STREQ("END", line); } +TEST_F(test_cifstream, big_signature_n) +{ + std::ofstream ofs("big_signature_n.txt"); + ofs << "01234567890123456789012345678901234567890123456789012345678901234567890123456789\n"; + ofs << "END"; + ofs.close(); + + cifstream cifs("big_signature_n.txt"); + char* bigsignature = cifs.signature(); + ASSERT_STREQ( + "01234567890123456789012345678901234567890123456789012345678901234567890123456789", + bigsignature); +} +TEST_F(test_cifstream, big_signature_rn) +{ + std::ofstream ofs("big_signature_rn.txt"); + ofs << "01234567890123456789012345678901234567890123456789012345678901234567890123456789\r\n"; + ofs << "END"; + ofs.close(); + + cifstream cifs("big_signature_rn.txt"); + char* bigsignature = cifs.signature(); + ASSERT_STREQ( + "01234567890123456789012345678901234567890123456789012345678901234567890123456789", + bigsignature); +} +TEST_F(test_cifstream, big_signature_r) +{ + std::ofstream ofs("big_signature_r.txt"); + ofs << "01234567890123456789012345678901234567890123456789012345678901234567890123456789\r"; + ofs << "END"; + ofs.close(); + + cifstream cifs("big_signature_rn.txt"); + char* bigsignature = cifs.signature(); + ASSERT_STREQ( + "01234567890123456789012345678901234567890123456789012345678901234567890123456789", + bigsignature); +} TEST_F(test_cifstream, double) { cifstream cifs("test_cifstream_getfield.txt"); @@ -691,3 +730,130 @@ TEST_F(test_cifstream, lvector2) ASSERT_EQ(43948093, lvec(3)); ASSERT_EQ(993859, lvec(4)); } +TEST_F(test_cifstream, lvector2_dos) +{ + std::ofstream ofs("test_cifstream_float_dos.txt"); + ofs << "# a\r\n"; + ofs << "\r\n"; + ofs << "# b\r\n"; + ofs << "\r\n\r\n"; + ofs << "# a\r\n"; + ofs << "\t\r\n"; + ofs << "# b\r\n"; + ofs << " \r\n"; + ofs << "# a\r\n"; + ofs << " \t\r\n"; + ofs << "# b\r\n"; + ofs << "356345 \t 9445938 43948093 \r 993859\r\n"; + ofs.close(); + + lvector lvec(1, 4); + ASSERT_TRUE(allocated(lvec)); + cifstream cifs("test_cifstream_float_dos.txt"); + cifs >> lvec; + cifs.close(); + + ASSERT_EQ(356345, lvec(1)); + ASSERT_EQ(9445938, lvec(2)); + ASSERT_EQ(43948093, lvec(3)); + ASSERT_EQ(993859, lvec(4)); +} +TEST_F(test_cifstream, comment_rn) +{ + std::ofstream ofs("test_cifstream_float_dos.txt"); + ofs << "# a\r\n"; + ofs << "\r\n"; + ofs << "# b\r\n"; + ofs << "\r\n\r\n"; + ofs << "# a\r\n"; + ofs << "\t\r\n"; + ofs << "356345 \t 9445938 # dkfjdkj kdjfkdj \r\n\t 43948093 \r 993859\r\n"; + ofs << "# b\r\n"; + ofs << " \r\n"; + ofs << "# a\r\n"; + ofs << " \t\r\n"; + ofs << "# b\r\n"; + ofs.close(); + + lvector lvec(1, 4); + ASSERT_TRUE(allocated(lvec)); + cifstream cifs("test_cifstream_float_dos.txt"); + cifs >> lvec; + cifs.close(); + + ASSERT_STREQ("# dkfjdkj kdjfkdj ", cifs.comment()); +#ifdef DEBUG + ASSERT_STREQ("# a", cifs.get_signature()); +#endif + + ASSERT_EQ(356345, lvec(1)); + ASSERT_EQ(9445938, lvec(2)); + ASSERT_EQ(43948093, lvec(3)); + ASSERT_EQ(993859, lvec(4)); +} +TEST_F(test_cifstream, comment_r) +{ + std::ofstream ofs("test_cifstream_float_dos.txt"); + ofs << "# a\r\n"; + ofs << "\r\n"; + ofs << "# b\r\n"; + ofs << "\r\n\r\n"; + ofs << "# a\r\n"; + ofs << "\t\r\n"; + ofs << "356345 \t 9445938 # dkfjdkj kdjfkdj \r\t 43948093 \r 993859\r\n"; + ofs << "# b\r\n"; + ofs << " \r\n"; + ofs << "# a\r\n"; + ofs << " \t\r\n"; + ofs << "# b\r\n"; + ofs.close(); + + lvector lvec(1, 4); + ASSERT_TRUE(allocated(lvec)); + cifstream cifs("test_cifstream_float_dos.txt"); + cifs >> lvec; + cifs.close(); + + ASSERT_STREQ("# dkfjdkj kdjfkdj ", cifs.comment()); +#ifdef DEBUG + ASSERT_STREQ("# a", cifs.get_signature()); +#endif + + ASSERT_EQ(356345, lvec(1)); + ASSERT_EQ(9445938, lvec(2)); + ASSERT_EQ(43948093, lvec(3)); + ASSERT_EQ(993859, lvec(4)); +} +TEST_F(test_cifstream, comment_n) +{ + std::ofstream ofs("test_cifstream_float_dos.txt"); + ofs << "# a\r\n"; + ofs << "\r\n"; + ofs << "# b\r\n"; + ofs << "\r\n\r\n"; + ofs << "# a\r\n"; + ofs << "\t\r\n"; + ofs << "356345 \t 9445938 # dkfjdkj kdjfkdj \n\t 43948093 \r 993859\r\n"; + ofs << "# b\r\n"; + ofs << " \r\n"; + ofs << "# a\r\n"; + ofs << " \t\r\n"; + ofs << "# b\r\n"; + ofs.close(); + + lvector lvec(1, 4); + ASSERT_TRUE(allocated(lvec)); + cifstream cifs("test_cifstream_float_dos.txt"); + cifs >> lvec; + cifs.close(); + + ASSERT_STREQ("# dkfjdkj kdjfkdj ", cifs.comment()); +#ifdef DEBUG + ASSERT_STREQ("# a", cifs.get_signature()); +#endif + + ASSERT_EQ(356345, lvec(1)); + ASSERT_EQ(9445938, lvec(2)); + ASSERT_EQ(43948093, lvec(3)); + ASSERT_EQ(993859, lvec(4)); +} diff --git a/tests/gtests/test_dvar_vector.cpp b/tests/gtests/test_dvar_vector.cpp index 756fd32a4..bf284d4c3 100644 --- a/tests/gtests/test_dvar_vector.cpp +++ b/tests/gtests/test_dvar_vector.cpp @@ -713,3 +713,20 @@ TEST_F(test_dvar_vector, sqrvariable) ASSERT_DOUBLE_EQ(gradients(3), 2.0 * independents(3)); ASSERT_DOUBLE_EQ(gradients(4), 2.0 * independents(4)); } +TEST_F(test_dvar_vector, nobraces) +{ + gradient_structure gs; + + ofstream ofs("test_dvector.txt"); + ofs << "0 1 2 3 4 5\n"; + ofs.close(); + + dvar_vector v("test_dvector.txt"); + + ASSERT_DOUBLE_EQ(0, value(v(1))); + ASSERT_DOUBLE_EQ(1, value(v(2))); + ASSERT_DOUBLE_EQ(2, value(v(3))); + ASSERT_DOUBLE_EQ(3, value(v(4))); + ASSERT_DOUBLE_EQ(4, value(v(5))); + ASSERT_DOUBLE_EQ(5, value(v(6))); +} diff --git a/tests/gtests/test_i5_array.cpp b/tests/gtests/test_i5_array.cpp index 1be7956c9..1e4c4d3f7 100644 --- a/tests/gtests/test_i5_array.cpp +++ b/tests/gtests/test_i5_array.cpp @@ -262,3 +262,65 @@ TEST_F(test_i5_array, deallocatecopies) ASSERT_EQ(0, firstcopy.get_ncopies()); ASSERT_EQ(0, secondcopy.get_ncopies()); } +TEST_F(test_i5_array, empty_initialize) +{ + i5_array a; + ASSERT_NO_THROW({ + a.initialize(); + }); +} +TEST_F(test_i5_array, initialize) +{ + i5_array a; + a.allocate(1, 5, 1, 4, 1, 3, 1, 2, 1, 10); + int index = 1; + for (int i5 = 1; i5 <= 5; ++i5) + { + for (int i4 = 1; i4 <= 4; ++i4) + { + for (int i3 = 1; i3 <= 3; ++i3) + { + for (int i2 = 1; i2 <= 2; ++i2) + { + for (int i1 = 1; i1 <= 10; ++i1) + { + a(i5, i4, i3, i2, i1) = index++; + } + } + } + } + } + for (int i5 = 1; i5 <= 5; ++i5) + { + for (int i4 = 1; i4 <= 4; ++i4) + { + for (int i3 = 1; i3 <= 3; ++i3) + { + for (int i2 = 1; i2 <= 2; ++i2) + { + for (int i1 = 1; i1 <= 10; ++i1) + { + ASSERT_TRUE(a(i5, i4, i3, i2, i1) != 0); + } + } + } + } + } + a.initialize(); + for (int i5 = 1; i5 <= 5; ++i5) + { + for (int i4 = 1; i4 <= 4; ++i4) + { + for (int i3 = 1; i3 <= 3; ++i3) + { + for (int i2 = 1; i2 <= 2; ++i2) + { + for (int i1 = 1; i1 <= 10; ++i1) + { + ASSERT_EQ(a(i5, i4, i3, i2, i1), 0); + } + } + } + } + } +} diff --git a/tests/gtests/test_xpools.cpp b/tests/gtests/test_xpools.cpp index 678a97c74..d3e938bd1 100644 --- a/tests/gtests/test_xpools.cpp +++ b/tests/gtests/test_xpools.cpp @@ -6,8 +6,8 @@ class test_xpools: public ::testing::Test {}; TEST_F(test_xpools, sizes) { #ifdef USE_VECTOR_SHAPE_POOL - ASSERT_EQ(vector_shape::get_xpool().size, sizeof(vector_shape)); - ASSERT_EQ(vector_shapex::get_xpool().size, sizeof(vector_shapex)); - ASSERT_EQ(arr_link::get_xpool().size, sizeof(arr_link)); + ASSERT_EQ(vector_shape::xpool->size, sizeof(vector_shape)); + ASSERT_EQ(vector_shapex::xpool->size, sizeof(vector_shapex)); + ASSERT_EQ(arr_link::xpool->size, sizeof(arr_link)); #endif } diff --git a/tests/hess_step/GNUmakefile b/tests/hess_step/GNUmakefile new file mode 100644 index 000000000..61574c487 --- /dev/null +++ b/tests/hess_step/GNUmakefile @@ -0,0 +1,56 @@ +TARGET=catage +OVERRIDE=all + +ifeq ($(OS),Windows_NT) +include ..\test-rules.mak +else +include ../test-rules.mak +endif + +run: catage.dat catage.tpl + $(MAKE) $(TARGET) +ifeq ($(CMDSHELL),cmd) + $(TARGET) -nox + @echo "\n===\n" + $(TARGET) -hess_step 10 -hess_step_tol 1e-18 +else + ./$(TARGET) -nox + @echo "\n===\n" + ./$(TARGET) -hess_step 10 -hess_step_tol 1e-18 +endif + +catage.dat: +ifeq ($(CMDSHELL),cmd) + copy ..\..\examples\admb\catage\catage.dat +else + cp ../../examples/admb/catage/catage.dat . +endif + +catage.tpl: +ifeq ($(CMDSHELL),cmd) + copy ..\..\examples\admb\catage\catage.tpl +else + cp ../../examples/admb/catage/catage.tpl . +endif + +get-outputs: _get-outputs +ifeq ($(CMDSHELL),cmd) + @if exist outputs type outputs +else + @if [ -e outputs ]; then cat outputs; fi +endif + +clean: _clean +ifeq ($(CMDSHELL),cmd) + @if exist $(TARGET).b02 del /Q $(TARGET).b02 2>nul + @if exist $(TARGET).dat del /Q $(TARGET).dat 2>nul + @if exist $(TARGET).p02 del /Q $(TARGET).p02 2>nul + @if exist $(TARGET).r02 del /Q $(TARGET).r02 2>nul + @if exist $(TARGET).tpl del /Q $(TARGET).tpl 2>nul +else + @rm -vf $(TARGET).b02 + @rm -vf $(TARGET).dat + @rm -vf $(TARGET).p02 + @rm -vf $(TARGET).r02 + @rm -vf $(TARGET).tpl +endif diff --git a/tests/hess_step/Makefile b/tests/hess_step/Makefile new file mode 100644 index 000000000..8a432a160 --- /dev/null +++ b/tests/hess_step/Makefile @@ -0,0 +1,26 @@ +TARGET=catage +OVERRIDE=all + +!include <..\test-rules.nmake> + +run: catage.dat catage.tpl + $(MAKE) $(TARGET) + $(TARGET) -nox + @echo "\n===\n" + $(TARGET) -hess_step 10 -hess_step_tol 1e-18 + +catage.dat: + copy ..\..\examples\admb\catage\catage.dat + +catage.tpl: + copy ..\..\examples\admb\catage\catage.tpl + +get-outputs: _get-outputs + @if exist outputs type outputs + +clean: _clean + @if exist $(TARGET).b02 del /Q $(TARGET).b02 2>nul + @if exist $(TARGET).dat del /Q $(TARGET).dat 2>nul + @if exist $(TARGET).p02 del /Q $(TARGET).p02 2>nul + @if exist $(TARGET).r02 del /Q $(TARGET).r02 2>nul + @if exist $(TARGET).tpl del /Q $(TARGET).tpl 2>nul diff --git a/tests/issue158/GNUmakefile b/tests/issue158/GNUmakefile new file mode 100644 index 000000000..bfde922c9 --- /dev/null +++ b/tests/issue158/GNUmakefile @@ -0,0 +1,36 @@ +TARGET=simple +OVERRIDE=all + +ifeq ($(OS),Windows_NT) +include ..\test-rules.mak +else +include ../test-rules.mak +endif + +run: simple.dat + $(MAKE) $(TARGET) + @printf "Started run:\n" +ifeq ($(CMDSHELL),cmd) + $(TARGET).exe +else + ./$(TARGET) +endif + @printf "Finished run.\n" + +simple.dat: +ifeq ($(CMDSHELL),cmd) + copy ..\\..\\examples\\admb\\simple\\simple.dat . +else + cp ../../examples/admb/simple/simple.dat . +endif + +clean: + +get-outputs: _get-outputs + +clean: _clean +ifeq ($(CMDSHELL),cmd) + @if exist simple.dat del /Q simple.dat 2>nul +else + @rm -vf simple.dat +endif diff --git a/tests/issue158/Makefile b/tests/issue158/Makefile new file mode 100644 index 000000000..6a5beaa0b --- /dev/null +++ b/tests/issue158/Makefile @@ -0,0 +1,20 @@ +TARGET=simple +OVERRIDE=all + +!include <..\test-rules.nmake> + +run: simple.dat + $(MAKE) $(TARGET) + @printf "Started run:\n" + $(TARGET).exe + @printf "Finished run.\n" + +simple.dat: + copy ..\\..\\examples\\admb\\simple\\simple.dat . + +clean: _clean + +get-outputs: _get-outputs + +clean: _clean + @if exist simple.dat del /Q simple.dat 2>nul diff --git a/tests/issue158/simple.tpl b/tests/issue158/simple.tpl new file mode 100644 index 000000000..57242556b --- /dev/null +++ b/tests/issue158/simple.tpl @@ -0,0 +1,23 @@ +// Author: David Fournier +// Copyright (c) 2009-2018 ADMB Foundation + +DATA_SECTION + init_int n + init_vector x(1,n) + init_vector y(1,n) +PARAMETER_SECTION + init_number b0 + init_number b1 + vector yhat(1,n) + objective_function_value f +PROCEDURE_SECTION + if (hessian_phase()) + { + cout << "Hessian phase is True." << endl; + } + else + { + cout << "Hessian phase is False." << endl; + } + yhat=b0+b1*x; + f=regression(y,yhat); diff --git a/tests/strip_full_path/GNUmakefile b/tests/strip_full_path/GNUmakefile new file mode 100644 index 000000000..e58ac46be --- /dev/null +++ b/tests/strip_full_path/GNUmakefile @@ -0,0 +1,57 @@ +ifeq ($(OS),Windows_NT) + ifeq ($(SHELL),cmd) + CMDSHELL=cmd + else + ifeq ($(findstring sh.exe,$(shell where sh.exe 2>&1 | findstr sh.exe)),sh.exe) + EXT=.sh + else + SHELL=cmd + CMDSHELL=cmd + endif + endif +endif + +all: clean + $(MAKE) dirs +ifeq ($(CMDSHELL),cmd) + pushd src & ..\\..\\..\\admb -o..\\bin\\simple simple.tpl + pushd run & ..\\bin\\simple.exe +else + cd src && ../../../admb$(EXT) -o../bin/simple simple.tpl + cd run && ../bin/simple +endif + +dirs: +ifeq ($(CMDSHELL),cmd) + md run + md src + md bin +else + mkdir run + mkdir src + mkdir bin +endif + $(MAKE) simple.dat simple.tpl + +simple.dat: +ifeq ($(CMDSHELL),cmd) + copy ..\..\examples\admb\simple\simple.dat run +else + cp ../../examples/admb/simple/simple.dat run +endif + +simple.tpl: +ifeq ($(CMDSHELL),cmd) + copy ..\..\examples\admb\simple\simple.tpl src +else + cp ../../examples/admb/simple/simple.tpl src +endif + +clean: +ifeq ($(CMDSHELL),cmd) + @if exist bin rmdir /Q bin 2> nul + @if exist src rmdir /Q src 2> nul + @if exist run rmdir /Q run 2> nul +else + @rm -rvf bin src run +endif