guitargeek / XGBoost-FastForest

Minimal library code to deploy XGBoost models in C++.
MIT License
86 stars 30 forks source link

cmake issue #5

Closed mtpadilla closed 4 years ago

mtpadilla commented 4 years ago

I'm following your recipe for compiling your library but am facing the following issue that I'm unsure how to resolve. Do you have any suggestions?

[mpadilla@speech-a-126.pnp build]$ cmake --version
cmake3 version 3.6.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[mpadilla@speech-a-126.pnp build]$ cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:7 (project):
  project with VERSION must use LANGUAGES before language names.

-- Configuring incomplete, errors occurred!
See also "/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/build/CMakeFiles/CMakeOutput.log".
[mpadilla@speech-a-126.pnp build]$

Unfortunately, looking at the log file wasn't immediately useful. Any help/suggestions would be appreciated. Thank you!

guitargeek commented 4 years ago

Hi, you use an older version of CMake that does not yet support the DESCRIPTION parameter in project, so it gets confused. Since this DESCRIPTION is not really needed, I just got rid of it: in the latest commit https://github.com/guitargeek/XGBoost-FastForest/commit/8b7549d8f85c99adae0fc56ea67e021f5d6b5677.

Is it working for you like that?

mtpadilla commented 4 years ago

Hello, and thank you for following up. I pulled the update and it produces a make file, but does so with an error:

[mpadilla@speech-a-126.pnp build]$ cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.41.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   unit_test_framework
-- Configuring done
CMake Error at CMakeLists.txt:19 (add_library):
  CXX_STANDARD is set to invalid value '17'

CMake Error at test/CMakeLists.txt:6 (add_executable):
  CXX_STANDARD is set to invalid value '17'

-- Generating done
-- Build files have been written to: /disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/build
[mpadilla@speech-a-126.pnp build]$ 

trying to make then fails. Please refer to the attached log.

log.txt

guitargeek commented 4 years ago

I see, your old compiler does not support C++17 yet. XGBoost-FastForest does not really need these features, so I adapted it such that it requires only C++11. Everyone should have that by now.

Let me know if you have further problems!

mtpadilla commented 4 years ago

Hi Jonas. Thanks again for the reply. Almost there...getting closer. That solved the cmake issue but am now having an issue with running make:

(blah blah)
-- Build files have been written to: /disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/build
[mpadilla@speech-a-126.pnp build]$ make
Scanning dependencies of target fastforest
[ 16%] Building CXX object CMakeFiles/fastforest.dir/src/common_details.cpp.o
[ 33%] Building CXX object CMakeFiles/fastforest.dir/src/fastforest.cpp.o
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:35:35: error: experimental/filesystem: No such file or directory
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:55: error: ISO C++ forbids initialization of member ‘value’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:55: error: making ‘value’ static
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:56: error: ISO C++ forbids initialization of member ‘found’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:56: error: making ‘found’ static
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:56: error: ISO C++ forbids in-class initialization of non-const static member ‘found’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:57: error: ISO C++ forbids initialization of member ‘failed’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:57: error: making ‘failed’ static
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:57: error: ISO C++ forbids in-class initialization of non-const static member ‘failed’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp: In function ‘fastforest::FastForest fastforest::load_txt(const std::string&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)’:
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:97: error: ‘std::experimental’ has not been declared
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp: At global scope:
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp: In instantiation of ‘<unnamed>::util::NumericAfterSubstrOutput<int>’:
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:159:   instantiated from here
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:55: error: ISO C++ forbids in-class initialization of non-const static member ‘<unnamed>::util::NumericAfterSubstrOutput<int>::value’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:56: error: ISO C++ forbids in-class initialization of non-const static member ‘<unnamed>::util::NumericAfterSubstrOutput<int>::found’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:57: error: ISO C++ forbids in-class initialization of non-const static member ‘<unnamed>::util::NumericAfterSubstrOutput<int>::failed’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp: In instantiation of ‘<unnamed>::util::NumericAfterSubstrOutput<float>’:
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:180:   instantiated from here
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:55: error: ISO C++ forbids in-class initialization of non-const static member ‘<unnamed>::util::NumericAfterSubstrOutput<float>::value’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:56: error: ISO C++ forbids in-class initialization of non-const static member ‘<unnamed>::util::NumericAfterSubstrOutput<float>::found’
/disk1/mpadilla/projects/conf_eng/XGBoost-FastForest/src/fastforest.cpp:57: error: ISO C++ forbids in-class initialization of non-const static member ‘<unnamed>::util::NumericAfterSubstrOutput<float>::failed’
make[2]: *** [CMakeFiles/fastforest.dir/src/fastforest.cpp.o] Error 1
make[1]: *** [CMakeFiles/fastforest.dir/all] Error 2
make: *** [all] Error 2
[mpadilla@speech-a-126.pnp build]$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[mpadilla@speech-a-126.pnp build]$ 
guitargeek commented 4 years ago

Hi Michael, that is really a super old gcc! I give you the benefit of the doubt and hope that it's not in your hands that the environment is so outdated...

I made fastforest now comply with the outdated ISO standard, it should compile now for you. Let me know if you still have troubles.

guitargeek commented 4 years ago

Also, let me know if it compiles now so the issue can be closed.

mtpadilla commented 4 years ago

Hi Jonas. Thank you again for the update and mail. I'm trying to get my system updated (a bit complicated as much of it is indeed out of my control) a bit since more errors arose. Please give me a day or two to do what I can and I'll definitely follow-up...

guitargeek commented 4 years ago

Hello, I'll close this issue, because the original issue with cmake was solved anyway. Afterwards, we were discussing more about old C++ standard compatibility, so it was actually a new issue. Please open a new issue about this if this is still relevant.

mtpadilla commented 4 years ago

Hi Jonas. Sounds great and will do. Will open new tickets if/when necessary. Vielen Dank für Ihre Hilfe.