From 8d53d5142ecdf8ca14507805345b962c072206e4 Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 3 May 2020 22:26:00 +0100 Subject: [PATCH 1/3] Add gitignore --- .gitignore | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..acb8847 --- /dev/null +++ b/.gitignore @@ -0,0 +1,187 @@ +# Builds +build*/* +*.so +public/ + +# Eclispe setting --- do not ignore *.cproject and *.project +*/**/.settings +.metadata + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +html/ + +# Visual Studio cache/options directory +.vs/ +*.vcxproj* +*.sln + + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Cmake, make and compiled objects on unix +*.cmake +*.c.o +*/CMakeFiles/* +*/Makefile +CMakeFiles/* +CMakeCache.txt +cmake-build-release/* +cmake-build-debug/* + +# JetBrains Rider +.idea/ +*.sln.iml + +# Matlab +*.mexa64 +*.mexmaci64 +*.mexw64 +*.asv + +# Cmake +CMakeCache.txt +CMakeFiles +CMakeScripts +Makefile +cmake_install.cmake +install_manifest.txt +CTestTestfile.cmake +*-config.cmake +*-version.cmake +*-targets.cmake + +#tex +*.log +*.pdf +*.synctex.gz +*.aux +*.bbl +*.blg +*.spl + +[Ll]ibrary/ +[Tt]emp/ +[Oo]bj/ +[Bb]uild/ +[Bb]uilds/ +Assets/AssetStoreTools* + +# Visual Studio cache directory +.vs/ + +# Visual Studio Code cache directory +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.opendb + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta + +# Unity3D Generated File On Crash Reports +sysinfo.txt + +# Builds +*.apk +*.unitypackage + +# Builds Clion +1_src/cmake-build-debug/* +1_src/cmake-build-release/* + +# Office +~*.pptx From 6ef178f508aec4537f09d09f494a66b8270bb79d Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Sat, 3 Jul 2021 13:26:49 +0200 Subject: [PATCH 2/3] Add install setup --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5d6913..6e7aaac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,9 +62,12 @@ ENDIF(BUILD_STATIC_LIB) set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER ${SOURCE_HEADS}) -# ADD DEFAULT COMPILER FLAGS +# Add compiler flags include(CompilerFlags) +# Install setup +install(TARGETS ${PROJECT_NAME} PERMISSIONS WORLD_WRITE ) + find_package(OpenMP REQUIRED) if (OPENMP_FOUND) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") From f8d043ed59a063d2e7ef1287dd13f0743869c6ea Mon Sep 17 00:00:00 2001 From: Mattia Montanari Date: Sat, 3 Jul 2021 13:28:12 +0200 Subject: [PATCH 3/3] Easy compile on Win with mingw32 --- examples/c/CMakeLists.txt | 11 ++++++++--- examples/c/main.c | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 253854c..01be2ad 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -42,12 +42,17 @@ set(SOURCE_FILES main.c ) # Create the executable add_executable(demo ${SOURCE_FILES}) -# Copy input files after build +# Copy input files for this example after build add_custom_command( TARGET demo POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/*.dat - ${CMAKE_CURRENT_BINARY_DIR}/ ) + ${CMAKE_CURRENT_SOURCE_DIR}/userP.dat + ${CMAKE_CURRENT_BINARY_DIR}/userP.dat ) +add_custom_command( + TARGET demo POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/userQ.dat + ${CMAKE_CURRENT_BINARY_DIR}/userQ.dat ) # PLATFORM-SPECIFIC SETTING if (UNIX) diff --git a/examples/c/main.c b/examples/c/main.c index 7258e87..7606bd1 100644 --- a/examples/c/main.c +++ b/examples/c/main.c @@ -77,7 +77,7 @@ int readinput(const char *inputfile, double ***pts, int * out) { } /* Read number of input vertices. */ - if (fscanf_s(fp, "%d", &npoints) != 1) + if (fscanf(fp, "%d", &npoints) != 1) return 1; /* Allocate memory. */ @@ -88,7 +88,7 @@ int readinput(const char *inputfile, double ***pts, int * out) { /* Read and store vertices' coordinates. */ for (idx = 0; idx < npoints; idx++) { - if (fscanf_s(fp, "%lf %lf %lf\n", &arr[idx][0], &arr[idx][1], &arr[idx][2]) != 3) + if (fscanf(fp, "%lf %lf %lf\n", &arr[idx][0], &arr[idx][1], &arr[idx][2]) != 3) return 1; }