Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fail to build with MINGW64 compiler within MSYS2 environment #54

Open
EssenOH opened this issue Feb 17, 2019 · 1 comment
Open

Fail to build with MINGW64 compiler within MSYS2 environment #54

EssenOH opened this issue Feb 17, 2019 · 1 comment

Comments

@EssenOH
Copy link

EssenOH commented Feb 17, 2019

cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. && make

DL@2030006696-SOH MINGW64 ~/cldnn/build
$ cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release .. && make
-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
[clDNN] CLDNN__ARCHITECTURE_TARGET: Target architecture is not specified. Trying to deduce it from context.
-- Found PythonInterp: C:/msys64/usr/bin/python2.7.exe (found suitable version "2.7.15", minimum required is "2.7")
-- Boost version: 1.64.0
-- Found the following Boost libraries:
-- system
-- date_time
-- program_options
-- filesystem
-- [clDNN] ======================== clDNN Project =======================
-- [clDNN] Version: 1.4.22.0
-- [clDNN]
-- [clDNN] Build type: Release (for single-configuration generators)
-- [clDNN] Av. build types: Debug;Release (for multi-configuration generators)
-- [clDNN]
-- [clDNN] Output bin directory:
-- [clDNN] - "C:/msys64/home/DL/cldnn/build/out/Windows32/Release"
-- [clDNN] Output lib directory:
-- [clDNN] - "C:/msys64/home/DL/cldnn/build/out/Windows32/Release"
-- [clDNN] Architecture:
-- [clDNN] - target: Windows32 (detected: Windows32)
-- [clDNN]
-- [clDNN]
-- [clDNN] Advanced:
-- [clDNN] - ICD version used to build: 6.3
-- [clDNN] - boost ver. used to build: 1.64.0
-- [clDNN]
-- [clDNN] - Include/Build cldnn core: ON
-- [clDNN] - Include/Build kernel selector: ON
-- [clDNN] - Include/Build tests: ON
-- [clDNN] - Include/Build core internal tests: ON
-- [clDNN] - Include/Build tutorial: ON
-- [clDNN]
-- [clDNN] - Run tests: OFF
-- [clDNN] - Run core internal tests: OFF
-- [clDNN]
-- [clDNN] - Use static C++ Runtime: OFF
-- [clDNN] - Allow unsafe size opts: ON
-- [clDNN] - CMake debug trace: OFF
-- [clDNN]
-- [clDNN]
-- [clDNN] ICD:
-- [clDNN] - Root: C:/msys64/home/DL/cldnn/common/intel_ocl_icd/6.3
-- [clDNN] + Headers: C:/msys64/home/DL/cldnn/common/intel_ocl_icd/6.3/windows/include
-- [clDNN] + Static libs: C:/msys64/home/DL/cldnn/common/intel_ocl_icd/6.3/windows/Release/lib/x86
-- [clDNN] + Shared libs: C:/msys64/home/DL/cldnn/common/intel_ocl_icd/6.3/windows/Release/bin/x86
-- [clDNN] + Libs to link: C:/msys64/home/DL/cldnn/common/intel_ocl_icd/6.3/windows/Release/lib/x86
-- [clDNN]
-- [clDNN] boost libraries:
-- [clDNN] - Root: C:/msys64/home/DL/cldnn/common/boost/1.64.0
-- [clDNN] + Headers: C:/msys64/home/DL/cldnn/common/boost/1.64.0/include/boost-1_64
-- [clDNN] + Libs to link: C:/msys64/home/DL/cldnn/common/boost/1.64.0/windows/x86/lib
-- [clDNN] =============================================================================
-- Performing Test CLDNN__COMPILER_SUPPORTS_CXX14
-- Performing Test CLDNN__COMPILER_SUPPORTS_CXX14 - Success
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- [clDNN] Selected capabilities: public
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
-- [clDNN] Selected capabilities: public
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/DL/cldnn/build
[ 0%] Generating ks_primitive_db.inc ...
processing C:/msys64/home/DL/cldnn/kernel_selector/core/cl_kernels/activation_opt.cl
processing C:/msys64/home/DL/cldnn/kernel_selector/core/cl_kernels/activation_ref.cl
processing C:/msys64/home/DL/cldnn/kernel_selector/core/cl_kernels/activation_tutorial.cl
processing C:/msys64/home/DL/cldnn/kernel_selector/core/cl_kernels/arg_max_min_axis.cl
processing C:/msys64/home/DL/cldnn/kernel_selector/core/cl_kernels/arg_max_min_gpu_ref.cl

..
..
..
..
..

[ 35%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax/softmax_kernel_fb.cpp.obj
[ 36%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax/softmax_kernel_items_class_optimized.cpp.obj
[ 36%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax/softmax_kernel_ref.cpp.obj
[ 36%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax/softmax_kernel_selector.cpp.obj
[ 36%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax_loss_grad/softmax_loss_grad_kernel_base.cpp.obj
[ 36%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax_loss_grad/softmax_loss_grad_kernel_ref.cpp.obj
[ 36%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/softmax_loss_grad/softmax_loss_grad_kernel_selector.cpp.obj
[ 37%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/tile/tile_kernel_ref.cpp.obj
[ 37%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/tile/tile_kernel_selector.cpp.obj
[ 37%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/upsampling/upsampling_kernel_base.cpp.obj
[ 37%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/upsampling/upsampling_kernel_ref.cpp.obj
[ 37%] Building CXX object kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/core/actual_kernels/upsampling/upsampling_kernel_selector.cpp.obj
[ 37%] Linking CXX static library ../out/Windows32/Release/libcldnn_kernel_selector32.a
Error copying file (if different) from "C:/msys64/home/DL/cldnn/kernel_selector/core/cache/cache.json" to "C:/msys64/home/DL/cldnn/build/out/Windows32/Release/Release/".
make[2]: *** [kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/build.make:3965: out/Windows32/Release/libcldnn_kernel_selector32.a] Error 1
make[2]: *** Deleting file 'out/Windows32/Release/libcldnn_kernel_selector32.a'
make[1]: *** [CMakeFiles/Makefile2:313: kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

@EssenOH
Copy link
Author

EssenOH commented Mar 20, 2019

The problem came from the generated make file missing target file name for the cash.json,.

out/Windows32/Release/libcldnn_kernel_selector32.a: kernel_selector/CMakeFiles/cldnn_kernel_selector.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/D/clDNN/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_249) "Linking CXX static library ../out/Windows32/Release/libcldnn_kernel_selector32.a"
cd /D/clDNN/build/kernel_selector && $(CMAKE_COMMAND) -P CMakeFiles/cldnn_kernel_selector.dir/cmake_clean_target.cmake
cd /D/clDNN/build/kernel_selector && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/cldnn_kernel_selector.dir/link.txt --verbose=$(VERBOSE)
cd /D/clDNN/build/kernel_selector && /C/msys64/mingw64/bin/cmake.exe -E copy_if_different D:/clDNN/kernel_selector/core/cache/cache.json D:/clDNN/build/out/Windows32/Release/Release**/cache.json**

D:\clDNN\kernel_selector\CMakeLists.txt
Change as following.

add_custom_command(
TARGET "${CLDNN_BUILD__PROJ}" POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${__CLDNN_Directory__core}/cache/cache.json
${CLDNN_CACHE_PATH}/cache.json)

After changing it, it generate a new error
$ make
[ 0%] Linking CXX static library ../out/Windows32/Release/libcldnn_kernel_selector32.a
[ 37%] Built target cldnn_kernel_selector
[ 37%] Updating file if the file changed (api_c_test.c) ...
[ 37%] Updating file if the file changed (api_cpp_test.cpp) ...
Scanning dependencies of target api_test_builds
[ 37%] Building CXX object api_test_builds/CMakeFiles/api_test_builds.dir//codegen/Release/test_builds/api_cpp_test.cpp.obj
[ 37%] Building C object api_test_builds/CMakeFiles/api_test_builds.dir/
/codegen/Release/test_builds/api_c_test.c.obj
[ 37%] Linking CXX static library ../codegen/out/libapi_test_builds32.a
[ 37%] Built target api_test_builds
Scanning dependencies of target clDNN_shlib
[ 37%] Building CXX object src/CMakeFiles/clDNN_shlib.dir/graph_optimizer/add_required_reorders.cpp.obj
In file included from D:/clDNN/src/include/layout_optimizer.h:31,
from D:/clDNN/src/include/pass_manager.h:20,
from D:/clDNN/src/graph_optimizer/add_required_reorders.cpp:21:
D:/clDNN/src/include/generic_layer.hpp: In constructor 'cldnn::generic_layer::generic_layer(const dto*)':
D:/clDNN/src/include/generic_layer.hpp:64:111: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
, generic_params(static_cast<const kernel_selector::generic_kernel_params const>(dto->generic_params))
^
cc1plus.exe: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/clDNN_shlib.dir/build.make:63: src/CMakeFiles/clDNN_shlib.dir/graph_optimizer/add_required_reorders.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:92: src/CMakeFiles/clDNN_shlib.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant