Merge branch 'update_occ' into 'master'

Update OCC

See merge request jschoeberl/netgen!408
This commit is contained in:
Matthias Hochsteger 2021-09-02 12:52:34 +00:00
commit 1c6be3b363
15 changed files with 64 additions and 141 deletions

View File

@ -58,9 +58,6 @@ build_win:
-DCHECK_RANGE=ON
-DUSE_CGNS=ON
-DUSE_OCC=ON
-DOCC_LIBRARY=C:/install_opencascade_7.4.0_static/win64/vc14/lib/TKernel.lib
-DOCC_INCLUDE_DIR=C:/install_opencascade_7.4.0_static/inc
-DOCC_LINK_FREETYPE=ON
-DUSE_CCACHE=ON
-DENABLE_UNIT_TESTS=ON
-DCMAKE_BUILD_TYPE=Release
@ -244,13 +241,10 @@ build_mac:
-DUSE_NATIVE_ARCH=OFF
-DUSE_CCACHE=ON
-DENABLE_UNIT_TESTS=ON
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
-DUSE_CGNS=ON
-DUSE_OCC=ON
-DOCC_LIBRARY=/usr/local/opt/opencascade-7.4.0/lib/libTKernel.a
-DOCC_INCLUDE_DIR=/usr/local/opt/opencascade-7.4.0/include/opencascade
-DOCC_LINK_FREETYPE=ON
- make -j5 install
test_mac:

View File

@ -314,9 +314,14 @@ install(TARGETS netgen_mpi netgen_metis ${NG_INSTALL_DIR})
#######################################################################
if (USE_OCC)
find_package(OpenCasCade REQUIRED)
add_definitions(-DOCCGEOMETRY -D_OCC64)
include_directories(${OCC_INCLUDE_DIR})
find_package(OpenCasCade NAMES OpenCASCADE opencascade REQUIRED)
add_definitions(-DOCCGEOMETRY)
set(OCC_LIBRARIES ${OpenCASCADE_LIBRARIES})
include_directories(${OpenCASCADE_INCLUDE_DIR})
if(NOT OpenCASCADE_BUILD_SHARED_LIBS)
find_library( FREETYPE NAMES freetype )
list(APPEND OCC_LIBRARIES ${FREETYPE})
endif()
endif (USE_OCC)
#######################################################################

View File

@ -16,7 +16,7 @@ macro(set_vars VAR_OUT)
endmacro()
#######################################################################
set (DEPS_DOWNLOAD_URL "https://github.com/NGSolve/ngsolve_dependencies/releases/download/v1.0.0" CACHE STRING INTERNAL)
set (OCC_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/occ_win64.zip" CACHE STRING INTERNAL)
set (OCC_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/occ75_win64.zip" CACHE STRING INTERNAL)
set (TCLTK_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/tcltk_win64.zip" CACHE STRING INTERNAL)
set (ZLIB_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/zlib_win64.zip" CACHE STRING INTERNAL)
set (CGNS_DOWNLOAD_URL_WIN "${DEPS_DOWNLOAD_URL}/cgns_win64.zip" CACHE STRING INTERNAL)
@ -65,19 +65,23 @@ endif (USE_PYTHON)
#######################################################################
if(USE_OCC AND WIN32 AND NOT OCC_INCLUDE_DIR)
ExternalProject_Add(win_download_occ
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tcl
URL ${OCC_DOWNLOAD_URL_WIN}
UPDATE_COMMAND "" # Disable update
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory . ${CMAKE_INSTALL_PREFIX}
LOG_DOWNLOAD 1
)
list(APPEND NETGEN_DEPENDENCIES win_download_occ)
endif(USE_OCC AND WIN32 AND NOT OCC_INCLUDE_DIR)
if(USE_OCC)
if(WIN32 AND NOT OCC_INCLUDE_DIR AND NOT OpenCASCADE_DIR)
ExternalProject_Add(win_download_occ
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tcl
URL ${OCC_DOWNLOAD_URL_WIN}
UPDATE_COMMAND "" # Disable update
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory . ${CMAKE_INSTALL_PREFIX}
LOG_DOWNLOAD 1
)
list(APPEND NETGEN_DEPENDENCIES win_download_occ)
else()
find_package(OpenCasCade NAMES OpenCASCADE opencascade REQUIRED)
endif()
endif(USE_OCC)
#######################################################################
@ -147,6 +151,7 @@ set_vars( NETGEN_CMAKE_ARGS
BUILD_STUB_FILES
BUILD_FOR_CONDA
NG_COMPILE_FLAGS
OpenCasCade_DIR
)
# propagate all variables set on the command line using cmake -DFOO=BAR

View File

@ -1,106 +0,0 @@
# Try to find OCC
# Once done this will define
#
# OCC_FOUND - system has OCC - OpenCASCADE
# OCC_INCLUDE_DIR - where the OCC include directory can be found
# OCC_LIBRARY_DIR - where the OCC library directory can be found
# OCC_LIBRARIES - Link this to use OCC
if(WIN32)
find_path(OCC_INCLUDE_DIR Standard_Version.hxx PATH_SUFFIXES inc ../inc)
find_library(OCC_LIBRARY TKernel)
else(WIN32)
find_path(OCC_INCLUDE_DIR Standard_Version.hxx
/usr/include/opencascade
/usr/local/include/opencascade
/usr/include/oce
/usr/local/include/oce
/opt/opencascade/include
/opt/opencascade/inc
)
find_library(OCC_LIBRARY TKernel
/usr/lib
/usr/local/lib
/opt/opencascade/lib
)
endif(WIN32)
if(OCC_LIBRARY AND NOT OCC_LIBRARY_DIR)
get_filename_component(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
endif(OCC_LIBRARY AND NOT OCC_LIBRARY_DIR)
if(OCC_INCLUDE_DIR)
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAJOR
REGEX "#define OCC_VERSION_MAJOR.*"
)
string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MINOR
REGEX "#define OCC_VERSION_MINOR.*"
)
string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAINT
REGEX "#define OCC_VERSION_MAINTENANCE.*"
)
string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
set(OCC_VERSION_STRING "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
endif(OCC_INCLUDE_DIR)
set(OCC_LIBRARY_NAMES
TKBO
TKBool
TKBRep
TKCAF
TKCDF
TKernel
TKG2d
TKG3d
TKGeomAlgo
TKGeomBase
TKHLR
TKIGES
TKLCAF
TKMath
TKMesh
TKOffset
TKPrim
TKService
TKShHealing
TKSTEP
TKSTEP209
TKSTEPAttr
TKSTEPBase
TKSTL
TKTopAlgo
TKV3d
TKXCAF
TKXDEIGES
TKXDESTEP
TKXSBase
TKFillet
)
if(OCC_LINK_FREETYPE)
set(OCC_LIBRARY_NAMES ${OCC_LIBRARY_NAMES} freetype)
endif(OCC_LINK_FREETYPE)
if(OCC_VERSION_STRING VERSION_GREATER_EQUAL "7.3.0")
set(OCC_LIBRARY_NAMES ${OCC_LIBRARY_NAMES} TKVCAF)
endif()
foreach( libname ${OCC_LIBRARY_NAMES} )
find_library( ${libname} ${libname} ${OCC_LIBRARY_DIR} NO_DEFAULT_PATH)
set(OCC_LIBRARIES ${OCC_LIBRARIES} ${${libname}})
endforeach()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OCC REQUIRED_VARS OCC_INCLUDE_DIR VERSION_VAR OCC_VERSION_STRING ${OCC_LIBRARIY_NAMES})
if(OCC_FOUND)
message(STATUS "-- Found OpenCASCADE version: ${OCC_VERSION_STRING}")
message(STATUS "-- OpenCASCADE include directory: ${OCC_INCLUDE_DIR}")
message(STATUS "-- OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}")
message(STATUS "-- OpenCASCADE shared libraries :\n ${OCC_LIBRARIES}")
endif(OCC_FOUND)

View File

@ -4,7 +4,7 @@ ExternalProject_Add(
project_catch
PREFIX ${CMAKE_BINARY_DIR}/catch
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.0.1
GIT_TAG v2.13.7
TIMEOUT 10
UPDATE_COMMAND "" # ${GIT_EXECUTABLE} pull
CONFIGURE_COMMAND ""

View File

@ -31,7 +31,7 @@ endif(NOT WIN32)
# target_link_libraries(nglib PRIVATE gen la gprim PUBLIC ngcore)
target_link_libraries(nglib PUBLIC ngcore)
target_link_libraries( nglib PRIVATE ${OCC_LIBRARIES} ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} netgen_cgns )
target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${X11_Xmu_LIB} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} netgen_cgns )
if(USE_OCC AND NOT WIN32)
target_link_libraries(nglib PUBLIC occ)

View File

@ -8,6 +8,7 @@ cmake \
-DUSE_OCC=ON \
-DCHECK_RANGE=ON \
-DUSE_CGNS=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
../../src/netgen
make -j12
make install

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <../core/ngcore.hpp>
using namespace ngcore;
using namespace std;

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <core/array.hpp>
using namespace ngcore;
using namespace std;

View File

@ -1,3 +1,3 @@
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#define DO_NOT_USE_WMAIN
#include <catch2/catch.hpp>

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <core/array.hpp>
#include <core/ranges.hpp>

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <../core/ngcore.hpp>
using namespace ngcore;
using namespace std;

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <core/ngcore.hpp>
using namespace ngcore;
using namespace std;

View File

@ -1,5 +1,5 @@
#include "catch.hpp"
#include <catch2/catch.hpp>
#include <../core/ngcore.hpp>
using namespace ngcore;
using namespace std;

View File

@ -1,6 +1,30 @@
FROM ubuntu:20.10
ENV DEBIAN_FRONTEND=noninteractive
MAINTAINER Matthias Hochsteger <matthias.hochsteger@tuwien.ac.at>
RUN apt-get update && apt-get -y install python3 python3-pip libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils clang libocct-data-exchange-dev libcgns-dev libhdf5-dev
RUN apt-get update && apt-get -y install \
ccache \
clang occt-misc \
clang-tidy \
cmake \
g++ \
git \
libcgns-dev \
libglu1-mesa-dev \
libhdf5-dev \
libocct-data-exchange-dev \
libocct-draw-dev \
libpython3-dev \
libtbb-dev \
libxi-dev \
libxmu-dev \
python3 \
python3-distutils \
python3-numpy \
python3-pip \
python3-pytest \
python3-tk \
tcl-dev \
tk-dev
RUN python3 -m pip install pytest-check
ADD . /root/src/netgen