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

Distribute the CMake configuration file. #189

Open
1 task done
trivialfis opened this issue Jul 31, 2024 · 6 comments
Open
1 task done

Distribute the CMake configuration file. #189

trivialfis opened this issue Jul 31, 2024 · 6 comments
Labels

Comments

@trivialfis
Copy link

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

The C header is distributed along with libxgboost, but not the CMake exported configuration files. The feedstock might be able to distribute CMake files as well as done by make install target. The downstream users should be able to call:

find_package(xgboost)

Installed packages

NA

Environment info

NA
@trivialfis trivialfis added the bug label Jul 31, 2024
@jakirkham
Copy link
Member

Thanks Jiaming! 🙏

Agree we should do this

Likely we are missing some lines here. Do you know what we need to add?

mkdir -p ${LIBDIR} ${INCDIR}/xgboost ${BINDIR} || true
cp ${SRC_DIR}/lib/${XGBOOSTDSO} ${SODIR}/
cp -Rf ${SRC_DIR}/include/xgboost ${INCDIR}/
cp -f ${SRC_DIR}/src/c_api/*.h ${INCDIR}/xgboost/

@hcho3
Copy link
Contributor

hcho3 commented Jul 31, 2024

I wonder why we don't just use make install or equivalent? That should install the headers as well as the CMake config files.

@jakirkham
Copy link
Member

Agree that would be preferable

Think this has to do with how Windows is setup

Maybe there is a good way to accomplish this just with CMake?

if [[ ${OSTYPE} == msys ]]; then
# Just for now; should we handle slash fixing in conda-build?
PREFIX=${PREFIX//\\//}
SRC_DIR=${SRC_DIR//\\//}
fi

if [[ ${OSTYPE} == msys ]]; then
LIBDIR=${PREFIX}/Library/mingw-w64/lib
INCDIR=${PREFIX}/Library/mingw-w64/include
BINDIR=${PREFIX}/Library/mingw-w64/bin

@jakirkham jakirkham mentioned this issue Aug 1, 2024
3 tasks
@trivialfis
Copy link
Author

Maybe CMAKE_INSTALL_PREFIX can help?

@jakirkham
Copy link
Member

Agree that sounds like a reasonable approach

Would you like to give it a try? 🙂

@trivialfis
Copy link
Author

It will probably take some time before I can get to it.

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

No branches or pull requests

3 participants