Skip to content

Source files for vendored libraries#1156

Merged
aviator-app[bot] merged 11 commits intomainfrom
feat/split-sources
Feb 27, 2024
Merged

Source files for vendored libraries#1156
aviator-app[bot] merged 11 commits intomainfrom
feat/split-sources

Conversation

@Antonov548
Copy link
Copy Markdown
Contributor

@Antonov548 Antonov548 commented Jan 23, 2024

Closes #1126.

@aviator-app
Copy link
Copy Markdown
Contributor

aviator-app bot commented Jan 23, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@Antonov548 Antonov548 requested a review from krlmlr January 23, 2024 13:51
@Antonov548 Antonov548 changed the title Sources file for vendored libraries Source files for vendored libraries Jan 23, 2024
@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Jan 23, 2024

Thanks. I'll review, can we discuss at around 16:00 if needed?

@Antonov548
Copy link
Copy Markdown
Contributor Author

Thanks. I'll review, can we discuss at around 16:00 if needed?

Yes, sure. I trying to find a way to check that glpk in installed, but seems there is no straight forward solution.

@krlmlr krlmlr force-pushed the feat/split-sources branch 2 times, most recently from 2aec3e7 to 0a2a6d6 Compare January 23, 2024 15:21
PKG_LIBS="$PKG_LIBS -lglpk"
else
echo "Using vendored GLPK"
PKG_CFLAGS="$PKG_CFLAGS -Ivendor/cigraph/vendor/glpk -Ivendor/cigraph/vendor/glpk/env -Ivendor/cigraph/vendor/glpk/minisat -Ivendor/cigraph/vendor/glpk/misc -Ivendor/cigraph/vendor/glpk/draft -Ivendor/cigraph/vendor/glpk/npp -Ivendor/cigraph/vendor/glpk/api -Ivendor/cigraph/vendor/glpk/mpl -Ivendor/cigraph/vendor/glpk/bflib -Ivendor/cigraph/vendor/glpk/amd -Ivendor/cigraph/vendor/glpk/simplex -Ivendor/cigraph/vendor/glpk/colamd"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-I flags should go in CPPFLAGS instead of CFLAGS, no?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to define @cppflags below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment just about naming? As I understand it doesn't has functional meaning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave it as is and resolve later if needed.

@krlmlr krlmlr added this to the upgrade-2 milestone Jan 23, 2024
@Antonov548 Antonov548 marked this pull request as draft January 29, 2024 12:14
@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Feb 8, 2024

The PR has conflicts now.

@maelle
Copy link
Copy Markdown
Contributor

maelle commented Feb 12, 2024

@Antonov548 is any help needed to fix the conflicts?

@Antonov548
Copy link
Copy Markdown
Contributor Author

@Antonov548 is any help needed to fix the conflicts?

I think it's better to start from scratch. Since part was already implemented in #1233

@maelle
Copy link
Copy Markdown
Contributor

maelle commented Feb 12, 2024

Ok so you want to close this PR and start a new one? I'm a bit lost as I don't know how you're generating the PR. (but I can learn!)

@Antonov548 Antonov548 closed this Feb 12, 2024
@Antonov548
Copy link
Copy Markdown
Contributor Author

Ok so you want to close this PR and start a new one? I'm a bit lost as I don't know how you're generating the PR. (but I can learn!)

Yes, I will create new one. Just need to clarify what still needs to be done regarding vendored libraries, since as I mentioned part is already done.

@krlmlr krlmlr reopened this Feb 13, 2024
@krlmlr krlmlr force-pushed the feat/split-sources branch 6 times, most recently from b754a98 to 724985c Compare February 13, 2024 08:22
@Antonov548
Copy link
Copy Markdown
Contributor Author

@krlmlr Seems it couldn't detect glpk on pipeline just with commpilation single file. Not sure why it happens. But using vendored glpk also doesn't work properlly now. Not all files from vendor/cigraph/vendor/glpk should be used.

PKG_LIBS="$PKG_LIBS -lglpk"
else
echo "Using vendored GLPK"
PKG_CFLAGS="$PKG_CFLAGS -Ivendor/cigraph/vendor/glpk -Ivendor/cigraph/vendor/glpk/env -Ivendor/cigraph/vendor/glpk/minisat -Ivendor/cigraph/vendor/glpk/misc -Ivendor/cigraph/vendor/glpk/draft -Ivendor/cigraph/vendor/glpk/npp -Ivendor/cigraph/vendor/glpk/api -Ivendor/cigraph/vendor/glpk/mpl -Ivendor/cigraph/vendor/glpk/bflib -Ivendor/cigraph/vendor/glpk/amd -Ivendor/cigraph/vendor/glpk/simplex -Ivendor/cigraph/vendor/glpk/colamd"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to define @cppflags below.


generate_sources('/', 'sources', 'SOURCES', ignore_folders)
generate_sources('/vendor/cigraph/vendor/glpk', 'sources-glpk', 'GLPKSOURCES', [], ('.c', '.cc', '.cpp'))
generate_sources('/vendor/cigraph/vendor/mini-gmp', 'sources-mini-gmp', 'MINIGMPSOURCES')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed.

Suggested change
generate_sources('/vendor/cigraph/vendor/mini-gmp', 'sources-mini-gmp', 'MINIGMPSOURCES')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needed here, but let's remove mini-gmp from ignore_folders in a separate PR.

PKG_LIBS="$PKG_LIBS -lglpk"
else
echo "Using vendored GLPK"
PKG_CFLAGS="$PKG_CFLAGS -Ivendor/cigraph/vendor/glpk -Ivendor/cigraph/vendor/glpk/env -Ivendor/cigraph/vendor/glpk/minisat -Ivendor/cigraph/vendor/glpk/misc -Ivendor/cigraph/vendor/glpk/draft -Ivendor/cigraph/vendor/glpk/npp -Ivendor/cigraph/vendor/glpk/api -Ivendor/cigraph/vendor/glpk/mpl -Ivendor/cigraph/vendor/glpk/bflib -Ivendor/cigraph/vendor/glpk/amd -Ivendor/cigraph/vendor/glpk/simplex -Ivendor/cigraph/vendor/glpk/colamd"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave it as is and resolve later if needed.

@Antonov548
Copy link
Copy Markdown
Contributor Author

Oh, I missed. It's has errors in checking code rather than build the package. Can we try to avoid this issues with not including files which raise the warnings?

@Antonov548
Copy link
Copy Markdown
Contributor Author

Antonov548 commented Feb 13, 2024

@krlmlr is there any way to ignore warnings in vendor folder for the check step?

P.S. still need to figure out why vendor version is chosen in GHA.

@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Feb 20, 2024

@Antonov548: Turning off warnings for certain parts of the code will be difficult.

@szhorvat: How did this even work with pre-2.0.0 without GLPK installed? Did R CMD check complain then?

Only CRAN is wary about these warnings, but they will never see them because they have GLPK installed. (Or so I hope.) We could just ignore those warnings on GHA, but we need multiple runs then: one with, and one without GLPK.

@krlmlr krlmlr modified the milestones: phoenix 🔥, upkeep, upgrade-2 Feb 20, 2024
@szhorvat
Copy link
Copy Markdown
Member

szhorvat commented Feb 20, 2024

How did this even work with pre-2.0.0 without GLPK installed?

It disabled GLPK.

Do we need to care about R CMD check for anything except CRAN? CRAN has GLPK.

We do turn off some warnings for the vendored GLPK with the C core's build system. It does use some outdated coding practices. GLPK has no issue tracker, not even a public repository. It is being developed the old-fashioned way on a GNU mailing list. I wouldn't take this up with upstream.

@szhorvat
Copy link
Copy Markdown
Member

I should point out that we go to great lengths to make sure that igraph doesn't print without permission. So the complaints about printf being referenced are theoretical, and only relevant for avoiding an argument with CRAN.

As for patching out all the printfs in the vendored GLPK: we don't do that because it makes it much more painful to upgrade GLPK when a new version comes out. Generally, we try to keep patches to vendored code to a minimum for this reason.

@Antonov548
Copy link
Copy Markdown
Contributor Author

Antonov548 commented Feb 21, 2024

@krlmlr I was wondering why on GHA it use vendored version of glpk even if it's installed.

I found that the problem is in using R command in configure. During the check using rcmdcheck R command is not available. They have it here: https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Configure-example
Do not invoke R by plain R, Rscript or...

I have changed it to use "${R_HOME}/bin/R" as it was suggested in the same webpage.
It also works with vendored glpk

@Antonov548 Antonov548 marked this pull request as ready for review February 22, 2024 19:02

generate_sources('/', 'sources', 'SOURCES', ignore_folders)
generate_sources('/vendor/cigraph/vendor/glpk', 'sources-glpk', 'GLPKSOURCES', [], ('.c', '.cc', '.cpp'))
generate_sources('/vendor/cigraph/vendor/mini-gmp', 'sources-mini-gmp', 'MINIGMPSOURCES')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needed here, but let's remove mini-gmp from ignore_folders in a separate PR.

@aviator-app aviator-app bot force-pushed the feat/split-sources branch from 7624a3e to ab22467 Compare February 27, 2024 08:16
@aviator-app aviator-app bot merged commit 990a73b into main Feb 27, 2024
@aviator-app aviator-app bot deleted the feat/split-sources branch February 27, 2024 08:49
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix installation if libraries are missing

4 participants