Comments (6)
Hi @svb688, can you be more specific about the issue you encounter? I tried to reproduce it by:
- taking a minimal cmake example (https://github.com/krux02/minimal_cmake_example)
- adding your snippet to the
CMakeLists.txt
- adding
fastforest
to the list of linked libraries in thetarget_link_libraries
part:target_link_libraries(example PUBLIC ${Boost_LIBRARIES} fastforest # here you can add any library dependencies )
- include
fastforest.h
in the projectsmain.cpp
:#include "fastforest.h"
- Calling some fastforest functionality in
MAIN()
to see if it gets correctly linked:std::vector<std::string> features{"f0", "f1", "f2", "f3", "f4"}; const auto fastForest = fastforest::load_txt("model.txt", features);
Since this compiles flawlessly, I don't see at the moment how this is a fastforest issue. Maybe you have tried to include it as <fastforest.h>
, but it should be in double quotes? Or you forgot to link it? Maybe the minimal example I referenced above can help you to solve your problem.
from xgboost-fastforest.
OK Must be something on my end. I am having issues recreating your example as well.
src/main/main.cpp
#include "main.h"
#include "fastforest.h"
// REST OF main.cpp
CMakeLists.txt
include(FetchContent)
FetchContent_Declare(
XGBoost-FastForest
GIT_REPOSITORY https://github.com/guitargeek/XGBoost-FastForest
)
FetchContent_MakeAvailable(XGBoost-FastForest)
# then below in the dependencies section I have:
target_link_libraries(example PUBLIC
${Boost_LIBRARIES}
fastforest
# here you can add any library dependencies
)
Yet when I try to make
minimal_cmake_example/src/main/main.cpp:13:10: fatal error: fastforest.h: No such file or directory
13 | #include "fastforest.h"
If you're able to assist or send your implementation that would be great, Since you're able to make it work the issue seems to be on my end, so you're welcome to close the issue and I can report back later if I figure out what's going on.
from xgboost-fastforest.
also, what version of cmake are you using? I am using 3.14.5
from xgboost-fastforest.
I am using cmake version 3.17.3, so maybe it's a cmake version issue.
Have you tried setting the include directory explicitly for the target? Like below, in our minimal example.
Note that I changed the content name from XGBoost-FastForest
to simply fastforest
, because upper case and the dash caused trouble with the *_SOURCE_DIR
variable (maybe this is even the underlying issue for you).
include(FetchContent)
FetchContent_Declare(
fastforest
GIT_REPOSITORY https://github.com/guitargeek/XGBoost-FastForest
)
FetchContent_MakeAvailable(fastforest)
target_link_libraries(example PUBLIC
${Boost_LIBRARIES}
fastforest
# here you can add any library dependencies
)
message( ${fastforest_SOURCE_DIR} ) # this is just a print to see if the include dir is correct
target_include_directories(example PUBLIC ${fastforest_SOURCE_DIR}/include)
I got inspired a bit by this issue here:
Skycoder42/QHotkey#24
from xgboost-fastforest.
ah ha! it did end up being the dash. Thanks for your help. First time using FetchContent!
from xgboost-fastforest.
You are welcome! I didn't know about FetchContent before and was happy to learn about this nice CMake feature.
I'll close this issue, feel free to open a new thread if you have further issues.
from xgboost-fastforest.
Related Issues (20)
- Does it support multi-softmax as the objective? HOT 2
- GCC version requirements? HOT 7
- Undefined reference to fastforest HOT 2
- Linking error for build C++ test HOT 3
- std::length_error issue HOT 4
- Cannot handle a multi-class model containing a tree with a single leaf node? HOT 1
- Difficulty reproducing benchmarks HOT 3
- C++ 98 Compatibility/Feasibility HOT 7
- Executing Test(s) Issue HOT 1
- C++98 Compatibility HOT 4
- XGBoost regression HOT 1
- Results of binary logistic regression mismatched with xgboost HOT 6
- FastForest inference decripincies with XGBoost HOT 7
- Prediction and Scores are not the same in Python and C++ (cannot reproduce results) HOT 1
- XGBoost and FastForest predictions don't match HOT 11
- gcc version HOT 2
- cmake issue HOT 9
- multiclass support HOT 4
- make issue when build test.cpp.o HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xgboost-fastforest.