From 08cc0afc797d2225cf23fbc785e6a28cc8667285 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Wed, 28 Mar 2018 21:52:00 -0600 Subject: Nuget packaged up dependencies --- redist/minimal_opencv.c | 172 ++++++++++++++++++++++++- src/epnp/epnp.c | 2 +- src/poser_sba.c | 1 + src/survive.c | 5 +- src/survive_cal.c | 2 +- winbuild/calibrate/calibrate.vcxproj | 11 ++ winbuild/calibrate/calibrate.vcxproj.filters | 3 + winbuild/data_recorder/data_recorder.vcxproj | 1 + winbuild/libsurvive/libsurvive.vcxproj | 33 ++++- winbuild/libsurvive/libsurvive.vcxproj.filters | 37 ++++++ winbuild/libsurvive/packages.config | 5 + winbuild/test/test.vcxproj | 4 +- 12 files changed, 265 insertions(+), 11 deletions(-) create mode 100644 winbuild/libsurvive/packages.config diff --git a/redist/minimal_opencv.c b/redist/minimal_opencv.c index 50eb7df..e35e31d 100644 --- a/redist/minimal_opencv.c +++ b/redist/minimal_opencv.c @@ -1,5 +1,3 @@ -//#include "/home/justin/source/CLAPACK/INCLUDE/f2c.h" -//#include "/home/justin/source/CLAPACK/INCLUDE/clapack.h" #include #include @@ -10,8 +8,176 @@ #include "string.h" #include +#include + //#define DEBUG_PRINT +#ifdef _WIN3211 +#include "cblas.h" + +int CBLAS_CallFromC; +int RowMajorStrg; +void cblas_xerbla(int info, const char *rout, const char *form, ...) +{ + extern int RowMajorStrg; + char empty[1] = ""; + va_list argptr; + + va_start(argptr, form); + + if (RowMajorStrg) + { + if (strstr(rout, "gemm") != 0) + { + if (info == 5) info = 4; + else if (info == 4) info = 5; + else if (info == 11) info = 9; + else if (info == 9) info = 11; + } + else if (strstr(rout, "symm") != 0 || strstr(rout, "hemm") != 0) + { + if (info == 5) info = 4; + else if (info == 4) info = 5; + } + else if (strstr(rout, "trmm") != 0 || strstr(rout, "trsm") != 0) + { + if (info == 7) info = 6; + else if (info == 6) info = 7; + } + else if (strstr(rout, "gemv") != 0) + { + if (info == 4) info = 3; + else if (info == 3) info = 4; + } + else if (strstr(rout, "gbmv") != 0) + { + if (info == 4) info = 3; + else if (info == 3) info = 4; + else if (info == 6) info = 5; + else if (info == 5) info = 6; + } + else if (strstr(rout, "ger") != 0) + { + if (info == 3) info = 2; + else if (info == 2) info = 3; + else if (info == 8) info = 6; + else if (info == 6) info = 8; + } + else if ((strstr(rout, "her2") != 0 || strstr(rout, "hpr2") != 0) + && strstr(rout, "her2k") == 0) + { + if (info == 8) info = 6; + else if (info == 6) info = 8; + } + } + if (info) + fprintf(stderr, "Parameter %d to routine %s was incorrect\n", info, rout); + vfprintf(stderr, form, argptr); + va_end(argptr); + if (info && !info) + F77_xerbla(empty, &info); /* Force link of our F77 error handler */ + exit(-1); +} +void cblas_dgemm(const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE TransA, + const CBLAS_TRANSPOSE TransB, const int M, const int N, + const int K, const double alpha, const double *A, + const int lda, const double *B, const int ldb, + const double beta, double *C, const int ldc) +{ + char TA, TB; +#ifdef F77_CHAR + F77_CHAR F77_TA, F77_TB; +#else +#define F77_TA &TA +#define F77_TB &TB +#endif + +#ifdef F77_INT + F77_INT F77_M = M, F77_N = N, F77_K = K, F77_lda = lda, F77_ldb = ldb; + F77_INT F77_ldc = ldc; +#else +#define F77_M M +#define F77_N N +#define F77_K K +#define F77_lda lda +#define F77_ldb ldb +#define F77_ldc ldc +#endif + + RowMajorStrg = 0; + CBLAS_CallFromC = 1; + + if (layout == CblasColMajor) + { + if (TransA == CblasTrans) TA = 'T'; + else if (TransA == CblasConjTrans) TA = 'C'; + else if (TransA == CblasNoTrans) TA = 'N'; + else + { + cblas_xerbla(2, "cblas_dgemm", "Illegal TransA setting, %d\n", TransA); + CBLAS_CallFromC = 0; + RowMajorStrg = 0; + return; + } + + if (TransB == CblasTrans) TB = 'T'; + else if (TransB == CblasConjTrans) TB = 'C'; + else if (TransB == CblasNoTrans) TB = 'N'; + else + { + cblas_xerbla(3, "cblas_dgemm", "Illegal TransB setting, %d\n", TransB); + CBLAS_CallFromC = 0; + RowMajorStrg = 0; + return; + } + +#ifdef F77_CHAR + F77_TA = C2F_CHAR(&TA); + F77_TB = C2F_CHAR(&TB); +#endif + + F77_dgemm(F77_TA, F77_TB, &F77_M, &F77_N, &F77_K, &alpha, A, + &F77_lda, B, &F77_ldb, &beta, C, &F77_ldc); + } + else if (layout == CblasRowMajor) + { + RowMajorStrg = 1; + if (TransA == CblasTrans) TB = 'T'; + else if (TransA == CblasConjTrans) TB = 'C'; + else if (TransA == CblasNoTrans) TB = 'N'; + else + { + cblas_xerbla(2, "cblas_dgemm", "Illegal TransA setting, %d\n", TransA); + CBLAS_CallFromC = 0; + RowMajorStrg = 0; + return; + } + if (TransB == CblasTrans) TA = 'T'; + else if (TransB == CblasConjTrans) TA = 'C'; + else if (TransB == CblasNoTrans) TA = 'N'; + else + { + cblas_xerbla(2, "cblas_dgemm", "Illegal TransB setting, %d\n", TransB); + CBLAS_CallFromC = 0; + RowMajorStrg = 0; + return; + } +#ifdef F77_CHAR + F77_TA = C2F_CHAR(&TA); + F77_TB = C2F_CHAR(&TB); +#endif + + F77_dgemm(F77_TA, F77_TB, &F77_N, &F77_M, &F77_K, &alpha, B, + &F77_ldb, A, &F77_lda, &beta, C, &F77_ldc); + } + else cblas_xerbla(1, "cblas_dgemm", "Illegal layout setting, %d\n", layout); + CBLAS_CallFromC = 0; + RowMajorStrg = 0; + return; +} +#endif + + int cvRound(float f) { return roundf(f); } #define CV_Error(code, msg) assert(0 && msg); // cv::error( code, msg, CV_Func, __FILE__, __LINE__ ) @@ -27,7 +193,7 @@ void cvCopyTo(const CvMat *srcarr, CvMat *dstarr) { void cvGEMM(const CvMat *src1, const CvMat *src2, double alpha, const CvMat *src3, double beta, CvMat *dst, int tABC) { lapack_int rows1 = src1->rows; lapack_int cols1 = src1->cols; - + lapack_int rows2 = src2->rows; lapack_int cols2 = src2->cols; diff --git a/src/epnp/epnp.c b/src/epnp/epnp.c index 4b888aa..53a1d48 100644 --- a/src/epnp/epnp.c +++ b/src/epnp/epnp.c @@ -134,7 +134,7 @@ void epnp_choose_control_points(epnp *self) { // Take C1, C2, and C3 from PCA on the reference points: CvMat *PW0 = cvCreateMat(self->number_of_correspondences, 3, CV_64F); - double pw0tpw0[3 * 3] = {}, dc[3], uct[3 * 3]; + double pw0tpw0[3 * 3] = {0}, dc[3], uct[3 * 3]; CvMat PW0tPW0 = cvMat(3, 3, CV_64F, pw0tpw0); CvMat DC = cvMat(3, 1, CV_64F, dc); CvMat UCt = cvMat(3, 3, CV_64F, uct); diff --git a/src/poser_sba.c b/src/poser_sba.c index 0ad38ac..df28a2d 100644 --- a/src/poser_sba.c +++ b/src/poser_sba.c @@ -4,6 +4,7 @@ #endif #include +#include #include "poser.h" #include diff --git a/src/survive.c b/src/survive.c index f46f128..23b1e4c 100644 --- a/src/survive.c +++ b/src/survive.c @@ -110,6 +110,9 @@ SurviveContext *survive_init_internal(int argc, char *const *argv) { MANUAL_DRIVER_REGISTRATION(PoserCharlesSlow) MANUAL_DRIVER_REGISTRATION(PoserDaveOrtho) MANUAL_DRIVER_REGISTRATION(PoserDummy) + MANUAL_DRIVER_REGISTRATION(PoserEPNP) + MANUAL_DRIVER_REGISTRATION(PoserSBA) + MANUAL_DRIVER_REGISTRATION(DriverRegHTCVive) MANUAL_DRIVER_REGISTRATION(DriverRegPlayback) @@ -260,7 +263,7 @@ int survive_startup(SurviveContext *ctx) { // start the thread to process button data ctx->buttonservicethread = OGCreateThread(button_servicer, ctx); - PoserCB PreferredPoserCB = GetDriverByConfig(ctx, "Poser", "defaultposer", "TurveyTori", 2); + PoserCB PreferredPoserCB = GetDriverByConfig(ctx, "Poser", "defaultposer", "SBA", 2); ctx->lightcapfunction = GetDriverByConfig(ctx, "Disambiguator", "disambiguator", "Turvey", 2); const char *DriverName; diff --git a/src/survive_cal.c b/src/survive_cal.c index 25e43b9..2fc1896 100755 --- a/src/survive_cal.c +++ b/src/survive_cal.c @@ -187,7 +187,7 @@ void survive_cal_install( struct SurviveContext * ctx ) } const char * DriverName; - cd->ConfigPoserFn = GetDriverByConfig(ctx, "Poser", "configposer", "TurveyTori", 0); + cd->ConfigPoserFn = GetDriverByConfig(ctx, "Poser", "configposer", "SBA", 0); ootx_packet_clbk = ootx_packet_clbk_d; diff --git a/winbuild/calibrate/calibrate.vcxproj b/winbuild/calibrate/calibrate.vcxproj index 51519e6..d0b1c48 100644 --- a/winbuild/calibrate/calibrate.vcxproj +++ b/winbuild/calibrate/calibrate.vcxproj @@ -75,6 +75,7 @@ true + $(LibraryPath) false @@ -190,7 +191,17 @@ {435cfd2c-8724-42ee-8fde-71ef7d2c6b2f} + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/winbuild/calibrate/calibrate.vcxproj.filters b/winbuild/calibrate/calibrate.vcxproj.filters index dae64dc..1498023 100644 --- a/winbuild/calibrate/calibrate.vcxproj.filters +++ b/winbuild/calibrate/calibrate.vcxproj.filters @@ -36,4 +36,7 @@ Header Files + + + \ No newline at end of file diff --git a/winbuild/data_recorder/data_recorder.vcxproj b/winbuild/data_recorder/data_recorder.vcxproj index 59a1e77..e63d474 100644 --- a/winbuild/data_recorder/data_recorder.vcxproj +++ b/winbuild/data_recorder/data_recorder.vcxproj @@ -72,6 +72,7 @@ true + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 true diff --git a/winbuild/libsurvive/libsurvive.vcxproj b/winbuild/libsurvive/libsurvive.vcxproj index 6268d63..2451c22 100644 --- a/winbuild/libsurvive/libsurvive.vcxproj +++ b/winbuild/libsurvive/libsurvive.vcxproj @@ -56,6 +56,7 @@ + @@ -70,14 +71,17 @@ - + + $(IncludePath) + $(LibraryPath) + Level3 Disabled - FLT=double;USE_DOUBLE;MANUAL_REGISTRATION;NOZLIB;_CRT_SECURE_NO_WARNINGS;HIDAPI;WINDOWS;_DEBUG;_LIB;%(PreprocessorDefinitions) + FLT=double;USE_DOUBLE;MANUAL_REGISTRATION;NOZLIB;_CRT_SECURE_NO_WARNINGS;HIDAPI;WINDOWS;_DEBUG;_LIB;HAVE_LAPACK_CONFIG_H;LAPACK_COMPLEX_STRUCTURE;%(PreprocessorDefinitions) ..\..\winbuild;..\..\include\libsurvive;..\..\redist;%(AdditionalIncludeDirectories) @@ -89,6 +93,10 @@ $(MSBuildProjectDirectory)\libsurvive.def + + libblas.lib;liblapacke.lib;liblapack.lib%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + @@ -149,14 +157,23 @@ + + + + + + + + + @@ -183,8 +200,11 @@ + + + @@ -193,8 +213,13 @@ + - - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/winbuild/libsurvive/libsurvive.vcxproj.filters b/winbuild/libsurvive/libsurvive.vcxproj.filters index 5387108..ffddee9 100644 --- a/winbuild/libsurvive/libsurvive.vcxproj.filters +++ b/winbuild/libsurvive/libsurvive.vcxproj.filters @@ -108,6 +108,33 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -152,8 +179,18 @@ Source Files + + Source Files + + + Header Files + + + Source Files + + \ No newline at end of file diff --git a/winbuild/libsurvive/packages.config b/winbuild/libsurvive/packages.config new file mode 100644 index 0000000..c283d9d --- /dev/null +++ b/winbuild/libsurvive/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winbuild/test/test.vcxproj b/winbuild/test/test.vcxproj index e6ee3fb..5ceff3d 100644 --- a/winbuild/test/test.vcxproj +++ b/winbuild/test/test.vcxproj @@ -72,6 +72,8 @@ true + $(LibraryPath) + $(VC_ReferencesPath_x64); true @@ -93,7 +95,7 @@ Console - setupapi.lib;dbghelp.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + setupapi.lib;dbghelp.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;libblas.lib;liblapacke.lib;liblapack.lib;%(AdditionalDependencies) true UseFastLinkTimeCodeGeneration -- cgit v1.2.3