Skip to content

Commit

Permalink
Support for Salome 9.8.0. (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
trelau authored Apr 30, 2022
1 parent e02a307 commit 5ddb7eb
Show file tree
Hide file tree
Showing 18 changed files with 233 additions and 238 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.3)
project(SMESH VERSION 9.7.0.2 LANGUAGES C CXX)
project(SMESH VERSION 9.8.0.0 LANGUAGES C CXX)

# --------------------------------------------------------------------------- #
# OPTIONS
Expand All @@ -13,9 +13,9 @@ set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
# SETTINGS
# --------------------------------------------------------------------------- #
set(SMESH_VERSION_MAJOR 9)
set(SMESH_VERSION_MINOR 7)
set(SMESH_VERSION_MINOR 8)
set(SMESH_VERSION_PATCH 0)
set(SMESH_VERSION_TWEAK 2)
set(SMESH_VERSION_TWEAK 0)

# Build shared libraries
set(BUILD_SHARED_LIBS TRUE)
Expand All @@ -39,6 +39,8 @@ if(UNIX)
add_definitions(-DHAVE_LIMITS_H -DCSFDB -DLIN -DOCC_CONVERT_SIGNALS)
else(UNIX)
if(WIN32)
# Define NOMINMAX to avoid conflice with Windows.h max and min
add_definitions(-DNOMINMAX)
if(MSVC)
add_definitions(-DWNT -DWIN32 -D_WINDOWS -DCSFDB -DUSE_CLOCK -DMSDOS -DNO_ONEXIT -DNO_My_ctype -DNO_ISATTY -DNO_FPINIT)
else(MSVC)
Expand All @@ -51,7 +53,7 @@ endif(UNIX)

if(CMAKE_SIZEOF_VOID_P STREQUAL 8)
add_definitions(-D_OCC64)
# add_definitions(-DSALOME_USE_64BIT_IDS)
add_definitions(-DSALOME_USE_64BIT_IDS)
endif(CMAKE_SIZEOF_VOID_P STREQUAL 8)


Expand All @@ -76,7 +78,7 @@ find_package(VTK REQUIRED COMPONENTS CommonCore CommonDataModel FiltersVerdict)
# BOOST
# --------------------------------------------------------------------------- #
message(STATUS "Searching for Boost...")
find_package(Boost REQUIRED COMPONENTS filesystem thread serialization)
find_package(Boost REQUIRED COMPONENTS filesystem thread serialization regex)

if (MSVC)
# find the shared boost libs
Expand Down
6 changes: 0 additions & 6 deletions ci/conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@ if [[ ${HOST} =~ .*linux.* ]]; then
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake")
fi

declare ENABLE_NETGEN=true
if [[ ${HOST} =~ .*apple.* ]]; then
ENABLE_NETGEN=true # set to false if you don't want to build and test Netgen
fi

cmake -G "Ninja" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
${CMAKE_PLATFORM_FLAGS[@]} \
-D CMAKE_INSTALL_PREFIX:FILEPATH=$PREFIX \
-D CMAKE_PREFIX_PATH:FILEPATH=$PREFIX \
-D Boost_NO_BOOST_CMAKE:BOOL=ON \
-D ENABLE_NETGEN:BOOL=$ENABLE_NETGEN \
..

ninja install
2 changes: 1 addition & 1 deletion ci/conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: smesh4pyocct
version: "9.7.0.2"
version: "9.8.0.0"

source:
path: ../..
Expand Down
1 change: 0 additions & 1 deletion ci/conda/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ cmake -G "Ninja" ^
-D CMAKE_SYSTEM_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
-D PTHREAD_INCLUDE_DIRS:FILEPATH="%LIBRARY_PREFIX%/include" ^
-D PTHREAD_LIB_DIRS:FILEPATH="%LIBRARY_PREFIX%/lib" ^
-D ENABLE_NETGEN:BOOL=ON ^
..

if errorlevel 1 exit 1
Expand Down
6 changes: 2 additions & 4 deletions cmake/Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(Kernel_SRCS
# Basics
${Kernel_SRC_DIR}/Basics/Basics_Utils.cxx
${Kernel_SRC_DIR}/Basics/Basics_DirUtils.cxx
${Kernel_SRC_DIR}/Basics/BasicsGenericDestructor.cxx
# Local Trace
${Kernel_SRC_DIR}/SALOMELocalTrace/BaseTraceCollector.cxx
Expand Down Expand Up @@ -31,10 +32,7 @@ if(WIN32)
set_target_properties(Kernel PROPERTIES COMPILE_FLAGS
"-DBASICS_EXPORTS \
-DSALOMELOCALTRACE_EXPORTS \
-DUTILS_EXPORTS \
-DSMESH_ONLY")
else()
set_target_properties(Kernel PROPERTIES COMPILE_FLAGS "-DSMESH_ONLY")
-DUTILS_EXPORTS")
endif()

configure_file(${Kernel_SRC_DIR}/Basics/smIdType.hxx.in ${Kernel_SRC_DIR}/Basics/smIdType.hxx)
Expand Down
2 changes: 1 addition & 1 deletion external/Geom
Submodule Geom updated from 8687a5 to 71b630
2 changes: 1 addition & 1 deletion external/Kernel
Submodule Kernel updated from 665f7c to 9dd760
2 changes: 1 addition & 1 deletion external/NETGENPlugin
Submodule NETGENPlugin updated from c0a871 to 11f59d
2 changes: 1 addition & 1 deletion external/SMESH
Submodule SMESH updated from d7de79 to 98cff9
28 changes: 13 additions & 15 deletions patch/Kernel.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,40 @@ diff --git a/src/Basics/Basics_Utils.hxx b/src/Basics/Basics_Utils.hxx
+#pragma comment(lib,"Ws2_32.lib")
#pragma warning (disable : 4251)
#endif

diff --git a/src/Utils/Utils_ExceptHandlers.cxx b/src/Utils/Utils_ExceptHandlers.cxx
--- a/src/Utils/Utils_ExceptHandlers.cxx
+++ b/src/Utils/Utils_ExceptHandlers.cxx
@@ -26,11 +26,14 @@
@@ -26,11 +26,12 @@
// <ota@localhost.localdomain>
//
#include "Utils_ExceptHandlers.hxx"
+#ifndef SMESH_ONLY
#include "Utils_CorbaException.hxx"
+#endif
-#include "Utils_CorbaException.hxx"
+// #include "Utils_CorbaException.hxx"
#include "Utils_SALOME_Exception.hxx"

#include <sstream>
#ifdef WIN32
+#include <Windows.h>
+#include <windows.h>
#include "DbgHelp.h"
#include <WinBase.h>
#pragma comment(lib, "Dbghelp.lib")
@@ -40,8 +43,10 @@
@@ -40,8 +41,8 @@
#include <cxxabi.h>
#endif

+#ifndef SMESH_ONLY
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
+#endif
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_Exception)
+// #include <SALOMEconfig.h>
+// #include CORBA_SERVER_HEADER(SALOME_Exception)

//#define NBLINES_BACKTRACE 64
#ifdef WIN32
@@ -142,6 +147,8 @@ void SALOME_SalomeException()
@@ -142,6 +143,6 @@ void SALOME_SalomeException()
txt << "INTERNAL_ERROR, backtrace stack:" << nbLines << std::endl;
printBacktrace(stacklines, nbLines, txt);
#endif
+#ifndef SMESH_ONLY
THROW_SALOME_CORBA_EXCEPTION(txt.str().c_str(), SALOME::INTERNAL_ERROR);
+#endif
- THROW_SALOME_CORBA_EXCEPTION(txt.str().c_str(), SALOME::INTERNAL_ERROR);
+ // THROW_SALOME_CORBA_EXCEPTION(txt.str().c_str(), SALOME::INTERNAL_ERROR);
}

82 changes: 0 additions & 82 deletions patch/NETGENPlugin.patch

This file was deleted.

69 changes: 69 additions & 0 deletions patch/NETGENPlugin_Mesher.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx
--- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx
+++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx
@@ -41,14 +41,14 @@
#include <SMESH_ComputeError.hxx>
#include <SMESH_ControlPnt.hxx>
#include <SMESH_File.hxx>
-#include <SMESH_Gen_i.hxx>
+#include <SMESH_Gen.hxx>
#include <SMESH_Mesh.hxx>
#include <SMESH_MesherHelper.hxx>
#include <SMESH_subMesh.hxx>
#include <StdMeshers_QuadToTriaAdaptor.hxx>
#include <StdMeshers_ViscousLayers2D.hxx>

-#include <SALOMEDS_Tool.hxx>
+// #include <SALOMEDS_Tool.hxx>

#include <utilities.h>

@@ -659,6 +659,7 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
// const char*
mparams.meshsizefilename= hyp->GetMeshSizeFile().empty() ? 0 : hyp->GetMeshSizeFile().c_str();
#endif
+ /*
const NETGENPlugin_Hypothesis::TLocalSize& localSizes = hyp->GetLocalSizesAndEntries();
if ( !localSizes.empty() )
{
@@ -680,6 +681,7 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
setLocalSize(S, val);
}
}
+ */
}

#ifdef NETGEN_V6
@@ -4554,6 +4556,8 @@ void NETGENPlugin_NetgenLibWrapper::CalcLocalH( netgen::Mesh * ngMesh )

std::string NETGENPlugin_NetgenLibWrapper::getOutputFileName()
{
+ return "";
+ /*
std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();

TCollection_AsciiString aGenericName = aTmpDir.c_str();
@@ -4568,6 +4572,7 @@ std::string NETGENPlugin_NetgenLibWrapper::getOutputFileName()
aGenericName += ".out";

return aGenericName.ToCString();
+ */
}

//================================================================================
@@ -4607,6 +4612,7 @@ void NETGENPlugin_NetgenLibWrapper::removeOutputFile()
netgen::myerr = _ngcerr;
_ngcout = 0;
}
+ /*
string tmpDir = SALOMEDS_Tool::GetDirFromPath ( _outputFileName );
string aFileName = SALOMEDS_Tool::GetNameFromPath( _outputFileName ) + ".out";
SALOMEDS_Tool::ListOfFiles aFiles;
@@ -4614,5 +4620,6 @@ void NETGENPlugin_NetgenLibWrapper::removeOutputFile()
aFiles.push_back(aFileName.c_str());

SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles, true );
+ */
}
-}
+}
17 changes: 17 additions & 0 deletions patch/SMDS_UnstructuredGrid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/src/SMDS/SMDS_UnstructuredGrid.hxx b/src/SMDS/SMDS_UnstructuredGrid.hxx
--- a/src/SMDS/SMDS_UnstructuredGrid.hxx
+++ b/src/SMDS/SMDS_UnstructuredGrid.hxx
@@ -24,10 +24,13 @@
#ifndef _SMDS_UNSTRUCTUREDGRID_HXX
#define _SMDS_UNSTRUCTUREDGRID_HXX

#include "SMESH_SMDS.hxx"

+ // Fix for https://discourse.vtk.org/t/compilation-error-include-limits-required-in-several-files/6496
+#include <limits>
+
#include <vtkUnstructuredGrid.h>
#include <vtkCellLinks.h>
#include <smIdType.hxx>

#include <vector>
Loading

0 comments on commit 5ddb7eb

Please sign in to comment.