Skip to content

Commit 7f0e415

Browse files
authored
Merge pull request #357 from sbriseid/msvc2022_support
Msvc2022 support
2 parents f48a1ab + 301e0da commit 7f0e415

File tree

13 files changed

+58
-26
lines changed

13 files changed

+58
-26
lines changed

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Linux
66

77
Install required packages:
88

9-
$ sudo apt install -y git cmake make build-essential libgl1-mesa-dev freeglut3-dev libpugixml-dev libjsoncpp-dev libboost-test-dev qtbase5-dev qtbase5-dev-tools
9+
$ sudo apt install -y git cmake make build-essential libgl1-mesa-dev freeglut3-dev libpugixml-dev libjsoncpp-dev libboost-test-dev libboost-timer-dev qtbase5-dev qtbase5-dev-tools
1010

1111
Git
1212
***

compositemodel/cmake/Modules/FindPugiXML.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if(WIN32)
3030
elseif((${MSVC_VERSION} GREATER_EQUAL 1920) AND (${MSVC_VERSION} LESS 1930))
3131
# MESSAGE("Visual Studio 2019!")
3232
set(MSVC_NAME "msvc2019_")
33-
elseif((${MSVC_VERSION} EQUAL 1930))
33+
elseif((${MSVC_VERSION} GREATER_EQUAL 1930) AND (${MSVC_VERSION} LESS 1940))
3434
set(MSVC_NAME "msvc2022_")
3535
else()
3636
message("MSVC version not supported or not installed!")
@@ -75,7 +75,7 @@ find_library(PUGIXML_LIBRARY_RELEASE
7575
"~/Install/${MSVC_NAME}lib${WIN_LIB_TYPE}/Release"
7676
"C:/local/${MSVC_NAME}lib${WIN_LIB_TYPE}/Release"
7777
)
78-
# message("PUGIXML_LIBRARY_RELEASE:" ${PUGIXML_LIBRARY_RELEASE})
78+
#message("PUGIXML_LIBRARY_RELEASE:" ${PUGIXML_LIBRARY_RELEASE})
7979
if(PUGIXML_LIBRARY_DEBUG)
8080
set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARIES} debug ${PUGIXML_LIBRARY_DEBUG})
8181
endif()

gotools-core/src/geometry/GSSpoint.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace Go
4848
namespace
4949
{
5050
/// Functor that scales the input argument.
51-
class ScaleBy : public std::unary_function<double, double>
51+
class ScaleBy// : public std::unary_function<double, double>
5252
{
5353
double m_scale;
5454

gotools-core/test/unit/LoopUtilsTest.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public:
6262
#ifdef GOTOOLS_TEST_PRIVATE_DATA
6363

6464
// Path relative to build/gotools-extra/step_reader
65-
const string datadir_priv = "../../../gotools-private-data/step_reader/data3/Ford/";
65+
const string datadir_priv = "../../gotools-private-data/step_reader/data3/Ford/";
6666

6767
infiles.push_back(datadir_priv + "Ford_Hood_Outer_001_sf_303.g2");
6868
infiles.push_back(datadir_priv + "Ford_Hood_Hinge_Reinf_001_sf_7.g2");

gotools-core/test/unit/fixInvalidBoundedSurfaceTest.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public:
5858
#ifdef GOTOOLS_TEST_PRIVATE_DATA
5959

6060
// Path relative to build/gotools-extra/step_reader
61-
const string datadir_priv = "../../../gotools-private-data/step_reader/data3/";
61+
const string datadir_priv = "../../gotools-private-data/step_reader/data3/";
6262

6363
// Ford models.
6464
infiles.push_back(datadir_priv + "Ford/Ford_Car_Hood_inner_001_obj_378.g2");
@@ -72,6 +72,7 @@ public:
7272

7373
infiles.push_back(datadir_priv +
7474
"CaxMan/Mould_Final_Version_1/Stock_Cavity_AM_stage4_R8_8_Printing_colorised_model_2_obj_12233.g2");
75+
//"CaxMan/Mould_Final_Version_1/12233.g2");
7576
valid_model.push_back(true);
7677
#endif
7778

@@ -107,7 +108,8 @@ BOOST_FIXTURE_TEST_CASE(BoundedSurfaceTest, Config)
107108
string infile = infiles[i];
108109
//string infile = "../step_reader/DemEx6woExtBlends.g2";
109110

110-
ifstream in(infile.c_str());
111+
// std::cout << "infile: " << infile << std::endl;
112+
ifstream in(infile.c_str(), std::ifstream::in);
111113
BOOST_CHECK_MESSAGE(in.good(), "Input file not found or file corrupt");
112114
header.read(in);
113115
shared_ptr<BoundedSurface> bs(new BoundedSurface());

lrsplines2D/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ PROJECT(GoLRspline2D)
55
IF(GoTools_ENABLE_OPENMP)
66
FIND_PACKAGE(OpenMP REQUIRED)
77
ENDIF(GoTools_ENABLE_OPENMP)
8-
8+
#set(Boost_DEBUG ON)
9+
FIND_PACKAGE(Boost COMPONENTS timer REQUIRED)
910

1011
# Include directories
1112

@@ -16,14 +17,17 @@ INCLUDE_DIRECTORIES(
1617
${Boost_INCLUDE_DIRS}
1718
)
1819

20+
ADD_COMPILE_DEFINITIONS(BOOST_TIMER_SOURCE)
1921

20-
# Linked in libraries
22+
ADD_COMPILE_DEFINITIONS(BOOST_CHRONO_HEADER_ONLY)
2123

24+
# Linked in libraries
25+
# message("Boost_USE_STATIC_LIBS: ${Boost_USE_STATIC_LIBS}")
2226
SET(DEPLIBS
2327
GoToolsCore
2428
sisl
2529
)
26-
30+
# message("DEPLIBS: ${DEPLIBS}")
2731
# Make the GoLRspline2D library
2832

2933
FILE(GLOB_RECURSE GoLRspline2D_SRCS src/*.C include/*.h)
@@ -76,6 +80,7 @@ MACRO(ADD_APPS SUBDIR PROPERTY_FOLDER IS_TEST)
7680
ENDMACRO(ADD_APPS)
7781

7882
IF(GoTools_COMPILE_APPS)
83+
SET(DEPLIBS ${DEPLIBS} ${Boost_LIBRARIES})
7984
FILE(GLOB_RECURSE GoLRspline2D_APPS app/*.C)
8085
FOREACH(app ${GoLRspline2D_APPS})
8186
GET_FILENAME_COMPONENT(appname ${app} NAME_WE)

lrsplines2D/app/PointCloud2LR.C

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,16 @@
5050
#include <fstream>
5151
#include <string.h>
5252
#include <sys/stat.h>
53-
#include <boost/timer.hpp>
53+
#include <boost/timer/timer.hpp>
54+
//#include <chrono>
55+
#include <boost/chrono.hpp>
5456
#include <time.h>
5557

58+
#define BOOST_CHRONO_HEADER_ONLY
59+
#define BOOST_TIMER_NO_LIB
60+
#define BOOST_TIMER_SOURCE
61+
#define BOOST_ALL_NO_LIB
62+
5663
//#define DEBUG
5764
//#define DEBUG_EL
5865
//#define DEBUG2
@@ -771,10 +778,10 @@ int main(int argc, char *argv[])
771778

772779

773780

774-
boost::timer t;
781+
boost::timer::cpu_timer t;
775782
double duration;
776783

777-
t.restart();
784+
t.start();
778785

779786
// if (del > 3)
780787
// {
@@ -884,8 +891,9 @@ int main(int argc, char *argv[])
884891

885892
approx->fetchOutsideTolInfo(maxout, avout);
886893

894+
auto nanoseconds = boost::chrono::nanoseconds(t.elapsed().user + t.elapsed().system);
887895

888-
duration = t.elapsed();
896+
duration = 1.0e-09*nanoseconds.count();//t.elapsed();
889897
std::cout << "Duration: " << duration << std::endl;
890898
double min = floor(duration/60);
891899
double sec = duration - 60*min;

lrsplines3D/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ IF(GoTools_ENABLE_OPENMP)
77
FIND_PACKAGE(OpenMP REQUIRED)
88
ENDIF(GoTools_ENABLE_OPENMP)
99

10+
FIND_PACKAGE(Boost COMPONENTS timer REQUIRED)
11+
1012
# Include directories
1113

1214
INCLUDE_DIRECTORIES(
@@ -15,12 +17,17 @@ INCLUDE_DIRECTORIES(
1517
${GoToolsCore_SOURCE_DIR}/include
1618
${GoTrivariate_SOURCE_DIR}/include
1719
${GoTools_COMMON_INCLUDE_DIRS}
20+
${Boost_INCLUDE_DIRS}
1821
)
1922

23+
ADD_COMPILE_DEFINITIONS(BOOST_TIMER_SOURCE)
24+
25+
ADD_COMPILE_DEFINITIONS(BOOST_CHRONO_HEADER_ONLY)
2026

2127
# Linked in libraries
2228

2329
SET(DEPLIBS
30+
#${Boost_LIBRARIES}
2431
GoToolsCore
2532
sisl
2633
GoTrivariate
@@ -80,6 +87,7 @@ MACRO(ADD_APPS SUBDIR PROPERTY_FOLDER IS_TEST)
8087
ENDMACRO(ADD_APPS)
8188

8289
IF(GoTools_COMPILE_APPS)
90+
SET(DEPLIBS ${DEPLIBS} ${Boost_LIBRARIES})
8391
FILE(GLOB_RECURSE GoLRspline3D_APPS app/*.C)
8492
FOREACH(app ${GoLRspline3D_APPS})
8593
GET_FILENAME_COMPONENT(appname ${app} NAME_WE)

lrsplines3D/app/PointCloud2LRVol.C

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
#include "GoTools/lrsplines3D/LRVolApprox.h"
55
#include "GoTools/geometry/ObjectHeader.h"
66
#include "GoTools/lrsplines3D/LRSpline3DBezierCoefs.h"
7-
#include <boost/timer.hpp>
7+
#include <boost/chrono.hpp>
8+
//#include <chrono>
9+
#include <boost/timer/timer.hpp>
810
#include <time.h>
911

12+
#define BOOST_CHRONO_HEADER_ONLY
13+
#define BOOST_TIMER_NO_LIB
14+
#define BOOST_TIMER_SOURCE
15+
#define BOOST_ALL_NO_LIB
16+
1017
using namespace std;
1118
using namespace Go;
1219

@@ -393,10 +400,10 @@ int main (int argc, char *argv[]) {
393400

394401

395402

396-
boost::timer t;
403+
boost::timer::cpu_timer t;
397404
double duration;
398405

399-
t.restart();
406+
t.start();
400407

401408
std::cout << "Domain: [" << domain[0] << "," << domain[1] << "]x[" << domain[2];
402409
std::cout << "," << domain[3] << "]x[" << domain[4] << "," << domain[5] << "]" << std::endl;
@@ -450,7 +457,8 @@ int main (int argc, char *argv[]) {
450457

451458
vol_approx.fetchOutsideTolInfo(maxout, avout);
452459

453-
duration = t.elapsed();
460+
auto nanoseconds = boost::chrono::nanoseconds(t.elapsed().user + t.elapsed().system);
461+
duration = duration = 1.0e-09*nanoseconds.count();//t.elapsed();
454462
std::cout << "Duration: " << duration << std::endl;
455463
double min = floor(duration/60);
456464
double sec = duration - 60*min;

trivariate/src/GSVpoint.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace Go
4848
namespace
4949
{
5050
/// Functor that scales the input argument.
51-
class ScaleBy : public std::unary_function<double, double>
51+
class ScaleBy //: public std::unary_function<double, double>
5252
{
5353
double m_scale;
5454

trivariatemodel/cmake/Modules/FindPugiXML.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if(WIN32)
3030
elseif((${MSVC_VERSION} GREATER_EQUAL 1920) AND (${MSVC_VERSION} LESS 1930))
3131
# MESSAGE("Visual Studio 2019!")
3232
set(MSVC_NAME "msvc2019_")
33-
elseif((${MSVC_VERSION} EQUAL 1930))
33+
elseif((${MSVC_VERSION} GREATER_EQUAL 1930) AND (${MSVC_VERSION} LESS 1940))
3434
set(MSVC_NAME "msvc2022_")
3535
else()
3636
message("MSVC version not supported or not installed!")

viewlib/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ endif(GoTools_ENABLE_OPENMP)
99

1010
find_package(OpenGL REQUIRED)
1111
find_path(OPENGL_INCLUDE_DIR
12-
gl.h
13-
PATH_PREFIXES GL
12+
GL/gl.h
13+
# PATH_PREFIXES GL
1414
PATHS
15-
/usr/local/include
16-
/usr/include
1715
"$ENV{HOME}\\Install\\include" # For some reason HOME is not found in VS 2019.
1816
"C:\\Users\\$ENV{USERNAME}\\Install\\include"
19-
"C:\\local\\include")
17+
"C:\\local\\include"
18+
/usr/local/include
19+
/usr/include
20+
)
2021
option(GoTools_USE_Qt4 "Use Qt4 (not Qt5)?" OFF)
2122

2223
if(GoTools_USE_Qt4)

viewlib/cmake/Modules/FindJsonCpp.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if(WIN32)
2222
elseif((${MSVC_VERSION} GREATER_EQUAL 1920) AND (${MSVC_VERSION} LESS 1930))
2323
# MESSAGE("Visual Studio 2019!")
2424
set(MSVC_NAME "msvc2019_")
25-
elseif((${MSVC_VERSION} EQUAL 1930))
25+
elseif((${MSVC_VERSION} GREATER_EQUAL 1930) AND (${MSVC_VERSION} LESS 1940))
2626
set(MSVC_NAME "msvc2022_")
2727
else()
2828
message("MSVC version not supported or not installed!")

0 commit comments

Comments
 (0)