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

libxc5: new port (new version of libxc) #14889

Merged
merged 2 commits into from May 26, 2023
Merged

Conversation

barracuda156
Copy link
Contributor

@barracuda156 barracuda156 commented May 19, 2022

Description

Latest versions of libxc missing in Macports. Added new segregated versions, which don't conflict with earlier versions.
(Universal variant does build on Leopard, unlike with earlier versions of libxc, therefore muniversal PG.)

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.6 PPC (10A190)
Xcode 3.2

macOS 10.5.8
Xcode 3.1.4

Verification
  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@macportsbot
Copy link

Notifying maintainers:
@dstrubbe for port libxc, libxc4.

@barracuda156
Copy link
Contributor Author

If anyone can say why macos-11 bot fails, would be great. Everything else, apparently, builds fine.

@barracuda156
Copy link
Contributor Author

@mascguy Could you say why it fails specifically on MacOS-11 bot (10.15 and 12 are both fine, as well as 10.6.8)? Moreover, looking at the log, build is okay, but something weird happens only at destroot:
https://github.com/macports/macports-ports/actions/runs/3090030319/jobs/4998326448#step:8:3559

@mascguy
Copy link
Member

mascguy commented Sep 20, 2022

@mascguy Could you say why it fails specifically on MacOS-11 bot (10.15 and 12 are both fine, as well as 10.6.8)? Moreover, looking at the log, build is okay, but something weird happens only at destroot: https://github.com/macports/macports-ports/actions/runs/3090030319/jobs/4998326448#step:8:3559

It looks like Clang is crashing with a segfault, during compilation.

@barracuda156
Copy link
Contributor Author

@mascguy With libxc5 I see in the log it reaches up to destroot and fails there (on MacOS-11):

make: Leaving directory `/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_science_libxc5/libxc5/work/build'
  DEBUG: Executing portdestroot::destroot_finish
  DEBUG: Fixing glibtool .la files in destroot for libxc5
  DEBUG: checking for mtree violations
  DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
  DEBUG: install phase started at Tue Sep 20 12:34:14 UTC 2022
 --->  Installing libxc5 @5.2.3_0

--->  Activating libxc5 @5.2.3_0

  DEBUG: Executing org.macports.load (libxc5)
  /Users/runner/work/_temp/909da96c-1975-482d-a124-f00a2fe9ec01.sh: line 4: 19263 Terminated: 15          tail -f "$workdir/logs/dependencies-progress.txt" 2> /dev/null

@barracuda156
Copy link
Contributor Author

BTW, need to blacklist Clang for ppc, this fails badly:

clang: warning: not using the clang compiler for the 'powerpc' architecture
clang: warning: argument unused during compilation: '-march=native'
[ 51%] Building C object CMakeFiles/xc.dir/src/hyb_gga_x_cam_s12.c.o
/usr/bin/clang -DHAVE_CBRT -DXC_DONT_COMPILE_KXC -DXC_DONT_COMPILE_LXC -DXC_ENFORCE_FERMI_HOLE_CURVATURE -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/build/src -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/build -pipe -Os -DNDEBUG -I/opt/local/include -march=native -arch ppc -mmacosx-version-min=10.6 -fPIC -o CMakeFiles/xc.dir/src/hyb_gga_x_cam_s12.c.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_x_cam_s12.c
clang: warning: not using the clang compiler for the 'powerpc' architecture
clang: warning: argument unused during compilation: '-march=native'
[ 51%] Building C object CMakeFiles/xc.dir/src/hyb_gga_xc_case21.c.o
/usr/bin/clang -DHAVE_CBRT -DXC_DONT_COMPILE_KXC -DXC_DONT_COMPILE_LXC -DXC_ENFORCE_FERMI_HOLE_CURVATURE -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/build/src -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/build -pipe -Os -DNDEBUG -I/opt/local/include -march=native -arch ppc -mmacosx-version-min=10.6 -fPIC -o CMakeFiles/xc.dir/src/hyb_gga_xc_case21.c.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c
clang: warning: not using the clang compiler for the 'powerpc' architecture
clang: warning: argument unused during compilation: '-march=native'
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c: In function ‘xbspline’:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:52: error: ‘for’ loop initial declaration used outside C99 mode
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c: In function ‘cbspline’:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:65: error: ‘for’ loop initial declaration used outside C99 mode
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c: In function ‘case21_set_ext_params’:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:86: error: ‘for’ loop initial declaration used outside C99 mode
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:93: error: ‘for’ loop initial declaration used outside C99 mode
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:95: error: redefinition of ‘i’
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:93: error: previous definition of ‘i’ was here
/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/libxc-5.2.3/src/hyb_gga_xc_case21.c:95: error: ‘for’ loop initial declaration used outside C99 mode
make[2]: *** [CMakeFiles/xc.dir/src/hyb_gga_xc_case21.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/build'
make[1]: *** [CMakeFiles/xc.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_science_libxc5/libxc5/work/build'
make: *** [all] Error 2

Will add it.

@mascguy
Copy link
Member

mascguy commented Sep 20, 2022

It looks like Clang is crashing with a segfault, during compilation.

To clarify, this is occurring for libcx4.

@barracuda156
Copy link
Contributor Author

It looks like Clang is crashing with a segfault, during compilation.

To clarify, this is occurring for libcx4.

@mascguy I did not do anything to that port, just added conflict with libcx5.

@mascguy
Copy link
Member

mascguy commented Sep 20, 2022

It looks like Clang is crashing with a segfault, during compilation.

To clarify, this is occurring for libcx4.

@mascguy I did not do anything to that port, just added conflict with libcx5.

Whether you modified it or not, is inconsequential: You asked why CI is failing, and I answered the question.

How we actually resolve it, is another story.

@barracuda156
Copy link
Contributor Author

@mascguy Fair enough. Should I try fixing libcx4? Or this issue can be considered separate from the present PR (and libcx5 builds fine)?

@mascguy
Copy link
Member

mascguy commented Sep 20, 2022

@mascguy Fair enough. Should I try fixing libcx4? Or this issue can be considered separate from the present PR (and libcx5 builds fine)?

For now, focus on wrapping up your other PRs, which don't have such issues. We'll revisit this one later.

@mascguy
Copy link
Member

mascguy commented May 21, 2023

For this one, you'll want to make libxc5 a new segregated port, that doesn't conflict. We'll ultimately want to segregate libxc4 as well, but I can tackle that separately.

@barracuda156
Copy link
Contributor Author

barracuda156 commented May 21, 2023

For this one, you'll want to make libxc5 a new segregated port, that doesn't conflict. We'll ultimately want to segregate libxc4 as well, but I can tackle that separately.

I will try to sort this out tomorrow.

UPD. Turned out, there is v. 6 already :)

@barracuda156
Copy link
Contributor Author

@mascguy In principle, we want to place all those libxc versions into /libexec and then modify .pc files (or whatever they install) accordingly?

@mascguy
Copy link
Member

mascguy commented May 24, 2023

@mascguy In principle, we want to place all those libxc versions into /libexec and then modify .pc files (or whatever they install) accordingly?

Yep, exactly!

@mascguy
Copy link
Member

mascguy commented May 24, 2023

@mascguy In principle, we want to place all those libxc versions into /libexec and then modify .pc files (or whatever they install) accordingly?

Yep, exactly!

Well, no, there's no need to modify the pkgconfig files. The ports should simply be rooted under libexec - including the pkgconfigs - and then dependents would need to be updated to know about them.

As an example, ffmpeg-upstream:

Click to Expand
Port ffmpeg-upstream contains:
  /opt/local/libexec/ffmpeg6/bin/ffmpeg
  /opt/local/libexec/ffmpeg6/bin/ffplay
  /opt/local/libexec/ffmpeg6/bin/ffprobe
  /opt/local/libexec/ffmpeg6/include/libavcodec/ac3_parser.h
  /opt/local/libexec/ffmpeg6/include/libavcodec/adts_parser.h
  /opt/local/libexec/ffmpeg6/include/libavcodec/avcodec.h
[...many more headers snipped...]
  /opt/local/libexec/ffmpeg6/lib/libavcodec.60.3.100.dylib
  /opt/local/libexec/ffmpeg6/lib/libavcodec.60.dylib
  /opt/local/libexec/ffmpeg6/lib/libavcodec.a
[...many more libs snipped...]
  /opt/local/libexec/ffmpeg6/lib/pkgconfig/libavcodec.pc
  /opt/local/libexec/ffmpeg6/lib/pkgconfig/libavdevice.pc
  /opt/local/libexec/ffmpeg6/lib/pkgconfig/libavfilter.pc
[...many more pkgconfigs snipped...]
  /opt/local/libexec/ffmpeg6/share/data/examples/Makefile
  /opt/local/libexec/ffmpeg6/share/data/examples/README
  /opt/local/libexec/ffmpeg6/share/data/examples/avio_http_serve_files.c
[...many more examples snipped...]
  /opt/local/libexec/ffmpeg6/share/doc/APIchanges
  /opt/local/libexec/ffmpeg6/share/doc/bootstrap.min.css
  /opt/local/libexec/ffmpeg6/share/doc/build_system.txt
[...lots of other docs snipped...]

@mascguy
Copy link
Member

mascguy commented May 25, 2023

FYI, it looks like upstream is up to version 6. (6.1.0 presently.) So you might want to either create another segregated port for that too, following the same pattern you end up using for libxc5.

@barracuda156
Copy link
Contributor Author

FYI, it looks like upstream is up to version 6. (6.1.0 presently.) So you might want to either create another segregated port for that too, following the same pattern you end up using for libxc5.

Yes, I wrote about that above #14889 (comment)

@barracuda156
Copy link
Contributor Author

Build of libxc6 is fine, need to add a fix for tests, otherwise they try to link to prefix.

@barracuda156
Copy link
Contributor Author

barracuda156 commented May 26, 2023

@mascguy I will run tests now. Builds confirmed, though for libxc5 we need to check if the patch does what it should. Otherwise it places cmake configs into a random directory.

UPD. Yes, patch is fine, now everything is installed into ${prefix}/libexec/${name}.

UPD2. Nop, libxc5 is still doing something wrong:

Could not open /opt/local/lib/libxc.9.dylib: Error opening or reading file (referenced from /opt/local/libexec/libxc5/bin/xc-info)

Will look into this.
Hmm, that file should not be there at all – after upgrade of the port. May not be an installation issue. Let me remove the port completely and rebuild anew.

@barracuda156
Copy link
Contributor Author

@mascguy CI fail, as before, on libxc4, which is as such unrelated to this PR.

@barracuda156
Copy link
Contributor Author

UPD3. Tests pass for libxc6:

            Start 19154: Libxc-hyb_mgga_xc_xb1k-Li-unpol-1-check
19154/19154 Test #19154: Libxc-hyb_mgga_xc_xb1k-Li-unpol-1-check ................   Passed    0.02 sec

100% tests passed, 0 tests failed out of 19154

Total Test time (real) = 384.61 sec

libxc5 needs a fix for that dylib.

@mascguy
Copy link
Member

mascguy commented May 26, 2023

@mascguy CI fail, as before, on libxc4, which is as such unrelated to this PR.

Well, now you can drop your commits for libxc and libxc4, as your new segregated ports don't conflict with them.

@barracuda156
Copy link
Contributor Author

@mascguy CI fail, as before, on libxc4, which is as such unrelated to this PR.

Well, now you can drop your commits for libxc and libxc4, as your new segregated ports don't conflict with them.

Indeed. Will do that. Let me also fix that annoying dylib in libxc5, something is setting the wrong path for it. And then hopefully we are done.

@mascguy mascguy marked this pull request as ready for review May 26, 2023 16:47
Copy link
Member

@mascguy mascguy left a comment

Choose a reason for hiding this comment

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

LGTM

@mascguy mascguy merged commit e98deca into macports:master May 26, 2023
3 checks passed
@mascguy
Copy link
Member

mascguy commented May 26, 2023

One more old PR merged, let's keep the momentum going Sergey!

@barracuda156 barracuda156 deleted the libxc5 branch May 26, 2023 17:02
@barracuda156
Copy link
Contributor Author

I think we still need a fix for that dylib, but I will test on another machine now.

P. S. By the way, libheif still broken – we need to condition clang-specific flags on actually clang being used (or libcxx?), not on OS version. These are compiler flags, right? Not linker ones. They will fail with GCC on newer systems, I believe, just as they fail on 10.6.

@mascguy
Copy link
Member

mascguy commented May 26, 2023

UPD2. Nop, libxc5 is still doing something wrong:

Could not open /opt/local/lib/libxc.9.dylib: Error opening or reading file (referenced from /opt/local/libexec/libxc5/bin/xc-info)

Will look into this. Hmm, that file should not be there at all – after upgrade of the port. May not be an installation issue. Let me remove the port completely and rebuild anew.

This should only occur when libxc is already installed, so it won't occur on the buildbots. Nonetheless, I'll take care of fixing.

mascguy added a commit that referenced this pull request May 27, 2023
mascguy added a commit that referenced this pull request May 29, 2023
mascguy added a commit that referenced this pull request May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants