Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
Co-authored-by: Author: Terry Cojean <terry.cojean@kit.edu>
  • Loading branch information
upsj and tcojean committed May 7, 2021
1 parent 979539d commit 59c8e23
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ if (MINGW OR CYGWIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
endif()

set(GINKGO_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")

# Ginkgo configuration options
option(GINKGO_DEVEL_TOOLS "Add development tools to the build system" OFF)
option(GINKGO_BUILD_TESTS "Generate build files for unit tests" ON)
Expand Down
17 changes: 3 additions & 14 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,9 @@ generators. Other CMake generators are untested.
### Building Ginkgo in Windows
Depending on the configuration settings, some manual work might be required:
* Build Ginkgo with Debug mode:
Some Debug build specific issues can appear depending on the machine and environment. The known issues are the following:
1. `ld` issue: encountering `ld: error: export ordinal too large` needs the compilation flag `-O1`

The following are the details for different environments:
* _Microsoft Visual Studio_:
1. `ld` issue (_Microsoft Visual Studio_ does not have this issue)
* _Cygwin_:
1. `ld` issue (If building Ginkgo as static library, this is not needed)
* `cmake -DGINKGO_COMPILER_FLAGS="-Wpedantic -O1" <other parameters> <source_folder>` (`GINKGO_COMPILER_FLAGS` is `-Wpedantic` by default)
* add `-O1` in the environement variable `CXX_FLAGS` or `CMAKE_CXX_FLAGS`
* _MinGW_:
1. `ld` issue (If building Ginkgo as static library, this is not needed)
* `cmake -DGINKGO_COMPILER_FLAGS="-Wpedantic -O1" <other parameters> <source_folder>` (`GINKGO_COMPILER_FLAGS` is `-Wpedantic` by default)
* add `-O1` in the environement variable `CXX_FLAGS` or `CMAKE_CXX_FLAGS`
Some Debug build specific issues can appear depending on the machine and environment:
When you encounter the error message `ld: error: export ordinal too large`, add the compilation flag `-O1`
by adding `-DCMAKE_CXX_FLAGS=-O1` to the CMake invocation.
* Build Ginkgo in _MinGW_:\
If encountering the issue `cc1plus.exe: out of memory allocating 65536 bytes`, please follow the workaround in
[reference](https://www.intel.com/content/www/us/en/programmable/support/support-resources/knowledge-base/embedded/2016/cc1plus-exe--out-of-memory-allocating-65536-bytes.html),
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,10 @@ The Ginkgo CUDA module has the following __additional__ requirements:
The Ginkgo OMP module has the following __additional__ requirements:
* _MinGW_ or _Cygwin_

Depending on the configuration settings, some manual work might be required. More details are availble in [windows section in INSTALL.md](INSTALL.md#building-ginkgo-in-windows):
* Build Ginkgo with Debug mode:
Some Debug build specific issues can appear depending on the machine and environment. The known issues are the following:
1. `ld` issue: encountering `ld: error: export ordinal too large` needs the compilation flag `-O1`
* Build Ginkgo in _MinGW_:
If encountering the issue `cc1plus.exe: out of memory allocating 65536 bytes`, please follow the workaround in
[reference](https://www.intel.com/content/www/us/en/programmable/support/support-resources/knowledge-base/embedded/2016/cc1plus-exe--out-of-memory-allocating-65536-bytes.html),
or compile ginkgo again might work.

__NOTE:__ _Microsoft Visual Studio_ only supports OpenMP 2.0, so it can not compile the ginkgo OMP module.
In these environments, two problems can be encountered, the solution for which is described in the
[windows section in INSTALL.md](INSTALL.md#building-ginkgo-in-windows):
* `ld: error: export ordinal too large` needs the compilation flag `-O1`
* `cc1plus.exe: out of memory allocating 65536 bytes` requires a modification of the environment

__NOTE:__ Some restrictions will also apply on the version of C and C++ standard
libraries installed on the system. This needs further investigation.
Expand Down
2 changes: 2 additions & 0 deletions cmake/build_helpers.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set(GINKGO_LIBRARY_PATH "${PROJECT_BINARY_DIR}/lib")

function(ginkgo_default_includes name)
# set include path depending on used interface
target_include_directories("${name}"
Expand Down
1 change: 0 additions & 1 deletion examples/build-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

# copy libraries
LIBRARY_DIRS="core core/device_hooks reference omp cuda hip"
LIBRARY_NAMES="ginkgo ginkgo_reference ginkgo_omp ginkgo_cuda ginkgo_hip ginkgo_dpcpp ginkgo_device"
SUFFIXES=".so .dylib .dll d.so d.dylib d.dll"
VERSION="1.4.0"
Expand Down
8 changes: 7 additions & 1 deletion examples/custom-matrix-format/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ project(custom-matrix-format CXX CUDA)
# We only need to find Ginkgo if we build this example stand-alone
if (NOT GINKGO_BUILD_EXAMPLES)
find_package(Ginkgo 1.4.0 REQUIRED)
find_package(OpenMP 3.0 REQUIRED)
endif()

if(NOT (GINKGO_BUILD_CUDA AND GINKGO_BUILD_OMP))
message(FATAL_ERROR
"This example needs Ginkgo built with CUDA and OpenMP support")
endif()

set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

add_executable(custom-matrix-format custom-matrix-format.cpp stencil_kernel.cu)
target_link_libraries(custom-matrix-format Ginkgo::ginkgo)
target_link_libraries(custom-matrix-format Ginkgo::ginkgo OpenMP::OpenMP_CXX)

# workaround for clang-cuda/g++ interaction
set_target_properties(custom-matrix-format PROPERTIES POSITION_INDEPENDENT_CODE ON)
4 changes: 4 additions & 0 deletions examples/papi-logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if (NOT GINKGO_BUILD_EXAMPLES)
find_package(Ginkgo 1.4.0 REQUIRED)
endif()

if (NOT GINKGO_HAVE_PAPI_SDE)
message(FATAL_ERROR "This example needs Ginkgo built with PAPI support")
endif()

add_executable(papi-logging papi-logging.cpp)
target_link_libraries(papi-logging ginkgo PAPI::PAPI)

Expand Down

0 comments on commit 59c8e23

Please sign in to comment.