Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom gcc paths #297

Closed
Liunus opened this issue Nov 10, 2018 · 11 comments
Closed

Support for custom gcc paths #297

Liunus opened this issue Nov 10, 2018 · 11 comments

Comments

@Liunus
Copy link

Liunus commented Nov 10, 2018

After installing devtoolset-7-gcc to /opt/rh/devtoolset-7/, failed when compiling:

thirdparty/installed//include/boost/config/select_stdlib_config.hpp:18:12: fatal error: 'cstddef' file not found # include <cstddef>

So maybe need to better support thirdparty libraries and build toolchains.

@chalsliu chalsliu self-assigned this Nov 14, 2018
@chalsliu
Copy link
Contributor

cd /home/user/doris/be/build/src/codegen && /home/user/doris/thirdparty/installed/llvm/bin/clang++ -gcc-toolchain /opt/rh/devtoolset-7/root/usr -std=c++11 -c -emit-llvm -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DIR_COMPILE -DNDEBUG -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -D__GLIBCXX_BITSIZE_INT_N_0=128 -D__GLIBCXX_TYPE_INT_N_0=__int128 -U_GLIBCXX_USE_FLOAT128 -DLLVM_ON_UNIX -I/home/user/doris/thirdparty/installed//llvm/include -I/home/user/doris/be/src -I/home/user/doris/be/../gensrc/build/ -I/home/user/doris/thirdparty/installed//include -I/home/user/doris/thirdparty/installed//include/thrift/ -I/home/user/doris/thirdparty/installed//include/event/ -I/home/user/doris/thirdparty/installed//gperftools/include -I/opt/rh/devtoolset-7/root/usr/include /home/user/doris/be/src/codegen/doris_ir.cpp -o /home/user/doris/be/../gensrc/build//doris_ir/doris_no_sse_tmp.bc

This step caused the error because the header file could not be found.

@chalsliu
Copy link
Contributor

solution:
Locate the location of the header files and add them to the CPLUS_INCLUDE_PATH environment variable.

@imay
Copy link
Contributor

imay commented Nov 20, 2018

what path should be added to CPLUS_INCLUDE_PATH??

@chalsliu
Copy link
Contributor

what path should be added to CPLUS_INCLUDE_PATH??

The correct header file path of custom GCC, by default, clang can't find them.
So it should be set explicitly.

@imay
Copy link
Contributor

imay commented Nov 20, 2018

what path should be added to CPLUS_INCLUDE_PATH??

The correct header file path of custom GCC, by default, clang can't find them.
So it should be set explicitly.

With -gcc-toolchain, LLVM should find gcc's path. And what's in your ${GCCHOME}/lib/gcc/ directory?

chalsliu added a commit to chalsliu/incubator-doris-time that referenced this issue Nov 20, 2018
ISSUE apache#297

Locate the header file path of DORIS_GCC_HOME, add them to the CPLUS_INCLUDE_PATH environment variable.
So clang can find it.
@chalsliu
Copy link
Contributor

what path should be added to CPLUS_INCLUDE_PATH??

The correct header file path of custom GCC, by default, clang can't find them.
So it should be set explicitly.

With -gcc-toolchain, LLVM should find gcc's path. And what's in your ${GCCHOME}/lib/gcc/ directory?

/opt/rh/devtoolset-7/root/usr/bin/gcc on my server.

@imay
Copy link
Contributor

imay commented Nov 20, 2018

What is in /opt/rh/devtoolset-7/root/usr/bin/gcc/lib/gcc

@chalsliu
Copy link
Contributor

What is in /opt/rh/devtoolset-7/root/usr/bin/gcc/lib/gcc

/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/

@imay
Copy link
Contributor

imay commented Nov 20, 2018

/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/

Could you reinstall gcc with three bit version x86_64-redhat-linux/7.3.0 other than x86_64-redhat-linux/7?

@chalsliu
Copy link
Contributor

/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/

Could you reinstall gcc with three bit version x86_64-redhat-linux/7.3.0 other than x86_64-redhat-linux/7?

After install gcc in this way,

sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*

There is only one version number by default.

@chalsliu
Copy link
Contributor

Another solution:

  1. Find default header file paths of DORIS_GCC_HOME and set as enviroment variable CLANG_COMPATIBLE_FLAGS.
  2. Explicitly add these paths to CLANG_INCLUDE_FLAGS in be/CMakeLists.txt

chalsliu pushed a commit to chalsliu/incubator-doris-time that referenced this issue Nov 21, 2018
ISSUE apache#297

1. Find default header file paths of DORIS_GCC_HOME and set as enviroment variable CLANG_COMPATIBLE_FLAGS.
2. Explicitly add these paths to CLANG_INCLUDE_FLAGS.
imay pushed a commit that referenced this issue Nov 21, 2018
* Support for custom build toolchains

ISSUE #297

Locate the header file path of DORIS_GCC_HOME, add them to the CPLUS_INCLUDE_PATH environment variable.
So clang can find it.

* Compatible with custom toolchain for clang

ISSUE #297

1. Find default header file paths of DORIS_GCC_HOME and set as enviroment variable CLANG_COMPATIBLE_FLAGS.
2. Explicitly add these paths to CLANG_INCLUDE_FLAGS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants