diff --git a/CMake/FindMPI4PY.cmake b/CMake/FindMPI4PY.cmake deleted file mode 100644 index 324a72ee51e634c7024918e0bbb09fea403a6526..0000000000000000000000000000000000000000 --- a/CMake/FindMPI4PY.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if(NOT MPI4PY_INCLUDE_DIR) - execute_process(COMMAND - "${PYTHON_EXECUTABLE}" "-c" "import mpi4py; print(mpi4py.get_include())" - OUTPUT_VARIABLE MPI4PY_INCLUDE_DIR - RESULT_VARIABLE MPI4PY_COMMAND_RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(MPI4PY_COMMAND_RESULT) - message("waves/CMake/FindMPI4PY: mpi4py not found") - set(MPI4PY_FOUND FALSE) - else(MPI4PY_COMMAND_RESULT) - if (MPI4PY_INCLUDE_DIR MATCHES "Traceback") - message("waves/CMake/FindMPI4PY: mpi4py matches traceback") - ## Did not successfully include MPI4PY - set(MPI4PY_FOUND FALSE) - else (MPI4PY_INCLUDE_DIR MATCHES "Traceback") - ## successful - set(MPI4PY_FOUND TRUE) - set(MPI4PY_INCLUDE_DIR ${MPI4PY_INCLUDE_DIR} CACHE STRING "mpi4py include path") - endif (MPI4PY_INCLUDE_DIR MATCHES "Traceback") - endif(MPI4PY_COMMAND_RESULT) -else(NOT MPI4PY_INCLUDE_DIR) - set(MPI4PY_FOUND TRUE) -endif(NOT MPI4PY_INCLUDE_DIR) -# ---------------------------------------------------------------------------- - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MPI4PY DEFAULT_MSG - MPI4PY_INCLUDE_DIR) diff --git a/CMake/codeblocks.cmake b/CMake/codeblocks.cmake deleted file mode 100644 index 9462769b60f52f71a56b671bb03058d4ca662597..0000000000000000000000000000000000000000 --- a/CMake/codeblocks.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -#SET(CMAKE_GENERATOR "CodeBlocks - Unix Makefiles" CACHE INTERNAL "" FORCE) - -SET(MKL_LIB_PATH "/opt/intel/mkl/lib/intel64;/opt/intel/lib/intel64" CACHE PATH "" FORCE) -SET(MKL_INCLUDE_PATH "/opt/intel/mkl/include" CACHE PATH "" FORCE) - diff --git a/CMake/debian-intel.cmake b/CMake/debian-intel.cmake deleted file mode 100644 index cd2c1cceaff96567e7bedb8fd5608608516e4cb2..0000000000000000000000000000000000000000 --- a/CMake/debian-intel.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2020 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -SET(CMAKE_CXX_COMPILER "icpc" CACHE FILEPATH "" FORCE) -SET(CMAKE_C_COMPILER "icc" CACHE FILEPATH "" FORCE) - -SET(MKL_LIB_PATH "/opt/intel/composerxe/mkl/lib/intel64;/opt/intel/composerxe/lib/intel64" CACHE PATH "" FORCE) -SET(MKL_INCLUDE_PATH "/opt/intel/composerxe/mkl/include" CACHE PATH "" FORCE) - diff --git a/CMake/debian.cmake b/CMake/debian.cmake deleted file mode 100644 index 829861dcb018c25e39e007af338d00bc06dead8d..0000000000000000000000000000000000000000 --- a/CMake/debian.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -SET(CMAKE_CXX_COMPILER "icpc" CACHE FILEPATH "" FORCE) -SET(CMAKE_C_COMPILER "icc" CACHE FILEPATH "" FORCE) - -SET(MKL_LIB_PATH "/opt/intel/composerxe/mkl/lib/intel64;/opt/intel/composerxe/lib/intel64" CACHE PATH "" FORCE) -SET(MKL_INCLUDE_PATH "/opt/intel/composerxe/mkl/include" CACHE PATH "" FORCE) diff --git a/CMake/FindNUMPY.cmake b/CMake/maclam.cmake similarity index 70% rename from CMake/FindNUMPY.cmake rename to CMake/maclam.cmake index 1196c8e663f6243d7a6b54cbcc21c7df1b520e40..75c8f070116d5a497f070d33329cd4bddc69133d 100644 --- a/CMake/FindNUMPY.cmake +++ b/CMake/maclam.cmake @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -find_path(NUMPY_INCLUDE_DIR "numpy/arrayobject.h") +# "maclam" is the mac of R Boman -# ---------------------------------------------------------------------------- - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(NUMPY DEFAULT_MSG - NUMPY_INCLUDE_DIR) +# set custom python +SET(Python3_ROOT_DIR "/Library/Frameworks/Python.framework/Versions/3.7" CACHE PATH "" FORCE) diff --git a/CMake/spring.cmake b/CMake/spring.cmake deleted file mode 100644 index 776f28b8d2d2af64d3abcabe8a41335c4999f704..0000000000000000000000000000000000000000 --- a/CMake/spring.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2020 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES icpc) -FIND_PROGRAM(CMAKE_C_COMPILER NAMES icc) - -# force to look for mkl -SET(BLA_VENDOR "Intel10_64lp" CACHE STRING "" FORCE) - -# Trilinos not available on spring -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -INCLUDE(disable-trilinos) - diff --git a/CMake/ubuntu.cmake b/CMake/ubuntu.cmake deleted file mode 100644 index e6e3eea827dad719ec61e9df28aead1cf0786499..0000000000000000000000000000000000000000 --- a/CMake/ubuntu.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2020 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -#FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES icpc) -#FIND_PROGRAM(CMAKE_C_COMPILER NAMES icc) - -#SET(CMAKE_BUILD_TYPE "Debug" CACHE FILEPATH "" FORCE) - -#SET(BLA_VENDOR "Intel10_64lp" CACHE STRING "" FORCE) # useless for cmake 3.5 (xenial) -#SET(SWIG_EXECUTABLE "/home/boman/local/swig3/bin/swig" CACHE FILEPATH "" FORCE) - diff --git a/CMake/gaston-clang-Py3.cmake b/CMake/use-clang-compiler.cmake similarity index 75% rename from CMake/gaston-clang-Py3.cmake rename to CMake/use-clang-compiler.cmake index 2dcb7c9881d8af67dc34462b54dafaa54d67ac11..7b62c310eb7ae00952ddb83d93ffcbbd415ad500 100644 --- a/CMake/gaston-clang-Py3.cmake +++ b/CMake/use-clang-compiler.cmake @@ -14,8 +14,3 @@ FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES clang++) FIND_PROGRAM(CMAKE_C_COMPILER NAMES clang) -# vtk for py3 -SET(VTK_DIR "/opt/vtk/lib/cmake/vtk-7.1" CACHE PATH "" FORCE) -# Trilinos not compiling with clang (check to wiki to fix) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -INCLUDE(disable-trilinos) diff --git a/CMake/OSX.cmake b/CMake/use-intel-compiler.cmake similarity index 80% rename from CMake/OSX.cmake rename to CMake/use-intel-compiler.cmake index 3fa586f5825cb27d4439a9432f620fe8028fa765..e7c05b02333626b4454bfe98aa0af2678e111389 100644 --- a/CMake/OSX.cmake +++ b/CMake/use-intel-compiler.cmake @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Disable Trilinos (we should test with Trilinos/clang) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -INCLUDE(disable-trilinos) +SET(CMAKE_CXX_COMPILER "icpc" CACHE FILEPATH "" FORCE) +SET(CMAKE_C_COMPILER "icc" CACHE FILEPATH "" FORCE) diff --git a/CMake/win64-libsVs2017Py3.cmake b/CMake/win64-libsVs2017Py3.cmake index dd67bf3076e46981d7d8d99d0128996c4b63ee7b..54b68a2e9791fd5d1e25ac4a07ba8ece23ad9bb0 100644 --- a/CMake/win64-libsVs2017Py3.cmake +++ b/CMake/win64-libsVs2017Py3.cmake @@ -2,17 +2,10 @@ # with Luc Papeleux's precompiled libraries -SET(CMAKE_INSTALL_PREFIX "../waves_INSTALL" CACHE PATH "" FORCE) - STRING(REGEX REPLACE "\\\\" "/" MYLIBS $ENV{METAFORLIBS}) SET(CMAKE_GENERATOR "Visual Studio 15 2017 Win64" CACHE INTERNAL "" FORCE) -SET(PYTHON_INCLUDE_DIR "${MYLIBS}/Python/include" CACHE PATH "" FORCE) -SET(PYTHON_LIBRARY "${MYLIBS}/Python/Libs/python37.lib" CACHE FILEPATH "" FORCE) -SET(PYTHON_RELEASE_LIBRARY "${MYLIBS}/Python/Libs/python37.lib" CACHE FILEPATH "" FORCE) -SET(PYTHON_DEBUG_LIBRARY "${MYLIBS}/Python/Libs/python37_d.lib" CACHE FILEPATH "" FORCE) - - -# Disable Trilinos (we should test with Trilinos/clang) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -INCLUDE(disable-trilinos) +SET(PYTHON_INCLUDE_DIR "${MYLIBS}/Python/include" CACHE PATH "" FORCE) +SET(PYTHON_LIBRARY "${MYLIBS}/Python/Libs/python37.lib" CACHE FILEPATH "" FORCE) +SET(PYTHON_RELEASE_LIBRARY "${MYLIBS}/Python/Libs/python37.lib" CACHE FILEPATH "" FORCE) +SET(PYTHON_DEBUG_LIBRARY "${MYLIBS}/Python/Libs/python37_d.lib" CACHE FILEPATH "" FORCE) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dc6b95b7a92588820b3aec97234b10022358ce9..5b5da42d071ae94d6989d1bb93a7538f3467114a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ MESSAGE(STATUS "Python_FRAMEWORKS=${Python_FRAMEWORKS}") # SWIG FIND_PACKAGE(SWIG REQUIRED) IF(CMAKE_GENERATOR MATCHES "Visual Studio") # not MSVC because of nmake & jom - SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/") + SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}/$(Configuration)/") ELSE() SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}") ENDIF() @@ -123,6 +123,7 @@ ENABLE_TESTING() # Default install location -> user's python site-packages IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m site --user-site OUTPUT_VARIABLE PY_SITE OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REGEX REPLACE "\\\\" "/" PY_SITE ${PY_SITE}) SET(CMAKE_INSTALL_PREFIX "${PY_SITE}/amfe" CACHE STRING "Install location" FORCE) ENDIF() # RPATH for Linux diff --git a/fwk/_src/CMakeLists.txt b/fwk/_src/CMakeLists.txt index 3a750903f5fb5e6cd642d570ab3eb121ff34e4ed..78c8658478fbd983c3d1625165f0e6957d27a216 100644 --- a/fwk/_src/CMakeLists.txt +++ b/fwk/_src/CMakeLists.txt @@ -42,5 +42,6 @@ SWIG_LINK_LIBRARIES(fwkw fwk ${PYTHON_LIBRARIES} ) -INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/fwkw.py DESTINATION ${CMAKE_INSTALL_PREFIX}) +INSTALL(FILES "${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE}/fwkw.py" + DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS _fwkw DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/tbox/_src/CMakeLists.txt b/tbox/_src/CMakeLists.txt index d69dc02e8e4af181e959708319ee48c0585cabda..1dea57d843faf64c93ee41ba2a9ce4ceee12ea56 100644 --- a/tbox/_src/CMakeLists.txt +++ b/tbox/_src/CMakeLists.txt @@ -46,5 +46,6 @@ SWIG_LINK_LIBRARIES(tboxw tbox fwk ${PYTHON_LIBRARIES} ) -INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/tboxw.py DESTINATION ${CMAKE_INSTALL_PREFIX}) +INSTALL(FILES "${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE}/tboxw.py" + DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS _tboxw DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/tbox/src/wLazy.h b/tbox/src/wLazy.h index 3d8e7970c66ddc53361d7f6b831436251ba88d59..ae5568d44ea457a8d074f9d1795ef85d27d22826 100644 --- a/tbox/src/wLazy.h +++ b/tbox/src/wLazy.h @@ -41,7 +41,7 @@ public: Lazy(int _np) : value(), np(_np) {} ~Lazy() { - delete value; + delete static_cast<T *>(value); //std::cout << "lazy pointer deleted\n"; } T &get() diff --git a/tboxVtk/_src/CMakeLists.txt b/tboxVtk/_src/CMakeLists.txt index f9c298713fd5b37bd973ef2e841f700d43d34e96..f1ad6f73a27613af52c9e94bbd1f84d55285a4f0 100644 --- a/tboxVtk/_src/CMakeLists.txt +++ b/tboxVtk/_src/CMakeLists.txt @@ -48,5 +48,6 @@ SWIG_LINK_LIBRARIES(tboxVtkw tboxVtk tbox fwk ${PYTHON_LIBRARIES} ) -INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/tboxVtkw.py DESTINATION ${CMAKE_INSTALL_PREFIX}) +INSTALL(FILES "${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE}/tboxVtkw.py" + DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS _tboxVtkw DESTINATION ${CMAKE_INSTALL_PREFIX})